|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fulcrum.yaafi.cli.Main
public class Main
An example of the embedding of a YAAFI kernel inside an arbitrary application.
Field Summary | |
---|---|
static String |
APPLICATION_CONFIG
parameter for the application container configuration file |
static String |
APPLICATION_HASSHUTDOWNHOOK
parameter for setting a shutdown hook |
static String |
APPLICATION_HOME
parameter for the application home directory |
static String |
APPLICATION_ISBLOCKING
parameter for blocking the main thread in Main.run() |
static String |
APPLICATION_NAME
parameter for the application name |
static String |
APPLICATION_TEMP
parameter for the application temporary directory |
Constructor Summary | |
---|---|
Main()
Constructor |
|
Main(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 |
Method Summary | |
---|---|
void |
dispose()
Dispose the YAAFI container |
String |
getApplicationHome()
|
String |
getApplicationName()
|
String[] |
getArgs()
|
String |
getContainerConfigValue()
|
org.apache.avalon.framework.logger.Logger |
getLogger()
|
ServiceContainer |
getServiceContainer()
|
org.apache.avalon.framework.service.ServiceManager |
getServiceManager()
|
String |
getTempHome()
|
boolean |
hasShutdownHook()
|
void |
initialize()
Initialize the instance |
boolean |
isBlocking()
|
boolean |
isInitialized()
|
static void |
main(String[] args)
The main method. |
static File |
makeAbsoluteFile(File baseDir,
String name)
Determines the file location of the given name. |
File |
makeAbsoluteFile(String fileName)
Locates the file for the given file name. |
String |
makeAbsolutePath(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(String applicationHome)
|
void |
setApplicationName(String applicationName)
|
void |
setArgs(String[] args)
|
void |
setContainerConfigValue(String containerConfigValue)
|
void |
setHasShutdownHook(boolean hasShutdownHook)
|
void |
setHasShutdownHook(Boolean hasShutdownHook)
|
void |
setHasShutdownHook(String hasShutdownHook)
|
protected void |
setInitialized(boolean isInitialized)
|
void |
setIsBlocking(boolean isBlocking)
|
void |
setIsBlocking(Boolean isBlocking)
|
void |
setIsBlocking(String isBlocking)
|
void |
setLogger(org.apache.avalon.framework.logger.Logger logger)
|
void |
setTempHome(String tempHome)
|
protected void |
shutdown()
Terminates the instance |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String APPLICATION_NAME
public static final String APPLICATION_HOME
public static final String APPLICATION_TEMP
public static final String APPLICATION_CONFIG
public static final String APPLICATION_HASSHUTDOWNHOOK
public static final String APPLICATION_ISBLOCKING
Constructor Detail |
---|
public Main()
public Main(String[] args)
args
- the command line argumentsMethod Detail |
---|
public static void main(String[] args) throws Exception
args
- Command line arguments
Exception
- the execution failedpublic static File makeAbsoluteFile(File baseDir, String name)
baseDir
- the base directoryname
- the filename
public void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
public void run()
run
in interface Runnable
Runnable.run()
public void onWait()
public File makeAbsoluteFile(String fileName)
fileName
- the filename
public String makeAbsolutePath(String fileName)
fileName
- the filename
public ServiceContainer getServiceContainer()
public org.apache.avalon.framework.service.ServiceManager getServiceManager()
public String getApplicationHome()
public void setApplicationHome(String applicationHome)
applicationHome
- The applicationHome to set.public String getContainerConfigValue()
public void setContainerConfigValue(String containerConfigValue)
containerConfigValue
- The containerConfigValue to set.public boolean isBlocking()
public void setIsBlocking(boolean isBlocking)
isBlocking
- The isBlocking to set.public void setIsBlocking(Boolean isBlocking)
isBlocking
- The isBlocking to set.public void setIsBlocking(String isBlocking)
isBlocking
- The isBlocking to set.public String getTempHome()
public void setTempHome(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 String getApplicationName()
public void setApplicationName(String applicationName)
applicationName
- The applicationName to set.public String[] getArgs()
public void setArgs(String[] args)
args
- The args to set.public boolean hasShutdownHook()
public void setHasShutdownHook(boolean hasShutdownHook)
hasShutdownHook
- The hasShutdownHook to set.public void setHasShutdownHook(Boolean hasShutdownHook)
hasShutdownHook
- The hasShutdownHook to set.public void setHasShutdownHook(String hasShutdownHook)
hasShutdownHook
- The hasShutdownHook to set.public String toString()
toString
in class Object
Object.toString()
public boolean isInitialized()
protected void setInitialized(boolean isInitialized)
isInitialized
- The isInitialized to set.public void initialize() throws Exception
Exception
- the initialization failedprotected void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |