1 23 24 package com.sun.enterprise.deployapi; 25 26 27 import javax.enterprise.deploy.spi.status.DeploymentStatus ; 28 import javax.enterprise.deploy.shared.StateType ; 29 import javax.enterprise.deploy.shared.CommandType ; 30 import javax.enterprise.deploy.shared.ActionType ; 31 35 public class DeploymentStatusImpl implements DeploymentStatus { 36 37 ProgressObjectImpl progressObject; 38 StateType stateType = null; 39 String lastMsg = null; 40 CommandType commandType = null; 41 42 43 public DeploymentStatusImpl(ProgressObjectImpl progressObject) { 44 this.progressObject = progressObject; 45 } 46 47 public DeploymentStatusImpl() { 48 } 49 50 54 public ActionType getAction() { 55 return ActionType.EXECUTE; 56 } 57 58 62 public CommandType getCommand() { 63 if (progressObject!=null) { 64 return progressObject.getCommandType(); 65 } else { 66 return commandType; 67 } 68 } 69 70 75 public String getMessage() { 76 return lastMsg; 77 } 78 79 83 public StateType getState() { 84 return stateType; 85 } 86 87 92 public boolean isCompleted() { 93 return StateType.COMPLETED.equals(stateType); 94 } 95 96 101 public boolean isFailed() { 102 return StateType.FAILED.equals(stateType); 103 } 104 105 110 public boolean isRunning() { 111 return StateType.RUNNING.equals(stateType); 112 } 113 114 public void setState(StateType stateType) { 115 this.stateType = stateType; 116 } 117 118 public void setMessage(String message) { 119 lastMsg = message; 120 } 121 122 public void setCommand(CommandType commandType) { 123 this.commandType = commandType; 124 } 125 } 126 | Popular Tags |