com.vaadin.terminal.gwt.server.
Class WebApplicationContext
java.lang.Object
com.vaadin.terminal.gwt.server.AbstractWebApplicationContext
com.vaadin.terminal.gwt.server.WebApplicationContext
All Implemented Interfaces:
ApplicationContext, Serializable, EventListener, HttpSessionBindingListener
Direct Known Subclasses:
- extends AbstractWebApplicationContext
public class WebApplicationContext
Web application context for Vaadin applications.
This is automatically added as a HttpSessionBindingListener
when
added to a HttpSession
.
Since:
3.1
Version:
6.8.18
Author:
Vaadin Ltd.
See Also:
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)
- Overrides:
startTransaction
in classAbstractWebApplicationContext
- Parameters:
application
- The application associated with the transaction.request
- the HTTP or portlet request that triggered the transaction.
Description copied from class: AbstractWebApplicationContext
Sends a notification that a transaction is starting.
endTransaction
protected void endTransaction(Application application,
Object request)
- Overrides:
endTransaction
in classAbstractWebApplicationContext
- Parameters:
application
- The application associated with the transaction.request
- the HTTP or portlet request that triggered the transaction.
Description copied from class: AbstractWebApplicationContext
Sends a notification that a transaction has ended.
valueUnbound
public void valueUnbound(HttpSessionBindingEvent event)
- Specified by:
valueUnbound
in interfaceHttpSessionBindingListener
- Overrides:
valueUnbound
in classAbstractWebApplicationContext
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()
- Returns:
- The application base directory or null if the application has no base directory.
- See Also:
ApplicationContext.getBaseDirectory()
Gets the application context base directory.
getHttpSession
public HttpSession getHttpSession()
- Returns:
- HttpSession this application context resides in.
Gets the http-session application is running in.
getApplicationContext
public static WebApplicationContext getApplicationContext(HttpSession session)
- Parameters:
session
- the HTTP session.- Returns:
- the application context for HttpSession.
Gets the application context for an HttpSession.
addApplication
protected void addApplication(Application application)
getApplicationManager
public CommunicationManager getApplicationManager(Application application,
AbstractApplicationServlet servlet)
- Parameters:
application
-- Returns:
- CommunicationManager
Gets communication manager for an application. If this application has not been running before, a new manager is created.