kaos.core.csi.transport
Interface TransportSupport


public interface TransportSupport

This interface defines the operations to bind an entity, whose KAoSAgentDescription or Locator is given to the specified transport and to send messages via a given transport. NOTE: The class implementing this interface is NOT an implementation of a specific transport, it just provides access to ANY transport for binding and message sends, simplifying some of the complexities of interfacing with a transport.

Author:
KAoS Team $Revision: 1.10 $

Method Summary
 void bindMsgListenerToTransport(MessageListener listener, java.lang.String listenerName, kaos.core.service.directory.KAoSAgentDescription listenerDesc)
          Bind the specified MessageListener, whose KAoSAgentDescription is given to the given transport.
 void bindMsgListenerToTransport(MessageListener listener, java.lang.String listenerName, Locator locator, java.lang.String transportName)
          Bind the specified MessageListener, whose Locator is given to the given transport.
 MessageReceiver bindToTransport(java.lang.String receiverName, Locator receiverLocator, java.lang.String transportName)
           
 Locator createLocator(java.lang.String name, JasBean agentInitInfo, java.lang.String transportName)
           
 kaos.core.service.KAoSServiceRoot getServiceRoot(java.lang.String transportName)
          Return KAoSServiceRoot for the specified transportName.
 java.util.List<java.lang.String> getSupportedTransportsNames()
          Return the names of the currently supported transports.
 boolean isTransportSupported(java.lang.String name)
          Answer true if the given transport is supported, otherwise, answer false.
 void sendMessageTo(kaos.core.service.directory.KAoSAgentDescription senderDesc, TransportMessage receivedMsg, java.io.Serializable content)
          Send the given message content to the receiver, from whom the receivedMsg was received.
 void sendMessageTo(Locator senderLocator, Locator receiverLocator, java.lang.String senderName, java.lang.String receiverName, java.lang.String fipaPerformative, java.io.Serializable content)
          Send the given message content to the receiver, whose Locator is given.
 void sendMessageTo(Locator senderLocator, Locator receiverLocator, java.lang.String senderName, java.lang.String receiverName, java.lang.String fipaPerformative, java.io.Serializable content, java.lang.String transportName)
          Send the given message content to the receiver, whose Locator is given.
 

Method Detail

createLocator

Locator createLocator(java.lang.String name,
                      JasBean agentInitInfo,
                      java.lang.String transportName)

bindMsgListenerToTransport

void bindMsgListenerToTransport(MessageListener listener,
                                java.lang.String listenerName,
                                Locator locator,
                                java.lang.String transportName)
                                throws NotLocatableException,
                                       TransportFailure
Bind the specified MessageListener, whose Locator is given to the given transport. Depending on the transport, the binding process will register the entity with the transport's lookup service, or create a server socket to accept client sockets, or what has to be done in order to communicate with other entities.

Parameters:
listener - MessageListener to receive messages via the specified transport using the given Locator.
listenerName - String containing the name of the receiver.
locator - Locator to be used to bind to the transport.
transportName - String indicating which transport to use.
Throws:
NotLocatableException - if locator is not a local locator.
TransportFailure - if the binding process fails

bindMsgListenerToTransport

void bindMsgListenerToTransport(MessageListener listener,
                                java.lang.String listenerName,
                                kaos.core.service.directory.KAoSAgentDescription listenerDesc)
                                throws NotLocatableException,
                                       TransportFailure
Bind the specified MessageListener, whose KAoSAgentDescription is given to the given transport. Depending on the transport, the binding process will register the entity with the transport's lookup service, or create a server socket to accept client sockets, or what has to be done in order to communicate with other entities.

Parameters:
listener - MessageListener to receive messages using the Locator, retrieved from the given KAoSAgentDescription.
listenerName - String containing the name of the receiver.
listenerDesc - KAoSAgentDescription to be used to retrieve the Locator of the MessageListener and the name of the transport to bind to.
Throws:
NotLocatableException - if locator is not a local locator.
TransportFailure - if the binding process fails

bindToTransport

MessageReceiver bindToTransport(java.lang.String receiverName,
                                Locator receiverLocator,
                                java.lang.String transportName)
                                throws NotLocatableException,
                                       TransportFailure
Throws:
NotLocatableException
TransportFailure

sendMessageTo

void sendMessageTo(kaos.core.service.directory.KAoSAgentDescription senderDesc,
                   TransportMessage receivedMsg,
                   java.io.Serializable content)
                   throws NotLocatableException,
                          TransportFailure
Send the given message content to the receiver, from whom the receivedMsg was received. This method is defined to be used for entities, who are replying to the receivedMsg.

Parameters:
senderDesc - KAoSAgentDescription of the sender. Based on the description, the sender Locator and name will be determined.
receivedMsg - TransportMessage that was received by the sender. Based on that the receiver Locator and name will be determined.
content - Serializable content of the message to be sent out.
Throws:
NotLocatableException - if the receiver cannot be located.
TransportFailure - if transport fails during message send.

sendMessageTo

void sendMessageTo(Locator senderLocator,
                   Locator receiverLocator,
                   java.lang.String senderName,
                   java.lang.String receiverName,
                   java.lang.String fipaPerformative,
                   java.io.Serializable content,
                   java.lang.String transportName)
                   throws NotLocatableException,
                          TransportFailure
Send the given message content to the receiver, whose Locator is given.

Parameters:
senderLocator - Locator of the sender.
receiverLocator - Locator of the receiver.
senderName - String containing the name of the sender.
receiverName - String containing the name of the receiver.
fipaPerformative - String containing the FIPA performative describing the message intent.
content - Serializable containing the message content.
transportName - String containing the name of the transport to be used.
Throws:
NotLocatableException - if the receiver cannot be located.
TransportFailure - if transport fails during message send.

sendMessageTo

void sendMessageTo(Locator senderLocator,
                   Locator receiverLocator,
                   java.lang.String senderName,
                   java.lang.String receiverName,
                   java.lang.String fipaPerformative,
                   java.io.Serializable content)
                   throws NotLocatableException,
                          TransportFailure
Send the given message content to the receiver, whose Locator is given.

Parameters:
senderLocator - Locator of the sender.
receiverLocator - Locator of the receiver.
senderName - String containing the name of the sender.
receiverName - String containing the name of the receiver.
fipaPerformative - String containing the FIPA performative describing the message intent.
content - Serializable containing the message content.
Throws:
NotLocatableException - if the receiver cannot be located.
TransportFailure - if transport fails during message send.

getSupportedTransportsNames

java.util.List<java.lang.String> getSupportedTransportsNames()
Return the names of the currently supported transports.

Returns:
a List containing Strings representing names of supported transports.

isTransportSupported

boolean isTransportSupported(java.lang.String name)
Answer true if the given transport is supported, otherwise, answer false.

Parameters:
name - String containing the name of the transport in question.
Returns:
a boolean indicating if the given transport is supported.

getServiceRoot

kaos.core.service.KAoSServiceRoot getServiceRoot(java.lang.String transportName)
Return KAoSServiceRoot for the specified transportName. This is method is used internally by other csi components.

Parameters:
transportName - String containing the name of the transport to create a KAoSServiceRoot for.
Returns:
a KAoSServiceRoot specific for the transportName.


Copyright © 2006 IHMC All Rights Reserved.