--- D:/temp/boss-as/system-jmx/src/main/java/org/jboss/system/ServiceMBeanSupport.java vr feb 1 10:27:52 2013
+++ D:/temp/boss-as/system-jmx/src/main/java/org/jboss/system/ServiceMBeanSupport.java di feb 5 08:13:08 2013
@@ -24,10 +24,13 @@
import javax.management.MBeanRegistration;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
+import javax.management.NotificationBroadcasterSupport;
import javax.management.ObjectName;
import org.jboss.logging.Logger;
+import EDU.oswego.cs.dl.util.concurrent.SynchronizedLong;
+
/**
* An abstract base class JBoss services can subclass to implement a service that conforms to the ServiceMBean interface.
* Subclasses must override {@link #getName} method and should override {@link #startService}, and {@link #stopService} as
@@ -41,7 +44,7 @@
* @author Jason Dillon
* @author Eduardo Martins (AS7)
*/
-public class ServiceMBeanSupport implements ServiceMBean, MBeanRegistration {
+public class ServiceMBeanSupport extends NotificationBroadcasterSupport /*[Roel]: added extends NotificationBroadcasterSupport */ implements ServiceMBean, MBeanRegistration {
protected Logger log;
@@ -64,7 +67,8 @@
private boolean stopIgnored = false;
private boolean destroyIgnored = false;
private boolean unregisterIgnored = false;
-
+
+
/**
* Construct a ServiceMBeanSupport.
*
@@ -449,5 +453,36 @@
*/
protected void destroyService() throws Exception {
}
+
+ /////////////////////////////////
+ // [Roel]: added sequenceNumber (from previous JBossNotificationBroadcasterSupport)
+
+ /** Sequence number for jmx notifications we send out */
+ private SynchronizedLong sequenceNumber = new SynchronizedLong(0);
+
+
+ /**
+ * The nextNotificationSequenceNumber
method returns
+ * the next sequence number for use in notifications.
+ *
+ * @return a long
value
+ */
+ public long nextNotificationSequenceNumber()
+ {
+ return sequenceNumber.increment();
+ }
+
+ /**
+ * The getNextNotificationSequenceNumber
method returns
+ * the next sequence number for use in notifications.
+ *
+ * @return a long
value
+ */
+ protected long getNextNotificationSequenceNumber()
+ {
+ return nextNotificationSequenceNumber();
+ }
+
+ ///////////////////////////////////////////
}