ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.platform
Interface AgentLifeCycleService

All Superinterfaces:
AblePlatformService, AblePlatformServiceEventGenerator, javax.agent.service.Service
All Known Implementing Classes:
RmiAgentLifeCycleServiceProxy

public interface AgentLifeCycleService
extends javax.agent.service.Service, AblePlatformService

The AgentLifeCycleService interface defines the operations that can be requested of an Agent Lifecycle Service.

An Agent Lifecycle Service can be used to


Field Summary
static java.lang.String SERVICE_TYPE
          The well-known service type, set to "agent-life-cycle-service".
 
Method Summary
 AblePlatformAgent createAgentInstance(AbleAgentClassDescription theAgentClassDescription, java.lang.String theAgentPoolAlias, AbleSecureKey theSecureKey)
          Creates an instance of an agent in a specified agent pool.
 AblePlatformAgent createAgentInstanceAndInitialize(AbleAgentClassDescription theAgentClassDescription, java.lang.String theAgentPoolAlias, AbleSecureKey theSecureKey)
          Creates an instance of an agent in a specified agent pool and initializes the agent using parameters found in the specified AbleAgentClassDescription.
 AblePlatformAgent createAgentInstanceAndInitialize(AbleAgentClassDescription theAgentClassDescription, java.lang.String theAgentPoolAlias, java.lang.Object theInitArg, AbleSecureKey theSecureKey)
          Creates an instance of an agent in a specified agent pool and initializes the agent using the specified parameters.
 java.util.Vector getCreatedAgents(AbleSecureKey theSecureKey)
          Gets a collection of all AblePlatformAgent objects created by this particular Agent Lifecycle Service.
 AbleAgentClassDescription[] getPermittedAgents()
          Gets a collection of agents that are permitted to run on this platform.
 void initializeAgent(AblePlatformAgent theAblePlatformAgent, AbleSecureKey theSecureKey)
          Initializes a previously created agent.
 void initializeAgent(AblePlatformAgent theAblePlatformAgent, java.lang.Object theInitArg, AbleSecureKey theSecureKey)
          Initializes a previously created agent instance using the specified initialization argument.
 void quiesceAgentPool(java.lang.String theAgentPoolAlias, AbleSecureKey theSecureKey)
          Quiesces the specified agent pool by sending a quitAgent to each agent known to be running in the pool.
 void quitAgent(javax.agent.service.directory.AgentDescription theAgentDescription, AbleSecureKey theSecureKey)
          Requests the agent represented by the specified AgentDescription to quit itself along with any threads the agent owns and any other beans and agents the agent may contain.
 void quitAgents(javax.agent.service.directory.AgentDescription[] theAgentDescriptionList, AbleSecureKey theSecureKey)
          Requests each agent represented in the specified AgentDescription list to quit itself along with any threads the agent owns and any other beans and agents the agent may contain.
 void resetAgent(javax.agent.service.directory.AgentDescription theAgentDescription, AbleSecureKey theSecureKey)
          Requests the agent represented by the specified AgentDescription to reset itself along with any threads the agent owns and any other beans and agents the agent may contain; however, the agent itself may decide whether to reset any internal agents and beans it may contain.
 void resetAgents(javax.agent.service.directory.AgentDescription[] theAgentDescriptionList, AbleSecureKey theSecureKey)
          Requests each agent represented in the specified AgentDescription list to reset itself along with any threads the agent owns and any other beans and agents the agent may contain.
 void resumeAgent(javax.agent.service.directory.AgentDescription theAgentDescription, AbleSecureKey theSecureKey)
          Requests the agent represented by the specified AgentDescription to resume itself along with any threads the agent owns and any other beans and agents the agent may contain; however, the agent itself may decide whether to resume any internal agents and beans it may contain.
 void resumeAgents(javax.agent.service.directory.AgentDescription[] theAgentDescriptionList, AbleSecureKey theSecureKey)
          Requests each agent represented in the specified AgentDescription list to resume itself along with any threads the agent owns and any other beans and agents the agent may contain.
 void suspendAgent(javax.agent.service.directory.AgentDescription theAgentDescription, AbleSecureKey theSecureKey)
          Requests the agent represented by the specified AgentDescription to suspend itself along with any threads the agent owns and any other beans and agents the agent may contain; however, the agent itself may decide whether to suspend any internal agents and beans it may contain.
 void suspendAgents(javax.agent.service.directory.AgentDescription[] theAgentDescriptionList, AbleSecureKey theSecureKey)
          Requests each agent represented in the specified AgentDescription list to suspend itself along with any threads the agent owns and any other beans and agents the agent may contain.
 
Methods inherited from interface javax.agent.service.Service
getServiceProperties, setServiceProperties
 
Methods inherited from interface com.ibm.able.platform.AblePlatformService
terminateService
 
Methods inherited from interface com.ibm.able.platform.AblePlatformServiceEventGenerator
addAblePlatformServiceEventListener, getAblePlatformServiceEventListeners, removeAblePlatformServiceEventListener
 

Field Detail

SERVICE_TYPE

public static final java.lang.String SERVICE_TYPE
The well-known service type, set to "agent-life-cycle-service".
Method Detail

getPermittedAgents

public AbleAgentClassDescription[] getPermittedAgents()
                                               throws AgentLifeCycleException,
                                                      AgentLifeCycleFailure
Gets a collection of agents that are permitted to run on this platform.
Returns:
a collection of agent class descriptions, each of which defines an agent that can run somewhere in the platform. These are passed to createAgentInstance methods to create new instances of agents in the platform.
Throws:
AgentLifeCycleException - On any Agent Lifecycle error.
AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.

createAgentInstance

public AblePlatformAgent createAgentInstance(AbleAgentClassDescription theAgentClassDescription,
                                             java.lang.String theAgentPoolAlias,
                                             AbleSecureKey theSecureKey)
                                      throws AgentLifeCycleException,
                                             AgentLifeCycleFailure,
                                             javax.agent.service.naming.NamingException
Creates an instance of an agent in a specified agent pool.

If the AbleAgentClassDescription contains constructor parameters, a constructor that matches the parameters will be used, if found. Otherwise, the agent's null argument constructor is used.

The agent is constructed, but not initialized; initialization must be performed as a separate step by calling one of the initializeAgent methods.

Parameters:
theAgentClassDescription - A class description obtained from the getPermittedAgents() method. The specified class description is verified that it is one from Agent Lifecycle's internal permitted agent list so that it cannot be spoofed.

theAgentPoolAlias - Specifies in which of the agent's eligible agent pools (defined in the platform preference file) the agent is to be created. The specified agent pool is verified against the agent's class description, so that an agent cannot be created in an agent pool in which it is not allowed to run.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Returns:
an AblePlatformAgent remote interface reference to the newly created agent.
Throws:
AgentLifeCycleException -

If the AbleAgentClassDescription is null.

If the AbleAgentClassDescription does not exist in the service's actual permitted agent list; that is, the AbleAgentClassDescription appears to have been spoofed.

If the specified agent pool name is not a valid agent pool for the AbleAgentClassDescription.

If the agent represented by the AbleAgentClassDescription is not an AblePlatformAgent.

AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

createAgentInstanceAndInitialize

public AblePlatformAgent createAgentInstanceAndInitialize(AbleAgentClassDescription theAgentClassDescription,
                                                          java.lang.String theAgentPoolAlias,
                                                          AbleSecureKey theSecureKey)
                                                   throws AgentLifeCycleException,
                                                          AgentLifeCycleFailure,
                                                          javax.agent.service.naming.NamingException
Creates an instance of an agent in a specified agent pool and initializes the agent using parameters found in the specified AbleAgentClassDescription.

If the AbleAgentClassDescription contains constructor parameters, a constructor that matches the parameters will be used, if found. Otherwise, the agent's null argument constructor is used.

If the AbleAgentClassDescription contains intialization parameters, those parameters are packaged into an Object[] that is used to intialize the agent; otherwise, the agent is initialized without any special parameters.

Parameters:
theAgentClassDescription - A class description obtained from the getPermittedAgents() method. The specified class description is verified that it is one from Agent Lifecycle's internal permitted agent list so that it cannot be spoofed.

theAgentPoolAlias - Specifies in which of the agent's eligible agent pools (defined in the platform preference file) the agent is to be created. The specified agent pool is verified against the agent's class description, so that an agent cannot be created in an agent pool in which it is not allowed to run.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Returns:
an AblePlatformAgent remote interface reference to the newly created agent.
Throws:
AgentLifeCycleException -

If the AbleAgentClassDescription is null.

If the AbleAgentClassDescription does not exist in the service's actual permitted agent list; that is, the AbleAgentClassDescription appears to have been spoofed.

If the specified agent pool name is not a valid agent pool for the AbleAgentClassDescription.

If the agent represented by the AbleAgentClassDescription is not an AblePlatformAgent.

AgentLifeCycleFailure - If the agent cannot be created.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

createAgentInstanceAndInitialize

public AblePlatformAgent createAgentInstanceAndInitialize(AbleAgentClassDescription theAgentClassDescription,
                                                          java.lang.String theAgentPoolAlias,
                                                          java.lang.Object theInitArg,
                                                          AbleSecureKey theSecureKey)
                                                   throws AgentLifeCycleException,
                                                          AgentLifeCycleFailure,
                                                          javax.agent.service.naming.NamingException
Creates an instance of an agent in a specified agent pool and initializes the agent using the specified parameters.

If the AbleAgentClassDescription contains constructor parameters, a constructor that matches the parameters will be used, if found. Otherwise, the agent's null argument constructor is used.

Parameters:
theAgentClassDescription - A class description obtained from the getPermittedAgents() method. The specified class description is verified that it is one from Agent Lifecycle's internal permitted agent list so that it cannot be spoofed.

theAgentPoolAlias - Specifies in which of the agent's eligible agent pools (defined in the platform preference file) the agent is to be created. The specified agent pool is verified against the agent's class description, so that an agent cannot be created in an agent pool in which it is not allowed to run.

theInitArg - If the initialization parameter is not null, the agent is initialized using the specified initialization parameter; otherwise, the agent is initialized without any special parameters.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Returns:
an AblePlatformAgent remote interface reference to the newly created agent.
Throws:
AgentLifeCycleException -

If the AbleAgentClassDescription is null.

If the AbleAgentClassDescription does not exist in the service's actual permitted agent list; that is, the AbleAgentClassDescription appears to have been spoofed.

If the specified agent pool name is not a valid agent pool for the AbleAgentClassDescription.

If the agent represented by the AbleAgentClassDescription is not an AblePlatformAgent.

AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

initializeAgent

public void initializeAgent(AblePlatformAgent theAblePlatformAgent,
                            AbleSecureKey theSecureKey)
                     throws AgentLifeCycleException,
                            AgentLifeCycleFailure,
                            javax.agent.service.naming.NamingException
Initializes a previously created agent. The agent is initialized without any special parameters.
Parameters:
theAblePlatformAgent - The agent to initialize.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Throws:
AgentLifeCycleException - On any Agent Lifecycle error.
AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

initializeAgent

public void initializeAgent(AblePlatformAgent theAblePlatformAgent,
                            java.lang.Object theInitArg,
                            AbleSecureKey theSecureKey)
                     throws AgentLifeCycleException,
                            AgentLifeCycleFailure,
                            javax.agent.service.naming.NamingException
Initializes a previously created agent instance using the specified initialization argument.
Parameters:
theAblePlatformAgent - The agent to initialize.

theInitArg - The initialization argument; typically this is an Object[] array, but depends on each agent's init method.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Throws:
AgentLifeCycleException - On any Agent Lifecycle error.
AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

quitAgent

public void quitAgent(javax.agent.service.directory.AgentDescription theAgentDescription,
                      AbleSecureKey theSecureKey)
               throws AgentLifeCycleException,
                      AgentLifeCycleFailure,
                      javax.agent.service.naming.NamingException
Requests the agent represented by the specified AgentDescription to quit itself along with any threads the agent owns and any other beans and agents the agent may contain.
Parameters:
theAgentDescription - The agent to quit.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Throws:
AgentLifeCycleException - On any Agent Lifecycle error.
AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

quitAgents

public void quitAgents(javax.agent.service.directory.AgentDescription[] theAgentDescriptionList,
                       AbleSecureKey theSecureKey)
                throws AgentLifeCycleException,
                       AgentLifeCycleFailure,
                       javax.agent.service.naming.NamingException
Requests each agent represented in the specified AgentDescription list to quit itself along with any threads the agent owns and any other beans and agents the agent may contain.
Parameters:
theAgentDescriptionList - The agents to quit.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Throws:
AgentLifeCycleException - On any Agent Lifecycle error.
AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

suspendAgent

public void suspendAgent(javax.agent.service.directory.AgentDescription theAgentDescription,
                         AbleSecureKey theSecureKey)
                  throws AgentLifeCycleException,
                         AgentLifeCycleFailure,
                         javax.agent.service.naming.NamingException
Requests the agent represented by the specified AgentDescription to suspend itself along with any threads the agent owns and any other beans and agents the agent may contain; however, the agent itself may decide whether to suspend any internal agents and beans it may contain.
Parameters:
theAgentDescription - The agent to suspend.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Throws:
AgentLifeCycleException - On any Agent Lifecycle error.
AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

suspendAgents

public void suspendAgents(javax.agent.service.directory.AgentDescription[] theAgentDescriptionList,
                          AbleSecureKey theSecureKey)
                   throws AgentLifeCycleException,
                          AgentLifeCycleFailure,
                          javax.agent.service.naming.NamingException
Requests each agent represented in the specified AgentDescription list to suspend itself along with any threads the agent owns and any other beans and agents the agent may contain.
Parameters:
theAgentDescriptionList - The agents to suspend.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Throws:
AgentLifeCycleException - On any Agent Lifecycle error.
AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

resumeAgent

public void resumeAgent(javax.agent.service.directory.AgentDescription theAgentDescription,
                        AbleSecureKey theSecureKey)
                 throws AgentLifeCycleException,
                        AgentLifeCycleFailure,
                        javax.agent.service.naming.NamingException
Requests the agent represented by the specified AgentDescription to resume itself along with any threads the agent owns and any other beans and agents the agent may contain; however, the agent itself may decide whether to resume any internal agents and beans it may contain.
Parameters:
theAgentDescription - The agent to resume.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Throws:
AgentLifeCycleException - On any Agent Lifecycle error.
AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

resumeAgents

public void resumeAgents(javax.agent.service.directory.AgentDescription[] theAgentDescriptionList,
                         AbleSecureKey theSecureKey)
                  throws AgentLifeCycleException,
                         AgentLifeCycleFailure,
                         javax.agent.service.naming.NamingException
Requests each agent represented in the specified AgentDescription list to resume itself along with any threads the agent owns and any other beans and agents the agent may contain.
Parameters:
theAgentDescriptionList - The agents to resume.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Throws:
AgentLifeCycleException - On any Agent Lifecycle error.
AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

resetAgent

public void resetAgent(javax.agent.service.directory.AgentDescription theAgentDescription,
                       AbleSecureKey theSecureKey)
                throws AgentLifeCycleException,
                       AgentLifeCycleFailure,
                       javax.agent.service.naming.NamingException
Requests the agent represented by the specified AgentDescription to reset itself along with any threads the agent owns and any other beans and agents the agent may contain; however, the agent itself may decide whether to reset any internal agents and beans it may contain.
Parameters:
theAgentDescription - The agent to reset.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Throws:
AgentLifeCycleException - On any Agent Lifecycle error.
AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

resetAgents

public void resetAgents(javax.agent.service.directory.AgentDescription[] theAgentDescriptionList,
                        AbleSecureKey theSecureKey)
                 throws AgentLifeCycleException,
                        AgentLifeCycleFailure,
                        javax.agent.service.naming.NamingException
Requests each agent represented in the specified AgentDescription list to reset itself along with any threads the agent owns and any other beans and agents the agent may contain.
Parameters:
theAgentDescriptionList - The agents to reset.

theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Throws:
AgentLifeCycleException - On any Agent Lifecycle error.
AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
javax.agent.service.naming.NamingException - On any Agent Naming Service error.

getCreatedAgents

public java.util.Vector getCreatedAgents(AbleSecureKey theSecureKey)
                                  throws AgentLifeCycleException,
                                         AgentLifeCycleFailure,
                                         javax.agent.service.naming.NamingException
Gets a collection of all AblePlatformAgent objects created by this particular Agent Lifecycle Service.
Parameters:
theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

Returns:
A collection of Object arrays.

Each element of the collection is an Object[n] object.

Each element of that is

  • [0] - (AbleAgentClassDescription) The AbleAgentClassDescription used to create the agent.
  • [1] - (String) The selected agent pool alias in which the agent was created.
  • [2] - (String) The system's IP name or address that was used to reach the agent pool.
  • [3] - (String) The system's port that was used.
  • [4] - (String) The fully qualified class name of the agent.
  • [5] - (Object) A reference to the created agent; this can be cast to the AblePlatformAgent interface.
  • [6] - (String) The globally unique AgentName of the agent.
  • [7] - (Boolean) A flag indicating whether the agent was initialzed by the Lifecycle Service
  • [8] - (Object) If initialized, any initialization arguments used.

    The collection may be empty, but not null.

    Throws:
    AgentLifeCycleException - On any Agent Lifecycle error.
    AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
    javax.agent.service.naming.NamingException - On any Agent Naming Service error.

  • quiesceAgentPool

    public void quiesceAgentPool(java.lang.String theAgentPoolAlias,
                                 AbleSecureKey theSecureKey)
                          throws AgentLifeCycleException,
                                 AgentLifeCycleFailure,
                                 javax.agent.service.naming.NamingException
    Quiesces the specified agent pool by sending a quitAgent to each agent known to be running in the pool.

    Note that there is nothing that prevents new agents from being created in the pool during the time the pool is being quiesced.

    Parameters:
    theAgentPoolAlias - The name of an agent pool defined in the platform preference file.

    theSecureKey - Used when security is on to make sure that the caller is authentic and has the authority to perform the operation; may be null when security is off.

    Throws:
    AgentLifeCycleException - On any Agent Lifecycle error.
    AgentLifeCycleFailure - When there is a problem in the lifecycle infrastructure code.
    javax.agent.service.naming.NamingException - On any Agent Naming Service error.

    ABLE 2.0.0 07/02/2003 10:25:01

    (C) Copyright IBM Corporation 1999, 2003