Interface IAgent
-
- All Known Implementing Classes:
CrawlerAgent
public interface IAgent
This interface describes the external functionality of an agent class. Agents are all poked at start-up time; they run independently until the JVM is shut down. All agent classes are expected to support the following constructor: xxx() throws ManifoldCFException Agent classes are furthermore expected to be cross-thread, but not necessarily thread-safe in that a given IAgent instance is meant to be used by only one thread at a time. It is furthermore safe to keep stateful data in the IAgent instance object pertaining to the running state of the system. That is, an instance of IAgent used to start the agent will be the same one stopAgent() is called with.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
_rcsid
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cleanUp(IThreadContext threadContext)
Tear down agent environment.void
cleanUpAgentData(IThreadContext threadContext, java.lang.String currentProcessID, java.lang.String cleanupProcessID)
Cleanup after agents process.void
cleanUpAllAgentData(IThreadContext threadContext, java.lang.String currentProcessID)
Cleanup after ALL agents processes.void
clusterInit(IThreadContext threadContext)
Called ONLY when no other active services of this kind are running.void
deinstall(IThreadContext threadContext)
Uninstall agent.void
initialize(IThreadContext threadContext)
Initialize agent environment.void
install(IThreadContext threadContext)
Install agent.boolean
isOutputConnectionInUse(IThreadContext threadContext, java.lang.String connName)
Request permission from agent to delete an output connection.boolean
isTransformationConnectionInUse(IThreadContext threadContext, java.lang.String connName)
Request permission from agent to delete a transformation connection.void
noteOutputConnectionChange(IThreadContext threadContext, java.lang.String connectionName)
Note a change in configuration for an output connection.void
noteOutputConnectorDeregistration(IThreadContext threadContext, java.lang.String[] connectionNames)
Note the deregistration of a set of output connections.void
noteOutputConnectorRegistration(IThreadContext threadContext, java.lang.String[] connectionNames)
Note the registration of a set of output connections.void
noteTransformationConnectionChange(IThreadContext threadContext, java.lang.String connectionName)
Note a change in configuration for a transformation connection.void
noteTransformationConnectorDeregistration(IThreadContext threadContext, java.lang.String[] connectionNames)
Note the deregistration of a set of transformation connections.void
noteTransformationConnectorRegistration(IThreadContext threadContext, java.lang.String[] connectionNames)
Note the registration of a set of transformation connections.void
startAgent(IThreadContext threadContext, java.lang.String processID)
Start the agent.void
stopAgent(IThreadContext threadContext)
Stop the agent.
-
-
-
Field Detail
-
_rcsid
static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
void initialize(IThreadContext threadContext) throws ManifoldCFException
Initialize agent environment. This is called before any of the other operations are called, and is meant to insure that the environment is properly initialized.- Throws:
ManifoldCFException
-
cleanUp
void cleanUp(IThreadContext threadContext) throws ManifoldCFException
Tear down agent environment. This is called after all the other operations are completed, and is meant to allow environment resources to be freed.- Throws:
ManifoldCFException
-
install
void install(IThreadContext threadContext) throws ManifoldCFException
Install agent. This usually installs the agent's database tables etc.- Throws:
ManifoldCFException
-
deinstall
void deinstall(IThreadContext threadContext) throws ManifoldCFException
Uninstall agent. This must clean up everything the agent is responsible for.- Throws:
ManifoldCFException
-
clusterInit
void clusterInit(IThreadContext threadContext) throws ManifoldCFException
Called ONLY when no other active services of this kind are running. Meant to be used after the cluster has been down for an indeterminate period of time.- Throws:
ManifoldCFException
-
cleanUpAllAgentData
void cleanUpAllAgentData(IThreadContext threadContext, java.lang.String currentProcessID) throws ManifoldCFException
Cleanup after ALL agents processes. Call this method to clean up dangling persistent state when a cluster is just starting to come up. This method CANNOT be called when there are any active agents processes at all.- Parameters:
currentProcessID
- is the current process ID.- Throws:
ManifoldCFException
-
cleanUpAgentData
void cleanUpAgentData(IThreadContext threadContext, java.lang.String currentProcessID, java.lang.String cleanupProcessID) throws ManifoldCFException
Cleanup after agents process. Call this method to clean up dangling persistent state after agent has been stopped. This method CANNOT be called when the agent is active, but it can be called at any time and by any process in order to guarantee that a terminated agent does not block other agents from completing their tasks.- Parameters:
currentProcessID
- is the current process ID.cleanupProcessID
- is the process ID of the agent to clean up after.- Throws:
ManifoldCFException
-
startAgent
void startAgent(IThreadContext threadContext, java.lang.String processID) throws ManifoldCFException
Start the agent. This method should spin up the agent threads, and then return.- Parameters:
processID
- is the process ID to start up an agent for.- Throws:
ManifoldCFException
-
stopAgent
void stopAgent(IThreadContext threadContext) throws ManifoldCFException
Stop the agent. This should shut down the agent threads.- Throws:
ManifoldCFException
-
isOutputConnectionInUse
boolean isOutputConnectionInUse(IThreadContext threadContext, java.lang.String connName) throws ManifoldCFException
Request permission from agent to delete an output connection.- Parameters:
connName
- is the name of the output connection.- Returns:
- true if the connection is in use, false otherwise.
- Throws:
ManifoldCFException
-
noteOutputConnectorDeregistration
void noteOutputConnectorDeregistration(IThreadContext threadContext, java.lang.String[] connectionNames) throws ManifoldCFException
Note the deregistration of a set of output connections.- Parameters:
connectionNames
- are the names of the connections being deregistered.- Throws:
ManifoldCFException
-
noteOutputConnectorRegistration
void noteOutputConnectorRegistration(IThreadContext threadContext, java.lang.String[] connectionNames) throws ManifoldCFException
Note the registration of a set of output connections.- Parameters:
connectionNames
- are the names of the connections being registered.- Throws:
ManifoldCFException
-
noteOutputConnectionChange
void noteOutputConnectionChange(IThreadContext threadContext, java.lang.String connectionName) throws ManifoldCFException
Note a change in configuration for an output connection.- Parameters:
connectionName
- is the name of the connection being changed.- Throws:
ManifoldCFException
-
isTransformationConnectionInUse
boolean isTransformationConnectionInUse(IThreadContext threadContext, java.lang.String connName) throws ManifoldCFException
Request permission from agent to delete a transformation connection.- Parameters:
connName
- is the name of the transformation connection.- Returns:
- true if the connection is in use, false otherwise.
- Throws:
ManifoldCFException
-
noteTransformationConnectorDeregistration
void noteTransformationConnectorDeregistration(IThreadContext threadContext, java.lang.String[] connectionNames) throws ManifoldCFException
Note the deregistration of a set of transformation connections.- Parameters:
connectionNames
- are the names of the connections being deregistered.- Throws:
ManifoldCFException
-
noteTransformationConnectorRegistration
void noteTransformationConnectorRegistration(IThreadContext threadContext, java.lang.String[] connectionNames) throws ManifoldCFException
Note the registration of a set of transformation connections.- Parameters:
connectionNames
- are the names of the connections being registered.- Throws:
ManifoldCFException
-
noteTransformationConnectionChange
void noteTransformationConnectionChange(IThreadContext threadContext, java.lang.String connectionName) throws ManifoldCFException
Note a change in configuration for a transformation connection.- Parameters:
connectionName
- is the name of the connection being changed.- Throws:
ManifoldCFException
-
-