NextApp Echo3
v3.0.b4

nextapp.echo.webcontainer
Interface ComponentSynchronizePeer

All Known Implementing Classes:
AbstractButtonPeer, AbstractComponentSynchronizePeer, AbstractListComponentPeer, ButtonPeer, CheckBoxPeer, ColumnPeer, ComponentPeer, CompositePeer, ContentPanePeer, GridPeer, LabelPeer, ListBoxPeer, PanelPeer, PasswordFieldPeer, RadioButtonPeer, RowPeer, SelectFieldPeer, SplitPanePeer, TablePeer, TextAreaPeer, TextComponentPeer, TextFieldPeer, ToggleButtonPeer, WindowPanePeer, WindowPeer

public interface ComponentSynchronizePeer

Peer for synchronizing the state of server-side Component objects with their equivalent client-side instances. Note about Contexts. Any context passed to any method in a ComponentSynchronizePeer must contain the following items:


Method Summary
 java.lang.String getClientComponentType(boolean shortType)
          Returns the remote client component type name.
 java.lang.Class getComponentClass()
          Returns the Class of Component supported by this peer.
 java.lang.Class getEventDataClass(java.lang.String eventType)
          Returns the Class of the event data that will be provided by the specified event type.
 java.util.Iterator getEventTypes(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component)
          Determines the (client-side) types of events which, when fired on the client, can result in immediate server notification.
 java.lang.Class getInputPropertyClass(java.lang.String propertyName)
          Returns the Class of the specified input property of the component.
 java.lang.Object getOutputProperty(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, java.lang.String propertyName, int propertyIndex)
          Returns the value of a specific output property.
 java.util.Iterator getOutputPropertyIndices(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, java.lang.String propertyName)
          Determines which indices of a particular property are set.
 java.lang.String getOutputPropertyMethodName(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, java.lang.String propertyName)
          Returns the name of the method that should be invoked to set the property on the remote client.
 java.util.Iterator getOutputPropertyNames(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component)
          Returns an Iterator over the collection of names of all output properties that should be rendered to the remote client.
 java.util.Iterator getUpdatedOutputPropertyNames(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, nextapp.echo.app.update.ServerComponentUpdate update)
          Returns an Iterator over the collection of names of all output properties that should be rendered to the client to complete the specified update.
 boolean hasListeners(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, java.lang.String clientEventType)
          Determines if the specified component has any listeners registered of the specified event type.
 boolean hasUpdatedListeners(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, nextapp.echo.app.update.ServerComponentUpdate update, java.lang.String clientEventType)
          Determines if any server-side listeners for a specific client-side event type have been added or removed in the specified ServerComponentUpdate.
 void init(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component)
          Initializes the peer.
 boolean isOutputPropertyIndexed(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, java.lang.String propertyName)
          Determines if the specified output property is indexed.
 boolean isOutputPropertyReferenced(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, java.lang.String propertyName)
          Determines if the specified property should be rendered-by-reference.
 void processEvent(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, java.lang.String eventType, java.lang.Object eventData)
          Processes an event received from the client.
 void storeInputProperty(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, java.lang.String propertyName, int propertyIndex, java.lang.Object newValue)
          Processes a property update from the client.
 

Method Detail

getClientComponentType

java.lang.String getClientComponentType(boolean shortType)
Returns the remote client component type name.

Parameters:
shortType - flag indicating whether short type or normal type name should be returned
Returns:
the client component type name

getComponentClass

java.lang.Class getComponentClass()
Returns the Class of Component supported by this peer.

Returns:
the Class

getEventDataClass

java.lang.Class getEventDataClass(java.lang.String eventType)
Returns the Class of the event data that will be provided by the specified event type.

Parameters:
eventType - the type of the event
Returns:
the event data Class

getEventTypes

java.util.Iterator getEventTypes(nextapp.echo.app.util.Context context,
                                 nextapp.echo.app.Component component)
Determines the (client-side) types of events which, when fired on the client, can result in immediate server notification. This method should return ALL the types of ANY such events.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the Component being rendered
Returns:
an Iterator over a collection of Strings of the remote client event type names

getInputPropertyClass

java.lang.Class getInputPropertyClass(java.lang.String propertyName)
Returns the Class of the specified input property of the component.

Parameters:
propertyName - the name of the property
Returns:
the property Class

getOutputProperty

java.lang.Object getOutputProperty(nextapp.echo.app.util.Context context,
                                   nextapp.echo.app.Component component,
                                   java.lang.String propertyName,
                                   int propertyIndex)
Returns the value of a specific output property.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the Component being rendered
propertyName - the name of the property being rendered
propertyIndex - the property index (only relevant for indexed properties, -1 will be provided for non-indexed properties)
Returns:
the property value

getOutputPropertyIndices

java.util.Iterator getOutputPropertyIndices(nextapp.echo.app.util.Context context,
                                            nextapp.echo.app.Component component,
                                            java.lang.String propertyName)
Determines which indices of a particular property are set. This method will only be invoked on properties where isOutputPropertyIndexed() has returned true.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the component
propertyName - the property name
Returns:
an Iterator that returns the set indices in incrementing order as Integers

getOutputPropertyMethodName

java.lang.String getOutputPropertyMethodName(nextapp.echo.app.util.Context context,
                                             nextapp.echo.app.Component component,
                                             java.lang.String propertyName)
Returns the name of the method that should be invoked to set the property on the remote client. If null is returned, the default "setProperty()" will be invoked to store the property in the remote component's style. This default behavior should be used in almost cases.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the component
propertyName - the property name
Returns:
the property name

getOutputPropertyNames

java.util.Iterator getOutputPropertyNames(nextapp.echo.app.util.Context context,
                                          nextapp.echo.app.Component component)
Returns an Iterator over the collection of names of all output properties that should be rendered to the remote client. Only the names of properties with non-default values should be returned.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the component
Returns:
an Iterator of property names

getUpdatedOutputPropertyNames

java.util.Iterator getUpdatedOutputPropertyNames(nextapp.echo.app.util.Context context,
                                                 nextapp.echo.app.Component component,
                                                 nextapp.echo.app.update.ServerComponentUpdate update)
Returns an Iterator over the collection of names of all output properties that should be rendered to the client to complete the specified update. Only the names of properties taht have been updated by the update should be returned (including those whose values have changed to null. Client-specific may be included as necessary.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the component
update - the ServerComponentUpdate being rendered
Returns:
an Iterator of property names to update on the client

hasListeners

boolean hasListeners(nextapp.echo.app.util.Context context,
                     nextapp.echo.app.Component component,
                     java.lang.String clientEventType)
Determines if the specified component has any listeners registered of the specified event type.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the component
clientEventType - the client-side event type
Returns:
true if the server should be notified when the specified event type is fired on the client

hasUpdatedListeners

boolean hasUpdatedListeners(nextapp.echo.app.util.Context context,
                            nextapp.echo.app.Component component,
                            nextapp.echo.app.update.ServerComponentUpdate update,
                            java.lang.String clientEventType)
Determines if any server-side listeners for a specific client-side event type have been added or removed in the specified ServerComponentUpdate.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the component
update - the ServerComponentUpdate to process
clientEventType - the client-side event
Returns:
true if any listeners of the specified event type have been added or removed on the server, thus potentially changing whether the client should or should not immediately contact the server when the specified event is fired

init

void init(nextapp.echo.app.util.Context context,
          nextapp.echo.app.Component component)
Initializes the peer. This method will be invoked prior to rendering a specific Component for the first time.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the component being rendered

isOutputPropertyIndexed

boolean isOutputPropertyIndexed(nextapp.echo.app.util.Context context,
                                nextapp.echo.app.Component component,
                                java.lang.String propertyName)
Determines if the specified output property is indexed.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the component
propertyName - the property name
Returns:
true if the property is indexed

isOutputPropertyReferenced

boolean isOutputPropertyReferenced(nextapp.echo.app.util.Context context,
                                   nextapp.echo.app.Component component,
                                   java.lang.String propertyName)
Determines if the specified property should be rendered-by-reference. Properties that are rendered-by-reference will be specified in the "init" section of the outgoing server message and referenced by an identifier each time they are reused by components being rendered in that server message. This results in a bandwidth savings in cases where it is likely that the same property will be reused by multiple components (and assuming the rendered property value is reasonably large). The property value must implement both equals() and hashCode() or the same reference must be used for reference-based rendering to be effective. Rendering-by-reference is often best used for rendering model properties, e.g., a ListModel that might be used by several listboxes on the same screen.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the component
propertyName - the property name
Returns:
true if the property is rendered-by-reference

processEvent

void processEvent(nextapp.echo.app.util.Context context,
                  nextapp.echo.app.Component component,
                  java.lang.String eventType,
                  java.lang.Object eventData)
Processes an event received from the client. Implementations must take care to implement appropriate security, ensuring that the client may only fire specific appropriate events.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ClientMessage
  • ClientUpdateManager
component - the updated Component
eventType - the type of the event
eventData - arbitrary component/event-specific event-related data

storeInputProperty

void storeInputProperty(nextapp.echo.app.util.Context context,
                        nextapp.echo.app.Component component,
                        java.lang.String propertyName,
                        int propertyIndex,
                        java.lang.Object newValue)
Processes a property update from the client. Implementations must take care to implement appropriate security, ensuring that the client may only modify specific properties of a component that are user-mutable.

Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ClientMessage
  • ClientUpdateManager
component - the updated Component
propertyName - the name of the property
propertyIndex - the index of the property (or -1 in the typical case of a non-indexed property)
newValue - the new value of the property

NextApp Echo3
v3.0.b4