1 28 package com.caucho.j2ee.deployclient; 29 30 import javax.enterprise.deploy.shared.StateType ; 31 import javax.enterprise.deploy.spi.TargetModuleID ; 32 import javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException ; 33 import javax.enterprise.deploy.spi.status.ClientConfiguration ; 34 import javax.enterprise.deploy.spi.status.DeploymentStatus ; 35 import javax.enterprise.deploy.spi.status.ProgressListener ; 36 import javax.enterprise.deploy.spi.status.ProgressObject ; 37 import java.util.logging.Level ; 38 import java.util.logging.Logger ; 39 40 43 public class ProgressObjectImpl implements ProgressObject , java.io.Serializable { 44 private static final Logger log = Logger.getLogger(ProgressObjectImpl.class.getName()); 45 46 private TargetModuleID []_targetModuleIDs; 47 private final DeploymentStatusImpl _status = new DeploymentStatusImpl(); 48 49 ProgressObjectImpl() 50 { 51 } 52 53 public ProgressObjectImpl(TargetModuleID []targetModuleIDs) 54 { 55 _targetModuleIDs = targetModuleIDs; 56 } 57 58 61 public DeploymentStatus getDeploymentStatus() 62 { 63 if (_status != null) 64 return _status; 65 else 66 return new DeploymentStatusImpl(); 67 } 68 69 72 public TargetModuleID []getResultTargetModuleIDs() 73 { 74 return _targetModuleIDs; 75 } 76 77 80 public ClientConfiguration getClientConfiguration(TargetModuleID id) 81 { 82 throw new UnsupportedOperationException (); 83 } 84 85 88 public boolean isCancelSupported() 89 { 90 return false; 91 } 92 93 96 public void cancel() 97 throws OperationUnsupportedException 98 { 99 throw new UnsupportedOperationException (); 100 } 101 102 105 public boolean isStopSupported() 106 { 107 return false; 108 } 109 110 113 public void stop() 114 throws OperationUnsupportedException 115 { 116 throw new UnsupportedOperationException (); 117 } 118 119 122 public void addProgressListener(ProgressListener listener) 123 { 124 } 125 126 129 public void removeProgressListener(ProgressListener listener) 130 { 131 } 132 133 136 public void failed(String message) 137 { 138 if (log.isLoggable(Level.FINEST)) 139 log.log(Level.FINEST, "failed " + message); 140 141 _status.setState(StateType.FAILED); 142 _status.setMessage(message); 143 } 144 145 148 public void completed(String message) 149 { 150 _status.setState(StateType.COMPLETED); 151 _status.setMessage(message); 152 } 153 154 public String toString() 155 { 156 return "ProgressObjectImpl[" + _status + "]"; 157 } 158 } 159 160 | Popular Tags |