fipaos.mts.http.internal
Class HTTPComms

fipaos.mts.MTPBase
  |
  +--fipaos.mts.InternalMTPBase
        |
        +--fipaos.mts.http.internal.HTTPComms

public class HTTPComms
extends InternalMTPBase

This class is a Comms implementation which offers support for HTTP.


Field Summary
 (package private) MessageReceiverreceiver
           

Fields inherited from class fipaos.mts.MTPBase
_shutdown, ACC_NAME

Constructor Summary
HTTPComms(String name, URL ns)
          Comms initialiser

Method Summary
 voidfailure(String reason, Message msg)
          Indicates failure when receiving a message.
 ListgetAddresses()
          Method to retreive the protocol dependant address of an object that can be used to receive messages.
 MessageReceivergetMessageReceiver()
           
 ListgetProtocols()
          Retreives the protocols known by this comms implementation
 voidhandleMessage(Message msg)
           
 voidincoming(String envelope, String envmime, ACL acl)
          Accept incoming envelope and message.
 ObjectlookupComms(String name)
          Attempt to lookup a reference to the MessageReceiver belonging to the given Agent
 ObjectlookupName(String name)
          Attempt to lookup a reference to the MessageReceiver belonging to the given Agent
 voidsetMessageReceiver(MessageReceiver r)
           
 voidshutdown()
          This should be invoked when the transport should be safely shutdown

Methods inherited from class fipaos.mts.InternalMTPBase
incoming, initialise, main, outgoing

Field Detail

receiver

MessageReceiver receiver
Constructor Detail

HTTPComms

public HTTPComms(String name, URL ns)
throws fipaos.mts.InitialisationException
Comms initialiser
Parameters:
our_name - The name to use when binding to the transport layers naming service - should include HAP address, i.e. "agentA@hap"
Method Detail

failure

public void failure(String reason, Message msg)
Indicates failure when receiving a message.
Parameters:
reason - the reason for the failure

getAddresses

public List getAddresses()
Method to retreive the protocol dependant address of an object that can be used to receive messages.
Returns: A URL containing the required address, or null if this Comms doesn't publish such an object

getMessageReceiver

public MessageReceiver getMessageReceiver()

getProtocols

public List getProtocols()
Retreives the protocols known by this comms implementation
Returns: A List of String's

handleMessage

public void handleMessage(Message msg)

incoming

public void incoming(String envelope, String envmime, ACL acl)
Accept incoming envelope and message.
Parameters:
envelope - the envelope
envmime - the envelope mime type
msg - the message
msgmime - the message mime type

lookupComms

public Object lookupComms(String name)
Attempt to lookup a reference to the MessageReceiver belonging to the given Agent

lookupName

public Object lookupName(String name)
Attempt to lookup a reference to the MessageReceiver belonging to the given Agent

setMessageReceiver

public void setMessageReceiver(MessageReceiver r)

shutdown

public void shutdown()
This should be invoked when the transport should be safely shutdown

Association Links

to Class fipaos.util.ThreadPool

ThreadPool for message sender

to Class java.lang.String

Transport specific protocol type

to Class fipaos.mts.http.internal.HTTPTransport

to Class fipaos.util.URL

Reference to the URL of this MTS

to Class fipaos.mts.MessageReceiver