org.sapia.ubik.rmi.server.transport.http
Class HttpTransportProvider

java.lang.Object
  extended by org.sapia.ubik.rmi.server.transport.http.HttpTransportProvider
All Implemented Interfaces:
HttpConsts, TransportProvider

public class HttpTransportProvider
extends java.lang.Object
implements TransportProvider, HttpConsts

An instance of this class creates HttpRmiServer instances, as well as client-side connections (using Jakartas HTTP client). It is the entry-point into Ubik's HTTP tranport layer.

For the properties that an instance of this class takes (and their default values), see the HttpConsts interface.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2004 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site
See Also:
HttpConsts, HttpRmiServer

Field Summary
 
Fields inherited from interface org.sapia.ubik.rmi.server.transport.http.HttpConsts
DEFAULT_CONTEXT_PATH, DEFAULT_HTTP_PORT, DEFAULT_HTTP_TRANSPORT_TYPE, HTTP_PORT_KEY, PATH_KEY, SERVER_URL_KEY
 
Constructor Summary
HttpTransportProvider()
           
HttpTransportProvider(java.lang.String transportType)
           
HttpTransportProvider(java.lang.String transportType, java.io.File baseDir)
           
 
Method Summary
 Connections getPoolFor(ServerAddress address)
          Returns a client connection pool to the given server address.
 ServiceMapper getServiceMapper()
          Returns the service mapper that is held within this instance.
 ServiceMapper getServices()
           
 java.lang.String getTransportType()
          Returns this instance's "transport type".
 Server newDefaultServer()
          This method is called by Ubik RMI's runtime when a server is needed on the client side to recieve asynchronous responses (i.e.: callbacks).
 Server newServer(java.util.Properties props)
          Returns a server implementation.
 void shutdown()
          Shuts down this provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpTransportProvider

public HttpTransportProvider()

HttpTransportProvider

public HttpTransportProvider(java.lang.String transportType)
Parameters:
transportType - a "transport type" identifier.

HttpTransportProvider

public HttpTransportProvider(java.lang.String transportType,
                             java.io.File baseDir)
Parameters:
transportType - a "transport type" identifier.
Method Detail

getServices

public ServiceMapper getServices()
Returns:
the ServiceMapper that holds this instance`s request handlers ("services", in the Simple API's terms).

getPoolFor

public Connections getPoolFor(ServerAddress address)
                       throws java.rmi.RemoteException
Description copied from interface: TransportProvider
Returns a client connection pool to the given server address.

Specified by:
getPoolFor in interface TransportProvider
Parameters:
address - a ServerAddress.
Returns:
a Connection.
Throws:
java.rmi.RemoteException - if a problem occurs creating the connection.
See Also:
TransportProvider.getPoolFor(org.sapia.ubik.net.ServerAddress)

getTransportType

public java.lang.String getTransportType()
Description copied from interface: TransportProvider
Returns this instance's "transport type".

Specified by:
getTransportType in interface TransportProvider
Returns:
a transport type.
See Also:
TransportProvider.getTransportType()

newDefaultServer

public Server newDefaultServer()
                        throws java.rmi.RemoteException
Description copied from interface: TransportProvider
This method is called by Ubik RMI's runtime when a server is needed on the client side to recieve asynchronous responses (i.e.: callbacks). Implementations must in this case provide a "default" Server instance.

Specified by:
newDefaultServer in interface TransportProvider
Returns:
a Server.
Throws:
java.rmi.RemoteException
See Also:
TransportProvider.newDefaultServer()

newServer

public Server newServer(java.util.Properties props)
                 throws java.rmi.RemoteException
Description copied from interface: TransportProvider
Returns a server implementation.

Specified by:
newServer in interface TransportProvider
Parameters:
props - the Properties used to create the server.
Returns:
a Server instance.
Throws:
java.rmi.RemoteException
See Also:
TransportProvider.newServer(java.util.Properties)

shutdown

public void shutdown()
Description copied from interface: TransportProvider
Shuts down this provider.

Specified by:
shutdown in interface TransportProvider
See Also:
TransportProvider.shutdown()

getServiceMapper

public ServiceMapper getServiceMapper()
Returns the service mapper that is held within this instance. Other services can be added, associated to different context paths. This allows other types of requests (non-Ubik ones) to be processed by the same HTTP server.

Returns:
the ServiceMapper that this instance holds.


Copyright © 2010 Sapia OSS. All Rights Reserved.