com.vaadin.terminal.gwt.server
Class WebApplicationContext

java.lang.Object
  extended by com.vaadin.terminal.gwt.server.AbstractWebApplicationContext
      extended by com.vaadin.terminal.gwt.server.WebApplicationContext
All Implemented Interfaces:
ApplicationContext, Serializable, EventListener, HttpSessionBindingListener

public class WebApplicationContext
extends AbstractWebApplicationContext

Web application context for Vaadin applications. This is automatically added as a HttpSessionBindingListener when added to a HttpSession.

Since:
3.1
Version:
7.0.0.alpha3
Author:
Vaadin Ltd.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.service.ApplicationContext
ApplicationContext.TransactionListener
 
Field Summary
protected  HttpSession session
           
 
Fields inherited from class com.vaadin.terminal.gwt.server.AbstractWebApplicationContext
applications, applicationToAjaxAppMgrMap, browser, listeners
 
Constructor Summary
protected WebApplicationContext()
          Creates a new Web Application Context.
 
Method Summary
protected  void addApplication(Application application)
           
protected  void endTransaction(Application application, Object request)
          Sends a notification that a transaction has ended.
static WebApplicationContext getApplicationContext(HttpSession session)
          Gets the application context for an HttpSession.
 CommunicationManager getApplicationManager(Application application, AbstractApplicationServlet servlet)
          Gets communication manager for an application.
 File getBaseDirectory()
          Gets the application context base directory.
 HttpSession getHttpSession()
          Gets the http-session application is running in.
 void reinitializeSession()
          Discards the current session and creates a new session with the same contents.
protected  void startTransaction(Application application, Object request)
          Sends a notification that a transaction is starting.
 void valueUnbound(HttpSessionBindingEvent event)
           
 
Methods inherited from class com.vaadin.terminal.gwt.server.AbstractWebApplicationContext
addTransactionListener, generateApplicationResourceURL, getApplications, getBrowser, getLastRequestTime, getTotalSessionTime, getURLKey, isApplicationResourceURL, removeApplication, removeTransactionListener, setLastRequestTime, valueBound
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

protected transient HttpSession session
Constructor Detail

WebApplicationContext

protected WebApplicationContext()
Creates a new Web Application Context.

Method Detail

startTransaction

protected void startTransaction(Application application,
                                Object request)
Description copied from class: AbstractWebApplicationContext
Sends a notification that a transaction is starting.

Overrides:
startTransaction in class AbstractWebApplicationContext
Parameters:
application - The application associated with the transaction.
request - the HTTP or portlet request that triggered the transaction.

endTransaction

protected void endTransaction(Application application,
                              Object request)
Description copied from class: AbstractWebApplicationContext
Sends a notification that a transaction has ended.

Overrides:
endTransaction in class AbstractWebApplicationContext
Parameters:
application - The application associated with the transaction.
request - the HTTP or portlet request that triggered the transaction.

valueUnbound

public void valueUnbound(HttpSessionBindingEvent event)
Specified by:
valueUnbound in interface HttpSessionBindingListener
Overrides:
valueUnbound in class AbstractWebApplicationContext
See Also:
HttpSessionBindingListener.valueUnbound(HttpSessionBindingEvent)

reinitializeSession

public void reinitializeSession()
Discards the current session and creates a new session with the same contents. The purpose of this is to introduce a new session key in order to avoid session fixation attacks.


getBaseDirectory

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

Returns:
The application base directory or null if the application has no 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.

getApplicationContext

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

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

addApplication

protected void addApplication(Application application)

getApplicationManager

public CommunicationManager getApplicationManager(Application application,
                                                  AbstractApplicationServlet servlet)
Gets communication manager for an application. If this application has not been running before, a new manager is created.

Parameters:
application -
Returns:
CommunicationManager


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.