java.lang.Object
org.tentackle.app.AbstractApplication
org.tentackle.persist.app.AbstractServerApplication
org.tentackle.web.app.WebApplication<T>
- Type Parameters:
T- the web session key type
- All Implemented Interfaces:
org.tentackle.app.Application,org.tentackle.dbms.ConnectionManagerProvider,org.tentackle.pdo.DomainContextProvider,org.tentackle.session.SessionPoolProvider,org.tentackle.session.SessionProvider
Web Server Application.
Web applications usually run in a web container or application server.
- Author:
- harald
-
Field Summary
Fields inherited from class org.tentackle.app.AbstractApplication
DISABLE_MODIFICATION_TRACKER, DISABLE_SECURITY_MANAGER, ENABLE_STATISTICS, LOCALE, SCRIPTING -
Constructor Summary
ConstructorsConstructorDescriptionWebApplication(String name, String version) Creates an instance of a web application. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWebSession(T sessionKey, org.tentackle.session.SessionInfo sessionInfo) Adds a mapping between a web session key and a user's session info.
This is usually done in the login controller.protected voidcleanup()protected voidorg.tentackle.session.SessiongetSession(T sessionKey) Gets a persistence session from the session pool by a web session key.getSessionKeys(org.tentackle.session.SessionInfo sessionInfo) Gets the web session keys for a user session info.voidputSession(org.tentackle.session.Session session) Release a persistence session.
Should be invoked after sending/rendering the response to the web browser.voidremoveWebSession(T sessionKey) Removes a mapping between a web session key and a user session info.
This is usually done in the logout controller.protected voidstartup()Methods inherited from class org.tentackle.persist.app.AbstractServerApplication
activateStatistics, configureModificationTracker, configurePreferences, configureSessionInfo, createConnectionManager, createRemoteSessionPool, createSessionPool, deregisterJdbcDrivers, detectContainer, getConnectionManager, getRemoteSessionPool, getSession, getSessionPool, initializeScripting, isRunningInContainer, isServer, isSystemExitNecessaryToStop, login, logStatistics, setSessionInfo, validateValidatorsMethods inherited from class org.tentackle.app.AbstractApplication
applyProperties, configure, configureSecurityManager, createDomainContext, createSession, createSessionInfo, filterName, filterVersion, getCommandLine, getCreationTime, getDomainContext, getName, getProperties, getProperty, getPropertyAsChars, getSessionInfo, getVersion, initialize, isInteractive, logStackdump, setDomainContext, setProperties, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tentackle.app.Application
getUser, register, start, stop, unregisterMethods inherited from interface org.tentackle.pdo.DomainContextProvider
on, on, op, op
-
Constructor Details
-
WebApplication
Creates an instance of a web application.- Parameters:
name- the application name, null for default nameversion- the application version, null for default version
-
-
Method Details
-
addWebSession
Adds a mapping between a web session key and a user's session info.
This is usually done in the login controller. If a session with that key already exists, the session info will be replaced.- Parameters:
sessionKey- the unique web session keysessionInfo- the session info
-
removeWebSession
Removes a mapping between a web session key and a user session info.
This is usually done in the logout controller. If there is no such session, the method will do nothing.- Parameters:
sessionKey- the (unique) web session key
-
getSessionKeys
Gets the web session keys for a user session info.- Parameters:
sessionInfo- the user session info- Returns:
- the web session keys, never null
-
getSession
Gets a persistence session from the session pool by a web session key.- Parameters:
sessionKey- the web session key- Returns:
- the attached session or null if no such session
-
putSession
public void putSession(org.tentackle.session.Session session) Release a persistence session.
Should be invoked after sending/rendering the response to the web browser.- Parameters:
session- the persistence session to release
-
startup
protected void startup()- Overrides:
startupin classAbstractServerApplication
-
finishStartup
protected void finishStartup()- Overrides:
finishStartupin classAbstractServerApplication
-
cleanup
protected void cleanup()- Overrides:
cleanupin classAbstractServerApplication
-