You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Mark Combellack (JIRA)" <tu...@ws.apache.org> on 2007/08/31 12:40:30 UTC

[jira] Created: (TUSCANY-1641) @Destroy method not called for CompositeScope

@Destroy method not called for CompositeScope
---------------------------------------------

                 Key: TUSCANY-1641
                 URL: https://issues.apache.org/jira/browse/TUSCANY-1641
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Java Implementation Extension
         Environment: Linux
Tuscany SVN revision 571406
            Reporter: Mark Combellack
             Fix For: Java-SCA-1.0


If you define a method on a class with Composite Scope, the @Destroy method is not called when the SCA Domain is closed.


The flow of events is:

DefaultSCADomain.close()
 -> For Each CompositeActivator
    -> CompositeActivatorImpl.stop()
        -> If instance of ScopedRuntimeComponent then
           -> compositeScopeContainer.stop()


The problem is in the CompositeScopeContainer.stop() method:

    public synchronized void stop() {
        super.stop();
        wrapper = null;
    }

The stop method just nulls the reference to the wrapper. However, if wrapper != null then it should call wrapper.stop().

The wrapper is actually an instance of ReflectiveInstanceWrapper which is responsible for calling the @Start and @Destroy annotated methods when wrapper.start() and wrapper.stop() are called.

The final code for the CompositeScopeContainer.stop() method would be something like:

    public synchronized void stop() {
        super.stop();
        if (wrapper != null) {
            try {
                wrapper.stop();
            } catch (TargetDestructionException ex) {
                // TODO: Handle this exception better
                ex.printStackTrace();
            }
        }
        wrapper = null;
    }




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Assigned: (TUSCANY-1641) @Destroy method not called for CompositeScope

Posted by "Raymond Feng (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raymond Feng reassigned TUSCANY-1641:
-------------------------------------

    Assignee: Raymond Feng

> @Destroy method not called for CompositeScope
> ---------------------------------------------
>
>                 Key: TUSCANY-1641
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1641
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Java Implementation Extension
>         Environment: Linux
> Tuscany SVN revision 571406
>            Reporter: Mark Combellack
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.0
>
>         Attachments: DestroyForCompositeScope.patch
>
>
> If you define a method on a class with Composite Scope, the @Destroy method is not called when the SCA Domain is closed.
> The flow of events is:
> DefaultSCADomain.close()
>  -> For Each CompositeActivator
>     -> CompositeActivatorImpl.stop()
>         -> If instance of ScopedRuntimeComponent then
>            -> compositeScopeContainer.stop()
> The problem is in the CompositeScopeContainer.stop() method:
>     public synchronized void stop() {
>         super.stop();
>         wrapper = null;
>     }
> The stop method just nulls the reference to the wrapper. However, if wrapper != null then it should call wrapper.stop().
> The wrapper is actually an instance of ReflectiveInstanceWrapper which is responsible for calling the @Start and @Destroy annotated methods when wrapper.start() and wrapper.stop() are called.
> The final code for the CompositeScopeContainer.stop() method would be something like:
>     public synchronized void stop() {
>         super.stop();
>         if (wrapper != null) {
>             try {
>                 wrapper.stop();
>             } catch (TargetDestructionException ex) {
>                 // TODO: Handle this exception better
>                 ex.printStackTrace();
>             }
>         }
>         wrapper = null;
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Resolved: (TUSCANY-1641) @Destroy method not called for CompositeScope

Posted by "Raymond Feng (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raymond Feng resolved TUSCANY-1641.
-----------------------------------

    Resolution: Fixed

Patch applied under r571516. Thank you for the fix.

> @Destroy method not called for CompositeScope
> ---------------------------------------------
>
>                 Key: TUSCANY-1641
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1641
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Java Implementation Extension
>         Environment: Linux
> Tuscany SVN revision 571406
>            Reporter: Mark Combellack
>            Assignee: Raymond Feng
>             Fix For: Java-SCA-1.0
>
>         Attachments: DestroyForCompositeScope.patch
>
>
> If you define a method on a class with Composite Scope, the @Destroy method is not called when the SCA Domain is closed.
> The flow of events is:
> DefaultSCADomain.close()
>  -> For Each CompositeActivator
>     -> CompositeActivatorImpl.stop()
>         -> If instance of ScopedRuntimeComponent then
>            -> compositeScopeContainer.stop()
> The problem is in the CompositeScopeContainer.stop() method:
>     public synchronized void stop() {
>         super.stop();
>         wrapper = null;
>     }
> The stop method just nulls the reference to the wrapper. However, if wrapper != null then it should call wrapper.stop().
> The wrapper is actually an instance of ReflectiveInstanceWrapper which is responsible for calling the @Start and @Destroy annotated methods when wrapper.start() and wrapper.stop() are called.
> The final code for the CompositeScopeContainer.stop() method would be something like:
>     public synchronized void stop() {
>         super.stop();
>         if (wrapper != null) {
>             try {
>                 wrapper.stop();
>             } catch (TargetDestructionException ex) {
>                 // TODO: Handle this exception better
>                 ex.printStackTrace();
>             }
>         }
>         wrapper = null;
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1641) @Destroy method not called for CompositeScope

Posted by "Mark Combellack (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Combellack updated TUSCANY-1641:
-------------------------------------

    Patch Info: [Patch Available]

Have attached patch to fix this issue

> @Destroy method not called for CompositeScope
> ---------------------------------------------
>
>                 Key: TUSCANY-1641
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1641
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Java Implementation Extension
>         Environment: Linux
> Tuscany SVN revision 571406
>            Reporter: Mark Combellack
>             Fix For: Java-SCA-1.0
>
>         Attachments: DestroyForCompositeScope.patch
>
>
> If you define a method on a class with Composite Scope, the @Destroy method is not called when the SCA Domain is closed.
> The flow of events is:
> DefaultSCADomain.close()
>  -> For Each CompositeActivator
>     -> CompositeActivatorImpl.stop()
>         -> If instance of ScopedRuntimeComponent then
>            -> compositeScopeContainer.stop()
> The problem is in the CompositeScopeContainer.stop() method:
>     public synchronized void stop() {
>         super.stop();
>         wrapper = null;
>     }
> The stop method just nulls the reference to the wrapper. However, if wrapper != null then it should call wrapper.stop().
> The wrapper is actually an instance of ReflectiveInstanceWrapper which is responsible for calling the @Start and @Destroy annotated methods when wrapper.start() and wrapper.stop() are called.
> The final code for the CompositeScopeContainer.stop() method would be something like:
>     public synchronized void stop() {
>         super.stop();
>         if (wrapper != null) {
>             try {
>                 wrapper.stop();
>             } catch (TargetDestructionException ex) {
>                 // TODO: Handle this exception better
>                 ex.printStackTrace();
>             }
>         }
>         wrapper = null;
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1641) @Destroy method not called for CompositeScope

Posted by "Mark Combellack (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Combellack updated TUSCANY-1641:
-------------------------------------

    Attachment: DestroyForCompositeScope.patch

> @Destroy method not called for CompositeScope
> ---------------------------------------------
>
>                 Key: TUSCANY-1641
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1641
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Java Implementation Extension
>         Environment: Linux
> Tuscany SVN revision 571406
>            Reporter: Mark Combellack
>             Fix For: Java-SCA-1.0
>
>         Attachments: DestroyForCompositeScope.patch
>
>
> If you define a method on a class with Composite Scope, the @Destroy method is not called when the SCA Domain is closed.
> The flow of events is:
> DefaultSCADomain.close()
>  -> For Each CompositeActivator
>     -> CompositeActivatorImpl.stop()
>         -> If instance of ScopedRuntimeComponent then
>            -> compositeScopeContainer.stop()
> The problem is in the CompositeScopeContainer.stop() method:
>     public synchronized void stop() {
>         super.stop();
>         wrapper = null;
>     }
> The stop method just nulls the reference to the wrapper. However, if wrapper != null then it should call wrapper.stop().
> The wrapper is actually an instance of ReflectiveInstanceWrapper which is responsible for calling the @Start and @Destroy annotated methods when wrapper.start() and wrapper.stop() are called.
> The final code for the CompositeScopeContainer.stop() method would be something like:
>     public synchronized void stop() {
>         super.stop();
>         if (wrapper != null) {
>             try {
>                 wrapper.stop();
>             } catch (TargetDestructionException ex) {
>                 // TODO: Handle this exception better
>                 ex.printStackTrace();
>             }
>         }
>         wrapper = null;
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org