Skip to content

Commit

Permalink
add rollback method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason committed Mar 25, 2012
1 parent 88ffc45 commit 4fa6ff8
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -4,10 +4,17 @@
import org.nju.artemis.aejb.evolution.OperationContext;
import org.nju.artemis.aejb.evolution.OperationFailedException;
import org.nju.artemis.aejb.evolution.handlers.DependencyComputeHandler;
import org.nju.artemis.aejb.evolution.handlers.OperationStepHandler;
import org.nju.artemis.aejb.evolution.handlers.StatusShiftHandler;
import org.nju.artemis.aejb.management.client.AEjbClientImpl.AEjbStatus;

/**
* This evolution behavior used to lock or unlock a component<br>
* It composed by two handlers:
*
* {@link DependencyComputeHandler};
* {@link StatusShiftHandler}.
*
* @author <a href="wangjue1199@gmail.com">Jason</a>
*/
public class ComponentLocker extends EvolutionBehavior{
Expand Down Expand Up @@ -57,12 +64,15 @@ public OperationResult execute(OperationContext context) throws OperationFailedE
unlock(context.getTargetName());
} else
throw new OperationFailedException("operation name: " + operationName + " has not been defined.");

return OperationResult.Expected;
}

@Override
public String getHandlerName() {
return HANDLER_NAME;
}

@Override
void rollBackWhenUnExpectedResult(OperationStepHandler handler) {
}
}

0 comments on commit 4fa6ff8

Please sign in to comment.