Simon Laws wrote:


On Fri, Jan 20, 2012 at 9:54 AM, Millies, Sebastian <[email protected] <mailto:[email protected]>> wrote:

    Hello there,

    in Tuscany 1.6, when a component cannot be initialized because the
    @Init()

    method encounters an exception, it can be desirable to stop the
    component

    altogether, so that no requests may be made of it.

    Is there a Tuscany configuration option or a an API that can do
    that? I’d rather

    disable only the faulty component than call System.exit()…

    n  Sebastian

    IDS Scheer Consulting GmbH
    Geschäftsführer/Managing Directors: Kamyar Niroumand, Ivo Totev
    Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken,
    Germany - Registergericht/Commercial register: Saarbrücken HRB 19681
    *http://www.softwareag.com*


Hi Sebastien

Not as far as I know. You'd have to comment the component description out in the composite file.

Regards

Simon

The OASIS SCA 1.1 spec states that the SCA runtime must destroy the component
if its @Init method throws an exception.  Here's the relevant text:

Once the method annotated with @Init completes successfully, the SCA Runtime
MUST transition the component implementation to the Running state. [JCA40014]
If an exception is thrown whilst initializing, the SCA Runtime MUST transition
the component implementation to the Destroying state. [JCA40015]

I'm not sure how much work it would be to backport this to Tuscany 1.x.

  Simon

--
Apache Tuscany committer: tuscany.apache.org <http://tuscany.apache.org>
Co-author of a book about Tuscany and SCA: tuscanyinaction.com <http://tuscanyinaction.com>

Reply via email to