|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tentackle.appworx.AbstractApplication
org.tentackle.appworx.ConsoleApplication
public abstract class ConsoleApplication
Abstract class to handle the application's lifecycle for a console application (no gui).
Tentackle applications should extend this class and invoke start(java.lang.String[]).
To shutdown gracefully, application should invokd stop().
The subclass just needs to provide a main-method, for example:
MyApplication app = new MyApplication(); app.start(args); // do something... app.stop();
| Constructor Summary | |
|---|---|
ConsoleApplication(String name)
Creates an application. |
|
| Method Summary | |
|---|---|
ModificationThread |
createModificationThread()
Creates the modification thread ready for being started. |
protected void |
doFinishStartup()
Finishes the startup. Invoked after all has been displayed. |
protected ContextDb |
doLogin()
Connects to the database backend (or application server). |
protected void |
doStop(int exitValue)
Terminates the application gracefully. |
CommandLine |
getCommandLine()
Gets the command line. |
String |
getName()
Gets the application name. |
protected void |
installPreferences()
Installs the preferences backend. The default implementation installs the DbPreferencesFactory unless
"--nodbprefs" is given. |
protected void |
installSecurityManager()
installs the tentackle security manager |
void |
start(String[] args)
Launches the application. |
void |
stop()
Gracefully terminates the application. |
String |
toString()
Gets the application's name. |
| Methods inherited from class org.tentackle.appworx.AbstractApplication |
|---|
createContextDb, createDb, createUserInfo, detectEE, detectJNLP, doConfigureApplication, doInitialize, getContextDb, getDb, getProperties, getProperty, getRunningApplication, getUser, getUser, getUserInfo, isDeployedByEE, isDeployedByJNLP, register, securityRulesChanged, setContextDb, setProperties, setUserInfo, unregister, updateUserId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConsoleApplication(String name)
name - the application's name| Method Detail |
|---|
public void start(String[] args)
args - the arguments (usually from commandline)public void stop()
public String toString()
toString in class Objectpublic CommandLine getCommandLine()
public String getName()
public ModificationThread createModificationThread()
createModificationThread in class AbstractApplicationprotected void installPreferences()
DbPreferencesFactory unless
"--nodbprefs" is given.
The option "--sysprefs" forces usage of system preferences only.
"--roprefs" sets the preferences to readonly.
installPreferences in class AbstractApplicationprotected void installSecurityManager()
installSecurityManager in class AbstractApplication
protected ContextDb doLogin()
throws ApplicationException
ApplicationException
protected void doFinishStartup()
throws ApplicationException
"--nomodthread" given.
doFinishStartup in class AbstractApplicationApplicationExceptionprotected void doStop(int exitValue)
exitValue - the doStop value for System.exit()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||