org.directwebremoting.impl
Class DefaultCallbackHelper

java.lang.Object
  extended by org.directwebremoting.impl.DefaultCallbackHelper
All Implemented Interfaces:
CallbackHelper

public class DefaultCallbackHelper
extends java.lang.Object
implements CallbackHelper

The default implementation of CallbackHelper

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Field Summary
static java.lang.String KEY_CALLBACK
          The key that we use in a script session to store Callbacks
static java.lang.String KEY_TYPE
          The key that we use in a script session to store Callbacks
 
Constructor Summary
DefaultCallbackHelper()
           
 
Method Summary
 java.lang.String createUniqueId()
          Callbacks need a unique ID
static
<T> void
executeCallback(java.lang.String key, RealRawData data)
          The reverse of CallbackHelper.saveCallback(Callback, Class) which executes a Callback which has been called by the browser
<T> java.lang.String
saveCallback(Callback<T> callback, java.lang.Class<T> type)
          Used by the many proxy classes to record a callback for later calling
 void setIdGenerator(IdGenerator idGenerator)
          The id generator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_CALLBACK

public static final java.lang.String KEY_CALLBACK
The key that we use in a script session to store Callbacks

See Also:
Constant Field Values

KEY_TYPE

public static final java.lang.String KEY_TYPE
The key that we use in a script session to store Callbacks

See Also:
Constant Field Values
Constructor Detail

DefaultCallbackHelper

public DefaultCallbackHelper()
Method Detail

saveCallback

public <T> java.lang.String saveCallback(Callback<T> callback,
                                         java.lang.Class<T> type)
Description copied from interface: CallbackHelper
Used by the many proxy classes to record a callback for later calling

Specified by:
saveCallback in interface CallbackHelper
Parameters:
callback - The callback that acts on the type
type - The type of the data that we are recording
Returns:
A key under which the data is stored

executeCallback

public static <T> void executeCallback(java.lang.String key,
                                       RealRawData data)
                            throws ConversionException
The reverse of CallbackHelper.saveCallback(Callback, Class) which executes a Callback which has been called by the browser

Throws:
ConversionException

createUniqueId

public java.lang.String createUniqueId()
Callbacks need a unique ID


setIdGenerator

public void setIdGenerator(IdGenerator idGenerator)
The id generator


Copyright 2008