mam.internetworking
Class Facility


public class Facility
implements Runnable

Tier for handling agent communication that is built on top of the Node.

Author:
igasp
created March 8, 2001

Field Summary
 protected final static StringAGENT_TAG_NAME
          Description of the Field
 final static StringAGENTS_ZIP_ENTRY_NAME
           
 protected final static StringDEFAULT_AGENTS_ROOT_ELEMENT
          Description of the Field
 protected final static doubleDEFAULT_LOCAL_RECEIVER_ROUTE_STRENGTH
          Description of the Field
 final static StringDEFAULT_STORAGE_FILENAME
          Description of the Field
 (package private) final static intHALF_LIFE_LIMIT
           
 final static RoutingTagLOCAL_FACILITY_ROUTING_TAG
          Description of the Field
 final static StringLOCAL_ROUTING_TAG_PREFIX
          Description of the Field
 (package private) static CategoryLog
           
 protected booleanm_debug
          Description of the Field
 protected MessageQueuem_facilityMessageQueue
          Description of the Field
 protected FacilityServiceManagerm_facilityServiceManager
          Description of the Field
 protected Threadm_facilityThread
          Description of the Field
 protected Collectionm_localAgents
          Description of the Field
 protected mam.internetworking.Nodem_localNode
          Description of the Field
 protected Stringm_nodeConfigurationFilename
          Description of the Field
 protected Mapm_processedMessages
          Description of the Field
 protected booleanm_quit
          Description of the Field
 protected RoutingTablem_routingTable
          Description of the Field
 protected booleanm_saveComplete
          Description of the Field
 protected booleanm_shutdownComplete
          Description of the Field
 protected final static StringNEWLY_PROCESSED_MESSAGES
          Description of the Field
 protected final static StringOLD_PROCESSED_MESSAGES
          Description of the Field

Constructor Summary
Facility()
          Constructor for the Facility object
Facility(String configurationFilename)
          Constructor for the Facility object

Method Summary
 (package private) voidaddProcessedMessage(MamId messageId)
          Adds a feature to the ProcessedMessage attribute of the Facility object
 AgentcreateAgent(String role, AgentProperties defaultAgentProperties)
          Description of the Method
 protected voidcreateFacilityServiceManager()
          Description of the Method
 synchronized voidforwardMessage(AgentMessage message)
          Description of the Method
 protected FacilityServiceManagergetFacilityServiceManager()
          Gets the FacilityServiceManager attribute of the Facility object
 protected NodegetLocalNode()
          Gets the LocalNode attribute of the Facility object
 MamIdgetMamId()
          Gets the MamId attribute of the Facility object
 booleangetSaveComplete()
          Gets the SaveComplete attribute of the Facility object
 booleangetShutdownComplete()
          Gets the ShutdownComplete attribute of the Facility object
 booleanmigrateAgent(Agent newAgent)
          Description of the Method
 voidnodeMessageReceived(AgentMessage message)
          Description of the Method
 synchronized voidregister(RoutingTag routingTag, MessageReceiver receiver)
          Allows tag registration.
 voidremoveAgent(Agent agent)
          Description of the Method
 protected voidrestoreAgents(String xmlAgentsFilename)
          Description of the Method
 (package private) voidretireProcessedMessages()
          Description of the Method
 (package private) voidrouteMessage(AgentMessage message)
          Description of the Method
 voidrun()
          Main processing method for the Facility object
 protected voidsaveAgents()
          Description of the Method
 voidsendAgentMessage(AgentMessage message)
          Public interface to send an agent message.
 protected voidsetShutdownComplete()
          Sets the ShutdownComplete attribute of the Facility object
 protected voidshutdown()
          Description of the Method
 protected voidsignalQuit()
          Description of the Method
 synchronized voidunregister(RoutingTag routingTag, MessageReceiver receiver)
          Description of the Method

Field Detail

AGENT_TAG_NAME

protected final static String AGENT_TAG_NAME
Description of the Field
Since:

AGENTS_ZIP_ENTRY_NAME

public final static String AGENTS_ZIP_ENTRY_NAME

DEFAULT_AGENTS_ROOT_ELEMENT

protected final static String DEFAULT_AGENTS_ROOT_ELEMENT
Description of the Field
Since:

DEFAULT_LOCAL_RECEIVER_ROUTE_STRENGTH

protected final static double DEFAULT_LOCAL_RECEIVER_ROUTE_STRENGTH
Description of the Field
Since:

DEFAULT_STORAGE_FILENAME

public final static String DEFAULT_STORAGE_FILENAME
Description of the Field
Since:

HALF_LIFE_LIMIT

final static int HALF_LIFE_LIMIT

LOCAL_FACILITY_ROUTING_TAG

public final static RoutingTag LOCAL_FACILITY_ROUTING_TAG
Description of the Field
Since:

LOCAL_ROUTING_TAG_PREFIX

public final static String LOCAL_ROUTING_TAG_PREFIX
Description of the Field
Since:

Log

static Category Log

m_debug

protected boolean m_debug
Description of the Field
Since:

m_facilityMessageQueue

protected MessageQueue m_facilityMessageQueue
Description of the Field
Since:

m_facilityServiceManager

protected FacilityServiceManager m_facilityServiceManager
Description of the Field
Since:

m_facilityThread

protected Thread m_facilityThread
Description of the Field
Since:

m_localAgents

protected Collection m_localAgents
Description of the Field
Since:

m_localNode

protected mam.internetworking.Node m_localNode
Description of the Field
Since:

m_nodeConfigurationFilename

protected String m_nodeConfigurationFilename
Description of the Field
Since:

m_processedMessages

protected Map m_processedMessages
Description of the Field
Since:

m_quit

protected boolean m_quit
Description of the Field
Since:

m_routingTable

protected RoutingTable m_routingTable
Description of the Field
Since:

m_saveComplete

protected boolean m_saveComplete
Description of the Field
Since:

m_shutdownComplete

protected boolean m_shutdownComplete
Description of the Field
Since:

NEWLY_PROCESSED_MESSAGES

protected final static String NEWLY_PROCESSED_MESSAGES
Description of the Field
Since:

OLD_PROCESSED_MESSAGES

protected final static String OLD_PROCESSED_MESSAGES
Description of the Field
Since:
Constructor Detail

Facility

public Facility()
Constructor for the Facility object
Since:

Facility

public Facility(String configurationFilename)
Constructor for the Facility object
Parameters:
configurationFilename - Description of Parameter
Since:
Method Detail

addProcessedMessage

void addProcessedMessage(MamId messageId)
Adds a feature to the ProcessedMessage attribute of the Facility object
Parameters:
messageId - The feature to be added to the ProcessedMessage attribute
Since:

createAgent

public Agent createAgent(String role, AgentProperties defaultAgentProperties)
Description of the Method
Parameters:
role - Description of Parameter
defaultAgentProperties - Description of Parameter
Returns: Description of the Returned Value
Since:

createFacilityServiceManager

protected void createFacilityServiceManager()
Description of the Method
Since:

forwardMessage

public synchronized void forwardMessage(AgentMessage message)
Description of the Method
Parameters:
message - Description of Parameter
Since:

getFacilityServiceManager

protected FacilityServiceManager getFacilityServiceManager()
Gets the FacilityServiceManager attribute of the Facility object
Returns: The FacilityServiceManager value
Since:

getLocalNode

protected Node getLocalNode()
Gets the LocalNode attribute of the Facility object
Returns: The LocalNode value
Since:

getMamId

public MamId getMamId()
Gets the MamId attribute of the Facility object
Returns: The MamId value
Since:

getSaveComplete

public boolean getSaveComplete()
Gets the SaveComplete attribute of the Facility object
Returns: The SaveComplete value
Since:

getShutdownComplete

public boolean getShutdownComplete()
Gets the ShutdownComplete attribute of the Facility object
Returns: The ShutdownComplete value
Since:

migrateAgent

public boolean migrateAgent(Agent newAgent)
Description of the Method
Parameters:
newAgent - Description of Parameter
Returns: Description of the Returned Value
Since:

nodeMessageReceived

public void nodeMessageReceived(AgentMessage message)
Description of the Method
Parameters:
message - Description of Parameter
Since:

register

public synchronized void register(RoutingTag routingTag, MessageReceiver receiver)
Allows tag registration.
Parameters:
routingTag - Description of Parameter
receiver - Description of Parameter
Since:

removeAgent

public void removeAgent(Agent agent)
Description of the Method
Parameters:
agent - Description of Parameter
Since:

restoreAgents

protected void restoreAgents(String xmlAgentsFilename)
Description of the Method
Parameters:
xmlAgentsFilename - Description of Parameter
Since:

retireProcessedMessages

void retireProcessedMessages()
Description of the Method
Since:

routeMessage

void routeMessage(AgentMessage message)
Description of the Method
Parameters:
message - Description of Parameter
Since:

run

public void run()
Main processing method for the Facility object
Since:

saveAgents

protected void saveAgents()
Description of the Method
Since:

sendAgentMessage

public void sendAgentMessage(AgentMessage message)
Public interface to send an agent message. The message is then routed locally and forwarded to nodes.
Parameters:
message - Description of Parameter
Since:

setShutdownComplete

protected void setShutdownComplete()
Sets the ShutdownComplete attribute of the Facility object
Since:

shutdown

protected void shutdown()
Description of the Method
Since:

signalQuit

protected void signalQuit()
Description of the Method
Since:

unregister

public synchronized void unregister(RoutingTag routingTag, MessageReceiver receiver)
Description of the Method
Parameters:
routingTag - Description of Parameter
receiver - Description of Parameter
Since: