NextApp Echo3
v3.0.b4

nextapp.echo.webcontainer
Class ClientMessage

java.lang.Object
  extended by nextapp.echo.webcontainer.ClientMessage

public class ClientMessage
extends java.lang.Object

The incoming XML message which synchronizes the state of the server to that of the client. Provides global facility to register processors to handle directive types. Processes DOm and invokes registered processors on individual messages.


Nested Class Summary
static interface ClientMessage.Processor
          Interface for Processors which may be associated with a specific type of <dir> (directive) element in the XML message.
 
Field Summary
static java.lang.String TYPE_INITIALIZE
           
 
Constructor Summary
ClientMessage(org.w3c.dom.Document document)
          Creates a new ClientMessage.
 
Method Summary
 org.w3c.dom.Document getDocument()
          Returns the XML DOM received from the client.
 int getTransactionId()
          Returns the transaction identifier, used for determining if the client has the current application state.
 java.lang.String getType()
          Returns the request type, if provided, e.g., TYPE_INITIALIZE to indicate the initial synchronization.
 void process(nextapp.echo.app.util.Context context)
          Processes the top-level directives of the ClientMessage, invoking the registered ClientMesage.Processors associated with each top-level directive type.
static void register(java.lang.String name, java.lang.Class processorClass)
          Registers a ClientMessage.Processor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_INITIALIZE

public static final java.lang.String TYPE_INITIALIZE
See Also:
Constant Field Values
Constructor Detail

ClientMessage

public ClientMessage(org.w3c.dom.Document document)
              throws java.io.IOException
Creates a new ClientMessage.

Parameters:
document - the XML DOM received from the client
Throws:
java.io.IOException
Method Detail

register

public static void register(java.lang.String name,
                            java.lang.Class processorClass)
Registers a ClientMessage.Processor.

Parameters:
name - the directive name for which the processor will be invoked
processorClass - the Class of the processor which should be instantiated to process the specified directive name

getDocument

public org.w3c.dom.Document getDocument()
Returns the XML DOM received from the client.

Returns:
the XML DOM

getTransactionId

public int getTransactionId()
Returns the transaction identifier, used for determining if the client has the current application state.

Returns:
the transaction identifier

getType

public java.lang.String getType()
Returns the request type, if provided, e.g., TYPE_INITIALIZE to indicate the initial synchronization.

Returns:
the request type

process

public void process(nextapp.echo.app.util.Context context)
             throws java.io.IOException
Processes the top-level directives of the ClientMessage, invoking the registered ClientMesage.Processors associated with each top-level directive type.

Parameters:
context - the Context
Throws:
java.io.IOException

NextApp Echo3
v3.0.b4