View Javadoc

1   package org.springframework.roo.file.undo;
2   
3   import java.util.logging.Logger;
4   
5   /**
6    * An operation than can be undone by {@link UndoManager}.
7    * 
8    * <p>
9    * An {@link UndoableOperation} is NOT permitted to throw any exception at any time. It should log
10   * any error conditions to the {@link Logger} only.
11   * 
12   * @author Ben Alex
13   * @since 1.0
14   *
15   */
16  public interface UndoableOperation {
17  
18  	/**
19  	 * Attempt to undo the changes, and release any resources consumed.
20  	 * 
21  	 * <p>
22  	 * No exceptions may be thrown.
23  	 * 
24  	 * @return whether the undo was successful or not
25  	 */
26  	boolean undo();
27  	
28  	/**
29  	 * Release any temporary resources consumed by the {@link UndoableOperation}.
30  	 * 
31  	 * <p>
32  	 * No exceptions may be thrown.
33  	 */
34  	void reset();
35  
36  }