com.ibm.streams.operator.control
Class NotifierSupport<T>
- java.lang.Object
-
- javax.management.NotificationBroadcasterSupport
-
- com.ibm.streams.operator.control.NotifierSupport<T>
-
- Type Parameters:
T
- Type ofuserData
for the notification.
- All Implemented Interfaces:
- javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter
- Direct Known Subclasses:
- AbstractPersistentControlMBean
public abstract class NotifierSupport<T> extends javax.management.NotificationBroadcasterSupport implements javax.management.MBeanRegistration
Abstract MBean implementation with notification support. ExtendsNotificationBroadcasterSupport
to support sequence numbers, simple notify methods and typed user data.- Since:
- InfoSphere® Streams Version 4.0
-
-
Field Summary
Fields Modifier and Type Field and Description static javax.management.MBeanNotificationInfo
ATTRIBUTE_CHANGE_INFO
AnMBeanNotificationInfo
that indicates an MBean generatesjmx.attribute.change
notifications usingjavax.management.AttributeChangeNotification
.static java.lang.String
IBM_COPYRIGHT
-
Constructor Summary
Constructors Modifier Constructor and Description protected
NotifierSupport(javax.management.MBeanNotificationInfo... info)
Create an instance of this MBean.
-
Method Summary
Methods Modifier and Type Method and Description protected javax.management.ObjectName
getObjectName()
Get this MBean'sObjectName
.protected javax.management.MBeanServer
getServer()
Get the MBeanServer this MBean is registered in.protected long
nextSequence()
void
postDeregister()
Actions the MBean takes after it has been unregistered from an MBean server.void
postRegister(java.lang.Boolean registrationDone)
Actions the MBean takes after it has been registered in an MBean server.void
preDeregister()
Actions the MBean takes before it is unregistered from an MBean server.javax.management.ObjectName
preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
Actions the MBean takes before it is registered in an MBean server.protected javax.management.AttributeChangeNotification
sendAttributeChangeNotification(java.lang.String attributeName, java.lang.String attributeType, java.lang.Object oldValue, java.lang.Object newValue)
Send anAttributeChangeNotification
with typejmx.attribute.change
.protected void
sendBooleanAttributeChangeNotification(java.lang.String attributeName, boolean newValue)
Send anAttributeChangeNotification
with typejmx.attribute.change
for aboolean
attribute.protected void
sendNotification(java.lang.String type)
Send a notification withtype
and no user data.protected void
sendNotification(java.lang.String type, T userData)
Send a notification withtype
anduserData
.
-
-
-
Field Detail
-
IBM_COPYRIGHT
public static final java.lang.String IBM_COPYRIGHT
- See Also:
- Constant Field Values
-
ATTRIBUTE_CHANGE_INFO
public static final javax.management.MBeanNotificationInfo ATTRIBUTE_CHANGE_INFO
AnMBeanNotificationInfo
that indicates an MBean generatesjmx.attribute.change
notifications usingjavax.management.AttributeChangeNotification
.
-
-
Constructor Detail
-
NotifierSupport
protected NotifierSupport(javax.management.MBeanNotificationInfo... info)
Create an instance of this MBean.- Parameters:
info
- Information about the notifications this MBean generates.
-
-
Method Detail
-
getServer
protected javax.management.MBeanServer getServer()
Get the MBeanServer this MBean is registered in. Set by thepreRegister(MBeanServer, ObjectName)
method.- Returns:
- MBeanServer this MBean is registered in.
-
getObjectName
protected javax.management.ObjectName getObjectName()
Get this MBean'sObjectName
. Set by thepreRegister(MBeanServer, ObjectName)
method.- Returns:
- Name this MBean is registered with.
-
nextSequence
protected long nextSequence()
-
sendNotification
protected void sendNotification(java.lang.String type)
Send a notification withtype
and no user data.- Parameters:
type
- Type of the notification.
-
sendNotification
protected void sendNotification(java.lang.String type, T userData)
Send a notification withtype
anduserData
.- Parameters:
type
- Type of the notification.userData
- User data for the notification.
-
sendAttributeChangeNotification
protected javax.management.AttributeChangeNotification sendAttributeChangeNotification(java.lang.String attributeName, java.lang.String attributeType, java.lang.Object oldValue, java.lang.Object newValue)
Send anAttributeChangeNotification
with typejmx.attribute.change
.- Parameters:
attributeName
- Name of the attribute which has changed.attributeType
- Type of the attribute.oldValue
- Old value of the attribute.newValue
- New value of the attribute.- Returns:
- The
AttributeChangeNotification
that was sent by this MBean.
-
sendBooleanAttributeChangeNotification
protected void sendBooleanAttributeChangeNotification(java.lang.String attributeName, boolean newValue)
Send anAttributeChangeNotification
with typejmx.attribute.change
for aboolean
attribute. The old value is!newValue
.- Parameters:
attributeName
- Name of the attribute which has changed.newValue
- New value of the attribute.
-
preRegister
public javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name) throws java.lang.Exception
Actions the MBean takes before it is registered in an MBean server.
The implementation savesserver
andname
for future use by the MBean. Sub-classes must callsuper.preRegister(server,name)
. Ifname
isnull
then then sub-class must call this once it has created theObjectName
it will return.- Specified by:
preRegister
in interfacejavax.management.MBeanRegistration
- Parameters:
server
- MBean server this MBean is being registered in.name
- Name of this MBean, ifnull
then the MBean must create anObjectName
and return it from this method.- Returns:
- Name to register this MBean under, must not be
null
. - Throws:
java.lang.Exception
- registering this MBean.
-
postRegister
public void postRegister(java.lang.Boolean registrationDone)
Actions the MBean takes after it has been registered in an MBean server.
This implementation does nothing.- Specified by:
postRegister
in interfacejavax.management.MBeanRegistration
-
preDeregister
public void preDeregister() throws java.lang.Exception
Actions the MBean takes before it is unregistered from an MBean server.
This implementation does nothing.- Specified by:
preDeregister
in interfacejavax.management.MBeanRegistration
- Throws:
java.lang.Exception
-
postDeregister
public void postDeregister()
Actions the MBean takes after it has been unregistered from an MBean server.
This implementation does nothing.- Specified by:
postDeregister
in interfacejavax.management.MBeanRegistration
-
-