fipaos.test.agent
Class TestingMTP

java.lang.Object
  |
  +--fipaos.mts.MTPBase
        |
        +--fipaos.mts.InternalMTPBase
              |
              +--fipaos.test.agent.TestingMTP
All Implemented Interfaces:
InternalMTP, PreParserService, Service

public class TestingMTP
extends InternalMTPBase

MTP implementation which allows an Agent to be tested at the ACL level of abstraction


Field Summary
static java.lang.Object __dummy
          Dummy object for observer to use
static URL __dummy_url
          URL for tester
static java.util.Map __ns
          NS Map ;)
 
Fields inherited from class fipaos.mts.MTPBase
_hap, _name, _ns_url, _shutdown, ACC_NAME
 
Fields inherited from interface fipaos.mts.service.Service
ACL_LANGUAGE_UNKNOWN, CONTENT_LANGUAGE_UNKNOWN, ERROR_STRING, ERROR_UNKNOWN, FIPAOS_DEBUG, FIPAOS_MSG_ID_SLOT, MALFORMED_ENVELOPE, MSG_DELIVERY_FAILURE_REASON, NONE, PROTOCOL_UNKNOWN, TARGET_UNKNOWN
 
Constructor Summary
TestingMTP(java.lang.String name, URL ns)
           
 
Method Summary
protected  void bind()
          Bind the MTP to the NS (if it exists) and perform other start-up operations
 java.util.List getAddresses()
          Method to retreive the protocol dependant addresses of an object that can be used to receive messages.
static AgentID getAID()
          Get the AID to be used by tester
static Message getNextIncomingMessage()
          Get the next incoming message from the given Agent
 java.util.List getProtocols()
          Retreives the protocols known by this comms implementation
protected  java.lang.Object lookup(java.lang.String str)
          Attempt to lookup a reference to the MTS belonging to the given Agent
protected  java.lang.Object lookup(URL uRL)
          Lookup a reference to the MTS at the given URL
protected  void send(java.lang.Object obj, Message message)
          Invoked to send the given Message to the given target
static boolean sendMessage(java.lang.String name, Message msg)
          Send the given message to the given Agent - please ensure to set AID in ACL and Envelope appropriately
static boolean sendMessage(URL url, Message msg)
          Send the given message to the given Agent - please ensure to set AID in ACL and Envelope appropriately
 void shutdown()
          This should be invoked when the service should be safely shutdown
protected  void unbind()
          Un-bind the MTP to the NS (if it exists)
 
Methods inherited from class fipaos.mts.InternalMTPBase
handleIncoming, incoming, initialise, main, outgoing
 
Methods inherited from class fipaos.mts.MTPBase
handleIncoming, handleOutgoing, shutdownMTPBase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__ns

public static java.util.Map __ns
NS Map ;)

__dummy

public static java.lang.Object __dummy
Dummy object for observer to use

__dummy_url

public static URL __dummy_url
URL for tester
Constructor Detail

TestingMTP

public TestingMTP(java.lang.String name,
                  URL ns)
           throws java.lang.Exception
Method Detail

bind

protected void bind()
             throws InitialisationException
Description copied from class: MTPBase
Bind the MTP to the NS (if it exists) and perform other start-up operations
Overrides:
bind in class MTPBase

getAddresses

public java.util.List getAddresses()
Description copied from class: InternalMTPBase
Method to retreive the protocol dependant addresses of an object that can be used to receive messages.
Overrides:
getAddresses in class InternalMTPBase
Following copied from class: fipaos.mts.InternalMTPBase
Returns:
A List containing the required addresses, or null if this Comms doesn't publish such an object

getProtocols

public java.util.List getProtocols()
Description copied from class: InternalMTPBase
Retreives the protocols known by this comms implementation
Overrides:
getProtocols in class InternalMTPBase
Following copied from class: fipaos.mts.InternalMTPBase
Returns:
A List of String's

lookup

protected java.lang.Object lookup(URL uRL)
                           throws UnknownTargetException
Description copied from class: MTPBase
Lookup a reference to the MTS at the given URL
Overrides:
lookup in class MTPBase

lookup

protected java.lang.Object lookup(java.lang.String str)
                           throws UnknownTargetException
Description copied from class: MTPBase
Attempt to lookup a reference to the MTS belonging to the given Agent
Overrides:
lookup in class MTPBase

send

protected void send(java.lang.Object obj,
                    Message message)
             throws UnknownTargetException,
                    UnknownProtocolException,
                    UnableToSendException
Description copied from class: InternalMTPBase
Invoked to send the given Message to the given target
Overrides:
send in class InternalMTPBase

shutdown

public void shutdown()
Description copied from class: InternalMTPBase
This should be invoked when the service should be safely shutdown
Overrides:
shutdown in class InternalMTPBase

unbind

protected void unbind()
Description copied from class: MTPBase
Un-bind the MTP to the NS (if it exists)
Overrides:
unbind in class MTPBase

sendMessage

public static boolean sendMessage(java.lang.String name,
                                  Message msg)
Send the given message to the given Agent - please ensure to set AID in ACL and Envelope appropriately

sendMessage

public static boolean sendMessage(URL url,
                                  Message msg)
Send the given message to the given Agent - please ensure to set AID in ACL and Envelope appropriately

getNextIncomingMessage

public static Message getNextIncomingMessage()
Get the next incoming message from the given Agent

getAID

public static AgentID getAID()
Get the AID to be used by tester