Fields Summary |
---|
static final long | serialVersionUID |
public static final int | FAILUREPossible status for a stage or overall deployment status |
public static final int | WARNING |
public static final int | SUCCESS |
public static final int | NOTINITIALIZED |
public static final String | CONTEXT_ROOT |
public static final String | KEY_SEPARATOR |
public static final String | MODULE_ID |
public static final String | MODULE_TYPE |
public static final String | SUBMODULE_COUNT |
public static final String | WSDL_PUBLISH_URL |
public static final String | WSDL_LOCATION |
public static final String | WSDL_DIRECTORY |
public static final String | WSDL_FILE_ENTRIES |
public static final String | COUNT |
private String | stageDescriptioninstance information :
- information about this stage
- information about sub stages |
private int | stageStatus |
private String | stageStatusMessage |
private Throwable | stageException |
private List | subStages |
private DeploymentStatus | parent |
private Map | additionalStatusbackend deployment can transfer some information back to the
client process through these properties. |
private Properties | props |
Methods Summary |
---|
public void | addProperty(java.lang.String propertyName, java.lang.String propertyValue)Add a new property to this status object
additionalStatus.put(propertyName, propertyValue);
// the name-value pair is also stored in props
// for backward compatibility
if (props==null) {
props = new Properties();
}
props.put(propertyName, propertyValue);
|
public void | addSubStage(com.sun.enterprise.deployment.backend.DeploymentStatus subStage)Add a sub stage to this deployment status
subStages.add(subStage);
subStage.setParent(this);
|
public java.util.Map | asMap()Implement the MapCapable interface so DeploymentStatus
can be converted back and forth with CompositeData
HashMap m = new HashMap();
m.put(MapCapable.MAP_CAPABLE_CLASS_NAME_KEY, com.sun.appserv.management.deploy.DeploymentStatus.DEPLOYMENT_STATUS_CLASS_NAME );
m.put(com.sun.appserv.management.deploy.DeploymentStatus.STAGE_STATUS_KEY, new Integer(stageStatus));
m.put(com.sun.appserv.management.deploy.DeploymentStatus.STAGE_STATUS_MESSAGE_KEY, stageStatusMessage);
m.put(com.sun.appserv.management.deploy.DeploymentStatus.STAGE_DESCRIPTION_KEY, stageDescription);
m.put(com.sun.appserv.management.deploy.DeploymentStatus.SUB_STAGES_KEY, subStagesToMapList());
m.put(com.sun.appserv.management.deploy.DeploymentStatus.STAGE_THROWABLE_KEY, stageException);
m.put(com.sun.appserv.management.deploy.DeploymentStatus.ADDITIONAL_STATUS_KEY, additionalStatus);
return( m );
|
public java.util.Map | getAdditionalStatus()
return additionalStatus;
|
public static java.util.Iterator | getAllStageStatusForLevel(com.sun.enterprise.deployment.backend.DeploymentStatus status, int level)Get all stages with this deployment status level
List stages = new ArrayList();
if (status.getStageStatus() == level) {
stages.add(status);
}
// need to iterate through the rest of status hierarchy
for (Iterator itr = status.getSubStages();itr.hasNext();) {
DeploymentStatus subStage = (DeploymentStatus) itr.next();
if (subStage.getStageStatus() == level) {
stages.add(subStage);
}
for (Iterator itr2 = subStage.getSubStages();itr2.hasNext();) {
DeploymentStatus subStage2 = (DeploymentStatus) itr2.next();
if (subStage2.getStageStatus() == level) {
stages.add(subStage2);
}
for (Iterator itr3 = subStage2.getSubStages();
itr3.hasNext();) {
DeploymentStatus subStage3 =
(DeploymentStatus) itr3.next();
if (subStage3.getStageStatus() == level) {
stages.add(subStage3);
}
}
}
}
return stages.iterator();
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | getMainStatus()
if (parent!=null) {
return parent.getMainStatus();
}
return this;
|
public java.lang.String | getMapClassName()Return the interface that this Map represents
(the Java classname).
return com.sun.appserv.management.deploy.DeploymentStatus.DEPLOYMENT_STATUS_CLASS_NAME;
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | getParent()
return parent;
|
public java.lang.String | getProperty(java.lang.String propertyName)
if (additionalStatus.get(propertyName) != null) {
return (String)additionalStatus.get(propertyName);
} else {
// we also try to retrieve from props
// for backward compatibility
if (props==null) {
return null;
}
return props.getProperty(propertyName);
}
|
public java.lang.String | getStageDescription()
return stageDescription;
|
public java.lang.Throwable | getStageException()
return stageException;
|
public java.lang.String | getStageIdentifier()
return stageDescription;
|
public int | getStageStatus()
return stageStatus;
|
public com.sun.enterprise.deployment.backend.DeploymentStatus | getStageStatusForLevel(int level)
if (stageStatus == level) {
return this;
} else {
for (Iterator itr = subStages.iterator();itr.hasNext();) {
DeploymentStatus subStage = (DeploymentStatus) itr.next();
if (subStage.getStatus()==level) {
return subStage;
}
}
}
return null;
|
public java.lang.String | getStageStatusMessage()
return stageStatusMessage;
|
public int | getStatus()
int currentStatus = stageStatus;
// iterate over all sub stages to get their status
for (Iterator stageItr = subStages.iterator();stageItr.hasNext();) {
DeploymentStatus subStage = (DeploymentStatus) stageItr.next();
int subStageStatus= subStage.getStatus();
// if the sub stage status is a lower number than our current, something
// went horribly wrong in the substage, update ours
if (subStageStatus<currentStatus) {
currentStatus = subStageStatus;
}
}
return currentStatus;
|
public java.util.Iterator | getSubStages()Get the list of sub stages for this deployment status
return subStages.iterator();
|
public static void | parseDeploymentStatus(com.sun.enterprise.deployment.backend.DeploymentStatus status, java.io.PrintWriter pw)Traverse through the DeploymenStatus hierarchy and
write failure/warning msgs to the print writer
if (status != null) {
// if it's falure case, print all exceptions
if (status.getStatus() == DeploymentStatus.FAILURE) {
for (Iterator itr = getAllStageStatusForLevel(status, DeploymentStatus.FAILURE); itr.hasNext();) {
DeploymentStatus stage = (DeploymentStatus) itr.next();
printFailure(pw, stage);
}
}
// if it's warning case, print all warnings
else if (status.getStatus() == DeploymentStatus.WARNING) {
for (Iterator itr = getAllStageStatusForLevel(status, DeploymentStatus.WARNING); itr.hasNext();) {
DeploymentStatus stage = (DeploymentStatus) itr.next();
String msg = stage.getStageStatusMessage();
if (msg != null) {
pw.println(msg);
}
}
}
pw.flush();
}
|
private static void | printFailure(java.io.PrintWriter pw, com.sun.enterprise.deployment.backend.DeploymentStatus status)Prints the status string and/or status exception
String msg = status.getStageStatusMessage();
Throwable t = status.getStageException();
if (msg != null && msg.trim().length() > 0) {
pw.println(msg);
// only print the exception if it's not the same as the
// the status message
if (t != null && t.getMessage() != null &&
!t.getMessage().equals(msg)) {
pw.println(t.getLocalizedMessage());
}
} else {
if (t != null) {
pw.println(t.getLocalizedMessage());
}
}
|
public void | setAdditionalStatus(java.util.Map additionalStatus)Set the additional status for this status
this.additionalStatus = additionalStatus;
|
public void | setParent(com.sun.enterprise.deployment.backend.DeploymentStatus parent)Setthe parent status for this status
this.parent = parent;
|
public void | setStageDescription(java.lang.String string)
stageDescription = string;
|
public void | setStageException(java.lang.Throwable throwable)When the stage throws an exception, it should store it here in
the assiciated deployment status
stageException = new Throwable(throwable.getMessage());
stageException.setStackTrace(throwable.getStackTrace());
|
public void | setStageStatus(int status)Set the status for this stage
stageStatus = status;
|
public void | setStageStatusMessage(java.lang.String string)
stageStatusMessage = string;
|
java.util.List | subStagesToMapList()DeploymentStatus class may not be available on the client side.
Converts the list of DeploymentStatus objects to list of Maps.
Iterates through the substages list and calls asMap().
final List l = new ArrayList(subStages.size());
final Iterator it = subStages.iterator();
while (it.hasNext()) {
final MapCapable mc = (MapCapable)it.next();
l.add(mc.asMap());
}
return l;
|
public java.lang.String | toString()
return "Status " + stageStatus + " message " + stageStatusMessage
+ " \nException " + stageException;
|