com.itmill.toolkit.terminal.web
Class WebApplicationContext

java.lang.Object
  extended by com.itmill.toolkit.terminal.web.WebApplicationContext
All Implemented Interfaces:
ApplicationContext

public class WebApplicationContext
extends Object
implements ApplicationContext

Web application context for the IT Mill Toolkit applications.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.service.ApplicationContext
ApplicationContext.TransactionListener
 
Method Summary
 void addTransactionListener(ApplicationContext.TransactionListener listener)
          Adds the transaction listener to this context.
protected  void endTransaction(Application application, HttpServletRequest request)
          Notifies the transaction end.
 boolean equals(Object obj)
          Returns true if and only if the argument is not null and is a Boolean object that represents the same boolean value as this object.
static WebApplicationContext getApplicationContext(HttpSession session)
          Gets the application context for HttpSession.
 Collection getApplications()
          Gets the applications in this context.
 File getBaseDirectory()
          Gets the application context base directory.
 HttpSession getHttpSession()
          Gets the http-session application is running in.
 List getOpenAjaxHubMessages()
          OpenAjax Hub messaging.
 String getWindowFormAction(Window window)
          Gets the form action for given window.
 int hashCode()
          Returns the hash code value .
 void removeTransactionListener(ApplicationContext.TransactionListener listener)
          Removes the transaction listener from this context.
 void setWindowFormAction(Window window, String action)
          Sets the form action for given window.
protected  void startTransaction(Application application, HttpServletRequest request)
          Notifies the transaction start.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getWindowFormAction

public String getWindowFormAction(Window window)
Gets the form action for given window.

By default, this action is "", which preserves the current url. Commonly this is wanted to be set to application.getUrl.toString or window.getUrl.toString in order to clean any local links or parameters set from the action.

Parameters:
window - the Window for which the action is queried.
Returns:
the Action to be set into Form action attribute.

setWindowFormAction

public void setWindowFormAction(Window window,
                                String action)
Sets the form action for given window.

By default, this action is "", which preserves the current url. Commonly this is wanted to be set to application.getUrl.toString or window.getUrl.toString in order to clean any local links or parameters set from the action.

Parameters:
window - the Window for which the action is set.
action - the New action for the window.

getBaseDirectory

public File getBaseDirectory()
Gets the application context base directory.

Specified by:
getBaseDirectory in interface ApplicationContext
Returns:
The application base directory
See Also:
ApplicationContext.getBaseDirectory()

getHttpSession

public HttpSession getHttpSession()
Gets the http-session application is running in.

Returns:
HttpSession this application context resides in.

getApplications

public Collection getApplications()
Gets the applications in this context.

Specified by:
getApplications in interface ApplicationContext
Returns:
Collection containing all applications in this context
See Also:
ApplicationContext.getApplications()

getApplicationContext

public static WebApplicationContext getApplicationContext(HttpSession session)
Gets the application context for HttpSession.

Parameters:
session - the HTTP session.
Returns:
the application context for HttpSession.

equals

public boolean equals(Object obj)
Returns true if and only if the argument is not null and is a Boolean object that represents the same boolean value as this object.

Overrides:
equals in class Object
Parameters:
obj - the object to compare with.
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Returns the hash code value .

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

addTransactionListener

public void addTransactionListener(ApplicationContext.TransactionListener listener)
Adds the transaction listener to this context.

Specified by:
addTransactionListener in interface ApplicationContext
Parameters:
listener - the listener to be added.
See Also:
ApplicationContext.addTransactionListener(com.itmill.toolkit.service.ApplicationContext.TransactionListener)

removeTransactionListener

public void removeTransactionListener(ApplicationContext.TransactionListener listener)
Removes the transaction listener from this context.

Specified by:
removeTransactionListener in interface ApplicationContext
Parameters:
listener - the listener to be removed.
See Also:
ApplicationContext.removeTransactionListener(com.itmill.toolkit.service.ApplicationContext.TransactionListener)

startTransaction

protected void startTransaction(Application application,
                                HttpServletRequest request)
Notifies the transaction start.

Parameters:
application -
request - the HTTP request.

endTransaction

protected void endTransaction(Application application,
                              HttpServletRequest request)
Notifies the transaction end.

Parameters:
application -
request - the HTTP request.

getOpenAjaxHubMessages

public List getOpenAjaxHubMessages()
OpenAjax Hub messaging. API is under development and subject to change without further notice.

Returns:


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