gov.nasa.arc.brahms.vm.api.jagt
Class ExternalAgentFactory

java.lang.Object
  extended by gov.nasa.arc.brahms.vm.api.jagt.ExternalAgentFactory

public class ExternalAgentFactory
extends java.lang.Object

ExternalAgentFactory is a factory class used to dynamically create new external agents. The creation of an external agent involves the creation of the Brahms agent representing the external agent and the external agent Java instance that implements the IExternalAgent interface. This factory makes sure that both the Brahms and Java components are created, registered with the model and properly initialized so they can be used in the model.

Version:
$Revision: 1.2 $ $Date: 2009/04/03 15:43:33 $ $Author: rvhoof $
Author:
Ron van Hoof

Constructor Summary
ExternalAgentFactory()
           
 
Method Summary
static ExternalAgentRecord createExternalAgent(java.lang.String agentClass, java.lang.String name, IContext actionCtx)
          Creates a new external agent created from the Java class specified in agentClass and with the specified name (optional).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalAgentFactory

public ExternalAgentFactory()
Method Detail

createExternalAgent

public static ExternalAgentRecord createExternalAgent(java.lang.String agentClass,
                                                      java.lang.String name,
                                                      IContext actionCtx)
                                               throws ExternalException
Creates a new external agent created from the Java class specified in agentClass and with the specified name (optional). If no name is specified a name is generated using the agent's classname. The specified name is only used as a base name, the Java virtual machine will add additional information to guarantee its uniqueness.

The external agent will be loaded in the model and if in distributed mode also registered in the directory service.

Parameters:
agentClass - the fully qualified name for the Java class providing the agent's implementation (must implement the IExternalAgent interface).
name - the optional name for the agent
actionCtx - the IContext for the action
Throws:
ExternalException - if there was an error creating the agent


Copyright © 1997-2012 All Rights Reserved.