com.ibm.streams.operator.control.variable

Class BooleanControlVariable

  • All Implemented Interfaces:
    PersistentControlMBean, BooleanControlVariableMXBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter


    public class BooleanControlVariable
    extends AbstractControlVariable<java.lang.Object>
    implements BooleanControlVariableMXBean
    Provides the implementation of the boolean control variable MBean.
    The name of the control variable is taken from the name property of this MBean's.

    It is recommended operators use createBooleanControlVariable instead of manually creating and registering BooleanControlVariable MBeans. ControlVariableAccessor provides simple support of a String control variable, hiding all the JMX interactions with the Job Control Plane.

    Since:
    InfoSphere® Streams Version 4.0
    • Method Detail

      • getValue

        public boolean getValue()
        Get the value of this control variable.
        Specified by:
        getValue in interface BooleanControlVariableMXBean
        Returns:
        the value of this control variable.
      • setValue

        public void setValue(boolean value)
                      throws java.io.IOException
        Set the value of this control variable. If the value changes an AttributeChangeNotification is sent using attribute name Value.

        When the value changes it will be persisted in the Job Control Plane.

        Specified by:
        setValue in interface BooleanControlVariableMXBean
        Parameters:
        value - New value for this control variable.
        Throws:
        java.io.IOException - Exception persisting the control variable in the Job Control Plane.
      • on

        public void on()
                throws java.io.IOException
        Set this control variable to true.
        Specified by:
        on in interface BooleanControlVariableMXBean
        Throws:
        java.io.IOException - Exception persisting the control variable in the Job Control Plane.
      • off

        public void off()
                 throws java.io.IOException
        Set this control variable to false.
        Specified by:
        off in interface BooleanControlVariableMXBean
        Throws:
        java.io.IOException - Exception persisting the control variable in the Job Control Plane.
      • updateControlState

        public void updateControlState(byte[] controlState)
        Update this variable's value from its persisted state.
        Specified by:
        updateControlState in interface PersistentControlMBean
        Parameters:
        controlState - Control state previous persisted for this MBean.