[ 
https://issues.apache.org/jira/browse/TUSCANY-3867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13046419#comment-13046419
 ] 

Simon Laws commented on TUSCANY-3867:
-------------------------------------

This is the way I think it should work... 

Tuscany will start a composite when requested and, assuming that there are no 
errors at this stage, will mark all components as started, see 
RuntimeComponent.isStarted(). A component being started doesn't necessarily 
mean that implementation instances will exist but it does mean that it's 
implementation and binding providers will have been started. If an error is 
detected during start the runtime will stop any providers it's already started 
for the failing component and then return an exception. It's the Node's (or 
whatever calls the activator) responsibility to call stop on the activator to 
stop any other components that have been started. 

Component instances themselves are created in different ways depending on 
component scope and other configuration. Here are the combinations. 

COMPOSITE/@EagerInit - one instance is created at component start time 
COMPOSITE - One instance is created at the time the first message arrives 
STATELESS - A new instance is created for each message 

These different configurations have an impact on how errors are handled and 
hence how shutdown operates. The general rule of thumb is that if an exception 
is detected while the composite is being started (the COMPOSITE/@EagerInit 
case) then the Node will trap the error and use the underlying SPI to shut down 
all the components in the composite before throwing the exception to the code 
that called start. If the exception is detected on receipt of a message then 
just the implementation instance is removed and the component remains in the 
started state until the code that called the node calls node.stop

> Confirm that framework/extension/composite starts and stops all happen in the 
> right places
> ------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-3867
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-3867
>             Project: Tuscany
>          Issue Type: Bug
>          Components: SCA Java Runtime
>            Reporter: Simon Laws
>            Assignee: Simon Laws
>            Priority: Minor
>             Fix For: Java-SCA-2.0
>
>
> Looking at some of the tests I'm not sure that we catch all of the start/stop 
> situations. It's not clear though so I'm raising this JIRA and I'll write a 
> test to track what's going on. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to