com.threerings.presents.peer.util
Class PeerUtil
java.lang.Object
com.threerings.presents.peer.util.PeerUtil
public class PeerUtil
- extends Object
Static methods of general utility for peer nodes.
|
Method Summary |
static
|
createProviderProxy(Class<S> clazz,
T svc,
Client client)
Creates a proxy object implementing the specified provider interface (a subinterface of
InvocationProvider that forwards requests to the given service implementation
(a subinterface of InvocationService corresponding to the provider interface)
on the specified client. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_pmethods
protected static HashMap<Method,Method> _pmethods
- Maps provider interface methods to service interface methods.
PeerUtil
public PeerUtil()
createProviderProxy
public static <S extends InvocationProvider,T extends InvocationService<?>> S createProviderProxy(Class<S> clazz,
T svc,
Client client)
- Creates a proxy object implementing the specified provider interface (a subinterface of
InvocationProvider that forwards requests to the given service implementation
(a subinterface of InvocationService corresponding to the provider interface)
on the specified client. This is useful for server entities that need to call a method
either on the current server (with null as the caller parameter) or on a
peer server.
- Parameters:
clazz - the subclass of InvocationProvider desired to be implementedsvc - the implementation of the corresponding subclass of InvocationServiceclient - the client to pass to the service methods