java.lang.Object
org.tentackle.app.AbstractApplication
org.tentackle.persist.app.AbstractServerApplication
- All Implemented Interfaces:
ConnectionManagerProvider,DomainContextProvider,org.tentackle.session.SessionPoolProvider,org.tentackle.session.SessionProvider
- Direct Known Subclasses:
ServerApplication
public abstract class AbstractServerApplication
extends AbstractApplication
implements org.tentackle.session.SessionPoolProvider, ConnectionManagerProvider
Base class for server applications.
- Author:
- harald
-
Field Summary
Fields inherited from class org.tentackle.app.AbstractApplication
DISABLE_MODIFICATION_TRACKER, DISABLE_SECURITY_MANAGER, ENABLE_STATISTICS, LOCALE, SCRIPTING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidcleanup()protected voidprotected voidprotected voidconfigureSessionInfo(org.tentackle.session.SessionInfo sessionInfo) Configures the session info.protected ConnectionManagerCreates the connection manager for the client sessions.org.tentackle.session.MultiUserSessionPoolCreates the remote session pool to serve the client sessions.org.tentackle.session.SessionPoolCreates the session pool to serve the client sessions.protected voidDeregisters all JDBC-Drivers loaded by the app's classloader.
Necessary in containers only (in case connected directly via JDBC and not via JNDI).protected voidDetects whether this application is running within a container.
The result can be retrieved byisRunningInContainer().protected voidorg.tentackle.session.MultiUserSessionPoolorg.tentackle.session.SessionPoolbooleanIndicates whether this application is running within a container.protected booleanprotected booleanprotected voidlogin()Connects the server to the database backend or another remote server.protected voidsetSessionInfo(org.tentackle.session.SessionInfo sessionInfo) protected voidstartup()Methods inherited from class org.tentackle.app.AbstractApplication
applyProperties, configure, configureSecurityManager, createDomainContext, createSession, createSessionInfo, getCommandLine, getCreationTime, getDomainContext, getName, getProperties, getProperty, getRunningApplication, getSessionInfo, getUser, getUser, getVersion, initialize, initializeScripting, isInteractive, isInteractiveImpl, isServer, logStackdump, register, setDomainContext, setProperties, start, start, stop, stop, toString, unregisterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tentackle.pdo.DomainContextProvider
on, op
-
Constructor Details
-
AbstractServerApplication
Creates a server.- Parameters:
name- the server's nameversion- the application version
-
-
Method Details
-
getSessionPool
public org.tentackle.session.SessionPool getSessionPool()- Specified by:
getSessionPoolin interfaceorg.tentackle.session.SessionPoolProvider
-
getRemoteSessionPool
public org.tentackle.session.MultiUserSessionPool getRemoteSessionPool()- Specified by:
getRemoteSessionPoolin interfaceorg.tentackle.session.SessionPoolProvider
-
isServerImpl
protected boolean isServerImpl()- Overrides:
isServerImplin classAbstractApplication
-
setSessionInfo
protected void setSessionInfo(org.tentackle.session.SessionInfo sessionInfo) Overwridden to protect the sessioninfo once it is set.
- Overrides:
setSessionInfoin classAbstractApplication
-
configurePreferences
protected void configurePreferences()- Overrides:
configurePreferencesin classAbstractApplication
-
configureModificationTracker
protected void configureModificationTracker()- Overrides:
configureModificationTrackerin classAbstractApplication
-
finishStartup
protected void finishStartup()- Overrides:
finishStartupin classAbstractApplication
-
createSessionPool
public org.tentackle.session.SessionPool createSessionPool()Creates the session pool to serve the client sessions.- Returns:
- the session pool
-
createRemoteSessionPool
public org.tentackle.session.MultiUserSessionPool createRemoteSessionPool()Creates the remote session pool to serve the client sessions.- Returns:
- the session pool
-
getSession
- Specified by:
getSessionin interfaceorg.tentackle.session.SessionProvider- Overrides:
getSessionin classAbstractApplication
-
createConnectionManager
Creates the connection manager for the client sessions. The default creates an MpxConnectionManager.- Returns:
- the connection manager
-
getConnectionManager
- Specified by:
getConnectionManagerin interfaceConnectionManagerProvider
-
configureSessionInfo
protected void configureSessionInfo(org.tentackle.session.SessionInfo sessionInfo) Configures the session info.- Parameters:
sessionInfo- the session info
-
startup
protected void startup()- Specified by:
startupin classAbstractApplication
-
login
protected void login()Connects the server to the database backend or another remote server. -
cleanup
protected void cleanup()- Overrides:
cleanupin classAbstractApplication
-
isRunningInContainer
public boolean isRunningInContainer()Indicates whether this application is running within a container.- Returns:
- true if running in a container, false if not
-
isSystemExitNecessaryToStop
protected boolean isSystemExitNecessaryToStop()- Overrides:
isSystemExitNecessaryToStopin classAbstractApplication
-
detectContainer
protected void detectContainer()Detects whether this application is running within a container.
The result can be retrieved byisRunningInContainer(). -
deregisterJdbcDrivers
Deregisters all JDBC-Drivers loaded by the app's classloader.
Necessary in containers only (in case connected directly via JDBC and not via JNDI). Avoids memleaks.- Parameters:
cl- the app's classloader
-
activateStatistics
protected void activateStatistics()- Overrides:
activateStatisticsin classAbstractApplication
-