|
SRJRCFrames v0.1.296 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.schwarzrot.app.support.AbstractApplicationLauncher<C>
C - - config type of applicationpublic abstract class AbstractApplicationLauncher<C extends AbstractSysConfig>
is a helper class called from main, responsable for all the grunt work at application-startup (i.e. fetch beans from context, setup services, load preferences ...).
typical usage:
class MyApplication implements MainEntry {
...
public static void main(String[] args) {
String contextBase = "de/schwarzrot/app/ctx/";
String appContext = contextBase + "application-context.xml";
String dataAccessCtx = contextBase + "data-access-context.xml";
String securityCtx = contextBase + "security-context.xml";
List sArgs = new ArrayList(Arrays.asList(args));
// if AnyClass needs some fake entries at commandline,
// it could add them to sArgs
new ApplicationLauncher(new MyApplication()
, new String[] { securityContext, dataAccessCtx, appCtx }
, sArgs).start();
}
}
The use-case of this class is very similar to the ApplicationLauncher from springframework, with the main difference, that this class supports application extensions with dynamically loaded jarfiles.
Such a jarfile-extension needs a Manifest-Entry Application-Context with the fully qualified path of the application-context-file usable for an UrlClassLoader.
| Field Summary | |
|---|---|
static String |
APPLICATION_TYPE
|
protected MainEntry<C> |
starter
|
protected SysInfo |
sysInfo
|
| Constructor Summary | |
|---|---|
AbstractApplicationLauncher(MainEntry<C> starter,
String[] appContextFiles,
List<String> appArgs)
constructor - loads the given context's and validates configuration. |
|
| Method Summary | |
|---|---|
protected void |
checkDBAccess()
validate the configuration from application context. |
protected void |
doUsage()
|
protected void |
dumpCharsets()
|
protected org.apache.commons.logging.Log |
getLogger()
|
MainEntry<C> |
getStarter()
|
SysInfo |
getSysInfo()
|
protected AbstractApplicationContext |
init(String[] appContextFiles)
|
protected void |
loadExtensions()
checks the plugin-directory for jarfiles, that contain valid application extensions. |
protected void |
parseAppArgs(List<String> args)
|
protected void |
printAppInfo()
|
void |
setSysInfo(SysInfo sysInfo)
|
void |
start()
entry point for application startup |
protected void |
sysDump()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String APPLICATION_TYPE
protected MainEntry<C extends AbstractSysConfig> starter
protected SysInfo sysInfo
| Constructor Detail |
|---|
public AbstractApplicationLauncher(MainEntry<C> starter,
String[] appContextFiles,
List<String> appArgs)
starter - - usually the class providing the main()appContextFiles - - the very basic requirements - at least one path to a context
fileappArgs - - the arguments from main, so commandline parsing can be
deffered| Method Detail |
|---|
public final MainEntry<C> getStarter()
public final SysInfo getSysInfo()
public final void setSysInfo(SysInfo sysInfo)
public void start()
protected void checkDBAccess()
protected void doUsage()
protected void dumpCharsets()
protected final org.apache.commons.logging.Log getLogger()
protected AbstractApplicationContext init(String[] appContextFiles)
protected void loadExtensions()
Application-Context with the fully qualified path of the
application-context-file usable for an UrlClassLoader.
protected void parseAppArgs(List<String> args)
protected void printAppInfo()
protected void sysDump()
|
SRJRCFrames v0.1.296 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||