Package net.sf.basedb.clients.jobagent
Class AgentController
java.lang.Object
net.sf.basedb.clients.jobagent.AgentController
This is the command line controller class for the job agent application. It is
responsible for starting up and managing a running job agent. The agent itself will
be started in separate thread.
- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2021-06-04 12:40:45 +0200 (Fri, 04 Jun 2021) $
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final Logger
Log job agent events.private final int
private final Properties
private final int
-
Constructor Summary
ConstructorDescriptionCreate a new controller for controlling the job agent specified by the given properties. -
Method Summary
Modifier and TypeMethodDescriptionprivate Agent
getInfo()
Get info about running job agent by sending an info request to the agents remote control service.Get status info about running job agent by sending an info request to the agents r emote control service.static void
void
Pause a running job agent by sending a stop request to the agents remote control service.private static void
private static void
void
void
Start the agent this controller is controlling.void
Stop a running job agent by sending a stop request to the agents remote control service.void
-
Field Details
-
log
Log job agent events. -
properties
-
port
private final int port -
timeout
private final int timeout
-
-
Constructor Details
-
AgentController
Create a new controller for controlling the job agent specified by the given properties.- Parameters:
p
- The properties for the job agent to control
-
-
Method Details
-
main
-
printUsage
private static void printUsage() -
printHelp
private static void printHelp() -
startAgent
Start the agent this controller is controlling. If no agent is running a new one is created in another thread in this virtual machine. The thread must be stopped before the virtual machine exits.- Throws:
IOException
- If there is an error- See Also:
-
stopAgent
Stop a running job agent by sending a stop request to the agents remote control service. The agent may be running in this or in another virtual machine.- Throws:
IOException
- If there is an error- See Also:
-
pauseAgent
Pause a running job agent by sending a stop request to the agents remote control service. The agent may be running in this or in another virtual machine.- Throws:
IOException
- If there is an error- See Also:
-
getInfo
Get info about running job agent by sending an info request to the agents remote control service. The agent may be running in this or in another virtual machine.- Returns:
- A
JobAgentInfo
object - Throws:
IOException
- If there is an error- See Also:
-
getStatus
Get status info about running job agent by sending an info request to the agents r emote control service. The agent may be running in this or in another virtual machine.- Returns:
- A
JobAgentInfo
object - Throws:
IOException
- If there is an error- Since:
- 2.5
- See Also:
-
registerAgent
public void registerAgent() -
unregisterAgent
public void unregisterAgent() -
createAgent
-