|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drupal.project.computing.DApplication
public abstract class DApplication
This is the application class. Additional thoughts: It'll be nice to have "site" and "config" as "final". But that means they have to be set in constructors, and launchFromShell() would have to be static factory method, and then it'll increase complexity. This design combines DApplication and DLauncher. Pro: simple. Con: Can't use other launcher easily.
Nested Class Summary | |
---|---|
static class |
DApplication.RunningMode
Various running mode of the Druplet |
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,java.lang.Class<? extends DCommand>> |
commandRegistry
acceptable command registry in the format of: Class name => the class object. |
protected DConfig |
config
Configuration for this application |
protected DSite |
drupalSite
Drupal site for this application |
protected java.util.logging.Logger |
logger
|
protected java.lang.String[] |
pushOptions
Extra options when running in "push" mode. |
Constructor Summary | |
---|---|
DApplication()
Default constructor. |
Method Summary | |
---|---|
protected abstract void |
buildCommandRegistry()
Register acceptable command here. |
DSite |
getDrupalSite()
|
java.lang.String |
getIdentifier()
Specifies the name this Druplet is known as. |
protected void |
initDrupalSite()
In your sub-class, you can override this method to initialized different drupal site. |
void |
launch()
launch the DApplication. |
void |
launchFromShell(java.lang.String[] args)
Launches the DApplication from shell. |
void |
registerCommand(java.lang.Class<? extends DCommand> commandClass)
Register a command with the DApplication. |
void |
registerCommand(java.lang.String identifier,
java.lang.Class commandClass)
Register a command with arbitrary identifier. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.logging.Logger logger
protected DConfig config
protected DSite drupalSite
protected java.lang.String[] pushOptions
protected java.util.Map<java.lang.String,java.lang.Class<? extends DCommand>> commandRegistry
Constructor Detail |
---|
public DApplication()
Method Detail |
---|
public DSite getDrupalSite()
public void launchFromShell(java.lang.String[] args)
args
- arguments from main()protected void initDrupalSite()
public void launch()
public java.lang.String getIdentifier()
public void registerCommand(java.lang.Class<? extends DCommand> commandClass)
commandClass
- public void registerCommand(java.lang.String identifier, java.lang.Class commandClass)
identifier
- commandClass
- protected abstract void buildCommandRegistry()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |