public class RemoteEventServiceFactory extends Object
DefaultRemoteEventService
Modifier | Constructor and Description |
---|---|
protected |
RemoteEventServiceFactory()
The RemoteEventServiceFactory should be created via the getInstance method.
|
Modifier and Type | Method and Description |
---|---|
static RemoteEventServiceFactory |
getInstance()
This method should be used to create an instance of RemoteEventServiceFactory.
|
RemoteEventService |
getRemoteEventService()
This method should be used to create an instance of RemoteEventService.
|
RemoteEventService |
getRemoteEventService(RemoteEventConnector aRemoteEventConnector)
This method should be used to create an instance of RemoteEventService.
|
void |
registerClientSpecificHandler(ServiceDefTarget anAsyncServiceInstance,
ClientHandler aClientHandler)
Registers an user-/client-specific
ClientHandler to an existing service instance to provide the connection-/client-id with every request / server-call. |
void |
requestClientHandler(AsyncCallback<ClientHandler> anAsyncCallback)
Requests a
ClientHandler which contains the client-/connection-id and
provides it via the callback. |
static void |
reset()
That method should only be used in TestCases, because it resets the factory and the factory can't ensure
anymore that only one instance exists!
|
protected RemoteEventServiceFactory()
getInstance()
public static RemoteEventServiceFactory getInstance()
public RemoteEventService getRemoteEventService()
public RemoteEventService getRemoteEventService(RemoteEventConnector aRemoteEventConnector)
aRemoteEventConnector
- RemoteEventConnector
to specify the connection to the server sidepublic void requestClientHandler(AsyncCallback<ClientHandler> anAsyncCallback)
ClientHandler
which contains the client-/connection-id and
provides it via the callback. A server-call is only executed when no other server call was executed before because
at least one server call has to be executed before to generate the client-/connection-id at the server-side.anAsyncCallback
- callback with a ClientHandler
public void registerClientSpecificHandler(ServiceDefTarget anAsyncServiceInstance, ClientHandler aClientHandler)
ClientHandler
to an existing service instance to provide the connection-/client-id with every request / server-call.
That makes it possible to add user-specific events or domain-user-specific EventFilters dynamically when the ClientHandler
is provided. The ClientHandler
can be got from
requestClientHandler(com.google.gwt.user.client.rpc.AsyncCallback)
.
The ClientHandler
could also be transferred manually to your custom service to manage or use the connection-/client-ids
for user-specific events or domain-user-specific EventFilters.
The service could extend from RemoteEventServiceServlet or use the EventExecutorService to execute events.
Events (also user-specific) can also be executed directly from the client-side (see RemoteEventService
).anAsyncServiceInstance
- an async service (instance) which needs to add user-specific events or domain-user-specific EventFilters dynamically from the server-sideaClientHandler
- ClientHandler
to provide the connection-/client-id for user-specific events or domain-user-specific EventFilterspublic static void reset()
Copyright © 2012. All Rights Reserved.