You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Scott Cranton (JIRA)" <ji...@apache.org> on 2010/05/25 20:59:51 UTC

[jira] Created: (CAMEL-2751) Timer Component is not Restartable

Timer Component is not Restartable
----------------------------------

                 Key: CAMEL-2751
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2751
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.2.0
            Reporter: Scott Cranton
         Attachments: TimerComponentRestart.patch

When the TimerComponent is stopped, it cancels all of the Timer instances it has created, which is good. However, TimerEndpoint keeps a local reference to the Timer instance, so if the TimerComponent is restarted, the TimerEndpoint will throw an exception as its timer is no longer usable as it has been canceled.

This patch provides a unit test, TimerRestartTest, and an update to TimerComponent that fixes this issue. The TimerComponent fix is to keep a list of all TimerEndpoints that have a reference to a Timer instance created by the TimerComponent. When TimerComponent.doStop is called, those TimerEndpoint references to the now canceled Timer instances are cleared.

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


[jira] Resolved: (CAMEL-2751) Timer Component is not Restartable

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hadrian Zbarcea resolved CAMEL-2751.
------------------------------------

    Resolution: Fixed

Patch applied with thanks to Scott.
r948293

> Timer Component is not Restartable
> ----------------------------------
>
>                 Key: CAMEL-2751
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2751
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.2.0
>            Reporter: Scott Cranton
>            Assignee: Hadrian Zbarcea
>         Attachments: TimerComponentRestart.patch
>
>
> When the TimerComponent is stopped, it cancels all of the Timer instances it has created, which is good. However, TimerEndpoint keeps a local reference to the Timer instance, so if the TimerComponent is restarted, the TimerEndpoint will throw an exception as its timer is no longer usable as it has been canceled.
> This patch provides a unit test, TimerRestartTest, and an update to TimerComponent that fixes this issue. The TimerComponent fix is to keep a list of all TimerEndpoints that have a reference to a Timer instance created by the TimerComponent. When TimerComponent.doStop is called, those TimerEndpoint references to the now canceled Timer instances are cleared.

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


[jira] Assigned: (CAMEL-2751) Timer Component is not Restartable

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hadrian Zbarcea reassigned CAMEL-2751:
--------------------------------------

    Assignee: Hadrian Zbarcea

> Timer Component is not Restartable
> ----------------------------------
>
>                 Key: CAMEL-2751
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2751
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.2.0
>            Reporter: Scott Cranton
>            Assignee: Hadrian Zbarcea
>         Attachments: TimerComponentRestart.patch
>
>
> When the TimerComponent is stopped, it cancels all of the Timer instances it has created, which is good. However, TimerEndpoint keeps a local reference to the Timer instance, so if the TimerComponent is restarted, the TimerEndpoint will throw an exception as its timer is no longer usable as it has been canceled.
> This patch provides a unit test, TimerRestartTest, and an update to TimerComponent that fixes this issue. The TimerComponent fix is to keep a list of all TimerEndpoints that have a reference to a Timer instance created by the TimerComponent. When TimerComponent.doStop is called, those TimerEndpoint references to the now canceled Timer instances are cleared.

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


[jira] Commented: (CAMEL-2751) Timer Component is not Restartable

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59537#action_59537 ] 

Hadrian Zbarcea commented on CAMEL-2751:
----------------------------------------

Scott, thanks for the patch. I modified it a bit. One thing was to get rid of the tabs to make checkstyle happy. Another change was that instead of using and navigating the list in the TimerComponent, I thought it's easier to just have the TimerEndpoint implement Service and then reset the timer to null on stop().

Good catch. Thanks.

> Timer Component is not Restartable
> ----------------------------------
>
>                 Key: CAMEL-2751
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2751
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.2.0
>            Reporter: Scott Cranton
>         Attachments: TimerComponentRestart.patch
>
>
> When the TimerComponent is stopped, it cancels all of the Timer instances it has created, which is good. However, TimerEndpoint keeps a local reference to the Timer instance, so if the TimerComponent is restarted, the TimerEndpoint will throw an exception as its timer is no longer usable as it has been canceled.
> This patch provides a unit test, TimerRestartTest, and an update to TimerComponent that fixes this issue. The TimerComponent fix is to keep a list of all TimerEndpoints that have a reference to a Timer instance created by the TimerComponent. When TimerComponent.doStop is called, those TimerEndpoint references to the now canceled Timer instances are cleared.

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


[jira] Updated: (CAMEL-2751) Timer Component is not Restartable

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hadrian Zbarcea updated CAMEL-2751:
-----------------------------------

    Fix Version/s: 2.4.0

> Timer Component is not Restartable
> ----------------------------------
>
>                 Key: CAMEL-2751
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2751
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.2.0
>            Reporter: Scott Cranton
>            Assignee: Hadrian Zbarcea
>             Fix For: 2.4.0
>
>         Attachments: TimerComponentRestart.patch
>
>
> When the TimerComponent is stopped, it cancels all of the Timer instances it has created, which is good. However, TimerEndpoint keeps a local reference to the Timer instance, so if the TimerComponent is restarted, the TimerEndpoint will throw an exception as its timer is no longer usable as it has been canceled.
> This patch provides a unit test, TimerRestartTest, and an update to TimerComponent that fixes this issue. The TimerComponent fix is to keep a list of all TimerEndpoints that have a reference to a Timer instance created by the TimerComponent. When TimerComponent.doStop is called, those TimerEndpoint references to the now canceled Timer instances are cleared.

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


[jira] Updated: (CAMEL-2751) Timer Component is not Restartable

Posted by "Scott Cranton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Cranton updated CAMEL-2751:
---------------------------------

    Attachment: TimerComponentRestart.patch

> Timer Component is not Restartable
> ----------------------------------
>
>                 Key: CAMEL-2751
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2751
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.2.0
>            Reporter: Scott Cranton
>         Attachments: TimerComponentRestart.patch
>
>
> When the TimerComponent is stopped, it cancels all of the Timer instances it has created, which is good. However, TimerEndpoint keeps a local reference to the Timer instance, so if the TimerComponent is restarted, the TimerEndpoint will throw an exception as its timer is no longer usable as it has been canceled.
> This patch provides a unit test, TimerRestartTest, and an update to TimerComponent that fixes this issue. The TimerComponent fix is to keep a list of all TimerEndpoints that have a reference to a Timer instance created by the TimerComponent. When TimerComponent.doStop is called, those TimerEndpoint references to the now canceled Timer instances are cleared.

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