com.itmill.toolkit.terminal.web
Class AjaxVariableMap

java.lang.Object
  extended by com.itmill.toolkit.terminal.web.AjaxVariableMap

public class AjaxVariableMap
extends Object

Variable map for ajax applications.

Since:
3.1
Version:
4.1.4
Author:
IT Mill Ltd.

Nested Class Summary
 class AjaxVariableMap.TerminalErrorImpl
          Implementation of VariableOwner.Error interface.
 class AjaxVariableMap.VariableOwnerErrorImpl
          Implementation of VariableOwner.Error interface.
 
Constructor Summary
AjaxVariableMap()
           
 
Method Summary
 Map handleVariables(HttpServletRequest req, Terminal.ErrorListener errorListener)
          Handles all variable changes in this request.
 String registerVariable(String name, Class type, Object value, VariableOwner owner)
          Registers a new variable.
 void unregisterVariable(String name, VariableOwner owner)
          Unregisters the variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AjaxVariableMap

public AjaxVariableMap()
Method Detail

registerVariable

public String registerVariable(String name,
                               Class type,
                               Object value,
                               VariableOwner owner)
Registers a new variable.

Parameters:
name - the Variable name.
type -
value -
owner - the Listener for variable changes.
Returns:
id to assigned for this variable.

unregisterVariable

public void unregisterVariable(String name,
                               VariableOwner owner)
Unregisters the variable.

Parameters:
name - the Variable name.
owner - the Listener for variable changes.

handleVariables

public Map handleVariables(HttpServletRequest req,
                           Terminal.ErrorListener errorListener)
                    throws IOException
Handles all variable changes in this request.

Parameters:
req - the HTTP request to handle.
errorListener - the listeners If the list is non null, only the listed listeners are served. Otherwise all the listeners are served.
Returns:
Name to Value[] mapping of unhandled variables.
Throws:
IOException - if the writing failed due to input/output error.


Copyright © 2000-2008 IT Mill Ltd. All Rights Reserved.