com.ibm.streams.operator.control.patterns
Class AbstractNotificationSource
- java.lang.Object
-
- com.ibm.streams.operator.AbstractOperator
-
- com.ibm.streams.operator.control.patterns.AbstractNotificationSource
-
- All Implemented Interfaces:
- Controllable, Operator
public abstract class AbstractNotificationSource extends AbstractOperator implements Controllable
Abstract operator for listening to notifications from the Job Control Plane and then submitting tuples derived from the notification to an output port.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.ibm.streams.operator.control.Controllable
Controllable.EventType
-
Nested classes/interfaces inherited from interface com.ibm.streams.operator.Operator
Operator.TagNames
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
IBM_COPYRIGHT
-
Constructor Summary
Constructors Constructor and Description AbstractNotificationSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
allPortsReady()
Connect this to the Job Control Plane as aControllable
.protected javax.management.NotificationFilter
getFilter()
java.lang.String[]
getFilters()
protected javax.management.NotificationListener
getNotificationListener()
java.lang.String[]
getObjectNames()
void
initialize(OperatorContext context)
boolean
isApplicable(OperatorContext context)
Is thisControllable
applicable for this invocation.void
setFilters(java.lang.String[] filters)
Set the filters.void
setObjectNames(java.lang.String[] objectNames)
Set the object names to listen to.void
setup(javax.management.MBeanServerConnection mbs, OperatorContext context)
Add the notification listener to each MBean listed in the getObjectNames() array using the filter.-
Methods inherited from class com.ibm.streams.operator.AbstractOperator
checkPorts, createAvoidCompletionThread, createAvoidCompletionThread, createAvoidCompletionThreadIfNoInputs, getControlPlaneContext, getInput, getOperatorContext, getOutput, process, processPunctuation, setLoggerAspects, setTagData, shutdown
-
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.Controllable
event
-
-
-
-
Field Detail
-
IBM_COPYRIGHT
public static final java.lang.String IBM_COPYRIGHT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractNotificationSource
public AbstractNotificationSource()
-
-
Method Detail
-
setObjectNames
public void setObjectNames(java.lang.String[] objectNames)
Set the object names to listen to.
-
getObjectNames
public java.lang.String[] getObjectNames()
-
setFilters
public void setFilters(java.lang.String[] filters)
Set the filters. Filters are simple filters on the notification type.- Parameters:
filters
-
-
getFilters
public java.lang.String[] getFilters()
-
initialize
public void initialize(OperatorContext context) throws java.lang.Exception
- Specified by:
initialize
in interfaceOperator
- Overrides:
initialize
in classAbstractOperator
- Throws:
java.lang.Exception
-
getNotificationListener
protected javax.management.NotificationListener getNotificationListener()
-
getFilter
protected javax.management.NotificationFilter getFilter()
-
allPortsReady
public void allPortsReady() throws java.lang.Exception
Connect this to the Job Control Plane as aControllable
. TheControllable
is only connected atOperator.allPortsReady()
to ensure no tuples are submitted before the output port is ready.- Specified by:
allPortsReady
in interfaceOperator
- Overrides:
allPortsReady
in classAbstractOperator
- Throws:
java.lang.Exception
-
isApplicable
public boolean isApplicable(OperatorContext context)
Is thisControllable
applicable for this invocation. Return true as the assumption is that thisControllable
is always application for its own operator. Sub-classes may override this if they there is no requirement to connect to the control plane for some invocations.- Specified by:
isApplicable
in interfaceControllable
- Returns:
- true
- See Also:
Controllable.isApplicable(OperatorContext)
-
setup
public void setup(javax.management.MBeanServerConnection mbs, OperatorContext context) throws java.lang.Exception
Add the notification listener to each MBean listed in the getObjectNames() array using the filter. The standard handler will submit a tuple to port 0 for each notification- Specified by:
setup
in interfaceControllable
- Throws:
java.lang.Exception
-
-