public interface Command
For example updating an enterprise application in an application may be composed of a list of commands to undeploy, update and redeploy the enterprise application. Each of these commands needs to be revertible so that if for example the final redeployment step fails, the prior update and undeployment steps can get reverted in order. If each of the commands in the list has ACID properties, then this results in the composed command to have ACID properties too, and thus work similar to a transaction.
Note that commands are generally not idempotent, that is once they have been
successfully executed, you may not be able to successfully execute them
again because the preconditions are no longer met.
However, commands must be restartable, that is if perform() has
thrown an exception and revert() has succeeded, then clients can
still successfully execute the command as soon as the preconditions are met
again.
Commands.execute(net.java.trueupdate.manager.spec.cmd.Command),
CompositeCommand| Modifier and Type | Method and Description |
|---|---|
void |
perform()
Performs this command, thereby creating some durable side effects.
|
void |
revert()
Reverts any durable side effects of the
perform() method. |
Copyright © 2013–2016 Schlichtherle IT Services. All rights reserved.