|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.novanic.eventservice.client.event.DefaultRemoteEventService
public final class DefaultRemoteEventService
The RemoteEventService supports listening to the server via RemoteEventListeners (RemoteEventListener).
It keeps a connection to the server. When an event occurred at the server, the RemoteEventService informs the RemoteEventListeners
about the event and starts listening at the server again. When no RemoteEventListeners registered anymore, the
RemoteEventService stops listening till new RemoteEventListeners are registered.
The listening works with a domain/context scope. See the documentation/manual to get more information about the
listening concept.
| Method Summary | |
|---|---|
void |
addListener(Domain aDomain,
RemoteEventListener aRemoteListener)
Adds a listener for a domain. |
void |
addListener(Domain aDomain,
RemoteEventListener aRemoteListener,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Adds a listener for a domain. |
void |
addListener(Domain aDomain,
RemoteEventListener aRemoteListener,
EventFilter anEventFilter)
Adds a listener for a domain. |
void |
addListener(Domain aDomain,
RemoteEventListener aRemoteListener,
EventFilter anEventFilter,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Adds a listener for a domain. |
void |
addUnlistenListener(UnlistenEventListener.Scope anUnlistenScope,
UnlistenEventListener anUnlistenEventListener,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Registers an UnlistenEventListener to listen for all
user/client domain deregistrations and timeouts. |
void |
addUnlistenListener(UnlistenEventListener.Scope anUnlistenScope,
UnlistenEventListener anUnlistenEventListener,
UnlistenEvent anUnlistenEvent,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Registers an UnlistenEventListener to listen for all
user/client domain deregistrations and timeouts. |
void |
addUnlistenListener(UnlistenEventListener anUnlistenEventListener,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Registers an UnlistenEventListener to listen for all
user/client domain deregistrations and timeouts. |
void |
addUnlistenListener(UnlistenEventListener anUnlistenEventListener,
UnlistenEvent anUnlistenEvent,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Registers an UnlistenEventListener to listen for all
user/client domain deregistrations and timeouts. |
void |
deregisterEventFilter(Domain aDomain)
Deregisters the EventFilter for a domain. |
void |
deregisterEventFilter(Domain aDomain,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Deregisters the EventFilter for a domain. |
java.util.Set<Domain> |
getActiveDomains()
Returns all active domains (all domains where the client has listeners registered). |
java.util.List<RemoteEventListener> |
getRegisteredListeners(Domain aDomain)
Returns all registered listeners of a domain. |
boolean |
isActive()
Checks if the RemoteEventService is active (listening). |
void |
registerEventFilter(Domain aDomain,
EventFilter anEventFilter)
Registers an EventFilter for a domain. |
void |
registerEventFilter(Domain aDomain,
EventFilter anEventFilter,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Registers an EventFilter for a domain. |
void |
removeListener(Domain aDomain,
RemoteEventListener aRemoteListener)
Removes a listener for a domain. |
void |
removeListener(Domain aDomain,
RemoteEventListener aRemoteListener,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Removes a listener for a domain. |
void |
removeListeners()
Removes all RemoteEventListeners and deactivates the RemoteEventService (stop listening). |
void |
removeListeners(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Removes all RemoteEventListeners and deactivates the RemoteEventService (stop listening). |
void |
removeListeners(Domain aDomain)
Stops listening for the corresponding domain. |
void |
removeListeners(Domain aDomain,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Stops listening for the corresponding domain. |
void |
removeListeners(java.util.Set<Domain> aDomains)
Calls unlisten for a set of domains (stop listening for these domains). |
void |
removeListeners(java.util.Set<Domain> aDomains,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Calls unlisten for a set of domains (stop listening for these domains). |
void |
removeUnlistenListener(UnlistenEventListener anUnlistenEventListener,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Removes an UnlistenEventListener. |
void |
removeUnlistenListeners(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Stops listening for UnlistenEvent instances. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void addListener(Domain aDomain,
RemoteEventListener aRemoteListener)
addListener in interface RemoteEventServiceaDomain - domainaRemoteListener - new listener
public void addListener(Domain aDomain,
RemoteEventListener aRemoteListener,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
addListener in interface RemoteEventServiceaDomain - domainaRemoteListener - new listeneraCallback - callback (only called when no listener is already registered for the domain)
public void addListener(Domain aDomain,
RemoteEventListener aRemoteListener,
EventFilter anEventFilter)
addListener in interface RemoteEventServiceaDomain - domainaRemoteListener - new listeneranEventFilter - EventFilter to filter the events before RemoteEventListener
public void addListener(Domain aDomain,
RemoteEventListener aRemoteListener,
EventFilter anEventFilter,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
addListener in interface RemoteEventServiceaDomain - domainaRemoteListener - new listeneranEventFilter - EventFilter to filter the events before RemoteEventListeneraCallback - callback (only called when no listener is registered for the domain)
public void addUnlistenListener(UnlistenEventListener anUnlistenEventListener,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
UnlistenEventListener to listen for all
user/client domain deregistrations and timeouts. The scope for unlisten events to receive is set to
UnlistenEventListener.Scope.UNLISTEN by default.
To use other scopes see
RemoteEventService.addUnlistenListener(de.novanic.eventservice.client.event.listener.unlisten.UnlistenEventListener.Scope, de.novanic.eventservice.client.event.listener.unlisten.UnlistenEventListener, com.google.gwt.user.client.rpc.AsyncCallback).
addUnlistenListener in interface RemoteEventServiceanUnlistenEventListener - UnlistenEventListener
to listen for all user/client domain deregistrations and timeouts.aCallback - callback
public void addUnlistenListener(UnlistenEventListener.Scope anUnlistenScope,
UnlistenEventListener anUnlistenEventListener,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
UnlistenEventListener to listen for all
user/client domain deregistrations and timeouts.
addUnlistenListener in interface RemoteEventServiceanUnlistenEventListener - UnlistenEventListener
to listen for all user/client domain deregistrations and timeouts.anUnlistenScope - scope of the unlisten events to receiveaCallback - callback
public void addUnlistenListener(UnlistenEventListener anUnlistenEventListener,
UnlistenEvent anUnlistenEvent,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
UnlistenEventListener to listen for all
user/client domain deregistrations and timeouts. The custom UnlistenEvent
will be registered at the server side and transferred to all users/clients which have an UnlistenEventListener
registered. That UnlistenEvent can for example contain user information
of your specific user-system to recover the user in your user-system on a timeout. The scope for unlisten events to receive is set to
UnlistenEventListener.Scope.UNLISTEN by default.
To use other scopes see
RemoteEventService.addUnlistenListener(de.novanic.eventservice.client.event.listener.unlisten.UnlistenEventListener.Scope, de.novanic.eventservice.client.event.listener.unlisten.UnlistenEventListener, de.novanic.eventservice.client.event.listener.unlisten.UnlistenEvent, com.google.gwt.user.client.rpc.AsyncCallback).
addUnlistenListener in interface RemoteEventServiceanUnlistenEventListener - UnlistenEventListener
to listen for all user/client domain deregistrations and timeouts.anUnlistenEvent - UnlistenEvent which can contain custom dataaCallback - callback
public void addUnlistenListener(UnlistenEventListener.Scope anUnlistenScope,
UnlistenEventListener anUnlistenEventListener,
UnlistenEvent anUnlistenEvent,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
UnlistenEventListener to listen for all
user/client domain deregistrations and timeouts. The custom UnlistenEvent
will be registered at the server side and transferred to all users/clients which have an UnlistenEventListener
registered. That UnlistenEvent can for example contain user information
of your specific user-system to recover the user in your user-system on a timeout.
addUnlistenListener in interface RemoteEventServiceanUnlistenScope - scope of the unlisten events to receiveanUnlistenEventListener - UnlistenEventListener
to listen for all user/client domain deregistrations and timeouts.anUnlistenEvent - UnlistenEvent which can contain custom dataaCallback - callback
public void removeListener(Domain aDomain,
RemoteEventListener aRemoteListener)
removeListener in interface RemoteEventServiceaDomain - domainaRemoteListener - listener to remove
public void removeListener(Domain aDomain,
RemoteEventListener aRemoteListener,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
removeListener in interface RemoteEventServiceaDomain - domainaRemoteListener - listener to removeaCallback - callback
public void registerEventFilter(Domain aDomain,
EventFilter anEventFilter)
registerEventFilter in interface RemoteEventServiceaDomain - domainanEventFilter - EventFilter to filter the events before RemoteEventListener
public void registerEventFilter(Domain aDomain,
EventFilter anEventFilter,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
registerEventFilter in interface RemoteEventServiceaDomain - domainanEventFilter - EventFilter to filter the events before RemoteEventListeneraCallback - callbackpublic void deregisterEventFilter(Domain aDomain)
deregisterEventFilter in interface RemoteEventServiceaDomain - domain to remove the EventFilter from
public void deregisterEventFilter(Domain aDomain,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
deregisterEventFilter in interface RemoteEventServiceaDomain - domain to remove the EventFilter fromaCallback - callbackpublic boolean isActive()
isActive in interface RemoteEventServicepublic java.util.Set<Domain> getActiveDomains()
getActiveDomains in interface RemoteEventServicepublic java.util.List<RemoteEventListener> getRegisteredListeners(Domain aDomain)
getRegisteredListeners in interface RemoteEventServiceaDomain - domain
public void removeListeners()
removeListeners in interface RemoteEventServicepublic void removeListeners(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
removeListeners in interface RemoteEventServiceaCallback - callback (only called when a listener is registered for the domain)public void removeListeners(java.util.Set<Domain> aDomains)
removeListeners() can be used to call unlisten for all domains.
removeListeners in interface RemoteEventServiceaDomains - domains to unlisten
public void removeListeners(java.util.Set<Domain> aDomains,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
removeListeners() can be used to call unlisten for all domains.
removeListeners in interface RemoteEventServiceaDomains - domains to unlistenaCallback - callback (only called when a listener is registered for the domain)public void removeListeners(Domain aDomain)
removeListeners() can be used to call unlisten for all domains.
removeListeners in interface RemoteEventServiceaDomain - domain to unlisten
public void removeListeners(Domain aDomain,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
removeListeners() can be used to call unlisten for all domains.
removeListeners in interface RemoteEventServiceaDomain - domain to unlistenaCallback - callback (only called when a listener is registered for the domain)
public void removeUnlistenListener(UnlistenEventListener anUnlistenEventListener,
com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
UnlistenEventListener.
The RemoteEventService will get inactive, when no other listeners are registered.
removeUnlistenListener in interface RemoteEventServiceanUnlistenEventListener - UnlistenEventListener to removeaCallback - callbackpublic void removeUnlistenListeners(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
UnlistenEvent instances.
removeUnlistenListeners in interface RemoteEventServiceaCallback - callback (only called when an UnlistenEventListener is registered)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||