public final class ServiceExporter extends Object
Constructor and Description |
---|
ServiceExporter() |
Modifier and Type | Method and Description |
---|---|
protected static Registry |
getRegistry()
Will look for the RMI registry.
|
static <E> void |
registerService(Class<E> serviceInterface,
E instance)
Will register a service using the default name.
|
static <E> void |
registerService(String rmiName,
E instance)
Will register a service using the given RMI name.
|
protected static void |
testRmiConfig()
Does some checks on RMI configuration
|
static void |
unregisterService(Class<?> serviceInterface)
Will unregister a service using the default name.
|
static void |
unregisterService(String rmiName)
Will unregister a service using the given RMI name.
|
protected static void testRmiConfig()
protected static Registry getRegistry() throws RemoteException
RemoteException
- in case it is not possible to get the registrypublic static <E> void registerService(Class<E> serviceInterface, E instance) throws RemoteException
E
- some interface classserviceInterface
- the interface used to bind the service. The RMI
name will be generated from this class nameinstance
- the service instance to bindRemoteException
- in case the registry is not reachablepublic static <E> void registerService(String rmiName, E instance) throws RemoteException
E
- some interface classrmiName
- the RMI name used to bind the service in the registryinstance
- the service instance to bindRemoteException
- in case the registry is not reachablepublic static void unregisterService(Class<?> serviceInterface) throws RemoteException, NotBoundException
serviceInterface
- the interface used to unbind the service. The RMI
name will be generated from this class nameRemoteException
- in case the registry is not reachableNotBoundException
- in case the given name is not boundpublic static void unregisterService(String rmiName) throws RemoteException, NotBoundException
rmiName
- the RMI name used to unbind the service in the registryRemoteException
- in case the registry is not reachableNotBoundException
- in case the given name is not boundCopyright © 2004–2020 CodeLutin. All rights reserved.