org.nuiton.util.rmi
Class RemoteProxyFactory

java.lang.Object
  extended by org.nuiton.util.rmi.RemoteProxyFactory

public class RemoteProxyFactory
extends Object

Factory to create RMI proxies to some given services.

Author:
Arnaud Thimel

Field Summary
protected static int PORT
           
protected static String REGISTRY_IP
           
 
Constructor Summary
RemoteProxyFactory()
           
 
Method Summary
static
<T> T
createProxy(Class<T> serviceInterface)
          Create a RMI proxy on the wanted service interface.
static
<T> T
createProxy(String rmiName, Class<T> serviceInterface)
          Create a RMI proxy on the wanted service interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORT

protected static final int PORT
See Also:
Constant Field Values

REGISTRY_IP

protected static final String REGISTRY_IP
See Also:
Constant Field Values
Constructor Detail

RemoteProxyFactory

public RemoteProxyFactory()
Method Detail

createProxy

public static <T> T createProxy(Class<T> serviceInterface)
                     throws RemoteException,
                            NotBoundException
Create a RMI proxy on the wanted service interface. The default RMI name will be used to find this service in the Registry.

Type Parameters:
T - some interface class
Parameters:
serviceInterface - The class of the service proxy to create
Returns:
A newly created proxy which interface is
Throws:
RemoteException - in case the registry is not reachable
NotBoundException - if the default RMI name cannot be found in the registry

createProxy

public static <T> T createProxy(String rmiName,
                                Class<T> serviceInterface)
                     throws RemoteException,
                            NotBoundException
Create a RMI proxy on the wanted service interface. The specific given RMI name will be used to find this service in the Registry.

Type Parameters:
T - some interface class
Parameters:
rmiName - The specific RMI name to use to find the service in the registry
serviceInterface - The class of the service proxy to create
Returns:
A newly created proxy which interface is
Throws:
RemoteException - in case the registry is not reachable
NotBoundException - if the default RMI name cannot be found in the registry


Copyright © 2004-2012 CodeLutin. All Rights Reserved.