DeploymentStatusImplWithErrorpublic class DeploymentStatusImplWithError extends DeploymentStatusImpl Simple implementation of DeploymentStatus intended to describe an exception that
occurred during a DeploymentManager method invocation. |
Fields Summary |
---|
private Throwable | causeRecords the error, if any, associated with this status object | private javax.enterprise.deploy.shared.CommandType | commandType |
Constructors Summary |
---|
public DeploymentStatusImplWithError()Creates a new instance of DeploymentStatusImplWithError
| public DeploymentStatusImplWithError(javax.enterprise.deploy.shared.CommandType commandType, Throwable cause)Creates a new instance of DeploymentStatusImplWithError
super();
initCause(cause);
setState(StateType.FAILED);
setCommand(commandType);
|
Methods Summary |
---|
public java.lang.Throwable | getCause()Returns the cause for this status.
return cause;
| public void | initCause(java.lang.Throwable cause)Assigns the cause for this status.
this.cause = cause;
setMessage(cause.getMessage());
| public java.lang.String | toString()Displays the status as a string, including stack trace information if error is present.
StringBuffer result = new StringBuffer(super.toString());
if (cause != null) {
String lineSep = System.getProperty("line.separator");
result.append(lineSep).append("Cause: ");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintWriter pw = new PrintWriter(baos);
cause.printStackTrace(pw);
pw.close();
result.append(baos.toString());
}
return result.toString();
|
|