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 of userData 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. Extends NotificationBroadcasterSupport 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
      An MBeanNotificationInfo that indicates an MBean generates jmx.attribute.change notifications using javax.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's ObjectName.
      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 an AttributeChangeNotification with type jmx.attribute.change.
      protected void sendBooleanAttributeChangeNotification(java.lang.String attributeName, boolean newValue)
      Send an AttributeChangeNotification with type jmx.attribute.change for a boolean attribute.
      protected void sendNotification(java.lang.String type)
      Send a notification with type and no user data.
      protected void sendNotification(java.lang.String type, T userData)
      Send a notification with type and userData.
      • Methods inherited from class javax.management.NotificationBroadcasterSupport

        addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ATTRIBUTE_CHANGE_INFO

        public static final javax.management.MBeanNotificationInfo ATTRIBUTE_CHANGE_INFO
        An MBeanNotificationInfo that indicates an MBean generates jmx.attribute.change notifications using javax.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 the preRegister(MBeanServer, ObjectName) method.
        Returns:
        MBeanServer this MBean is registered in.
      • getObjectName

        protected javax.management.ObjectName getObjectName()
        Get this MBean's ObjectName. Set by the preRegister(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 with type and no user data.
        Parameters:
        type - Type of the notification.
      • sendNotification

        protected void sendNotification(java.lang.String type,
                            T userData)
        Send a notification with type and userData.
        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 an AttributeChangeNotification with type jmx.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 an AttributeChangeNotification with type jmx.attribute.change for a boolean 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 saves server and name for future use by the MBean. Sub-classes must call super.preRegister(server,name). If name is null then then sub-class must call this once it has created the ObjectName it will return.
        Specified by:
        preRegister in interface javax.management.MBeanRegistration
        Parameters:
        server - MBean server this MBean is being registered in.
        name - Name of this MBean, if null then the MBean must create an ObjectName 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 interface javax.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 interface javax.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 interface javax.management.MBeanRegistration