1 19 20 package org.netbeans.modules.tomcat5.progress; 21 22 import javax.enterprise.deploy.shared.ActionType ; 23 import javax.enterprise.deploy.shared.CommandType ; 24 import javax.enterprise.deploy.shared.StateType ; 25 import javax.enterprise.deploy.spi.status.DeploymentStatus ; 26 27 28 32 public class Status implements DeploymentStatus { 33 34 35 private ActionType at; 36 37 38 private CommandType ct; 39 40 41 private String msg; 42 43 44 private StateType state; 45 46 public Status (ActionType at, CommandType ct, String msg, StateType state) { 47 this.at = at; 48 this.ct = ct; 49 int lastEx; 50 if ((lastEx = msg.lastIndexOf ("Exception:")) > 0) { this.msg = msg.substring (lastEx + "Exception:".length()); } else { 53 this.msg = msg; 54 } 55 this.state = state; 56 } 57 58 public ActionType getAction () { 59 return at; 60 } 61 62 public CommandType getCommand () { 63 return ct; 64 } 65 66 public String getMessage () { 67 return msg; 68 } 69 70 public StateType getState () { 71 return state; 72 } 73 74 public boolean isCompleted () { 75 return StateType.COMPLETED.equals (state); 76 } 77 78 public boolean isFailed () { 79 return StateType.FAILED.equals (state); 80 } 81 82 public boolean isRunning () { 83 return StateType.RUNNING.equals (state); 84 } 85 86 public String toString () { 87 return "A="+getAction ()+" S="+getState ()+" "+getMessage (); } 89 } 90 | Popular Tags |