2 * Copyright (c) 2015 Cisco Systems and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package ntfbenchmark.impl;
10 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
14 public class NtfbenchBlockingProducer extends AbstractNtfbenchProducer {
15 private static final Logger LOG = LoggerFactory.getLogger(NtfbenchBlockingProducer.class);
17 public NtfbenchBlockingProducer(final NotificationPublishService publishService, final int iterations,
18 final int payloadSize) {
19 super(publishService, iterations, payloadSize);
23 @SuppressWarnings("checkstyle:illegalCatch")
28 for (int i = 0; i < iterations; i++) {
30 publishService.putNotification(ntf);
32 } catch (final Exception e) {
34 LOG.debug("Failed to push notification", e);
39 this.ntfError = ntfError;