Package org.refcodes.command
Interface Undoable<CTX,RET,E extends java.lang.Exception>
-
- Type Parameters:
CTX
- The context type to use, can by anyComponent
, service or POJO.RET
- The return type of theUndoable
's proceedings.E
- The exception type of theUndoable
's erroneous termination.
- All Superinterfaces:
Command<CTX,RET,E>
- All Known Implementing Classes:
AbstractUndoable
public interface Undoable<CTX,RET,E extends java.lang.Exception> extends Command<CTX,RET,E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isUndoable(CTX aContext)
This method determines whether theUndoable
can undo the work it has done.void
undo(CTX aContext)
This method tries to undo theUndoable
in case it was successfully executed.
-
-
-
Method Detail
-
isUndoable
boolean isUndoable(CTX aContext)
This method determines whether theUndoable
can undo the work it has done.
-
undo
void undo(CTX aContext) throws NotUndoableRuntimeException, java.lang.UnsupportedOperationException
This method tries to undo theUndoable
in case it was successfully executed. Test viaisUndoable(Object)
beforehand to see whether a call toundo(Object)
can be applied.- Parameters:
aContext
- The target object which is used by theUndoable
to do itsUndoable
.- Throws:
NotUndoableRuntimeException
- Thrown in case the performed operation cannot be undone, or no operation as been done before by thisUndoable
.java.lang.UnsupportedOperationException
- Thrown in case theUndoable
does not provide undo facilities.
-
-