Hi Scott,

 

There are two outstanding OASIS issues regarding this problem. Basically,
the spec does not say what should happen but it should.

 

The relevant issues are:

 

http://www.osoa.org/jira/browse/JAVA-65             There is no lifecycle
defined for SCA Components

http://www.osoa.org/jira/browse/JAVA-53             What happens if init()
throws a runtime exception

 

JAVA-65 provides a proposal that will define the lifecycle for SCA
Components and explicitly details what to do with exceptions. The proposal
has not yet been accepted so may well be tweaked before it is included in
the specification.

 

Thanks,

 

Mark

  _____  

From: Scott Kurz [mailto:scottk...@gmail.com] 
Sent: 16 February 2009 23:54
To: dev@tuscany.apache.org
Subject: What to do with instance when RuntimeException thrown from @Init?

 

I feel like I remember seeing this conversation before but can't find it in
my mail search.

Just noticing that if we throw a RuntimeException from an @Init method in a
composite-scoped component ... then the instance gets used anyway even
though it may have failed to initialize. 

Was thinking it would be a useful service for the container to provide to
discard the instance, under the assumption that the next time the service is
invoked, we'll retry the instance creation, since maybe later the @Init will
complete successfully?   

Don't see anything in a very quick scan of the specs but I didn't look
thoroughly.

Any thoughts on this?

Thanks,
Scott

Reply via email to