[ 
https://issues.apache.org/activemq/browse/CAMEL-2936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62088#action_62088
 ] 

Claus Ibsen commented on CAMEL-2936:
------------------------------------

Looks good, however there is one issue = OSGi.

Loading properties should be using the {{ClassResolver}} from {{CamelContext}}. 
See the {{loadProperties}} method in {{QuartzComponent}}.

But I think a better solution would be to re-use the {{QuartzComponent}} in the 
route policy. As the component has all the quartz scheduler bits already and 
working in OSGi.
Also people want to use the same quartz scheduler for route policies and if 
they use quartz in the camel routes as well. 

You can get the quartz component from the {{onInit}} method

{code}
QuartzComponent quartz = 
route.getRouteContext().getCamelContext().getComponent("quartz", 
QuartzComponent.class);
{code}

So your class {[ScheduledRoutePolicy}} should use {{QuartzComponent}}. 

You may need to alter the API in QuartzCompent a bit if there is some pieces 
missing for you.

> Provided a ScheduledRoutePolicy to make it easy to define when routes should 
> be active
> --------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2936
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2936
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: CAMEL-2936-Core-routepolicy.diff, 
> CAMEL-2936-ScheduledRoutePolicy.diff
>
>
> A {{ScheduledRoutePolicy}} which can suspend/resume routes based on a user 
> configuration.
> The scheduled should invoke a callback on regular bases where end user can 
> determine if the routes should be active nor not.
> For example we may even let it be defined using cron or the likes.

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