Apama API Reference for .NET  10.0.0.2
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Apama.Engine.EngineManagement Class Reference

The EngineManagement interface is the primary low-level interface to the Engine, and allows operations to be carried out on it. More...

Inherits Apama.Event.EventConsumer.

Public Types

enum  ConnectMode { CONNECT_LEGACY, CONNECT_PARALLEL }
 Enumeration for selecting the mode to use for connecting Correlators together. More...
 

Public Member Functions

bool AttachAsEventConsumerTo (EngineManagement target, string[] channels, bool disconnectSlow, EngineManagement.ConnectMode mode)
 Connect this Engine as an event receiver to another Engine More...
 
bool AttachAsEventConsumerTo (EngineManagement target, string[] channels, bool disconnectSlow)
 Connect this Engine as an event receiver to another Engine More...
 
bool AttachAsEventConsumerTo (EngineManagement target, string[] channels)
 Connect this Engine as an event receiver to another Engine More...
 
bool AttachAsEventConsumerTo ([MarshalAs(UnmanagedType.LPWStr)]string host, int port, string[] channels, bool disconnectSlow, EngineManagement.ConnectMode mode)
 Connect this Engine as an event receiver to another Engine More...
 
bool AttachAsEventConsumerTo ([MarshalAs(UnmanagedType.LPWStr)]string host, int port, string[] channels, bool disconnectSlow)
 Connect this Engine as an event receiver to another Engine More...
 
bool AttachAsEventConsumerTo ([MarshalAs(UnmanagedType.LPWStr)]string host, int port, string[] channels)
 Connect this Engine as an event receiver to another Engine More...
 
EventSupplier ConnectEventConsumer (EventConsumer consumer, string[] channels, bool disconnectSlow)
 Connect an event receiver to the Engine. More...
 
EventSupplier ConnectEventConsumer (EventConsumer consumer, string[] channels)
 Connect an event receiver to the Engine. More...
 
void DeleteAll ()
 Deletes everything from the engine More...
 
void DeleteName ([MarshalAs(UnmanagedType.LPWStr)]string name)
 Delete a named object from the Engine. More...
 
void DetachAsEventConsumerFrom (EngineManagement target, string[] channels, EngineManagement.ConnectMode mode)
 Unsubscribe this Engine as an event receiver from another Engine More...
 
void DetachAsEventConsumerFrom (EngineManagement target, string[] channels)
 Unsubscribe this Engine as an event receiver from another Engine More...
 
void DetachAsEventConsumerFrom ([MarshalAs(UnmanagedType.LPWStr)]string host, int port, string[] channels, EngineManagement.ConnectMode mode)
 Unsubscribe this Engine as an event receiver from another Engine More...
 
void DetachAsEventConsumerFrom ([MarshalAs(UnmanagedType.LPWStr)]string host, int port, string[] channels)
 Unsubscribe this Engine as an event receiver from another Engine More...
 
virtual void Disconnect ()
 Disconnect this client completely from the remote component. More...
 
override void Dispose ()
 Must be called to free unmanaged resources associated with this object. More...
 
void FlushEvents ()
 Flush events sent to the Engine using SendEvents(Event[]). More...
 
void ForceDeleteName ([MarshalAs(UnmanagedType.LPWStr)]string name)
 Force deletion of a named object from the Engine. More...
 
EngineConnection[] GetReceiverConnections ()
 Get all the persistent connections associated with the engine. More...
 
Apama.Engine.EngineStatus GetStatus ()
 Get the Engine's current operational status. More...
 
virtual string[] InjectCDP (byte[] cdpbytes, String filename)
 Injects a CDP (Correlator Deployment package) into the engine. More...
 
virtual string[] InjectCDP (byte[] cdpbytes)
 Injects a CDP (Correlator Deployment package) into the engine. More...
 
virtual string[] InjectJava (byte[] jarbytes)
 Injects a Java application (a jar) into the engine. More...
 
string[] InjectMonitorScript (MonitorScript mon)
 Inject MonitorScript text into the Engine. More...
 
string[] InjectMonitorScript (string monitorscript)
 Inject MonitorScript text into the Engine. More...
 
string[] InjectMonitorScript (string script, string fileName)
 Inject MonitorScript text into the Engine. More...
 
Apama.Engine.EngineInfo InspectEngine ()
 Returns information about the monitors, event types, timers aggregates which exist in the engine. More...
 
bool IsConnected ()
 This method is used to check that this object is still connected to the Engine. It will never reconnect. More...
 
void KillName ([MarshalAs(UnmanagedType.LPWStr)]string name)
 Kill a named object in the Engine. Note that this will kill running monitors in such as way as to break the fault tolerance scheme. More...
 
void Ping ()
 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 an EngineException is thrown. At present, ping() will not attempt to reconnect once the initial connection is lost. More...
 
override void SendEvents (Event[] events)
 Send events into the Engine (inherited from EventConsumer), automatically rebatching the actual event sending for efficiency. More...
 
void SendEventsNoBatching (Event[] events)
 Send events into the Engine without rebatching the actual event sending. More...
 
void SetReceiverConnections (params 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). More...
 
override string ToString ()
 Returns a string that represents the object. More...
 
- Public Member Functions inherited from Apama.Event.EventConsumer
override string ToString ()
 Returns a string that represents the object. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 Virtual helper method to implement Dispose() More...
 

Properties

bool ReconnectOnSend [get, set]
 Determines whether the disconnected client should implicitly attempt to reconnect when sending events or injecting MonitorScript. More...
 
ulong RemotePhysicalComponentID [get]
 Obtain a unique ID for the component that this object is connected to. More...
 

Detailed Description

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 EngineManagementFactory class are used to create an object implementing this interface. Because an EngineManagement object is also an EventConsumer, it can have events sent to it (and to the Engine) through its SendEvents() method.

Do not call Disconnect() or DetachAsEventConsumerFrom() synchronously from consumer code.

Note that for most applications it is recommended to use the higher-level interfaces provided by Apama.Engine.Client.IEngineClient or Apama.Services.Event.IEventService instead of the low-level EngineManagement interface.

Member Enumeration Documentation

Enumeration for selecting the mode to use for connecting Correlators together.

Member Function Documentation

bool Apama.Engine.EngineManagement.AttachAsEventConsumerTo ( EngineManagement  target,
string[]  channels,
bool  disconnectSlow,
EngineManagement.ConnectMode  mode 
)

Connect this Engine as an event receiver to another Engine

Parameters
targetThe Engine to connect to.
channelsAn array of names representing the channels to subscribe to.
disconnectSlowdisconnect if slow (may be overridden by correlator configuration or previous connection)
modewhich mode to connect using
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
true if successful
bool Apama.Engine.EngineManagement.AttachAsEventConsumerTo ( EngineManagement  target,
string[]  channels,
bool  disconnectSlow 
)

Connect this Engine as an event receiver to another Engine

Parameters
targetThe Engine to connect to.
channelsAn array of names representing the channels to subscribe to.
disconnectSlowdisconnect if slow (may be overridden by correlator configuration or previous connection)
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
true if successful
bool Apama.Engine.EngineManagement.AttachAsEventConsumerTo ( EngineManagement  target,
string[]  channels 
)

Connect this Engine as an event receiver to another Engine

Parameters
targetThe Engine to connect to.
channelsAn array of names representing the channels to subscribe to.
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
true if successful
bool Apama.Engine.EngineManagement.AttachAsEventConsumerTo ( [MarshalAs(UnmanagedType.LPWStr)] string  host,
int  port,
string[]  channels,
bool  disconnectSlow,
EngineManagement.ConnectMode  mode 
)

Connect this Engine as an event receiver to another Engine

Parameters
hostHostname of the Engine to connect to.
portPort of the Engine to connect to.
channelsAn array of names representing the channels to subscribe to.
disconnectSlowdisconnect if slow (may be overridden by correlator configuration or previous connection)
modewhich mode to connect using
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
true if successful
bool Apama.Engine.EngineManagement.AttachAsEventConsumerTo ( [MarshalAs(UnmanagedType.LPWStr)] string  host,
int  port,
string[]  channels,
bool  disconnectSlow 
)

Connect this Engine as an event receiver to another Engine

Parameters
hostHostname of the Engine to connect to.
portPort of the Engine to connect to.
channelsAn array of names representing the channels to subscribe to.
disconnectSlowdisconnect if slow (may be overridden by correlator configuration or previous connection)
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
true if successful
bool Apama.Engine.EngineManagement.AttachAsEventConsumerTo ( [MarshalAs(UnmanagedType.LPWStr)] string  host,
int  port,
string[]  channels 
)

Connect this Engine as an event receiver to another Engine

Parameters
hostHostname of the Engine to connect to.
portPort of the Engine to connect to.
channelsAn array of names representing the channels to subscribe to.
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
true if successful
EventSupplier Apama.Engine.EngineManagement.ConnectEventConsumer ( EventConsumer  consumer,
string[]  channels,
bool  disconnectSlow 
)

Connect an event receiver to the Engine.

Parameters
consumerThe EventConsumer to connect to the Engine.
channelsAn array of names representing the channels to subscribe to
disconnectSlowdisconnect if slow (may be overridden by correlator configuration or previous connection)
Returns
An IDisposable EventSupplier object representing the connected consumer. Dispose() must be called on this object when the supplier is no longer required.
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Deprecated:
instead use ConnectEventConsumer(EventConsumer, string[])
EventSupplier Apama.Engine.EngineManagement.ConnectEventConsumer ( EventConsumer  consumer,
string[]  channels 
)

Connect an event receiver to the Engine.

Parameters
consumerThe EventConsumer to connect to the Engine.
channelsAn array of names representing the channels to subscribe to
Returns
An IDisposable EventSupplier object representing the connected consumer. Dispose() must be called on this object when the supplier is no longer required.
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
void Apama.Engine.EngineManagement.DeleteAll ( )

Deletes everything from the engine

Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
void Apama.Engine.EngineManagement.DeleteName ( [MarshalAs(UnmanagedType.LPWStr)] string  name)

Delete a named object from the Engine.

Parameters
nameThe name of the object to be deleted.
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
void Apama.Engine.EngineManagement.DetachAsEventConsumerFrom ( EngineManagement  target,
string[]  channels,
EngineManagement.ConnectMode  mode 
)

Unsubscribe this Engine as an event receiver from another Engine

Parameters
targetHostname of the Engine to unsubscribe from.
channelsAn array of names representing the channels to subscribe to.
modewhich mode to connect using
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
true if successful
void Apama.Engine.EngineManagement.DetachAsEventConsumerFrom ( EngineManagement  target,
string[]  channels 
)

Unsubscribe this Engine as an event receiver from another Engine

Parameters
targetHostname of the Engine to unsubscribe from.
channelsAn array of names representing the channels to subscribe to.
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
true if successful
void Apama.Engine.EngineManagement.DetachAsEventConsumerFrom ( [MarshalAs(UnmanagedType.LPWStr)] string  host,
int  port,
string[]  channels,
EngineManagement.ConnectMode  mode 
)

Unsubscribe this Engine as an event receiver from another Engine

Parameters
hostHostname of the Engine to unsubscribe from.
portPort of the Engine to unsubscribe from.
channelsAn array of names representing the channels to subscribe to.
modewhich mode to connect using
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
true if successful
void Apama.Engine.EngineManagement.DetachAsEventConsumerFrom ( [MarshalAs(UnmanagedType.LPWStr)] string  host,
int  port,
string[]  channels 
)

Unsubscribe this Engine as an event receiver from another Engine

Parameters
hostHostname of the Engine to unsubscribe from.
portPort of the Engine to unsubscribe from.
channelsAn array of names representing the channels to subscribe to.
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
true if successful
virtual void Apama.Engine.EngineManagement.Disconnect ( )
virtual

Disconnect this client completely from the remote component.

Even if this method has been called, it is still necessary to Dispose() when this object is no longer needed, so in most cases there is no need to directly call Disconnect().

override void Apama.Engine.EngineManagement.Dispose ( )
virtual

Must be called to free unmanaged resources associated with this object.

Reimplemented from Apama.Event.EventConsumer.

override void Apama.Engine.EngineManagement.Dispose ( bool  disposing)
protectedvirtual

Virtual helper method to implement Dispose()

Reimplemented from Apama.Event.EventConsumer.

void Apama.Engine.EngineManagement.FlushEvents ( )

Flush events sent to the Engine using SendEvents(Event[]).

Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
void Apama.Engine.EngineManagement.ForceDeleteName ( [MarshalAs(UnmanagedType.LPWStr)] string  name)

Force deletion of a named object from the Engine.

Parameters
nameThe name of the object to be deleted.
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
EngineConnection [] Apama.Engine.EngineManagement.GetReceiverConnections ( )

Get all the persistent connections associated with the engine.

Returns
An array of EngineConnection objects
Exceptions
Apama.EngineExceptionThrown if any exceptions occur in the Client SDK.
Apama.Engine.EngineStatus Apama.Engine.EngineManagement.GetStatus ( )

Get the Engine's current operational status.

Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
Apama.Engine.EngineStatus instance containing the current operational status
virtual string [] Apama.Engine.EngineManagement.InjectCDP ( byte[]  cdpbytes,
String  filename 
)
virtual

Injects a CDP (Correlator Deployment package) into the engine.

Parameters
cdpbytesA byte array of containing the CDP file.
filenameThe file we are injecting.
Exceptions
Apama.EngineExceptionThis may contain warnings as well as an error message
virtual string [] Apama.Engine.EngineManagement.InjectCDP ( byte[]  cdpbytes)
virtual

Injects a CDP (Correlator Deployment package) into the engine.

Parameters
cdpbytesA byte array of containing the CDP file.
Exceptions
Apama.EngineExceptionThis may contain warnings as well as an error message
virtual string [] Apama.Engine.EngineManagement.InjectJava ( byte[]  jarbytes)
virtual

Injects a Java application (a jar) into the engine.

Parameters
jarbytesA byte array of containing the jar.
Exceptions
Apama.EngineExceptionThis may contain warnings as well as an error message
string [] Apama.Engine.EngineManagement.InjectMonitorScript ( MonitorScript  mon)

Inject MonitorScript text into the Engine.

Deprecated - Use InjectMonitorScript(string) instead.

Parameters
monA MonitorScript instance representing the script to be injected
Returns
A string array of warnings that occurred during inject
string [] Apama.Engine.EngineManagement.InjectMonitorScript ( string  monitorscript)

Inject MonitorScript text into the Engine.

Parameters
monitorscriptA MonitorScript string representing the script to be injected
Returns
A string array of warnings that occurred during inject
string [] Apama.Engine.EngineManagement.InjectMonitorScript ( string  script,
string  fileName 
)

Inject MonitorScript text into the Engine.

Parameters
scriptA MonitorScript string representing the script to be injected
fileNameIdentifies the filename that the MonitorScript came from, which is then included in diagnostic log messages.
Returns
A string array of warnings that occurred during inject
Apama.Engine.EngineInfo Apama.Engine.EngineManagement.InspectEngine ( )

Returns information about the monitors, event types, timers aggregates which exist in the engine.

Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
Returns
EngineInfo instance containing information about the engine.
bool Apama.Engine.EngineManagement.IsConnected ( )

This method is used to check that this object is still connected to the Engine. It will never reconnect.

Returns
true if successful
void Apama.Engine.EngineManagement.KillName ( [MarshalAs(UnmanagedType.LPWStr)] string  name)

Kill 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
nameThe name of the object to be killed.
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
void Apama.Engine.EngineManagement.Ping ( )

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 an EngineException is thrown. At present, ping() will not attempt to reconnect once the initial connection is lost.

Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
override void Apama.Engine.EngineManagement.SendEvents ( Event[]  events)
virtual

Send events into the Engine (inherited from EventConsumer), automatically rebatching the actual event sending for efficiency.

Parameters
eventsAn array of events to send
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.

Reimplemented from Apama.Event.EventConsumer.

void Apama.Engine.EngineManagement.SendEventsNoBatching ( Event[]  events)

Send events into the Engine without rebatching the actual event sending.

Parameters
eventsAn array of events to send
Exceptions
Apama.EngineExceptionIf an error occurs while performing this operation.
void Apama.Engine.EngineManagement.SetReceiverConnections ( params 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).

Parameters
connectionsAn array of Apama.Engine.EngineConnection. Must not contain null elements.
Exceptions
Apama.EngineExceptionIf 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.

override string Apama.Engine.EngineManagement.ToString ( )

Returns a string that represents the object.

Property Documentation

bool Apama.Engine.EngineManagement.ReconnectOnSend
getset

Determines whether the disconnected client should implicitly attempt to reconnect when sending events or injecting MonitorScript.

ulong Apama.Engine.EngineManagement.RemotePhysicalComponentID
get

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)

Submit a bug or feature
Copyright (c) 2013-2017 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.