fipaos.mts
Class MTPBase

java.lang.Object
  |
  +--fipaos.mts.MTPBase
Direct Known Subclasses:
ExternalMTPBase, InternalMTPBase

public abstract class MTPBase
extends java.lang.Object

Contains the abstract functionality that all MTP's require in order to deal with messages - increases code-reuse in MTP implementations

$Revision: 1.10 $ $Date: 2001/04/05 14:54:50 $ $Author: alantreadway $


Field Summary
protected  java.lang.String _hap
          HAP address for the platform we're registered with
protected  java.lang.String _name
          Reference to our name
protected  URL _ns_url
          URL of this MTP's naming service
 boolean _shutdown
          Indicates if this MTP has been shutdown
static java.lang.String ACC_NAME
          Default name that the ACC binds to the NS using
 
Constructor Summary
protected MTPBase(java.lang.String name, URL ns)
          Initialises the MTP variables (i.e.
 
Method Summary
protected abstract  void bind()
          Bind the MTP to the NS (if it exists) and perform other start-up operations
abstract  java.util.List getProtocols()
          Retreives the protocols known by this comms implementation
protected  void handleIncoming(Envelope envelope, java.lang.Object msg)
          Should be invoked by the underlying MTP when an incoming message is received
protected  void handleOutgoing(Envelope env, java.lang.Object msg)
          Should be invoked by the underlying MTP when an outgoing message is received
protected abstract  java.lang.Object lookup(java.lang.String name)
          Attempt to lookup a reference to the MTS belonging to the given Agent
protected abstract  java.lang.Object lookup(URL name)
          Lookup a reference to the MTS at the given URL
static void main(java.lang.String[] args)
           
protected  void shutdownMTPBase()
          Should be invoked by the undelying implementation when shutting down
protected abstract  void unbind()
          Un-bind the MTP to the NS (if it exists)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACC_NAME

public static java.lang.String ACC_NAME
Default name that the ACC binds to the NS using

_ns_url

protected URL _ns_url
URL of this MTP's naming service

_name

protected java.lang.String _name
Reference to our name

_hap

protected java.lang.String _hap
HAP address for the platform we're registered with

_shutdown

public boolean _shutdown
Indicates if this MTP has been shutdown
Constructor Detail

MTPBase

protected MTPBase(java.lang.String name,
                  URL ns)
           throws InitialisationException
Initialises the MTP variables (i.e. _hap, __name & _ns_url), and then invokes bind()
Method Detail

handleOutgoing

protected void handleOutgoing(Envelope env,
                              java.lang.Object msg)
Should be invoked by the underlying MTP when an outgoing message is received

handleIncoming

protected void handleIncoming(Envelope envelope,
                              java.lang.Object msg)
Should be invoked by the underlying MTP when an incoming message is received

shutdownMTPBase

protected void shutdownMTPBase()
Should be invoked by the undelying implementation when shutting down

bind

protected abstract void bind()
                      throws InitialisationException
Bind the MTP to the NS (if it exists) and perform other start-up operations

unbind

protected abstract void unbind()
Un-bind the MTP to the NS (if it exists)

lookup

protected abstract java.lang.Object lookup(URL name)
                                    throws UnknownTargetException
Lookup a reference to the MTS at the given URL

lookup

protected abstract java.lang.Object lookup(java.lang.String name)
                                    throws UnknownTargetException
Attempt to lookup a reference to the MTS belonging to the given Agent

getProtocols

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

main

public static void main(java.lang.String[] args)
                 throws java.lang.Throwable