fipaos.mts.rmi.internal
Class RMIComms

fipaos.mts.MTPBase
  |
  +--fipaos.mts.InternalMTPBase
        |
        +--fipaos.mts.rmi.internal.RMIComms
Direct Known Subclasses:
SSLRMIComms

public class RMIComms
extends InternalMTPBase

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




Inner Class Summary
 public classRMIComms.MTSListener
          Class that is actually bound to the NS

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

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

Method Summary
 static voidbindToRegistry(String name, Remote r, int port)
          This method will (re)bind the given entry into the local Registry
NOTE: RMIRegistry's only allow local objects to be bound to them,
hence the need for an additional (lightweight) Naming-Service.
 ListgetAddresses()
          Method to retreive the protocol dependant address of an object that can be used
to receive messages.
 ListgetProtocols()
          Retreives the protocols known by this comms implementation
 voidhandleMessage(Message msg)
           
 static voidmain(String[] args)
          Test harness for transport
 voidshutdown()
          This should be invoked when the transport should be safely shutdown
 static synchronized voidstartupRegistry(int port)
          This method will create a new Registry locally if there isn't already
one running

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

Constructor Detail

RMIComms

public RMIComms(String name, URL ns)
throws fipaos.mts.InitialisationException,
java.rmi.RemoteException
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

bindToRegistry

public static void bindToRegistry(String name, Remote r, int port)
throws fipaos.mts.InitialisationException
This method will (re)bind the given entry into the local Registry
NOTE: RMIRegistry's only allow local objects to be bound to them,
hence the need for an additional (lightweight) Naming-Service.
Parameters:
name - Name to bind the object into the Registry using
r - The Remote object reference to bind

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

getProtocols

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

handleMessage

public void handleMessage(Message msg)

main

public static void main(String[] args)
throws java.lang.Exception
Test harness for transport

shutdown

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

startupRegistry

public static synchronized void startupRegistry(int port)
throws fipaos.mts.InitialisationException
This method will create a new Registry locally if there isn't already
one running

Association Links

to Class java.lang.String

Transport specific protocol type

to Class fipaos.mts.rmi.internal.ns.RMIAgentNamingService

Reference to NamingService

to Class fipaos.mts.rmi.internal.MTS

Reference to MTS object to export

to Class fipaos.util.URL

Reference to the URL of this MTS