flux.agent
Interface AgentAdministrator


public interface AgentAdministrator

Monitors and controls agents.

Author:
Copyright 2014 Flux Corporation. All rights reserved.

Method Summary
 void dispose(java.lang.String id)
          Unregisters this agent and then shuts it down.
 AgentInfo get(java.lang.String id)
          Returns information about the specified Flux agent, which is assumed to be already registered with a Flux engine in this cluster.
 java.util.SortedSet<AgentInfo> getAll()
          Returns information about all Flux agents that are registered with any Flux engine in this cluster.
 void interrupt(java.lang.String id)
          Interrupts the currently executing process on the specified agent.
 void restart(AgentConfiguration configuration)
          Provides a way to reconfigure an agent without creating a new agent object.
 void start(java.lang.String id)
          Starts the specified agent.
 void stop(java.lang.String id)
          Stops the specified agent.
 

Method Detail

dispose

void dispose(java.lang.String id)
             throws EngineException
Unregisters this agent and then shuts it down.

Parameters:
id - Unique identifier for an agent.
Throws:
EngineException - If the agent is not recognized, if the agent cannot be contacted, or if a system error occurs.
EngineCommunicationException - If a networking error occurs.

get

AgentInfo get(java.lang.String id)
              throws EngineException
Returns information about the specified Flux agent, which is assumed to be already registered with a Flux engine in this cluster.

Parameters:
id - Unique identifier for an agent.
Returns:
Registration information for a Flux agent.
Throws:
EngineException - If the agent is not recognized or if a system error occurs.
EngineCommunicationException - If a networking error occurs.

getAll

java.util.SortedSet<AgentInfo> getAll()
                                      throws EngineException
Returns information about all Flux agents that are registered with any Flux engine in this cluster.

Returns:
Returns information about all Flux agents that are registered with any Flux engine in this cluster. The returned AgentInfo objects are sorted first by host name, then by port number.
Throws:
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.

interrupt

void interrupt(java.lang.String id)
               throws EngineException
Interrupts the currently executing process on the specified agent. The running process will be destroyed only if it is running synchronously and its destroy on interrupt flag is enabled.

Parameters:
id - Unique identifier for an agent.
Throws:
EngineException - If the agent is not recognized, if the agent cannot be contacted, or if a system error occurs.
EngineCommunicationException - If a networking error occurs.
See Also:
Agent.interrupt()

restart

void restart(AgentConfiguration configuration)
             throws EngineException
Provides a way to reconfigure an agent without creating a new agent object. Disposes this agent and reinstantiates it using the supplied agent configuration.

If this agent was created originally with Agent(String configurationFile), after a successful restart, the configuration file specified there will be overwritten with the new configuration supplied here. The purpose is that when the agent is restarted from a command line script, it will use the agent configuration data from the new configuration supplied here.

If an exception is thrown, this agent will become inactive until reset() is called successfully on it.

Parameters:
configuration - Properties that control how this agent communicates with an engine and how it otherwise behaves.
Throws:
EngineException - If the agent configuration is invalid.
EngineCommunicationException - If a networking error occurs.
See Also:
Agent.restart(AgentConfiguration)

start

void start(java.lang.String id)
           throws EngineException
Starts the specified agent. A started agent can accept requests from Flux engines to run processes.

Parameters:
id - Unique identifier for an agent.
Throws:
EngineException - If the agent is not recognized, if the agent cannot be contacted, or if a system error occurs.
EngineCommunicationException - If a networking error occurs.
See Also:
Agent.start()

stop

void stop(java.lang.String id)
          throws EngineException
Stops the specified agent. A stopped agent does not accept any new requests to run processes. If a process is currently executing, this method blocks until that process finishes.

Parameters:
id - Unique identifier for an agent.
Throws:
EngineException - If the agent is not recognized, if the agent cannot be contacted, or if a system error occurs.
EngineCommunicationException - If a networking error occurs.
See Also:
Agent.stop()


© 2014 Flux Corporation. All rights reserved.