kaos.core.service.transport.tcp
Class TCPMessageTransportService

java.lang.Object
  extended by kaos.core.service.transport.tcp.TCPMessageTransportService
All Implemented Interfaces:
java.io.Serializable

public class TCPMessageTransportService
extends java.lang.Object
implements java.io.Serializable

Since:
1.0
See Also:
Serialized Form

Field Summary
static java.lang.String DIRECTORY_HOST
           
static java.lang.String DIRECTORY_NAME
           
static java.lang.String DIRECTORY_PORT
           
static java.lang.String DIRECTORY_SERVICE_LOCATOR
           
static java.lang.String HOST
           
static java.lang.String NAME
           
static java.lang.String PORT
           
static java.lang.String TRANSPORT_SERVICE_HOST
           
static java.lang.String TRANSPORT_SERVICE_PORT
           
 
Constructor Summary
TCPMessageTransportService()
           
TCPMessageTransportService(ServiceProperties env)
           
 
Method Summary
 TransportMessage createTransportMessage()
          Create an empty TransportMessage suitable for attribute population and use.
 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.
static void main(java.lang.String[] args)
           
 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 whose 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 l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSPORT_SERVICE_HOST

public static final java.lang.String TRANSPORT_SERVICE_HOST
See Also:
Constant Field Values

TRANSPORT_SERVICE_PORT

public static final java.lang.String TRANSPORT_SERVICE_PORT
See Also:
Constant Field Values

DIRECTORY_NAME

public static final java.lang.String DIRECTORY_NAME
See Also:
Constant Field Values

DIRECTORY_HOST

public static final java.lang.String DIRECTORY_HOST
See Also:
Constant Field Values

DIRECTORY_PORT

public static final java.lang.String DIRECTORY_PORT
See Also:
Constant Field Values

DIRECTORY_SERVICE_LOCATOR

public static final java.lang.String DIRECTORY_SERVICE_LOCATOR
See Also:
Constant Field Values

HOST

public static final java.lang.String HOST
See Also:
Constant Field Values

PORT

public static final java.lang.String PORT
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values
Constructor Detail

TCPMessageTransportService

public TCPMessageTransportService()
                           throws TransportFailure
Throws:
TransportFailure

TCPMessageTransportService

public TCPMessageTransportService(ServiceProperties env)
                           throws TransportFailure
Throws:
TransportFailure
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. The transport service uses its own values for host name and port# of the Corba name server to set the corresponding properties in the locator. The locator doesn't have a name, so using it without setting its name will cause failure.

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

newLocalLocator

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

Parameters:
env - The jasbean object whose properties will be used to set this locator's corresponding properties.
Returns:
a Locator.
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 specified properties.
Throws:
TransportFailure - if any transport related failure occurs.

newMessageReceiver

public MessageReceiver newMessageReceiver()
                                   throws TransportFailure
Returns a new MessageReceiver suitable for local binding.

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 specified attributes.
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 l)
                 throws NotLocatableException,
                        TransportFailure
Throws:
NotLocatableException
TransportFailure

createTransportMessage

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

Returns:
an empty TransportMessage

main

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