ibspan.tss.agents.pra
Class ProxyAgent

java.lang.Object
  extended by jade.core.Agent
      extended by ibspan.tss.agents.SystemAgent
          extended by ibspan.tss.agents.pra.ProxyAgent
All Implemented Interfaces:
TimerListener, Serializable, Runnable

public class ProxyAgent
extends SystemAgent

ProxyAgent - this agent is intermediary between system and non-agent client software like HTTP/HTML or HTTP/WML browsers. Each user request send over HTTP protocol is translated into ACLMessage and forwarded to SesssionHandlingAgent. Responses of the system are returned back to the user on the same HTTP connection. See [1] for more details.

The agent must provided with ports of WML and HTML servers given in properties file (with filename passed as an argument when creating this agent). It also requires SessionHandlingAgent registered in Directory Facilitator to start working.

  1. Pawel Kaczmarek "Multimodal Communication Between Users and Software Agents", 2005. Master Thesis, Adam Mickiewicz University, Poznan. Poland.

Author:
Pawel Kaczmarek, Maciej Gawinecki
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jade.core.Agent
Agent.Interrupted
 
Field Summary
static String HTML_MAINSERVER_PORT_KEY
           
static String WML_MAINSERVER_PORT_KEY
           
 
Fields inherited from class jade.core.Agent
AP_ACTIVE, AP_DELETED, AP_IDLE, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_WAITING, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN
 
Constructor Summary
ProxyAgent()
           
 
Method Summary
protected  void activateProperties(Properties conf)
          Activates configuration by processing given properties.
protected  DataView getResponse(UserRequest request)
          It uses data from ExternalRequest instance input parameter to create proper being of SystemOntology; send the request; retrieve response; return response;
protected  DataView receiveResponse(String jobID)
          Retrives PrASystemInit instance from responseMessageMap(member) based on PrASystemInit instance JobID as a key.
protected  void setup()
          Loads configuration from properties file for this agent and passes it to SystemAgent.activateProperties(Properties).
 
Methods inherited from class jade.core.Agent
addBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, changeStateTo, clean, doActivate, doClone, doDelete, doMove, doSuspend, doTimeOut, doWait, doWait, doWake, getAgentState, getAID, getAMS, getArguments, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AObject, getProperty, getQueueSize, getState, here, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, receive, receive, removeBehaviour, restartLater, restore, restoreBufferedState, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setQueueSize, takeDown, waitUntilStarted, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTML_MAINSERVER_PORT_KEY

public static final String HTML_MAINSERVER_PORT_KEY
See Also:
Constant Field Values

WML_MAINSERVER_PORT_KEY

public static final String WML_MAINSERVER_PORT_KEY
See Also:
Constant Field Values
Constructor Detail

ProxyAgent

public ProxyAgent()
Method Detail

activateProperties

protected void activateProperties(Properties conf)
Description copied from class: SystemAgent
Activates configuration by processing given properties.

Specified by:
activateProperties in class SystemAgent
Parameters:
conf - are properties of the agent.

setup

protected void setup()
Description copied from class: SystemAgent
Loads configuration from properties file for this agent and passes it to SystemAgent.activateProperties(Properties). Property file is given as the first argument for the launched agent. The programmer is encouraged to call this method in her agent's setup() method.

Overrides:
setup in class SystemAgent

getResponse

protected DataView getResponse(UserRequest request)
                        throws SystemResponseException
It uses data from ExternalRequest instance input parameter to create proper being of SystemOntology; send the request; retrieve response; return response;

Parameters:
request - - request from outside of the agent world.
Returns:
response of the system
Throws:
SystemResponseException

receiveResponse

protected DataView receiveResponse(String jobID)
                            throws SystemResponseException
Retrives PrASystemInit instance from responseMessageMap(member) based on PrASystemInit instance JobID as a key.

Parameters:
requestHandler -
Returns:
Throws:
SystemResponseException