Voyager ORB

com.objectspace.voyager.transport
Class Transport

java.lang.Object
  |
  +--com.objectspace.voyager.transport.Transport

public class Transport
extends java.lang.Object

The Transport class is where all ITransport implementations and IRequestHandlers are registred.
An ITransport implementation provides specific network protocol services, like tcp or udp. The default transport provides the default networking protocol, for example, the TcpTransport allows all default communications to happen over the tcp/ip protocol. Thus all urls have an implied prefix, tcp://
An IRequestHandler implementation provides specific application protocol handling services, like vrmp or http. A request handler processes incoming data from any registered transport.

Version:
3.0

Method Summary
static ITransportConnection acquireConnection(java.lang.String xurl)
          Returns an existing or creates a new ITransportConnection implemetation connected to the given xurl.
static ITransportConnection acquireConnection(java.lang.String bindXURL, java.lang.String xurl)
          Returns an existing or creates a new ITransportConnection implemetation connected to the given xurl and locally bound to the given bindXURL value.
static ITransportServer acquireServer(java.lang.String xurl)
          Returns an existing or starts a new ITransportServer implementation for the given protocol, bind address, and port.
static void addRequestHandler(IRequestHandler handler)
          Adds a new IRequestHandler implementation.
static java.lang.String getDefaultTransport()
          Returns the default transport value.
static ITransportServer getServer(java.lang.String xurl)
          Returns an existing ITransportServer implementation for the given protocol, bind address, and port.
static boolean isLocal(java.lang.String xurl)
          Tests if the given xurl value references the local vm/host.
static ITransportConnection newConnection(java.lang.String xurl)
          Creates and returns a new connection to the given xurl value.
static void register(ITransport transport)
          Registers an ITransport implementation.
static void setDefaultTransport(java.lang.String transport)
          Sets the default transport protocol to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

register

public static void register(ITransport transport)
Registers an ITransport implementation.

setDefaultTransport

public static void setDefaultTransport(java.lang.String transport)
Sets the default transport protocol to use. A ITransport implementation registered with the same value returned by ITransport.getProtocol().

getDefaultTransport

public static java.lang.String getDefaultTransport()
Returns the default transport value. At startup this value is "tcp".

getServer

public static ITransportServer getServer(java.lang.String xurl)
Returns an existing ITransportServer implementation for the given protocol, bind address, and port. For example "tcp://somehost.com:8000".
If the protocol is not given, the default transport protocol is used.

acquireServer

public static ITransportServer acquireServer(java.lang.String xurl)
                                      throws java.io.IOException
Returns an existing or starts a new ITransportServer implementation for the given protocol, bind address, and port. For example "tcp://somehost.com:8000".
If the protocol is not given, the default transport protocol is used.
Use this method to allow voyager to listen on multiple ports with possibly different transport protocols. For example, port 8000 can listen for tcp connections, and port 7000 can listen for upd datagrams.
Throws:
java.io.IOException - Thrown if server cannot be created on given url.

acquireConnection

public static ITransportConnection acquireConnection(java.lang.String xurl)
                                              throws java.io.IOException
Returns an existing or creates a new ITransportConnection implemetation connected to the given xurl. For example, "tcp://somehost.com:800" will return a TcpConnection to the host listening on somehost.com:8000.
Throws:
java.io.IOException - Thrown if server cannot be created on given url.

acquireConnection

public static ITransportConnection acquireConnection(java.lang.String bindXURL,
                                                     java.lang.String xurl)
                                              throws java.io.IOException
Returns an existing or creates a new ITransportConnection implemetation connected to the given xurl and locally bound to the given bindXURL value. For example, "tcp://somehost.com:800" will return a TcpConnection to the host listening on somehost.com:8000.
Throws:
java.io.IOException - Thrown if connection cannot be created for given url.

newConnection

public static ITransportConnection newConnection(java.lang.String xurl)
                                          throws java.io.IOException
Creates and returns a new connection to the given xurl value.
Throws:
java.io.IOException - Thrown if connection cannot be created for given url.

isLocal

public static boolean isLocal(java.lang.String xurl)
Tests if the given xurl value references the local vm/host.

addRequestHandler

public static void addRequestHandler(IRequestHandler handler)
Adds a new IRequestHandler implementation.

ObjectSpace Inc.

(c) Copyright 1997-1999 ObjectSpace, Inc.
14850 Quorum Drive, Suite 500
Dallas, Texas 75240