View Javadoc

1   package org.springframework.roo.shell;
2   
3   /**
4    * An immutable representation of a request to exit the shell.
5    * 
6    * <p>
7    * Implementations of the shell are free to handle these requests in whatever
8    * way they wish. Callers should not expect an exit request to be completed.
9    * 
10   * @author Ben Alex
11   *
12   */
13  public final class ExitShellRequest {
14  
15  	private int exitCode;
16  	
17  	public static final ExitShellRequest NORMAL_EXIT = new ExitShellRequest(0);
18  	public static final ExitShellRequest FATAL_EXIT = new ExitShellRequest(1);
19  	public static final ExitShellRequest EXIT_AND_RESTART = new ExitShellRequest(100);
20  	/** indicates that on Windows the work dir should be cleaned out and restored (ROO-357) */
21  	public static final ExitShellRequest EXIT_AND_RESTART_AFTER_ADDON_UNINSTALL = new ExitShellRequest(200);
22  
23  	private ExitShellRequest(int exitCode) {
24  		this.exitCode = exitCode;
25  	}
26  
27  	public int getExitCode() {
28  		return exitCode;
29  	}
30  	
31  }