ServiceUnitManager.deploy method signature

Java doc of ServiceUnitManager.deploy() says upon successful deployment it should return a status message string task-result set to "SUCCESS", and on failure task-result should be set to "FAILED". When do you think it should throw DeploymentException?ThanksRajesh
[284 byte] By [rajesh930a] at [2007-11-26 13:54:36]
# 1

Unfortunately, there was some duplication in the JSR208 specification in this area. Having 2 different ways to signal a failure is not exactly straightforward. While the code in Open ESB will support either way, I would suggest using the status message string for both success and failure. If you do throw DeploymentException, the actual exception message must be in the form of a status message string just like the return value from the method.

I will consult the JSR208 spec lead on this as well. It is likely that this will be corrected in the next revision of the spec.

mark

Mark-S-Whitea at 2007-7-8 1:33:17 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

The preferred method of returning an error from ServiceUnitManager.deploy() is to use the method return value, with task-result (and other fields in the XML structure) set appropriately. deploy() can throw a DeploymentException, in which case the JBI implementation hosting the component will convert the exception message to a suitable XML string, for return to the deployment MBean (and subsequently the admin tool).

The preferred method is to use the XML String return value; this allows the component to return a parameterized message string that can be localized at the admin tool, as well as error context information.

The use of DeploymentException is a hold-over from an earlier version of the JBI specification, while it was being developed. It was, previously, the only way SUM.deploy() implementations could signal a failure, and a number of components were developed that relied on that. When the XML String return value was introduced, the DeploymentException was retained to make migration of those existing components easier. Strictly speaking, Deployment exception should have been removed before JBI 1.0 was released, but such changes were not deemed important enough to slip JBI 1.0 from its original schedule. Again, either technique for indicating failure will work.

RonTen-Hovea at 2007-7-8 1:33:17 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
ThanksI thought its little confusing so I brought this to your notice.-Rajesh
rajesh930a at 2007-7-8 1:33:17 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...