2 * Copyright (c) 2013, 2017 Cisco Systems, Inc. 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
9 package org.opendaylight.controller.config.api.jmx.notifications;
11 import javax.management.Notification;
12 import javax.management.NotificationBroadcasterSupport;
13 import javax.management.ObjectName;
14 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
16 public abstract class ConfigJMXNotification extends Notification {
18 private static final long serialVersionUID = 6754474563863772845L;
20 private static long sequenceNumber = 1;
22 public static final String TYPE_NAME = "configfNotificationProvider";
23 public static final ObjectName OBJECT_NAME = ObjectNameUtil.createONWithDomainAndType(TYPE_NAME);
25 private final NotificationType type;
27 protected ConfigJMXNotification(final NotificationType type, final NotificationBroadcasterSupport source,
28 final String message) {
29 super(type.toString(), source, sequenceNumber++, System.nanoTime(), message);
34 public String toString() {
35 return "TransactionProviderJMXNotification [type=" + type + "]";
39 * Sends this notification using source that created it.
42 ((NotificationBroadcasterSupport) getSource()).sendNotification(this);
46 * Creates notification about successful commit execution. Intended for
49 public static CommitJMXNotification afterCommit(final NotificationBroadcasterSupport source,
50 final String messages) {
51 return new CommitJMXNotification(source, messages);
54 enum NotificationType {