org.directwebremoting.ui
Class Callback<T>

java.lang.Object
  extended by org.directwebremoting.ui.Callback<T>

public abstract class Callback<T>
extends java.lang.Object

A way to call functions in JavaScript that return data using a reverse ajax proxy.

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

Constructor Summary
Callback()
          Create a Callback from a DWR thread, i.e.
Callback(java.util.Collection<ScriptSession> sessionList)
          Used when you need to specify a group of browsers that will be providing the responses.
Callback(ScriptSession session)
          Used when you need to specify the browser that will be providing the response
 
Method Summary
abstract  void dataReturned(T data)
          A browser has completed some remote call as has data for you
 java.util.Collection<ScriptSession> getScriptSessions()
          Accessor for the ScriptSessions that will reply to the question.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Callback

public Callback()
Create a Callback from a DWR thread, i.e. where WebContextFactory.get() =! null


Callback

public Callback(ScriptSession session)
Used when you need to specify the browser that will be providing the response

Parameters:
session - The browser to answer the question

Callback

public Callback(java.util.Collection<ScriptSession> sessionList)
Used when you need to specify a group of browsers that will be providing the responses. The callback will be executed once per browser that replies.

Parameters:
sessionList - The browsers to answer the question
Method Detail

dataReturned

public abstract void dataReturned(T data)
A browser has completed some remote call as has data for you

Parameters:
data - The data returned by the browser

getScriptSessions

public java.util.Collection<ScriptSession> getScriptSessions()
Accessor for the ScriptSessions that will reply to the question. This method is generally for DWR internal use, but only because it's unlikely to be useful to others.

Returns:
An immutable list of browsers that may reply to the question.

Copyright 2008