com.ibm.streams.operator.control.variable
Class BooleanControlVariable
- java.lang.Object
-
- javax.management.NotificationBroadcasterSupport
-
- com.ibm.streams.operator.control.NotifierSupport<T>
-
- com.ibm.streams.operator.control.AbstractPersistentControlMBean<T>
-
- com.ibm.streams.operator.control.variable.AbstractControlVariable<java.lang.Object>
-
- com.ibm.streams.operator.control.variable.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 theboolean
control variable MBean.
Thename
of the control variable is taken from thename
property of this MBean's.It is recommended operators use
createBooleanControlVariable
instead of manually creating and registeringBooleanControlVariable
MBeans.ControlVariableAccessor
provides simple support of aString
control variable, hiding all the JMX interactions with the Job Control Plane.- Since:
- InfoSphere® Streams Version 4.0
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
IBM_COPYRIGHT
-
Fields inherited from class com.ibm.streams.operator.control.NotifierSupport
ATTRIBUTE_CHANGE_INFO
-
-
Constructor Summary
Constructors Constructor and Description BooleanControlVariable()
Create aBooleanControlVariableMXBean
initially set tofalse
.BooleanControlVariable(boolean initialState)
Create aBooleanControlVariableMXBean
initially set toinitialState
.
-
Method Summary
Methods Modifier and Type Method and Description boolean
getValue()
Get the value of this control variable.void
off()
Set this control variable tofalse
.void
on()
Set this control variable totrue
.void
setValue(boolean value)
Set the value of this control variable.void
updateControlState(byte[] controlState)
Update this variable's value from its persisted state.-
Methods inherited from class com.ibm.streams.operator.control.variable.AbstractControlVariable
getName, preRegister
-
Methods inherited from class com.ibm.streams.operator.control.AbstractPersistentControlMBean
persistControlState, setupComplete
-
Methods inherited from class com.ibm.streams.operator.control.NotifierSupport
getObjectName, getServer, nextSequence, postDeregister, postRegister, preDeregister, sendAttributeChangeNotification, sendBooleanAttributeChangeNotification, sendNotification, sendNotification
-
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
-
Methods inherited from interface com.ibm.streams.operator.control.variable.BooleanControlVariableMXBean
getName
-
Methods inherited from interface com.ibm.streams.operator.control.PersistentControlMBean
setupComplete
-
-
-
-
Field Detail
-
IBM_COPYRIGHT
public static final java.lang.String IBM_COPYRIGHT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BooleanControlVariable
public BooleanControlVariable()
Create aBooleanControlVariableMXBean
initially set tofalse
.
-
BooleanControlVariable
public BooleanControlVariable(boolean initialState)
Create aBooleanControlVariableMXBean
initially set toinitialState
.
-
-
Method Detail
-
getValue
public boolean getValue()
Get the value of this control variable.- Specified by:
getValue
in interfaceBooleanControlVariableMXBean
- 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 anAttributeChangeNotification
is sent using attribute nameValue
.When the value changes it will be persisted in the Job Control Plane.
- Specified by:
setValue
in interfaceBooleanControlVariableMXBean
- 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 totrue
.- Specified by:
on
in interfaceBooleanControlVariableMXBean
- 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 tofalse
.- Specified by:
off
in interfaceBooleanControlVariableMXBean
- 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 interfacePersistentControlMBean
- Parameters:
controlState
- Control state previous persisted for this MBean.
-
-