NextApp Echo3
v3.0.b4

nextapp.echo.webcontainer
Class AbstractComponentSynchronizePeer.EventPeer

java.lang.Object
  extended by nextapp.echo.webcontainer.AbstractComponentSynchronizePeer.EventPeer
Enclosing class:
AbstractComponentSynchronizePeer

public static class AbstractComponentSynchronizePeer.EventPeer
extends java.lang.Object

Peer for synchronizing events between client and server. This is a convenience object that is used with the addEvent() method of the AbstractComponentSynchronizePeer object. This object will often be derived with overriding implementations of the hasListeners() method to return true in cases where the supported server-side Component has registered listeners of the appropriate type, such that only events that actually will result in code being executed will cause immediate server interactions.


Constructor Summary
AbstractComponentSynchronizePeer.EventPeer()
          Default constructor.
AbstractComponentSynchronizePeer.EventPeer(java.lang.String eventType, java.lang.String listenerPropertyName)
           
AbstractComponentSynchronizePeer.EventPeer(java.lang.String eventType, java.lang.String listenerPropertyName, java.lang.Class eventDataClass)
           
 
Method Summary
 java.lang.Class getEventDataClass()
          Returns the Class type of the event data that will be received from the client (used to determine serialization peer to use for processing)
 java.lang.String getEventType()
          Returns the client-side event type name.
 java.lang.String getListenerPropertyName()
          Returns the name of the event property in the Component, i.e., the property name of the PropertyChangeEvent fired when listeners are added/removed.
 boolean hasListeners(nextapp.echo.app.util.Context context, nextapp.echo.app.Component c)
          Determines if the Component has any listeners of this type.
 void processEvent(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, java.lang.Object eventData)
          Processes an event received from the client-side component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractComponentSynchronizePeer.EventPeer

public AbstractComponentSynchronizePeer.EventPeer()
Default constructor.


AbstractComponentSynchronizePeer.EventPeer

public AbstractComponentSynchronizePeer.EventPeer(java.lang.String eventType,
                                                  java.lang.String listenerPropertyName)
Parameters:
eventType - the name of the event, as serialized to the client
listenerPropertyName - the name of the event property in the Component, i.e., the property name of the PropertyChangeEvent fired when listeners are added/removed

AbstractComponentSynchronizePeer.EventPeer

public AbstractComponentSynchronizePeer.EventPeer(java.lang.String eventType,
                                                  java.lang.String listenerPropertyName,
                                                  java.lang.Class eventDataClass)
Parameters:
eventType - the name of the event, as serialized to the client
listenerPropertyName - the name of the event property in the Component, i.e., the property name of the PropertyChangeEvent fired when listeners are added/removed
eventDataClass - the Class type of the event data that will be received from the client (used to determine serialization peer to use for processing)
Method Detail

getEventType

public java.lang.String getEventType()
Returns the client-side event type name.

Returns:
the client-side event type name

getListenerPropertyName

public java.lang.String getListenerPropertyName()
Returns the name of the event property in the Component, i.e., the property name of the PropertyChangeEvent fired when listeners are added/removed.

Returns:
the name of the event property

getEventDataClass

public java.lang.Class getEventDataClass()
Returns the Class type of the event data that will be received from the client (used to determine serialization peer to use for processing)

Returns:
the event data Class

hasListeners

public boolean hasListeners(nextapp.echo.app.util.Context context,
                            nextapp.echo.app.Component c)
Determines if the Component has any listeners of this type. Default implementation simply returns true, should be overridden by derived implementations when possible to return false when no listeners of the this type exist.

Parameters:
context - the relevant Context
c - the Component
Returns:
true if the Component has registered listeners of this type

processEvent

public void processEvent(nextapp.echo.app.util.Context context,
                         nextapp.echo.app.Component component,
                         java.lang.Object eventData)
Processes an event received from the client-side component.

Parameters:
context - the relevant contextual information
component - the server-side Component
eventData - the serialized event data from the client (will be of type specified by getEventDataClass())

NextApp Echo3
v3.0.b4