fipaos.mts.iiop.sun.external
Class SUNIIOPComms

java.lang.Object
  |
  +--fipaos.mts.MTPBase
        |
        +--fipaos.mts.ExternalMTPBase
              |
              +--fipaos.mts.iiop.sun.external.SUNIIOPComms
All Implemented Interfaces:
ExternalMTP, PostParserService, Service

public class SUNIIOPComms
extends ExternalMTPBase

SUNIIOPComms uses jdk1.2's IDL classes to provide a FIPA99 Structured IIOP interface for Agent communications.

$Revision: 1.15 $ $Date: 2001/04/04 23:21:35 $ $Author: alantreadway $


Inner Class Summary
 class SUNIIOPComms.MTSListener
          Listener class for the MTS
 
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
SUNIIOPComms(java.lang.String our_name, URL ns_url)
          Comms initialiser
 
Method Summary
protected  void bind()
          Bind the MTP to the NS (if it exists) and perform other start-up operations
static org.omg.CORBA.Object corbaNameResolve(URL name)
          Attempt to resolve the given CORBANAME url
 java.util.List getAddresses()
          Method to retreive the protocol dependant address of an object that can be used to receive messages.
 java.util.List getProtocols()
          Retreives the protocols known by this comms implementation
 void handleMessage(FipaMessage msg)
          Handle incoming messages
protected  java.lang.Object lookup(java.lang.String name)
          Attempt to lookup a reference to the MTS belonging to the given Agent
protected  java.lang.Object lookup(URL name)
          Lookup a reference to the MTS at the given URL
static void main(java.lang.String[] args)
          Test harness for transport Use java fipaos.comm.sunidl.SUNIDLComms /? for usage details
static org.omg.CORBA.Object nsResolve(java.lang.String host, int port, java.lang.String url_target)
          Attempt to resolve the target at the given CosNamingService located at the given ORB server
protected  void send(java.lang.Object target, Envelope env, byte[] msg)
          Invoked to send the given Message to the given target
 void shutdown()
          This should be invoked when the transport should be safely shutdown
protected  void unbind()
          Un-bind the MTP from the NS (if it exists)
 
Methods inherited from class fipaos.mts.ExternalMTPBase
handleIncoming, incoming, initialise, 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
 

Constructor Detail

SUNIIOPComms

public SUNIIOPComms(java.lang.String our_name,
                    URL ns_url)
             throws InitialisationException
Comms initialiser
Parameters:
our_name - The name of the Agent
ns_url - URL for the transport
Method Detail

bind

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

unbind

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

lookup

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

lookup

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

shutdown

public void shutdown()
This should be invoked when the transport should be safely shutdown
Overrides:
shutdown in class ExternalMTPBase

getAddresses

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

getProtocols

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

send

protected void send(java.lang.Object target,
                    Envelope env,
                    byte[] msg)
             throws UnknownTargetException,
                    UnknownProtocolException,
                    UnableToSendException
Invoked to send the given Message to the given target
Overrides:
send in class ExternalMTPBase

handleMessage

public void handleMessage(FipaMessage msg)
Handle incoming messages

corbaNameResolve

public static org.omg.CORBA.Object corbaNameResolve(URL name)
Attempt to resolve the given CORBANAME url

nsResolve

public static org.omg.CORBA.Object nsResolve(java.lang.String host,
                                             int port,
                                             java.lang.String url_target)
                                      throws java.lang.Exception
Attempt to resolve the target at the given CosNamingService located at the given ORB server

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test harness for transport Use java fipaos.comm.sunidl.SUNIDLComms /? for usage details