de.novanic.eventservice.client.event
Class GWTRemoteEventConnector

java.lang.Object
  extended by de.novanic.eventservice.client.event.DefaultRemoteEventConnector
      extended by de.novanic.eventservice.client.event.GWTRemoteEventConnector
All Implemented Interfaces:
RemoteEventConnector

public final class GWTRemoteEventConnector
extends DefaultRemoteEventConnector

RemoteEventConnector should handle the connections between client- and the server side. GWTRemoteEventConnector uses the GWT-RPC mechanism to communicate with the server side.

Author:
sstrohschein
Date: 12.10.2008
Time: 11:16:23

Method Summary
 void activateStart(Domain aDomain, EventFilter anEventFilter, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
          Activates the connector for the domain.
 void deactivate(Domain aDomain, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
          Deactivates the connector for the domain (no events can be got from the domain).
 void deactivate(java.util.Set<Domain> aDomains, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
          Deactivates the connector for the domains (no events can be got from the domains).
 void deregisterEventFilter(Domain aDomain, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
          Deregisters the EventFilter for a domain.
 void init(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
          That method is called to execute the first server call (for initialization).
protected  void listen(com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<DomainEvent>> aCallback)
          Starts listening for events (listen call to the server side).
 void registerEventFilter(Domain aDomain, EventFilter anEventFilter, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
          Registers an EventFilter for a domain.
 void registerUnlistenEvent(UnlistenEventListener.Scope anUnlistenScope, UnlistenEvent anUnlistenEvent, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
          Registers an UnlistenEvent to the server side which will be triggered when a timeout or unlisten/deactivation for a domain occurs.
 
Methods inherited from class de.novanic.eventservice.client.event.DefaultRemoteEventConnector
activate, deactivate, isActive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public void init(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
That method is called to execute the first server call (for initialization).

Parameters:
aCallback - callback

activateStart

public void activateStart(Domain aDomain,
                          EventFilter anEventFilter,
                          com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Activates the connector for the domain. An EventFilter to filter events on the server side is optional.

Specified by:
activateStart in class DefaultRemoteEventConnector
Parameters:
aDomain - domain to activate
anEventFilter - EventFilter to filter the events on the server side (optional)
aCallback - callback

deactivate

public void deactivate(java.util.Set<Domain> aDomains,
                       com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Deactivates the connector for the domains (no events can be got from the domains).

Parameters:
aDomains - domains to deactivate
aCallback - callback

deactivate

public void deactivate(Domain aDomain,
                       com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Deactivates the connector for the domain (no events can be got from the domain).

Parameters:
aDomain - domain to deactivate
aCallback - callback

registerUnlistenEvent

public void registerUnlistenEvent(UnlistenEventListener.Scope anUnlistenScope,
                                  UnlistenEvent anUnlistenEvent,
                                  com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Registers an UnlistenEvent to the server side which will be triggered when a timeout or unlisten/deactivation for a domain occurs.

Specified by:
registerUnlistenEvent in interface RemoteEventConnector
Overrides:
registerUnlistenEvent in class DefaultRemoteEventConnector
Parameters:
anUnlistenScope - scope of the unlisten events to receive
anUnlistenEvent - UnlistenEvent which can contain custom data
aCallback - callback

registerEventFilter

public void registerEventFilter(Domain aDomain,
                                EventFilter anEventFilter,
                                com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Registers an EventFilter for a domain. That can be used when the domain is already activated and an EventFilter is needed later or isn't available when the domain becomes active.

Parameters:
aDomain - domain
anEventFilter - EventFilter to filter the events on the server side (optional)
aCallback - callback

deregisterEventFilter

public void deregisterEventFilter(Domain aDomain,
                                  com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
Deregisters the EventFilter for a domain.

Parameters:
aDomain - domain to remove the EventFilter from
aCallback - callback

listen

protected void listen(com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<DomainEvent>> aCallback)
Starts listening for events (listen call to the server side).

Specified by:
listen in class DefaultRemoteEventConnector
Parameters:
aCallback - callback