ie.nuigalway.ecrg.jade.jmsagentgateway.examples
Class ClientAgent

java.lang.Object
  |
  +--jade.core.Agent
        |
        +--ie.nuigalway.ecrg.jade.jmsagentgateway.examples.ClientAgent
All Implemented Interfaces:
java.lang.Runnable, jade.util.leap.Serializable, java.io.Serializable, jade.core.TimerListener

public class ClientAgent
extends jade.core.Agent

Example Client agent used to interact with the PubSubAgent

Version:
0.5 12 January 2004
Author:
Edward Curry
See Also:
Serialized Form

Nested Class Summary
(package private)  class ClientAgent.JmsSubscriptionInitiator
          Implementation of the SubscriptionInitiator interface
(package private)  class ClientAgent.PublishCommand
          Behaviour used to publish messages to the JmsProxyAgent
 
Nested classes inherited from class jade.core.Agent
 
Field Summary
private  jade.content.lang.Codec codec
           
private  jade.core.AID jmsProxyAgent
           
private  jade.content.onto.Ontology ontology
           
 
Fields inherited from class jade.core.Agent
AP_ACTIVE, AP_COPY, AP_DELETED, AP_IDLE, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_TRANSIT, AP_WAITING, currentBehaviour, currentMessage, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN
 
Constructor Summary
ClientAgent()
           
 
Method Summary
private  jade.lang.acl.ACLMessage getSubscriptionMsg()
          Create a subscription message
private  void lookupAgent()
          Lookup the JmsProxyAgent
private  void publishMessage(java.lang.String payload)
          Utility messgea to publish a message
private  void sendMessage(int performative, jade.content.AgentAction action)
          Utility method for sending a message
protected  void setup()
          Setup the agent
 
Methods inherited from class jade.core.Agent
addBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, doActivate, doClone, doDelete, doMove, doStart, doSuspend, doTimeOut, doWait, doWait, doWake, extractPassword, extractUsername, getAgentState, getAID, getAMS, getArguments, getAuthority, getCertificateFolder, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AObject, getPrincipal, getProperty, getQueueSize, getState, here, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, read, read, receive, receive, removeBehaviour, restartLater, restore, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setOwnership, setPrincipal, setQueueSize, takeDown, waitUntilStarted, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jmsProxyAgent

private jade.core.AID jmsProxyAgent

codec

private jade.content.lang.Codec codec

ontology

private jade.content.onto.Ontology ontology
Constructor Detail

ClientAgent

public ClientAgent()
Method Detail

setup

protected void setup()
Setup the agent

Overrides:
setup in class jade.core.Agent

publishMessage

private void publishMessage(java.lang.String payload)
Utility messgea to publish a message

Parameters:
payload - Payload of the message to be published

sendMessage

private void sendMessage(int performative,
                         jade.content.AgentAction action)
Utility method for sending a message

Parameters:
performative - Performative for the message
action - The AgentAction of the message to be sent

getSubscriptionMsg

private jade.lang.acl.ACLMessage getSubscriptionMsg()
Create a subscription message

Returns:
The subscriptionMsg value

lookupAgent

private void lookupAgent()
Lookup the JmsProxyAgent