public final class SimpleRMI extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SimpleRMI.Registry
Registry of services.
|
static interface |
SimpleRMI.ServerListener
Server-side implementations may implement this interface to receive notifications of server start and stop
|
Constructor and Description |
---|
SimpleRMI() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
createClient(Class<T> clazz,
InetSocketAddress address)
Creates a remote client proxy to the given address.
|
static <T> T |
createClient(Class<T> clazz,
InetSocketAddress address,
NetworkConfiguration netConfig)
Creates a remote client proxy to the given address.
|
static <T> T |
createLocalClient(Class<T> clazz,
T target)
Returns a local client proxy to the given service.
|
static GenericTCPServer |
createServer(SimpleRMI.Registry registry)
Creates a server that can host the list of services listed in the given registry.
|
static Object |
getLocalClientTarget(Object client)
Returns the underlying implementation of a local client proxy
|
static NetworkConfiguration |
getNetworkConfiguration(Object remoteClient)
Returns the network configuration for the given proxy.
|
static InetSocketAddress |
getRemoteClientAddress(Object remoteClient)
Returns the remote client address for the given proxy.
|
static boolean |
isRemoteProxy(Object client)
Returns whether the given client is a remote proxy handler
|
static <T> T |
transferNetworkConfiguration(Object from,
T to)
Returns a new remote client, obtaining a network configuration from another remote interface
|
static <T> T |
withNetworkConfiguration(T remoteClient,
NetworkConfiguration socketProvider)
Returns a new remote client, specifying the socket factory to use
|
public static GenericTCPServer createServer(SimpleRMI.Registry registry)
registry
- the registrypublic static <T> T createClient(Class<T> clazz, InetSocketAddress address)
T
- the service interfaceclazz
- the service interfaceaddress
- the address to connect to. must be the host and port of a server
that contains a registered implementation of the given service interface.public static <T> T createClient(Class<T> clazz, InetSocketAddress address, NetworkConfiguration netConfig)
T
- the service interfaceclazz
- the service interfaceaddress
- the address to connect to. must be the host and port of a server
that contains a registered implementation of the given service interface.netConfig
- the network configuration to usepublic static InetSocketAddress getRemoteClientAddress(Object remoteClient)
remoteClient
- the remote client proxy.public static NetworkConfiguration getNetworkConfiguration(Object remoteClient)
remoteClient
- the remote client proxy.public static <T> T transferNetworkConfiguration(Object from, T to)
from
- the remote interface from which to obtain the network configurationto
- the remote client that we want to set the network configuration onpublic static <T> T withNetworkConfiguration(T remoteClient, NetworkConfiguration socketProvider)
remoteClient
- the remote client proxysocketProvider
- the provider to usepublic static boolean isRemoteProxy(Object client)
client
- the clientpublic static <T> T createLocalClient(Class<T> clazz, T target)
T
- the service interfaceclazz
- the service interfacetarget
- the service implementationpublic static Object getLocalClientTarget(Object client)
client
- the local client proxy. Must be an object returned by createLocalClient(Class, Object)
Copyright © 2016 Actian Corporation. All rights reserved.