Package com.apama.engine
Interface EngineManagement
- 
- All Superinterfaces:
- java.lang.AutoCloseable,- EventConsumer
 
 public interface EngineManagement extends EventConsumer, java.lang.AutoCloseable The EngineManagement interface is the primary low-level interface to the Engine, and allows operations to be carried out on it.The static methods of the EngineManagementFactoryclass are used to create an object implementing this interface.Note that for most applications it is recommended to use the higher-level interfaces provided by EngineClientBeanorIEventServiceinstead of the low-level EngineManagement interface.Because an EngineManagement object is also an EventConsumer, it can have events sent to it (and to the Engine) through its sendEvents() method. 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidattachAsEventConsumerTo(EngineManagement eventSupplier, java.lang.String[] channels)Connect another Engine to this one as an event supplier, with this engine consuming its events.voidattachAsEventConsumerTo(EngineManagement eventSupplier, java.lang.String[] channels, boolean disconnectSlow)Connect another Engine to this one as an event supplier, with this engine consuming its events.voidattachAsEventConsumerTo(EngineManagement eventSupplier, java.lang.String[] channels, boolean disconnectSlow, ConnectMode mode)Connect another Engine to this one as an event supplier, with this engine consuming its events.voidattachAsEventConsumerTo(java.lang.String host, int port, java.lang.String[] channels)Connect another Engine to this one as an event supplier, with this engine consuming its events, and the receiver should reconnect if it is disconnected.voidattachAsEventConsumerTo(java.lang.String host, int port, java.lang.String[] channels, boolean disconnectSlow)Connect another Engine to this one as an event supplier, with this engine consuming its events, and the receiver should reconnect if it is disconnected.voidattachAsEventConsumerTo(java.lang.String host, int port, java.lang.String[] channels, boolean disconnectSlow, ConnectMode mode)Connect another Engine to this one as an event supplier, with this engine consuming its events, and the receiver should reconnect if it is disconnected.voidclose()Closes this resource, relinquishing any underlying resources.EventSupplierconnectEventConsumer(EventConsumer consumer, java.lang.String[] channels)Connect an event receiver to the Engine.EventSupplierconnectEventConsumer(EventConsumer consumer, java.lang.String[] channels, boolean disconnectSlow)Deprecated.voiddeleteAll()Deletes everything from the engine.voiddeleteName(java.lang.String name)Delete a named object from the Engine.voiddetachAsEventConsumerFrom(EngineManagement eventSupplier, java.lang.String[] channels)Detach another Engine from this one as an event supplier, with this engine no longer consuming its events.voiddetachAsEventConsumerFrom(EngineManagement eventSupplier, java.lang.String[] channels, ConnectMode mode)Detach another Engine from this one as an event supplier, with this engine no longer consuming its events.voiddetachAsEventConsumerFrom(java.lang.String host, int port, java.lang.String[] channels)Detach another Engine from this one as an event supplier, with this engine no longer consuming its events.voiddetachAsEventConsumerFrom(java.lang.String host, int port, java.lang.String[] channels, ConnectMode mode)Detach another Engine from this one as an event supplier, with this engine no longer consuming its events.voiddisconnect()Disconnect this client completely from the remote component.voidflushEvents()Wait for any outstanding events from previoussendEvents(Event[])calls into the Engine, and then return.voidforceDeleteName(java.lang.String name)Force deletion of a named object from the Engine.java.lang.StringgetEngineVersion()Get the version of the Engine.EngineConnection[]getReceiverConnections()Get all the persistent connections associated with the engine.longgetRemotePhysicalComponentID()Obtain a unique ID for the component that this object is connected to.EngineStatusgetStatus()Get the Engine's current operational status.java.lang.String[]injectCDP(byte[] cdpbytes, java.lang.String filename)Injects a CDP (Correlator Deployment Package) into the engine.java.lang.String[]injectJava(byte[] jarbytes)Injects a Java application (a jar) into the engine.java.lang.String[]injectMonitorScript(MonitorScript script)Inject MonitorScript text into the Engine.java.lang.String[]injectMonitorScript(MonitorScript script, java.lang.String filename)Inject MonitorScript text into the Engine.EngineInfoinspectEngine()Ask the Engine for information about the internal state.booleanisConnected()This method is used to check that the Engine is still connected.voidkillName(java.lang.String name)Kill a named object in the Engine.voidping()This method is used to check that the Engine is still alive.voidsendEvents(Event[] events)Send events into the Engine (inherited from EventConsumer), automatically rebatching the actual event sending for efficiency.voidsendEventsNoBatching(Event[] events)Send events into the Engine, without rebatching the actual event sending.voidsetPersistentReceiveConnections(EngineConnection... connections)Deprecated.usesetReceiverConnections(EngineConnection... )insteadvoidsetReceiverConnections(EngineConnection... connections)Attaches this component as a persistent receiver of the remote components specified in the connections argument, then decrements the reference count of any existing connections (which typically results in their removal).
 
- 
- 
- 
Method Detail- 
closevoid close() Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.The implementation of this method should perform the same task as disconnect(), thus making it unnecessary to call bothclose()anddisconnect().- Specified by:
- closein interface- java.lang.AutoCloseable
- See Also:
- AutoCloseable.close()
 
 - 
disconnectvoid disconnect() throws EngineExceptionDisconnect this client completely from the remote component.- Throws:
- EngineException
 
 - 
injectMonitorScriptjava.lang.String[] injectMonitorScript(MonitorScript script) throws EngineException Inject MonitorScript text into the Engine.- Parameters:
- script- MonitorScript text to be injected.
- Returns:
- An array of strings which are the set of warnings + * generated by the MonitorScript compiler. May be zero length.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK. This exception may contain warnings.
- InterruptedEngineException- If the calling thread is interrupted
 
 - 
injectMonitorScriptjava.lang.String[] injectMonitorScript(MonitorScript script, java.lang.String filename) throws EngineException Inject MonitorScript text into the Engine.- Parameters:
- script- MonitorScript text to be injected.
- filename- Filename that the monitorscript came from (or null)
- Returns:
- An array of strings which are the set of warnings + * generated by the MonitorScript compiler. May be zero length.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK. This exception may contain warnings.
- InterruptedEngineException- If the calling thread is interrupted
 
 - 
deleteNamevoid deleteName(java.lang.String name) throws EngineExceptionDelete a named object from the Engine.- Parameters:
- name- The name of the object to be deleted.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
- InterruptedEngineException- If the calling thread is interrupted
 
 - 
forceDeleteNamevoid forceDeleteName(java.lang.String name) throws EngineExceptionForce deletion of a named object from the Engine.- Parameters:
- name- The name of the object to be deleted.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
killNamevoid killName(java.lang.String name) throws EngineExceptionKill a named object in the Engine. Note that this will kill running monitors in such as way as to break the fault tolerance scheme.- Parameters:
- name- The name of the object to be killed.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
deleteAllvoid deleteAll() throws EngineExceptionDeletes everything from the engine.- Throws:
- EngineException
 
 - 
injectJavajava.lang.String[] injectJava(byte[] jarbytes) throws EngineExceptionInjects a Java application (a jar) into the engine.- Parameters:
- jarbytes- the bytes of the Java (Jmon) Application jar to be injected.
- Returns:
- An array of strings which are the set of warnings about the JMon application. May be zero length.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK. This exception may contain warnings.
- InterruptedEngineException- If the calling thread is interrupted
 
 - 
injectCDPjava.lang.String[] injectCDP(byte[] cdpbytes, java.lang.String filename) throws EngineExceptionInjects a CDP (Correlator Deployment Package) into the engine.- Parameters:
- cdpbytes- the bytes of the CDP file to be injected.
- filename- the name of the file we are injecting from.
- Returns:
- An array of strings which are the set of warnings about the CDP file. May be zero length.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK. This exception may contain warnings.
- InterruptedEngineException- If the calling thread is interrupted
 
 - 
getStatusEngineStatus getStatus() throws EngineException Get the Engine's current operational status.- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
inspectEngineEngineInfo inspectEngine() throws EngineException Ask the Engine for information about the internal state. This provides a minimal "introspection" mechanism to discover for example the names of each of the Monitor defintions and EventType definition that are currently known to the Engine.- Returns:
- an EngineInfo object contain a "snapshot" of information about the contents of the Engine.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
pingvoid ping() throws EngineException This method is used to check that the Engine is still alive. If the Engine is alive it returns normally. If there is a problem then reconnection may be attempted, and if that fails, an EngineException is thrown.- Throws:
- EngineException
- InterruptedEngineException- If the calling thread is interrupted
 
 - 
isConnectedboolean isConnected() throws InterruptedEngineExceptionThis method is used to check that the Engine is still connected. It will not reconnect.- Returns:
- true if connected, else false.
- Throws:
- InterruptedEngineException- If the calling thread is interrupted
 
 - 
connectEventConsumerEventSupplier connectEventConsumer(EventConsumer consumer, java.lang.String[] channels) throws EngineException Connect an event receiver to the Engine.- Parameters:
- consumer- The EventConsumer to connect to the Engine.
- channels- An array of names representing the channels to subscribe to.
- Returns:
- A reference to an EventSupplier resource.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
connectEventConsumer@Deprecated EventSupplier connectEventConsumer(EventConsumer consumer, java.lang.String[] channels, boolean disconnectSlow) throws EngineException Deprecated.Connect an event receiver to the Engine.- Parameters:
- consumer- The EventConsumer to connect to the Engine.
- channels- An array of names representing the channels to subscribe to.
- disconnectSlow- Whether we should be disconnected if we don't keep up. Only the first consumer's disconnectSlow value is used; subsequent consumers added to this EngineManagement object share the connection and thus the disconnect behaviour.
- Returns:
- A reference to an EventSupplier resource.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
attachAsEventConsumerTovoid attachAsEventConsumerTo(EngineManagement eventSupplier, java.lang.String[] channels) throws EngineException Connect another Engine to this one as an event supplier, with this engine consuming its events.- Parameters:
- eventSupplier- The EngineManagement which will supply events to this engine.
- channels- An array of names representing the channels to subscribe to.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
detachAsEventConsumerFromvoid detachAsEventConsumerFrom(EngineManagement eventSupplier, java.lang.String[] channels) throws EngineException Detach another Engine from this one as an event supplier, with this engine no longer consuming its events.- Parameters:
- eventSupplier- The EngineManagement which is currently supplying events to this engine.
- channels- An array of names representing the channels we were subscribed to.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
detachAsEventConsumerFromvoid detachAsEventConsumerFrom(EngineManagement eventSupplier, java.lang.String[] channels, ConnectMode mode) throws EngineException Detach another Engine from this one as an event supplier, with this engine no longer consuming its events.- Parameters:
- eventSupplier- The EngineManagement which is currently supplying events to this engine.
- channels- An array of names representing the channels we were subscribed to.
- mode- the connection mode to use, defaults to legacy (single connection, all events delivered to the default channel). Set to PARALLEL for connection per channel and channel values passed through.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
attachAsEventConsumerTovoid attachAsEventConsumerTo(EngineManagement eventSupplier, java.lang.String[] channels, boolean disconnectSlow) throws EngineException Connect another Engine to this one as an event supplier, with this engine consuming its events.- Parameters:
- eventSupplier- The EngineManagement which will supply events to this engine.
- channels- An array of names representing the channels to subscribe to.
- disconnectSlow- Whether we should be disconnected if we don't keep up. Only the first consumer's disconnectSlow value is used; subsequent consumers added to this EngineManagement object share the connection and thus the disconnect behaviour.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
attachAsEventConsumerTovoid attachAsEventConsumerTo(EngineManagement eventSupplier, java.lang.String[] channels, boolean disconnectSlow, ConnectMode mode) throws EngineException Connect another Engine to this one as an event supplier, with this engine consuming its events.- Parameters:
- eventSupplier- The EngineManagement which will supply events to this engine.
- channels- An array of names representing the channels to subscribe to.
- disconnectSlow- Whether we should be disconnected if we don't keep up. Only the first consumer's disconnectSlow value is used; subsequent consumers added to this EngineManagement object share the connection and thus the disconnect behaviour.
- mode- the connection mode to use, defaults to legacy (single connection, all events delivered to the default channel). Set to PARALLEL for connection per channel and channel values passed through.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
attachAsEventConsumerTovoid attachAsEventConsumerTo(java.lang.String host, int port, java.lang.String[] channels) throws EngineExceptionConnect another Engine to this one as an event supplier, with this engine consuming its events, and the receiver should reconnect if it is disconnected.- Parameters:
- host- host of the component which is supplying events
- port- port of the component which is supplying events
- channels- An array of names representing the channels to subscribe to.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
attachAsEventConsumerTovoid attachAsEventConsumerTo(java.lang.String host, int port, java.lang.String[] channels, boolean disconnectSlow) throws EngineExceptionConnect another Engine to this one as an event supplier, with this engine consuming its events, and the receiver should reconnect if it is disconnected.- Parameters:
- host- host of the component which is supplying events
- port- port of the component which is supplying events
- channels- An array of names representing the channels to subscribe to.
- disconnectSlow- Whether we should be disconnected if we don't keep up. Only the first consumer's disconnectSlow value is used; subsequent consumers added to this EngineManagement object share the connection and thus the disconnect behaviour.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
attachAsEventConsumerTovoid attachAsEventConsumerTo(java.lang.String host, int port, java.lang.String[] channels, boolean disconnectSlow, ConnectMode mode) throws EngineExceptionConnect another Engine to this one as an event supplier, with this engine consuming its events, and the receiver should reconnect if it is disconnected.- Parameters:
- host- host of the component which is supplying events
- port- port of the component which is supplying events
- channels- An array of names representing the channels to subscribe to.
- disconnectSlow- Whether we should be disconnected if we don't keep up. Only the first consumer's disconnectSlow value is used; subsequent consumers added to this EngineManagement object share the connection and thus the disconnect behaviour.
- mode- the connection mode to use, defaults to legacy (single connection, all events delivered to the default channel). Set to PARALLEL for connection per channel and channel values passed through.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
detachAsEventConsumerFromvoid detachAsEventConsumerFrom(java.lang.String host, int port, java.lang.String[] channels) throws EngineExceptionDetach another Engine from this one as an event supplier, with this engine no longer consuming its events.- Parameters:
- host- host of the component which is supplying events
- port- port of the component which is supplying events
- channels- An array of names representing the channels we were subscribed to.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
detachAsEventConsumerFromvoid detachAsEventConsumerFrom(java.lang.String host, int port, java.lang.String[] channels, ConnectMode mode) throws EngineExceptionDetach another Engine from this one as an event supplier, with this engine no longer consuming its events.- Parameters:
- host- host of the component which is supplying events
- port- port of the component which is supplying events
- channels- An array of names representing the channels we were subscribed to.
- mode- the connection mode to use, defaults to legacy (single connection, all events delivered to the default channel). Set to PARALLEL for connection per channel and channel values passed through.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
setPersistentReceiveConnections@Deprecated void setPersistentReceiveConnections(EngineConnection... connections) throws EngineException Deprecated.usesetReceiverConnections(EngineConnection... )insteadAttaches this component as a persistent receiver of the remote components specified in the connections argument, then decrements the reference count of any existing connections (which typically results in their removal).- Parameters:
- connections- Must not contain- nullelements.
- Throws:
- EngineException- If the change in the persistent connection set failed. Note that no exception is thrown if some of the specified connections could not be established immediately - in this case the receiver will simply keep trying to reconnect in the background.
 
 - 
setReceiverConnectionsvoid setReceiverConnections(EngineConnection... connections) throws EngineException Attaches this component as a persistent receiver of the remote components specified in the connections argument, then decrements the reference count of any existing connections (which typically results in their removal).- Parameters:
- connections- Must not contain- nullelements.
- Throws:
- EngineException- If the change in the persistent connection set failed. Note that no exception is thrown if some of the specified connections could not be established immediately - in this case the receiver will simply keep trying to reconnect in the background.
 
 - 
getReceiverConnectionsEngineConnection[] getReceiverConnections() throws EngineException Get all the persistent connections associated with the engine.- Returns:
- an array of EngineConnection objects.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
getEngineVersionjava.lang.String getEngineVersion() throws EngineExceptionGet the version of the Engine.- Returns:
- A string with the version of the Engine connected to.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
sendEventsvoid sendEvents(Event[] events) throws EngineException Send events into the Engine (inherited from EventConsumer), automatically rebatching the actual event sending for efficiency.- Specified by:
- sendEventsin interface- EventConsumer
- Parameters:
- events- An array of Event objects containing the events to send into the Engine.
- Throws:
- InterruptedEngineException- If the calling thread is interrupted
- EngineException- Thrown if any exceptions occur in the Client SDK.
 
 - 
sendEventsNoBatchingvoid sendEventsNoBatching(Event[] events) throws EngineException Send events into the Engine, without rebatching the actual event sending.- Parameters:
- events- An array of Event objects containing the events to send into the Engine.
- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
- InterruptedEngineException- If the calling thread is interrupted
- See Also:
- flushEvents()
 
 - 
flushEventsvoid flushEvents() throws EngineException, java.lang.InterruptedExceptionWait for any outstanding events from previoussendEvents(Event[])calls into the Engine, and then return.- Throws:
- EngineException- Thrown if any exceptions occur in the Client SDK.
- java.lang.InterruptedException- Thrown if this thread is interrupted while waiting for outstanding events to be sent and acknowledged (see- Thread.interrupt().
- See Also:
- sendEvents(Event[])
 
 - 
getRemotePhysicalComponentIDlong getRemotePhysicalComponentID() Obtain a unique ID for the component that this object is connected to. The physical ID is the same for a given process, so connecting to the same process should yield the same physical component ID. Restarting the process will yield a different ID, even if re-started on the same host and port. (This is the same ID logged in server log files)
 
- 
 
-