com.agentfactory.platform
Class AgentPlatform

java.lang.Object
  extended by java.util.Observable
      extended by com.agentfactory.platform.AgentPlatform

public class AgentPlatform
extends java.util.Observable

A simple Agent Platform which can create and run agents specified by their agent design files. Agents are stored in a hashtable using the agent names as keys. If the platform is running on an ARM architecture AWT is used. Otherwise a swing is utilised. This class, like every other core platform class, should not reference any plugin classes directly. All plugin classes should instead be loaded dynamically, or through the use of platform description files.


Field Summary
static java.lang.String SHUTDOWN_MESSAGE
           
 
Constructor Summary
AgentPlatform(java.lang.String inConfigFileName)
          Agent Platfrom Constructor to be used when supplying a specific platform configurtion file.
 
Method Summary
 void addApplicationAgent(java.lang.String name)
           
 void addSystemAgent(Agent agent)
           
 void destrory()
          Method which may be used to shutdown the agent platform.
 java.lang.String generatePlatformID()
          Used to control access to the underlying Agent Management Services of the Agent Platform.
 AgentContainer getAgentContainer()
          Get the Agent Container.
 java.util.Hashtable getInterpreters()
          Get any registered interpreter plugins.
 java.lang.String getName()
          Getters and Setters
 java.lang.String getPlatformDomain()
          Get the Platform Domain.
 PlatformServiceManager getPlatformServiceManager()
          Returns the AgentPlatform's MessageTransportManager instance.
 SecurityModule getSecurityModule()
           
 void notify(java.lang.String message)
          Notify any observers that the Platform has changed in some way.
 void removeSystemAgent(Agent agent)
           
 void setName(java.lang.String inName)
          Set the name of the platform.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHUTDOWN_MESSAGE

public static final java.lang.String SHUTDOWN_MESSAGE
See Also:
Constant Field Values
Constructor Detail

AgentPlatform

public AgentPlatform(java.lang.String inConfigFileName)
Agent Platfrom Constructor to be used when supplying a specific platform configurtion file. If not operating on IPAQ creates a Registry Viewer of agents on the platform

Parameters:
inConfigFileName - - A String Object. The name of the platform configuration file to be used. This filename should be a resource name which can be located via a class loader. e.g. myPackage/mySubPackage/my_file
Method Detail

addSystemAgent

public void addSystemAgent(Agent agent)

removeSystemAgent

public void removeSystemAgent(Agent agent)

addApplicationAgent

public void addApplicationAgent(java.lang.String name)

getInterpreters

public java.util.Hashtable getInterpreters()
Get any registered interpreter plugins.

Returns:
a hashtable of interpreters

generatePlatformID

public java.lang.String generatePlatformID()
Used to control access to the underlying Agent Management Services of the Agent Platform. The method returns a unique ID the first time it is invoked, and returns null thereafter.

Returns:
A unique ID that can be used to access platform services.

destrory

public void destrory()
Method which may be used to shutdown the agent platform. All agents are expliclty killed, any viewers destroyed, and important objects set to null.


notify

public void notify(java.lang.String message)
Notify any observers that the Platform has changed in some way. This mehtod seems to be unused at present. TODO - RR - Find out the the Platform viewwer does actually ask for events from the Platform.


getName

public java.lang.String getName()
Getters and Setters


setName

public void setName(java.lang.String inName)
Set the name of the platform. This is used in the SetPlatformNameActuator


getPlatformDomain

public java.lang.String getPlatformDomain()
Get the Platform Domain. This is used in the AFInfrastructureModulePerceptor (what ever that is).


getAgentContainer

public AgentContainer getAgentContainer()
Get the Agent Container.


getPlatformServiceManager

public PlatformServiceManager getPlatformServiceManager()
Returns the AgentPlatform's MessageTransportManager instance.

Returns:
a MessageTransportManager instance

getSecurityModule

public SecurityModule getSecurityModule()