See information about the latest product version
Checking the results of deployment in a CMP application
When you deploy from a CMP application, you can check the results of that action.
DeployResult dr = eg.deploy("MyBAR.bar", true, 30000);
System.out.println("Overall result = "+dr.getCompletionCode());
// Display log messages
Enumeration logEntries = dr.getLogEntries();
while (logEntries.hasMoreElements()) {
LogEntry le = (LogEntry)logEntries.nextElement();
System.out.println("General message: " + le.getDetail());
}
The deploy method blocks other processes until the broker has responded to the deployment request. When the method returns, the DeployResult object represents the outcome of the deployment at the time when the method returned; the object is not updated by the CMP API.
If the deployment message could not be sent to the broker, a ConfigManagerProxyLoggedException exception is thrown at the time of the deployment. If the broker receives the deployment message, log messages for the overall deployment are displayed, followed by completion codes specific to each broker that is affected by the deployment. The completion code, shown in the following table, is one of the static instances from the CompletionCodeType class.
Completion code | Description |
---|---|
pending | The deployment is held in a batch and is not sent until you call BrokerProxy.sendUpdates(). |
submitted | The deploy message was sent to the broker, but no response was received before the timeout period expired. |
success | The broker has successfully completed the deployment. |
failure | The broker has generated one or more errors during deployment. You can call the getLogEntries() method of the DeployResult class to get more information about the deployment failure. This method returns an enumeration of available LogEntry objects. |