Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.httpServerTest.server.application
Class BasicTestApp  view BasicTestApp download BasicTestApp.java

java.lang.Object
  extended bycom.lutris.appserver.server.StandardApplication
      extended byorg.enhydra.httpServerTest.server.application.BasicTestApp
All Implemented Interfaces:
com.lutris.appserver.server.Application

public class BasicTestApp
extends com.lutris.appserver.server.StandardApplication

This is the basic application class object for the http server test. This class is very limited in its functionality and simply provides static references to a temporary directory location, setable through the appication configuration file, and a counter. The temorary directory is used for caching of files that are uploaded. The counter is used to ensure that each thread of this application, handling uploaded files, will create a unique sub-directory, under the specified temporary directory, to write to. This allows each thread to only account for uploaded files that occured on the current request being handled.


Field Summary
static java.lang.String APPLICATION_TAG
          This is the reference key used to grab the application specific section of the configuration file.
static com.lutris.util.Config config
          This is the global Config object that is shared by the whole application.
protected static java.lang.Long fileCacheDirCnt
          This is a static counter used by the presentation objects to ensure a unique sub-directory under the specified temporary base directory.
static java.lang.String HTTP_RESPONSE_OBJECT_DTD
          This is the reference key used to lookup the validation DTD for HttpResponseObject.
static java.lang.String httpResponseObjectDTD
          This holds the location of the DTD used to validate the HttpResponseObject when read from the application configuration file.
static java.lang.String TEMP_BASE_DIR
          This is the reference key used to lookup the temporary base directory in the application configuration file.
static java.lang.String temporaryBaseDir
          This holds the value of the temporary base direstory when read from the application configuration file.
 
Fields inherited from class com.lutris.appserver.server.StandardApplication
appName, data, databaseManager, defaultUrl, logChannel, presentationManager, sendCookieForNewSession, sessionManager, state, xmlcFactory
 
Fields inherited from interface com.lutris.appserver.server.Application
DEAD, HALTED, INCOMPLETE, RUNNING, STOPPED
 
Constructor Summary
BasicTestApp()
           
 
Method Summary
static long getFileCacheDirCnt()
          This is a static function to retrieve the next sequence of the conter variable held in this class.
 void startup(com.lutris.util.Config appConfig)
          This is the startup function called when this application is loaded.
 java.lang.String toHtml()
          This is an optional function, used only by the Multiserver's graphical administration.
 
Methods inherited from class com.lutris.appserver.server.StandardApplication
createDatabaseManager, createSession, createSessionManager, encodeUrl, encodeUrl, ensureSession, getApplicationData, getConfig, getDatabaseManager, getHttpPresentationManager, getLogChannel, getName, getSessionManager, getState, getXMLCFactory, initializeNewSession, printCopyrightHeader, requestPostProcessor, requestPreprocessor, restartup, servletRequestPreprocessor, setCookieForNewSession, setHttpPresentationManager, setLogChannel, setName, setXMLCFactory, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_RESPONSE_OBJECT_DTD

public static final java.lang.String HTTP_RESPONSE_OBJECT_DTD
This is the reference key used to lookup the validation DTD for HttpResponseObject. This value is specified in the application configuration file as 'Application.HttpResponseObjectDTD =

See Also:
Constant Field Values

TEMP_BASE_DIR

public static final java.lang.String TEMP_BASE_DIR
This is the reference key used to lookup the temporary base directory in the application configuration file. The expected key is 'Application.TemporaryBaseDir = '.

See Also:
Constant Field Values

APPLICATION_TAG

public static final java.lang.String APPLICATION_TAG
This is the reference key used to grab the application specific section of the configuration file. All application specific configuration variables begin with this tag 'Application.'.

See Also:
Constant Field Values

httpResponseObjectDTD

public static java.lang.String httpResponseObjectDTD
This holds the location of the DTD used to validate the HttpResponseObject when read from the application configuration file.


temporaryBaseDir

public static java.lang.String temporaryBaseDir
This holds the value of the temporary base direstory when read from the application configuration file.


fileCacheDirCnt

protected static java.lang.Long fileCacheDirCnt
This is a static counter used by the presentation objects to ensure a unique sub-directory under the specified temporary base directory. The directories created using this count variable are used to cache files uploaded from the client.


config

public static com.lutris.util.Config config
This is the global Config object that is shared by the whole application. If there was an error reading the file, this will be null.

See Also:
com.lutris.util.Config
Constructor Detail

BasicTestApp

public BasicTestApp()
Method Detail

startup

public void startup(com.lutris.util.Config appConfig)
             throws com.lutris.appserver.server.ApplicationException
This is the startup function called when this application is loaded. This function calls super.startup(appConfig) and then attempts to read the temporary base directory from the supplied configuration parameters. If this configuration setting is not found, this function will throw an excepion.


getFileCacheDirCnt

public static long getFileCacheDirCnt()
This is a static function to retrieve the next sequence of the conter variable held in this class. This function synchronizes on the fileCacheDirCnt and increments this count each time this function is called and then returns the new count.


toHtml

public java.lang.String toHtml()
This is an optional function, used only by the Multiserver's graphical administration. This bit of HTML appears in the status page for this application. You could add extra status info, for example a list of currently logged in users.