JBoss Remoting 3.0.0.Beta2

org.jboss.remoting
Class Remoting

java.lang.Object
  extended by org.jboss.remoting.Remoting

public final class Remoting
extends Object

The standalone interface into Remoting. This class contains static methods that are useful to standalone programs for managing endpoints and services in a simple fashion.


Method Summary
static Endpoint createEndpoint(Executor executor, String name)
          Create an endpoint using the given Executor to execute tasks.
static Endpoint createEndpoint(String name)
          Create an endpoint.
static Endpoint createEndpoint(String name, int maxThreads)
          Create an endpoint.
static CloseableExecutor createExecutor(int maxThreads)
          Create a simple thread pool that is compatible with Remoting.
static
<I,O> Client<I,O>
createLocalClient(Endpoint endpoint, RequestListener<I,O> requestListener, Class<I> requestClass, Class<O> replyClass)
          Create a local client from a request listener.
static
<I,O> ClientSource<I,O>
createLocalClientSource(Endpoint endpoint, LocalServiceConfiguration<I,O> config)
          Create a local client source from a local service configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createEndpoint

public static Endpoint createEndpoint(String name)
Create an endpoint. The endpoint will create its own thread pool with a maximum of 10 threads.

Parameters:
name - the name of the endpoint
Returns:
the endpoint

createEndpoint

public static Endpoint createEndpoint(String name,
                                      int maxThreads)
Create an endpoint. The endpoint will create its own thread pool with a maximum of maxThreads threads.

Parameters:
name - the name of the endpoint
maxThreads - the maximum thread count
Returns:
the endpoint

createExecutor

public static CloseableExecutor createExecutor(int maxThreads)
Create a simple thread pool that is compatible with Remoting. The thread pool will have a maximum of maxThreads threads.

Parameters:
maxThreads - the maximum thread count
Returns:
a closeable executor

createEndpoint

public static Endpoint createEndpoint(Executor executor,
                                      String name)
Create an endpoint using the given Executor to execute tasks.

Parameters:
executor - the executor to use
name - the name of the endpoint
Returns:
the endpoint

createLocalClient

public static <I,O> Client<I,O> createLocalClient(Endpoint endpoint,
                                                  RequestListener<I,O> requestListener,
                                                  Class<I> requestClass,
                                                  Class<O> replyClass)
                                     throws IOException
Create a local client from a request listener. The client will retain the sole reference to the request listener, so when the client is closed, the listener will also be closed (unless the client is sent to a remote endpoint).

Type Parameters:
I - the request type
O - the reply type
Parameters:
endpoint - the endpoint to bind the request listener to
requestListener - the request listener
requestClass - the request class
replyClass - the reply class
Returns:
a new client
Throws:
IOException - if an error occurs

createLocalClientSource

public static <I,O> ClientSource<I,O> createLocalClientSource(Endpoint endpoint,
                                                              LocalServiceConfiguration<I,O> config)
                                                 throws IOException
Create a local client source from a local service configuration. The client source will be registered on the endpoint.

Type Parameters:
I - the request type
O - the reply type
Parameters:
endpoint - the endpoint to bind the service to
config - the service configuration
Returns:
a new client source
Throws:
IOException - if an error occurs

JBoss Remoting 3.0.0.Beta2

Copyright © 2008 JBoss, a division of Red Hat, Inc.