|
JavaGantt 2011.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.beesoft.gaia.app.Context
eu.beesoft.gaia.app.Application
public abstract class Application
Abstract superclass for each server application. It is created and managed by
the running ApplicationContainer
implementation.
You need override in you subclass only methods
getStartControllerClassName()
and getFile(String)
.
Constructor Summary | |
---|---|
Application()
Default constructor. |
Method Summary | |
---|---|
Context |
close()
Closes this application. |
static java.lang.String |
encryptPassword(java.lang.String password)
Encryptes given password with MD5 hash function. |
ApplicationContainer |
getApplicationContainer()
Returns an application container of this application. |
Context |
getCurrentContext()
Returns the current application context. |
abstract java.io.File |
getFile(java.lang.String fileName)
Returns a file with given fileName . |
java.lang.String |
getId()
Returns id of this application. |
static Application |
getInstance()
Returns current application (bound to running thread). |
long |
getLastConnectionTime()
Returns last time when this application was requested by the client. |
abstract java.lang.String |
getStartControllerClassName()
Returns the name of the controller that should be started when this application is created. |
long |
getTimeout()
Returns a time period to kill this application if no client request will be delivered in (default value is 1 hour). |
ApplicationResponse |
process(ApplicationRequest request)
Processes a client request by forwarding it to the appropriate controller. |
void |
setApplicationContainer(ApplicationContainer applicationContainer)
Sets an application container of this application. |
void |
setId(java.lang.String id)
Sets an application id. |
static void |
setInstance(Application application)
Sets the current application (bound to running thread). |
void |
setLastConnectionTime(long lastConnectionTime)
Sets last time when this application was requested by the client (in milliseconds since 1.1.1970). |
void |
setTimeout(long timeout)
Sets a time period to kill this application if no client request will be delivered in. |
void |
timedOut()
Finishes this application by invocation of ApplicationContainer.finishApplication(Application) method. |
Methods inherited from class eu.beesoft.gaia.app.Context |
---|
containsValue, containsValue, findValue, findValue, getApplication, getChildContext, getParentContext, getRunner, getStarter, getValue, getValue, isClosed, removeValue, removeValue, setRunner, setValue, setValue, startNewContext, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Application()
Method Detail |
---|
public static Application getInstance()
public static void setInstance(Application application)
ApplicationContainer
implementation.
application
- - application to set currentpublic java.lang.String getId()
ApplicationRequest
.
public void setId(java.lang.String id)
ApplicationContainer
implementation.
id
- - the id to setpublic long getLastConnectionTime()
public void setLastConnectionTime(long lastConnectionTime)
ApplicationContainer
implementation after client request is
processed.
public long getTimeout()
public void setTimeout(long timeout)
timeout
- - the timeout to setpublic ApplicationContainer getApplicationContainer()
public void setApplicationContainer(ApplicationContainer applicationContainer)
ApplicationContainer
implementation when this
application is created.
applicationContainer
- - the application container to setpublic Context getCurrentContext()
getCurrentContext
in class Context
public Context close()
close
in class Context
public ApplicationResponse process(ApplicationRequest request)
runner
controller in the current
context.
request
- - a client request to process
public void timedOut()
ApplicationContainer.finishApplication(Application)
method. Is
invoked from an application container when a client does not request
anything for more time than is an application timeout set.
public abstract java.io.File getFile(java.lang.String fileName)
fileName
. You need override this
method to map the given relative file name to absolute file name in file
system.
fileName
- - a relative name of the requested file
public abstract java.lang.String getStartControllerClassName()
public static java.lang.String encryptPassword(java.lang.String password)
password
- - text to encrypt
|
JavaGantt 2011.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |