public class Main
extends java.lang.Object
implements java.lang.Runnable, org.apache.avalon.framework.activity.Disposable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPLICATION_CONFIG
parameter for the application container configuration file
|
static java.lang.String |
APPLICATION_HASSHUTDOWNHOOK
parameter for setting a shutdown hook
|
static java.lang.String |
APPLICATION_HOME
parameter for the application home directory
|
static java.lang.String |
APPLICATION_ISBLOCKING
parameter for blocking the main thread in Main.run()
|
static java.lang.String |
APPLICATION_NAME
parameter for the application name
|
static java.lang.String |
APPLICATION_TEMP
parameter for the application temporary directory
|
Constructor and Description |
---|
Main()
Constructor
|
Main(java.lang.String[] args)
Constructor
The following command line parameters are supported
--yaafi.cli.applicationName name
--yaafi.cli.applicationHome dir
--yaafi.cli.tempHome dir
--yaafi.cli.isBlocking [true|false]
--yaafi.cli.hasShutdownHook [true|false]
--yaafi.cli.config file
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Dispose the YAAFI container
|
java.lang.String |
getApplicationHome() |
java.lang.String |
getApplicationName() |
java.lang.String[] |
getArgs() |
java.lang.String |
getContainerConfigValue() |
org.apache.avalon.framework.logger.Logger |
getLogger() |
ServiceContainer |
getServiceContainer() |
org.apache.avalon.framework.service.ServiceManager |
getServiceManager() |
java.lang.String |
getTempHome() |
boolean |
hasShutdownHook() |
void |
initialize()
Initialize the instance
|
boolean |
isBlocking() |
boolean |
isInitialized() |
static void |
main(java.lang.String[] args)
The main method.
|
static java.io.File |
makeAbsoluteFile(java.io.File baseDir,
java.lang.String name)
Determines the file location of the given name.
|
java.io.File |
makeAbsoluteFile(java.lang.String fileName)
Locates the file for the given file name.
|
java.lang.String |
makeAbsolutePath(java.lang.String fileName)
Locates the file for the given file name.
|
void |
onWait()
Depending on the configuration this method might block
the calling thread or return immediatly.
|
void |
run()
Runs the instance by initializing it and potentially blocking
the invoking thread depending on the configuration.
|
void |
setApplicationHome(java.lang.String applicationHome) |
void |
setApplicationName(java.lang.String applicationName) |
void |
setArgs(java.lang.String[] args) |
void |
setContainerConfigValue(java.lang.String containerConfigValue) |
void |
setHasShutdownHook(boolean hasShutdownHook) |
void |
setHasShutdownHook(java.lang.Boolean hasShutdownHook) |
void |
setHasShutdownHook(java.lang.String hasShutdownHook) |
protected void |
setInitialized(boolean isInitialized) |
void |
setIsBlocking(boolean isBlocking) |
void |
setIsBlocking(java.lang.Boolean isBlocking) |
void |
setIsBlocking(java.lang.String isBlocking) |
void |
setLogger(org.apache.avalon.framework.logger.Logger logger) |
void |
setTempHome(java.lang.String tempHome) |
protected void |
shutdown()
Terminates the instance
|
java.lang.String |
toString() |
public static final java.lang.String APPLICATION_NAME
public static final java.lang.String APPLICATION_HOME
public static final java.lang.String APPLICATION_TEMP
public static final java.lang.String APPLICATION_CONFIG
public static final java.lang.String APPLICATION_HASSHUTDOWNHOOK
public static final java.lang.String APPLICATION_ISBLOCKING
public Main()
public Main(java.lang.String[] args)
args
- the command line argumentspublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- Command line argumentsjava.lang.Exception
- the execution failedpublic static java.io.File makeAbsoluteFile(java.io.File baseDir, java.lang.String name)
baseDir
- the base directoryname
- the filenamepublic void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
public void run()
run
in interface java.lang.Runnable
Runnable.run()
public void onWait()
public java.io.File makeAbsoluteFile(java.lang.String fileName)
fileName
- the filenamepublic java.lang.String makeAbsolutePath(java.lang.String fileName)
fileName
- the filenamepublic ServiceContainer getServiceContainer()
public org.apache.avalon.framework.service.ServiceManager getServiceManager()
public java.lang.String getApplicationHome()
public void setApplicationHome(java.lang.String applicationHome)
applicationHome
- The applicationHome to set.public java.lang.String getContainerConfigValue()
public void setContainerConfigValue(java.lang.String containerConfigValue)
containerConfigValue
- The containerConfigValue to set.public boolean isBlocking()
public void setIsBlocking(boolean isBlocking)
isBlocking
- The isBlocking to set.public void setIsBlocking(java.lang.Boolean isBlocking)
isBlocking
- The isBlocking to set.public void setIsBlocking(java.lang.String isBlocking)
isBlocking
- The isBlocking to set.public java.lang.String getTempHome()
public void setTempHome(java.lang.String tempHome)
tempHome
- The tempHome to set.public org.apache.avalon.framework.logger.Logger getLogger()
public void setLogger(org.apache.avalon.framework.logger.Logger logger)
logger
- The logger to set.public java.lang.String getApplicationName()
public void setApplicationName(java.lang.String applicationName)
applicationName
- The applicationName to set.public java.lang.String[] getArgs()
public void setArgs(java.lang.String[] args)
args
- The args to set.public boolean hasShutdownHook()
public void setHasShutdownHook(boolean hasShutdownHook)
hasShutdownHook
- The hasShutdownHook to set.public void setHasShutdownHook(java.lang.Boolean hasShutdownHook)
hasShutdownHook
- The hasShutdownHook to set.public void setHasShutdownHook(java.lang.String hasShutdownHook)
hasShutdownHook
- The hasShutdownHook to set.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean isInitialized()
protected void setInitialized(boolean isInitialized)
isInitialized
- The isInitialized to set.public void initialize() throws java.lang.Exception
java.lang.Exception
- the initialization failedprotected void shutdown()
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.