S - The (super) type of services this factory creates stubs for (e. g.
set S to
ADEPT2Service to
limit stub creation to remote ADEPT2 services).public interface ADEPT2StubFactory<S>
CommunicationService defined by this interface are
responsible for creating stubs which represent the corresponding remote
services/callback objects on remote side.| Modifier and Type | Method and Description |
|---|---|
<T extends S> |
getInvocationHandler(java.net.URI remoteObjectIdentifier,
java.lang.Class<T> remoteIface,
boolean create)
Returns the InvocationHandler for the remote service/callback object that
is associated with the designated remote object identifier and the
designated remote interface.
|
<T extends S> |
getServiceStub(java.net.URI remoteObjectIdentifier,
java.lang.Class<T> remoteInterface)
Returns the stub ready to invoke operations remotely on the service or
callback object described by the given URI.
|
void |
removeStub(java.net.URI remoteObjectIdentifier)
Removes the stub with the designated identifier if it is cached.
|
<T extends S> T getServiceStub(java.net.URI remoteObjectIdentifier, java.lang.Class<T> remoteInterface)
T - The type (interface) of the service/callback object that must be
a sub type of that type this factory .remoteObjectIdentifier - The Identifier of the service/callback object
instance to create a stub for.remoteInterface - The interface used to access the remote service/the
callback object.java.lang.IllegalArgumentException - If the stub can not handle the
communication required by the URI.<T extends S> java.lang.reflect.InvocationHandler getInvocationHandler(java.net.URI remoteObjectIdentifier, java.lang.Class<T> remoteIface, boolean create)
remoteObjectIdentifier - The identifier of the requested remote
service/callback object.remoteIface - The interface of the requested remote service/callback
object.create - Whether the invocation handler should be created. Only let it
create if you remove it later.InvocationHandler associated with the given
remoteObjectIdentifier or null if no InvocationHandler
exists for the given remoteObjectIdentifier.void removeStub(java.net.URI remoteObjectIdentifier)
remoteObjectIdentifier - The identifier of the service or callback
object to remove the stub from.