[ 
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.

Reply via email to