|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.deploymentadmin.spi.Command
public abstract class Command
Commands describe a group of tasks to be executed within the execution a deployment session. A command that has already executed can be rolled back and a command that is currently in progress can be signaled to stop it's activities by canceling it.
Constructor Summary | |
---|---|
Command()
|
Method Summary | |
---|---|
protected void |
addCommit(Runnable runnable)
Adds an action to be executed in case of a commit |
protected void |
addRollback(Runnable runnable)
Adds an action to be executed in case of a roll back. |
void |
cancel()
Sets the command to being cancelled, this does not have an immediate effect. |
protected void |
commit()
Commits all changes the command may have defined when it was executed by calling the execute() method. |
abstract void |
execute(DeploymentSessionImpl session)
Executes the command, the specified DeploymentSession can be used to obtain various
information about the deployment session which the command is part of. |
protected boolean |
isCancelled()
Determines if the command was canceled. |
void |
rollback()
Rolls back all actions that were added through the addRollback(Runnable r) method (in reverse
adding order). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Command()
Method Detail |
---|
public abstract void execute(DeploymentSessionImpl session) throws DeploymentException
DeploymentSession
can be used to obtain various
information about the deployment session which the command is part of.
session
- The deployment session this command is part of.
DeploymentException
- Thrown if the command could not successfully execute.public void rollback()
addRollback(Runnable r)
method (in reverse
adding order). It is not guaranteed that the state of everything related to the command will be as if the
command was never executed, a best effort should be made though.
protected void commit()
execute()
method.
protected boolean isCancelled()
protected void addRollback(Runnable runnable)
runnable
- The runnable to be executed in case of a roll back.protected void addCommit(Runnable runnable)
runnable
- The runnable to be executes in case of a commit.public void cancel()
DeploymentException.CODE_CANCELLED
exception.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |