de.novanic.eventservice.client.event
Class DefaultRemoteEventConnector

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

public abstract class DefaultRemoteEventConnector
extends java.lang.Object
implements RemoteEventConnector

RemoteEventConnector should handle the connections between client- and the server side.

Author:
sstrohschein
Date: 14.10.2008
Time: 11:34:45

Constructor Summary
DefaultRemoteEventConnector()
           
 
Method Summary
 void activate(Domain aDomain, EventFilter anEventFilter, EventNotification anEventNotification, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Void> aCallback)
          Activates the connector for the domain.
protected abstract  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()
          Deactivates the connector for all domains (no events can be got from the domains).
 boolean isActive()
          Checks if the connector is active (listening).
protected abstract  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 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.novanic.eventservice.client.event.RemoteEventConnector
deactivate, deactivate, deregisterEventFilter, init, registerEventFilter
 

Constructor Detail

DefaultRemoteEventConnector

public DefaultRemoteEventConnector()
Method Detail

deactivate

public void deactivate()
Deactivates the connector for all domains (no events can be got from the domains).

Specified by:
deactivate in interface RemoteEventConnector

isActive

public boolean isActive()
Checks if the connector is active (listening).

Specified by:
isActive in interface RemoteEventConnector
Returns:
true when active/listening, otherwise false

activate

public void activate(Domain aDomain,
                     EventFilter anEventFilter,
                     EventNotification anEventNotification,
                     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:
activate in interface RemoteEventConnector
Parameters:
aDomain - domain to activate
anEventFilter - EventFilter to filter the events on the server side (optional)
anEventNotification - supports the notification about incoming events
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. The UnlistenEvent will also be hold at the client side to trigger on local timeouts (for e.g. connection errors).

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

listen

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

Parameters:
aCallback - callback

activateStart

protected abstract 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.

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