kaos.core.service.transport.cougaar
Class CougaarMessageTransportService

java.lang.Object
  extended by kaos.core.service.transport.cougaar.CougaarMessageTransportService

public class CougaarMessageTransportService
extends java.lang.Object


Constructor Summary
CougaarMessageTransportService(CougaarServiceRoot sr)
          Constructor
 
Method Summary
 TransportMessage createTransportMessage()
          Create an empty TransportMessage suitable for attribute population and use.
 long currentTimeMillis()
           
 java.lang.String getBlackboardClientName()
          Implements BlackboardClient
 ServiceProperties getServiceProperties()
          Returns the service properties associated with the transport service.
 boolean isSupported(Locator l)
          Determines if the specified locator is supported by the transport service.
 Locator newLocalLocator()
          Returns a new local locator whose transport type is supported by the transport service.
 Locator newLocalLocator(JasBean env)
          Returns a new local locator whos transport type is supported by the transport service and has the provided environment properties.
 MessageReceiver newMessageReceiver()
          Returns a new MessageReceiver suitable for local binding.
 MessageReceiver newMessageReceiver(JasBean env)
          Returns a new MessageReceiver suitable for local binding having the specified properties.
 MessageSender newMessageSender()
          Returns a new MessageSender capable of binding to message receivers supported by this transport service.
 MessageSender newMessageSender(JasBean env)
          Returns a new MessageSender capable of binding to message receivers supported by this transport service and having the specified properties.
 void sendMessage(TransportMessage msg)
          A convenience method directed to a message sending endpoint specified by the message receiver's locator.
 void sendMessage(TransportMessage msg, Locator loc)
          A convenience method directed to a message sending endpoint specified by the provided locator.
 boolean triggerEvent(java.lang.Object event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CougaarMessageTransportService

public CougaarMessageTransportService(CougaarServiceRoot sr)
Constructor

Method Detail

getServiceProperties

public ServiceProperties getServiceProperties()
                                       throws TransportFailure
Returns the service properties associated with the transport service.

Returns:
the transport's service properties.
Throws:
TransportFailure - if any transport related failure occurs.

isSupported

public boolean isSupported(Locator l)
                    throws TransportFailure
Determines if the specified locator is supported by the transport service.

Parameters:
l - the locator to test for supportability.
Returns:
true if the specified locator is supported.
Throws:
TransportFailure - if any transport related failure occurs.

newLocalLocator

public Locator newLocalLocator()
                        throws TransportFailure
Returns a new local locator whose transport type is supported by the transport service.

Returns:
a Locator.
Throws:
TransportFailure - if any transport related failure occurs.

newLocalLocator

public Locator newLocalLocator(JasBean env)
                        throws TransportFailure
Returns a new local locator whos transport type is supported by the transport service and has the provided environment properties.

Throws:
TransportFailure - if any transport related failure occurs.

newMessageSender

public MessageSender newMessageSender()
                               throws TransportFailure
Returns a new MessageSender capable of binding to message receivers supported by this transport service.

Returns:
MessageSender a message sender with general capabilities.
Throws:
TransportFailure - if any transport related failure occurs.

newMessageSender

public MessageSender newMessageSender(JasBean env)
                               throws TransportFailure
Returns a new MessageSender capable of binding to message receivers supported by this transport service and having the specified properties.

Parameters:
env - specific attributes required of the returned message sender.
Returns:
MessageSender a message sender with specific capabilities.
Throws:
TransportFailure - if any transport related failure occurs.

newMessageReceiver

public MessageReceiver newMessageReceiver()
                                   throws TransportFailure
Returns a new MessageReceiver suitable for local binding. If a MessageReceiver has already been created, it will not be recreated because we need a one-to-one mapping of message receivers to blackboards (or else only the first one would receive the messages) instead, we return the existing MessageReceiver to which the caller may add a MessageListener. The caller should be aware that he may receive messages intended for another component receiving messages via the same blackboard, and thus should ignore any unexpected messages.

Returns:
MessageReceiver a message receiver with general capabilities.
Throws:
TransportFailure - if any transport related failure occurs.

newMessageReceiver

public MessageReceiver newMessageReceiver(JasBean env)
                                   throws TransportFailure
Returns a new MessageReceiver suitable for local binding having the specified properties.

Parameters:
env - specific attributes required of the returned message receiver.
Returns:
MessageReceiver a message receiver with specific capabilities.
Throws:
TransportFailure - if any transport related failure occurs.

sendMessage

public void sendMessage(TransportMessage msg)
                 throws NotLocatableException,
                        TransportFailure
A convenience method directed to a message sending endpoint specified by the message receiver's locator.

Parameters:
msg - the message to send to the receiving agent.
Throws:
NotLocatableException - if a message transport service is not available supporting the specified environment.
TransportFailure - if any transport related failure occurs.

sendMessage

public void sendMessage(TransportMessage msg,
                        Locator loc)
                 throws NotLocatableException,
                        TransportFailure
A convenience method directed to a message sending endpoint specified by the provided locator.

Parameters:
msg - the message to send to the receiving agent.
loc - the locator describing the remote message receiving endpoint.
Throws:
NotLocatableException - if a message transport service is not available supporting the specified environment.
TransportFailure - if any transport related failure occurs.

createTransportMessage

public TransportMessage createTransportMessage()
Create an empty TransportMessage suitable for attribute population and use. The returned value may be null.

Returns:
an empty TransportMessage

getBlackboardClientName

public java.lang.String getBlackboardClientName()
Implements BlackboardClient


currentTimeMillis

public long currentTimeMillis()

triggerEvent

public boolean triggerEvent(java.lang.Object event)