public abstract class ServerApplication extends AbstractApplication implements org.tentackle.session.SessionPoolProvider, ConnectionManagerProvider
| Constructor and Description |
|---|
ServerApplication(String name,
Class<? extends RemoteDbConnectionImpl> connectionClass)
Creates an instance of an application server.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
configurePreferences() |
protected void |
configureSessionInfo(org.tentackle.session.SessionInfo sessionInfo)
Configures the session info.
|
ConnectionManager |
createConnectionManager()
Creates the connection manager for the client sessions.
|
protected DbServer |
createDbServer(Class<? extends RemoteDbConnectionImpl> connectionClass)
Creates the DbServer instance (but does not start it).
The default implementation creates a DbServer. |
org.tentackle.session.SessionPool |
createSessionPool()
Creates the logical SessionPool.
|
protected void |
doFinishStartup()
Finishes the startup.
The default implementation starts the modification thread, unless "--nomodthread" given, creates the connection manager, the Db pool,
and the DbServer instance. |
protected void |
doLogin()
Connects the server to the database backend.
|
protected void |
doStartDbServer()
Starts the RMI-server.
|
protected void |
doStop(int exitValue)
Terminates the application server.
|
protected void |
doStop(int exitValue,
Exception ex)
Terminates the application server.
|
org.tentackle.misc.CommandLine |
getCommandLine()
Gets the command line.
|
ConnectionManager |
getConnectionManager()
Gets the connection manager.
|
DbServer |
getDbServer()
Gets the RMI server.
|
static ServerApplication |
getServerApplication()
Gets the running server application.
|
org.tentackle.session.SessionPool |
getSessionPool() |
boolean |
isServer() |
void |
setSessionInfo(org.tentackle.session.SessionInfo sessionInfo) |
void |
start()
Starts the application server without further arguments.
|
void |
start(String[] args)
Starts the application server.
|
void |
stop()
Gracefully terminates the application server.
|
applyProperties, configureModificationTracker, configureSecurityManager, createDomainContext, createSession, createSessionInfo, deregisterJdbcDrivers, detectContainer, detectJNLP, doConfigureApplication, doInitialize, getCreationTime, getDomainContext, getName, getProperties, getProperty, getRunningApplication, getSession, getSessionInfo, getUser, getUser, isDeployedByJNLP, isRunningInContainer, logStackdump, register, setDomainContext, setName, setProperties, toString, unregister, updateSessionInfoAfterLoginclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waiton, oppublic ServerApplication(String name, Class<? extends RemoteDbConnectionImpl> connectionClass)
name - the application nameconnectionClass - the class of the connection object to instantiate, null = default or from serverInfo's properties filepublic static ServerApplication getServerApplication()
public org.tentackle.misc.CommandLine getCommandLine()
public DbServer getDbServer()
public boolean isServer()
isServer in class AbstractApplicationpublic void start(String[] args)
args - the arguments (usually from commandline)public void start()
public void stop()
protected void configurePreferences()
configurePreferences in class AbstractApplicationprotected DbServer createDbServer(Class<? extends RemoteDbConnectionImpl> connectionClass) throws org.tentackle.misc.ApplicationException
DbServer.connectionClass - the class of the connection object to instantiate,
null = default or from serverInfo's properties fileorg.tentackle.misc.ApplicationException - if creating the DbServer failedpublic ConnectionManager createConnectionManager()
public ConnectionManager getConnectionManager()
getConnectionManager in interface ConnectionManagerProviderpublic org.tentackle.session.SessionPool createSessionPool()
public org.tentackle.session.SessionPool getSessionPool()
getSessionPool in interface org.tentackle.session.SessionPoolProviderpublic void setSessionInfo(org.tentackle.session.SessionInfo sessionInfo)
Overwridden to protect the sessioninfo once it is set.
setSessionInfo in class AbstractApplicationprotected void configureSessionInfo(org.tentackle.session.SessionInfo sessionInfo)
sessionInfo - the session infoprotected void doLogin()
throws org.tentackle.misc.ApplicationException
org.tentackle.misc.ApplicationException - if login failedprotected void doFinishStartup()
throws org.tentackle.misc.ApplicationException
"--nomodthread" given, creates the connection manager, the Db pool,
and the DbServer instance.doFinishStartup in class AbstractApplicationorg.tentackle.misc.ApplicationException - if finish failedprotected void doStartDbServer()
throws org.tentackle.misc.ApplicationException
dbServer.start().org.tentackle.misc.ApplicationException - if starting the dbServer failedprotected void doStop(int exitValue,
Exception ex)
exitValue - the doStop value for System.exit()ex - an exception causing the termination, null if noneprotected void doStop(int exitValue)
exitValue - the doStop value for System.exit()Tentackle - distributed, domain- and model-driven