[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: JAVA-53 - what happens if init() throws a runtime exception - a proposal
Hi, I’ve written the following proposal with the intent of
starting discussions on this issue before the next SCA-J Face to face. http://www.osoa.org/jira/browse/JAVA-53 @Init throws an exception The @Init method will be called when the scope is started.
This is typically in response to some other code wanting to use a new instance
of the scope. Since the @Init method has failed, the Component will be in an
invalid state. This needs to be signalled back to the calling code so the SCA
Runtime should throw an Exception. Proposed new wording: Insert the following new paragraph before line 1275 in
section 8.12 @Init “If the method marked as @Init
throws an exception, the SCA Runtime MUST catch this exception and MUST throw a
ServiceRuntimeException to the calling code. The service operations MUST NOT be
called on the Component.” @Destroy throws an exception The @Destroy method will be called when the SCA Runtime is
disposing of instances that it has finished with. There is not really any
calling code that wants to continue using the instance so there seems little
point in propagating the exception onwards. Therefore the SCA Runtime should
handle the fact that the exception has been thrown but not prevent continued
code execution. Proposed new wording: Insert the following new paragraph before line 1199 in
section 8.9 @Destroy “If the method marked as @Destroy
throws an exception, the SCA Runtime MUST catch this exception but MUST NOT prevent
continued code execution” @EagerInit throws an exception The @EagerInit method can only be applied to Composite
Scoped Components. Therefore, it will only be called at deployment time. Since
something has failed to initialise, the deployment should fail. Proposed new wording: Insert the following new paragraph after line 1219 in
section 8.10 @EagerInit “If the method marked as
@EagerInit throws an exception, the SCA Runtime MUST fail the deployment of the
SCA Contribution” Thanks, Mark Mark Combellack| Software Developer| Avaya | |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]