On Thu, May 26, 2011 at 1:30 PM, Simon Laws <simonsl...@googlemail.com> wrote: > On Thu, May 26, 2011 at 1:17 PM, ant elder <ant.el...@gmail.com> wrote: >> On Thu, May 26, 2011 at 12:42 PM, Simon Laws <simonsl...@googlemail.com> >> wrote: >>> I'm working on a test to look at the lifecycle events to make sure >>> that they happen in the right places [1]. One of the tests looks at >>> what happens when an exception is thrown in the @Init operation. It >>> happens to use the domain node implementation and does the following >>> when starting the composite... >>> >>> // start a composite >>> try { >>> node.startComposite("HelloworldContrib", "lifecycle.composite"); >>> >>> // stop a composite - it won't do this >>> node.stopComposite("HelloworldContrib", "lifecycle.composite"); >>> } catch (Exception exception) { >>> // it's thrown from the HelloworldClientImpl @Init method >>> } >>> >>> I did run the test to see what happens if I try and stop the composite >>> after the error and the runtime reports. >>> >>> java.lang.IllegalStateException: not supportted for LocalOnly >>> at >>> org.apache.tuscany.sca.core.assembly.impl.DomainRegistryImpl.remoteCommand(DomainRegistryImpl.java:251) >>> at >>> org.apache.tuscany.sca.impl.NodeImpl.stopComposite(NodeImpl.java:270) >>> at >>> org.apache.tuscany.sca.itest.lifecycle.LifecycleTestCase.testInitExceptionShutdown(LifecycleTestCase.java:113) >>> >>> It looks like it tries to do remote things if it doesn't find a >>> started composite when it's asked to stop one. It would be good to be >>> able to call the stop operation regardless and have is just warn that >>> there isn't a composite to stop. >>> >> >> I've just changed it so that doesn't happen and now its throwing an >> IllegalStateException saying "composite not started: >> lifecycle.composite". Does that do more closely what you want? >> >> ...ant >> > > Sounds spot on. Let me give it a try. > > Thanks > > Simon > > > -- > Apache Tuscany committer: tuscany.apache.org > Co-author of a book about Tuscany and SCA: tuscanyinaction.com >
Looks good Ant. Simon -- Apache Tuscany committer: tuscany.apache.org Co-author of a book about Tuscany and SCA: tuscanyinaction.com