|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drupal.project.async_command.AsyncCommand
public abstract class AsyncCommand
Individual command to be executed. Each command is also registered with a druplet. A command doesn't necessarily know a DrupalConnection. If needed, it can get from druplet. The Record inner class needs to know a DrupalConnection in order to do database operations. f Subclass can also write a initialize(...) function, which initialize parameters for the app and is used for CLI evaluation.
Nested Class Summary | |
---|---|
static class |
AsyncCommand.Control
|
static class |
AsyncCommand.Status
|
Field Summary | |
---|---|
protected java.lang.String |
commandMessage
Command message. |
protected AsyncCommand.Status |
commandStatus
The command status. |
protected Druplet |
druplet
The druplet this command is associated with. |
protected static java.util.logging.Logger |
logger
|
protected CommandRecord |
record
The database record this command is associated with. |
Constructor Summary | |
---|---|
protected |
AsyncCommand()
|
|
AsyncCommand(CommandRecord record,
Druplet druplet)
Constructor should prepare the command to run "run()". |
Method Summary | |
---|---|
protected void |
afterExecute()
Usually save results back to 'record' |
protected void |
beforeExecute()
Usually initialize the command from 'record' |
protected void |
execute()
Execute this command. |
protected DrupalConnection |
getDrupalConnection()
|
protected Druplet |
getDruplet()
|
java.lang.String |
getIdentifier()
Specifies the name this command is known as. |
CommandRecord |
getRecord()
|
void |
run()
Run this command. |
protected void |
setDruplet(Druplet druplet)
|
protected void |
setRecord(CommandRecord record)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.logging.Logger logger
protected Druplet druplet
protected CommandRecord record
protected AsyncCommand.Status commandStatus
protected java.lang.String commandMessage
Constructor Detail |
---|
public AsyncCommand(CommandRecord record, Druplet druplet)
record
- druplet
- protected AsyncCommand()
Method Detail |
---|
protected DrupalConnection getDrupalConnection()
protected Druplet getDruplet()
protected void setRecord(CommandRecord record)
public CommandRecord getRecord()
protected void setDruplet(Druplet druplet)
public java.lang.String getIdentifier()
public void run()
run
in interface java.lang.Runnable
protected void beforeExecute()
protected void afterExecute()
protected void execute()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |