|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.scooterframework.admin.ApplicationConfig
public class ApplicationConfig
ApplicationConfig class configures an application in one of the three modes.
In the WEB mode, the application runs in a web container. Its file structure follows Scooter's file structure, unless you reset locations of some files as specified below.
In the APP mode, the application runs outside of a web container. Its file structure follows Scooter's file structure, unless you reset locations of some files as specified below. Scooter's JUnit test uses this mode.
In the ORM mode, no web container is necessary to use scooter. Any application can use Scooter's Active Record or SQL Data Express (SDE) capability in their data access layer. This can be achieved by just using scooter.jar file and some config property files (database.properties, environment.properties, log4j.properties, and sql.properties). The config files must be on the classpath of the running application.
In the ORM mode, application's file structure does not need to follow Scooter's file structure. This is good for those applications that want to include Scooter in their own data access layers.
See sample stand-alone application scooter-orm for more details.
For either WEB or APP mode, application path is required. It is automatically set by WebApplicationStartListener for web application or detected for non-web application.
For example, it the application is located in c:\>project\petclinic, then the application path would be 'c:\>project\petclinic'.
In either WEB or APP mode, the following properties can be set through System property from command line.
Configurable System Properties and corresponding default values for web application: class.file.location => {app.path}/WEB-INF/classes property.file.location => {app.path}/WEB-INF/config source.file.location => {app.path}/WEB-INF/src reference.file.location => {scooter.home}/lib
Field Summary | |
---|---|
static boolean |
noConsoleDisplay
|
static java.lang.String |
SYSTEM_KEY_CLASSFILE
|
static java.lang.String |
SYSTEM_KEY_PLUGINFILE
|
static java.lang.String |
SYSTEM_KEY_PROPERTYFILE
|
static java.lang.String |
SYSTEM_KEY_REFERENCEFILE
|
static java.lang.String |
SYSTEM_KEY_SOURCEFILE
|
Method Summary | |
---|---|
boolean |
applicationStarted()
|
static ApplicationConfig |
configInstanceForApp()
Returns an instance of ApplicationConfig for non-web application based on Scooter's directory structure. |
static ApplicationConfig |
configInstanceForOrmAlone()
Returns an instance of ApplicationConfig for non-web application using only Scooter's ORM. |
static ApplicationConfig |
configInstanceForWeb(java.lang.String webappPath,
java.lang.String contextName)
Returns an instance of ApplicationConfig for web application. |
static java.lang.String |
detectRootPath()
|
void |
endApplication()
|
java.lang.String |
getApplicationPath()
|
long |
getApplicationStartTime()
|
java.lang.String |
getClassFileLocationPath()
|
java.lang.String |
getConfiguredMode()
|
java.lang.String |
getContextName()
|
static ApplicationConfig |
getInstance()
Returns an instance of ApplicationConfig. |
java.lang.String |
getPluginsPath()
|
java.lang.String |
getPropertyFileLocationPath()
|
java.lang.String |
getReferencesLibPath()
|
java.lang.String |
getRunningEnvironment()
Returns running environment |
static int |
getSessionCount()
Returns number of sessions in the container. |
java.lang.String |
getSourceFileLocationPath()
|
java.lang.String |
getWebappLibPath()
|
boolean |
isApp()
Return true if the current app is configured as a regular app. |
boolean |
isInDevelopmentEnvironment()
Checks if the current running environment is development environment. |
boolean |
isInProductionEnvironment()
Checks if the current running environment is production environment. |
boolean |
isInTestEnvironment()
Checks if the current running environment is test environment. |
boolean |
isOrmAlone()
Return true if the current app is configured to use orm alone. |
boolean |
isWebApp()
Return true if the current app is configured as a web app. |
void |
setClassFileLocationPath(java.lang.String classFileLocationPath)
|
void |
setPropertyFileLocationPath(java.lang.String propertyFileLocationPath)
|
void |
setRunningEnvironment(java.lang.String runningEnvironment)
|
void |
setSourceFileLocationPath(java.lang.String sourceFileLocationPath)
|
void |
startApplication()
|
void |
startORMApplication()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean noConsoleDisplay
public static final java.lang.String SYSTEM_KEY_CLASSFILE
public static final java.lang.String SYSTEM_KEY_PROPERTYFILE
public static final java.lang.String SYSTEM_KEY_SOURCEFILE
public static final java.lang.String SYSTEM_KEY_PLUGINFILE
public static final java.lang.String SYSTEM_KEY_REFERENCEFILE
Method Detail |
---|
public static ApplicationConfig configInstanceForWeb(java.lang.String webappPath, java.lang.String contextName)
public static ApplicationConfig configInstanceForApp()
This method assumes the current directory as the application's root directory.
public static ApplicationConfig configInstanceForOrmAlone()
This method assumes that Scooter's config files are on classpath of the calling application.
public static ApplicationConfig getInstance()
public void startORMApplication()
public void startApplication()
public void endApplication()
public static java.lang.String detectRootPath()
public static int getSessionCount()
public long getApplicationStartTime()
public java.lang.String getApplicationPath()
public java.lang.String getContextName()
public boolean applicationStarted()
public java.lang.String getConfiguredMode()
public boolean isWebApp()
public boolean isApp()
public boolean isOrmAlone()
public java.lang.String getRunningEnvironment()
public void setRunningEnvironment(java.lang.String runningEnvironment)
public boolean isInDevelopmentEnvironment()
public boolean isInTestEnvironment()
public boolean isInProductionEnvironment()
public java.lang.String getClassFileLocationPath()
public java.lang.String getPropertyFileLocationPath()
public java.lang.String getSourceFileLocationPath()
public java.lang.String getWebappLibPath()
public java.lang.String getPluginsPath()
public java.lang.String getReferencesLibPath()
public void setClassFileLocationPath(java.lang.String classFileLocationPath)
public void setPropertyFileLocationPath(java.lang.String propertyFileLocationPath)
public void setSourceFileLocationPath(java.lang.String sourceFileLocationPath)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |