Interface EngineClientInterface
-
- All Superinterfaces:
java.lang.AutoCloseable
,BaseClientInterface
,ConnectOperationsInterface
,DeleteOperationsInterface
,InjectOperationsInterface
,InspectOperationsInterface
,PingClientInterface
,PingOperationsInterface
,ReceiveConsumerOperationsInterface
,SendOperationsInterface
,WatchOperationsInterface
- All Known Implementing Classes:
EngineClientBean
public interface EngineClientInterface extends PingClientInterface, DeleteOperationsInterface, InjectOperationsInterface, InspectOperationsInterface, SendOperationsInterface, WatchOperationsInterface, ReceiveConsumerOperationsInterface, ConnectOperationsInterface
EngineClientInterface is an interface that specifies ALL of the standard operations to enable an engine client to communicate with a remote correlator. UseEngineClientFactory
to construct an instance of this interface.
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_MONITOR_ONLY
The default value for the monitorOnly property.static boolean
DEFAULT_RECEIVE_ONLY
The default value for the receiveOnly property.static java.lang.String
PROPERTY_MONITOR_ONLY
The string name of the bound property that is used for "monitorOnly" updates.static java.lang.String
PROPERTY_RECEIVE_ONLY
The string name of the bound property that is used for "receiveOnly" updates.-
Fields inherited from interface com.apama.net.beans.interfaces.BaseClientInterface
COPYRIGHT, DEFAULT_CONNECTION_POLLING_INTERVAL, DEFAULT_HOST, DEFAULT_PORT, DEFAULT_PROCESS_NAME, PRODUCTNAME, PROPERTY_BEAN_CONNECTED, PROPERTY_CONNECTION_POLLING_INTERVAL, PROPERTY_HOST, PROPERTY_PORT, PROPERTY_PROCESS_NAME, PROPERTY_VERBOSE, VERSION
-
Fields inherited from interface com.apama.engine.beans.interfaces.InspectOperationsInterface
DEFAULT_INSPECT_POLLING_INTERVAL, PROPERTY_ENGINE_INFO, PROPERTY_INSPECT_POLLING_INTERVAL
-
Fields inherited from interface com.apama.engine.beans.interfaces.ReceiveConsumerOperationsInterface
PROPERTY_ALL_CONSUMERS_CONNECTED
-
Fields inherited from interface com.apama.engine.beans.interfaces.WatchOperationsInterface
DEFAULT_STATUS_POLLING_INTERVAL, PROPERTY_STATUS, PROPERTY_STATUS_POLLING_INTERVAL
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener.void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Add a property change listener for a specific named property.void
addPropertyChangeListenerSync(java.beans.PropertyChangeListener listener)
Deprecated.Use addPropertyChangeListener insteadvoid
addPropertyChangeListenerSync(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Deprecated.Use addPropertyChangeListener insteadvoid
connectInBackground()
Requests that the client begins to establish a connection in the background.void
connectNow()
Manually request that the bean connects to the remote server.void
disconnect()
Disconnect from a server.void
flushListeners()
Utility method that blocks until all pending property change listeners that have already fired have finished executing.void
pingServer()
Manually test if the remote server process is alive and responding to client requests.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener.void
removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Remove a property change listener for a specific named property.void
removePropertyChangeListenerSync(java.beans.PropertyChangeListener listener)
Deprecated.void
removePropertyChangeListenerSync(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Deprecated.void
setHost(java.lang.String newHostValue)
Setter for the host property.void
setPort(int newPortValue)
Setter for the port property.void
setProcessName(java.lang.String newProcessName)
Setter for the process name property.void
setReconnectPeriod(long reconnectPeriodMillis)
Set the minimum period between attempts to reconnect the bean and/or any of the bean's named consumers that have been disconnected (e.g.void
setReconnectPolicy(ReconnectPolicyInterface p)
Set a singleton reconnection policy that will be used to limit when reconnection can be attempted for the bean, and/or any of the bean's named consumers that have been disconnected (e.g.-
Methods inherited from interface com.apama.net.beans.interfaces.BaseClientInterface
close, dispose, getBeanConnected, getConnectionPollingInterval, getHost, getPort, getProcessName, isBeanConnected, setConnectionPollingInterval
-
Methods inherited from interface com.apama.engine.beans.interfaces.ConnectOperationsInterface
attachAsConsumerOfEngine, attachAsConsumerOfEngine, attachAsConsumerOfEngine, attachAsConsumerOfEngine, detachAsConsumerOfEngine, detachAsConsumerOfEngine, detachAsConsumerOfEngine, detachAsConsumerOfEngine, getReceiverConnections, setPersistentReceiveConnections, setReceiverConnections
-
Methods inherited from interface com.apama.engine.beans.interfaces.DeleteOperationsInterface
deleteAll, deleteName, deleteNames, deleteNamesFromFile, deleteNamesFromFile, killName, killNames, killNamesFromFile, killNamesFromFile, setCancelDeleteFileRead
-
Methods inherited from interface com.apama.engine.beans.interfaces.InjectOperationsInterface
injectCDP, injectCDPsFromFile, injectJavaApplication, injectJavaApplicationsFromFile, injectMonitorScript, injectMonitorScript, injectMonitorScriptFromFile, injectMonitorScriptFromFile, injectMonitorScriptFromFile, setCancelInjectFileRead
-
Methods inherited from interface com.apama.engine.beans.interfaces.InspectOperationsInterface
getEngineInfo, getInspectPollingInterval, getRemoteEngineInfo, setInspectPollingInterval, startInspectPollingThread, stopInspectPollingThread
-
Methods inherited from interface com.apama.engine.beans.interfaces.ReceiveConsumerOperationsInterface
addAsyncConsumer, addConsumer, addConsumer, addConsumer, getAllConsumers, getConsumer, isAllConsumersConnected, isDisconnectIfSlowReceiver, removeAllConsumers, removeConsumer
-
Methods inherited from interface com.apama.engine.beans.interfaces.SendOperationsInterface
flushEvents, sendEvents, sendEvents, sendEventsFromFile, sendEventsFromFile, sendEventsFromFile, sendEventsFromFile, setCancelSendFileRead
-
Methods inherited from interface com.apama.engine.beans.interfaces.WatchOperationsInterface
getRemoteStatus, getStatus, getStatusPollingInterval, setStatusPollingInterval, startStatusPollingThread, stopStatusPollingThread
-
-
-
-
Field Detail
-
PROPERTY_MONITOR_ONLY
static final java.lang.String PROPERTY_MONITOR_ONLY
The string name of the bound property that is used for "monitorOnly" updates.- See Also:
- Constant Field Values
-
PROPERTY_RECEIVE_ONLY
static final java.lang.String PROPERTY_RECEIVE_ONLY
The string name of the bound property that is used for "receiveOnly" updates.- See Also:
- Constant Field Values
-
DEFAULT_MONITOR_ONLY
static final boolean DEFAULT_MONITOR_ONLY
The default value for the monitorOnly property.- See Also:
- Constant Field Values
-
DEFAULT_RECEIVE_ONLY
static final boolean DEFAULT_RECEIVE_ONLY
The default value for the receiveOnly property.- See Also:
- Constant Field Values
-
-
Method Detail
-
connectInBackground
void connectInBackground()
Requests that the client begins to establish a connection in the background.Calling
disconnect()
will bring connection attempts to an end. Repeated calls to this method, or calling this method after a connection has already been established will have no effect.
-
setReconnectPolicy
void setReconnectPolicy(ReconnectPolicyInterface p)
Set a singleton reconnection policy that will be used to limit when reconnection can be attempted for the bean, and/or any of the bean's named consumers that have been disconnected (e.g. as a slow consumer).In most cases, we recommend using
setReconnectPeriod(long)
instead of writing a custom policy object.- See Also:
ReconnectPolicyInterface
-
setReconnectPeriod
void setReconnectPeriod(long reconnectPeriodMillis)
Set the minimum period between attempts to reconnect the bean and/or any of the bean's named consumers that have been disconnected (e.g. as a slow consumer).By default there is no minimum reconnection period defined, and if any consumers have been disconnected by the engine, the bean will attempt to reconnect them at least as often as the bean's connection polling interval.
Any previously set reconnect policy will be overwritten when this method is called.
- Parameters:
reconnectPeriodMillis
- The minimum reconnection period in milliseconds, or 0 to place no limit on how often we can attempt to reconnect.- See Also:
setReconnectPolicy(ReconnectPolicyInterface)
-
removePropertyChangeListener
void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener.- Specified by:
removePropertyChangeListener
in interfaceBaseClientInterface
- Parameters:
listener
- the listener to be removed.
-
removePropertyChangeListener
void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Remove a property change listener for a specific named property.- Specified by:
removePropertyChangeListener
in interfaceBaseClientInterface
- Parameters:
propertyName
- the name of the property that was listened on.listener
- the listener to be removed.
-
addPropertyChangeListener
void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener. Use this method to be informed whenever a property value is changed. Since Apama 5.2, listeners registered with this method will be called back asynchronously on a dedicated thread, which means it is permissible to call any engine client method from the listener - though be aware that the property value could have changed since the property change notification was fired, so may be different to the specified 'new value'. Applications that need the previous synchronous notification behaviour can use addPropertyChangeListenerSync to help with migration.- Specified by:
addPropertyChangeListener
in interfaceBaseClientInterface
- Parameters:
listener
- the listener to be added.
-
addPropertyChangeListener
void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Add a property change listener for a specific named property. Since Apama 5.2, listeners registered with this method will be called back asynchronously on a dedicated thread, which means it is permissible to call any engine client method from the listener - though be aware that the property value could have changed since the property change notification was fired, so may be different to the specified 'new value'. Applications that need the previous synchronous notification behaviour can use addPropertyChangeListenerSync to help with migration.- Specified by:
addPropertyChangeListener
in interfaceBaseClientInterface
- Parameters:
propertyName
- the name of the property to listen on.listener
- the listener to be added.
-
flushListeners
void flushListeners()
Utility method that blocks until all pending property change listeners that have already fired have finished executing. Mostly useful for testing.
-
addPropertyChangeListenerSync
@Deprecated void addPropertyChangeListenerSync(java.beans.PropertyChangeListener listener)
Deprecated.Use addPropertyChangeListener insteadAdd a property change listener (with synchronous notifications). This method is deprecated and applications should use addPropertyChangeListener instead wherever possible, however this method is provided to simplify migration from pre-5.2 Apama releases which provided synchronous listener behaviour by default. To avoid the possibility of deadlock, it is essential that listeners registered using this method do not attempt to make calls back into the engine client (or any other service that uses it).- Parameters:
listener
- the listener to be added.
-
addPropertyChangeListenerSync
@Deprecated void addPropertyChangeListenerSync(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Deprecated.Use addPropertyChangeListener insteadAdd a property change listener for a specific named property. This method is deprecated and applications should use addPropertyChangeListener instead wherever possible, however this method is provided to simplify migration from pre-5.2 Apama releases which provided synchronous listener behaviour by default. To avoid the possibility of deadlock, it is essential that listeners registered using this method do not attempt to make calls back into the engine client (or any other service that uses it).- Parameters:
propertyName
- the name of the property to listen on.listener
- the listener to be added.
-
removePropertyChangeListenerSync
@Deprecated void removePropertyChangeListenerSync(java.beans.PropertyChangeListener listener)
Deprecated.Remove a property change listener registered with addPropertyChangeListenerSync.- Parameters:
listener
- the listener to be removed.
-
removePropertyChangeListenerSync
@Deprecated void removePropertyChangeListenerSync(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Deprecated.Remove a property change listener for a specific named property registered with addPropertyChangeListenerSync.- Parameters:
propertyName
- the name of the property that was listened on.listener
- the listener to be removed.
-
setHost
void setHost(java.lang.String newHostValue) throws EngineException
Setter for the host property. This is the name of the host on which the server to be monitored is running. Changing this property will cause any existing connection to be lost. If there was an existing connection, then a new connection will be created.- Specified by:
setHost
in interfaceBaseClientInterface
- Parameters:
newHostValue
- The new value for the Host property.- Throws:
EngineException
- Thrown if any exceptions occur in the Client SDK.
-
setPort
void setPort(int newPortValue) throws EngineException
Setter for the port property. This is the port number on which the server to be monitored is listening. Changing this property will cause any existing connection to be lost. If there was an existing connection, then a new connection will be created.- Specified by:
setPort
in interfaceBaseClientInterface
- Parameters:
newPortValue
- The new value for the Port property.- Throws:
EngineException
- Thrown if any exceptions occur in the Client SDK.
-
setProcessName
void setProcessName(java.lang.String newProcessName) throws EngineException
Setter for the process name property. This is the process name the client will use. Changing this property will cause any existing connection to be lost. If there was an existing connection, then a new connection will be created.- Specified by:
setProcessName
in interfaceBaseClientInterface
- Parameters:
newProcessName
- The new value for the Process Name- Throws:
EngineException
- Thrown if any exceptions occur in the Client SDK.
-
connectNow
void connectNow() throws EngineException
Manually request that the bean connects to the remote server. Repeated calls are permitted, and attempting to connect a bean that is already connected is identical to callingpingServer()
from the PingOperationsInterface.- Specified by:
connectNow
in interfaceBaseClientInterface
- Throws:
EngineException
- Thrown if any exceptions occur in the Client SDK.
-
disconnect
void disconnect() throws EngineException
Disconnect from a server. Removes the reference to the underlying RPC object, and unhooks the ShutdownHook.The beanConnected property is set to false, and the connection polling thread is terminated.
- Specified by:
disconnect
in interfaceBaseClientInterface
- Throws:
EngineException
- When there was a problem during the disconnection.
-
pingServer
void pingServer() throws EngineException
Manually test if the remote server process is alive and responding to client requests. This method makes a no-arg, void return, method call on the client interface of the server. If a connection is not yet established, this method will request a connection. In the event that a connection cannot be established, or an error during the ping, an EngineException will be raised.- Specified by:
pingServer
in interfacePingOperationsInterface
- Throws:
EngineException
- when the ping fails.
-
-