|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.connector.Connector
com.ibm.di.connector.RACConnector
public class RACConnector
The RAC Connector collaborates with the Agent Controller and Generic Log Adapter technologies to: - supply a TDI Assembly Line with log data from the log of a remote software system (in Iterator mode) - allow a TDI Assembly Line to publish data to remote clients (in AddOnly mode) (Agent Controller is the new name of the Remote Agent Controller (RAC))
When operating in AddOnly mode, the Connector registers a Logging Agent with the local Agent Controller. All Common Base Event objects, received from the Assembly Line, are serialized as XML and written to the Logging Agent. The Logging Agent stays operational as long as the process of the TDI server is alive. During its lifetime it can be monitored by clients even if the Connector which registered it has already closed. When the TDI server stops (or crashes), however, the Agent Controller (RAC) terminates the TDI Logging Agent's registration. The Connector could wait a specified amount of time for a monitoring client to arrive before starting to write data to the Logging Agent. Particularly, it can wait forever. When a client starts monitoring the agent, the agent starts transferring data to the Agent Controller. The Agent Controller then sends the data to the client. Waiting happens before each write attempt (the 'putEntry' method of the Connector). If the waiting time expires and there is still no monitoring client, the Connector throws an Exception. Internally the Connector uses the TPTP Logging Agent implementation - org.eclipse.hyades.logging.core.LoggingAgent.
In Iterator mode the RAC Connector acts as a client of a remote Agent Controller. It connects to the Agent Controller to obtain a handle to the Logging Agent, whose name is specified in the Connector's configuration. After that the Connector starts monitoring the Logging Agent. During the monitoring, the Connector receives data, produced by the Logging Agent. If there is no active agent with the specified name, when the Connector contacts the Agent Controller, the Connector waits until such agent is registered. If at some point the agent gets unregistered (while the Connector is listening for events), the Connector will wait for another agent with the same name to appear. Essentially the Connector never stops unless its connection to the Agent Controller fails. The implementation of the Connector relies on the Java client library, which is part of the Agent Controller technology.
Field Summary | |
---|---|
static String |
PARAM_AGENT_CONTROLLER_HOST
Host of the remote Agent Controller. |
static String |
PARAM_AGENT_CONTROLLER_PORT
Port of the remote Agent Controller. |
static String |
PARAM_CONNECTION_TIMEOUT
Timeout (in seconds) for the connection to the Agent Controller. |
static String |
PARAM_LOGGING_AGENT_NAME
The name of the Logging Agent within the local Agent Controller. |
static String |
PARAM_RECEIVING_QUEUE_SIZE
The size of the queue, where the received events are buffered before the Connector manages to read them. |
static String |
PARAM_REMOTE_LOGGING_AGENT_NAME
The name of the remote Logging Agent to be monitored. |
static String |
PARAM_WAIT_FOR_DEAD_AGENT_DATA_TIMEOUT
Timeout (in seconds) for each data reception after the remote agent dies. |
static String |
PARAM_WAIT_TO_BE_MONITORED
Time to wait (in seconds) for the agent to be monitored. |
Fields inherited from class com.ibm.di.connector.Connector |
---|
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER |
Constructor Summary | |
---|---|
RACConnector()
Constructor for the RAC Connector object |
Method Summary | |
---|---|
org.eclipse.hyades.logging.events.cbe.CommonBaseEvent |
getCurrentCbeObject()
Returns the Common Base Event object, obtained by the Connector on the current Assembly Line iteration (the last event, processed by the 'getNextEntry' method of the Connector). |
Entry |
getNextEntry()
Retrieves the next CommonBaseEvent produced by the remote Logging Agent. |
String |
getVersion()
Version information. |
void |
initialize(Object aObj)
Reads and validates the Connector's configuration parameters. |
boolean |
isLogging()
This method determines whether the Logging Agent, which the Connector uses, is currently being monitored by a client. |
void |
putEntry(Entry aEntry)
Creates a CommonBaseEvent object using the attributes of the given Entry. |
void |
terminate()
Terminate the Connector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.di.connector.ConnectorInterface |
---|
deleteEntry, findEntry, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, modEntry, pushback, queryOperations, queryReply, querySchema, reconnect, registerScriptBeans, replyEntry, selectEntries, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer |
Field Detail |
---|
public static final String PARAM_REMOTE_LOGGING_AGENT_NAME
public static final String PARAM_AGENT_CONTROLLER_HOST
public static final String PARAM_AGENT_CONTROLLER_PORT
public static final String PARAM_RECEIVING_QUEUE_SIZE
public static final String PARAM_WAIT_FOR_DEAD_AGENT_DATA_TIMEOUT
public static final String PARAM_CONNECTION_TIMEOUT
public static final String PARAM_LOGGING_AGENT_NAME
public static final String PARAM_WAIT_TO_BE_MONITORED
Constructor Detail |
---|
public RACConnector()
Method Detail |
---|
public void initialize(Object aObj) throws Exception
Reads and validates the Connector's configuration parameters.
In Iterator mode establishes a connection to the remote Agent Controller.
In AddOnly mode registers a Logging Agent within the local Agent Controller. If a Logging Agent with the specified name is already registered, it is reused.
initialize
in interface ConnectorInterface
initialize
in class Connector
aObj
- -
ignored.
Exception
- if some of the configuration parameters has invalid value
in Iterator mode, if a problem occurs while connecting to
the remote Agent Controllerpublic Entry getNextEntry() throws Exception
getNextEntry
in interface ConnectorInterface
getNextEntry
in class Connector
Exception
- if some error occurred during the interaction with the
remote Agent ControllerConnectorInterface.selectEntries()
public void putEntry(Entry aEntry) throws Exception
Creates a CommonBaseEvent object using the attributes of the given Entry. After that serializes the Common Base Event object as a XML fragment and publishes the XML fragment through the Logging Agent.
Before doing anything, however, the method will wait a client to monitor the Logging Agent. (If there is already a monitoring client, the method will not wait.) If the Connector is configured to wait for a finite time and that time expires, an exception will be thrown.
putEntry
in interface ConnectorInterface
putEntry
in class Connector
aEntry
- the CBE object (as entry) to publish.
Exception
- if there is no monitoring client within the configured
waiting time if the specified Entry cannot be converted
into a CommonBaseEventpublic void terminate()
In Iterator mode stops monitoring and detaches from the remote agent, so that other clients can monitor it.
In AddOnly mode does nothing - does not deregister the Logging Agent. This way the agent can be reused by other Connectors inside the same TDI server instance. All agents will get automatically unregistered by the Agent Controller when the TDI server process exits (the JVM shuts down).
terminate
in interface ConnectorInterface
terminate
in class Connector
public boolean isLogging()
public org.eclipse.hyades.logging.events.cbe.CommonBaseEvent getCurrentCbeObject()
public String getVersion()
getVersion
in interface VersionInfoInterface
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |