hi . i integrated the quartz for the future remainder so its executing
good..but now i need to reset the quartz cron expression .when i try to stop
using root id and starting again then its added to existing quartz job.
this is my code for creating 
public class test
{
      CamelContext context = new DefaultCamelContext();
public RouteBuilder createMyRoutes(final String cronExp,final int day) 
        {
            return new RouteBuilder()
            {
                @Override
                public void configure() throws Exception {
                        log.debug("Before set schedulling");
                    
from("quartz2://RemainderGroup/Remainder?cron="+cronExp+"&trigger.repeatCount=0&deleteJob=true&job.name='RemainderServices'").bean(new
RemainderScheduler(), "sendRemainder('"+day+"')").routeId("Remainder");
                     log.debug("after set schedulling");
                        
                }
            };
        }
i am calling from bellow method
public void create(final String cronExp,final int day)
        {
        try
        {
                        
                        context.addRoutes(createMyRoutes(cronExp, day));
                        context.start();
                        context.stopRoute("Remainder");
                        context.removeRoute("Remainder");
                        context.addRoutes(createMyRoutes(cronExp, day));
                        context.start();

                        
        }
        catch(Exception e)
        {
                System.out.println(e.toString());
                e.printStackTrace();
        }

    }
}
 i am doing the remove the existing quartz job and starting with new job.
but its added to existing job. i do know what is   wrong. and i am creating
the instance variable of context.
and this create method of class i calling at run time.
so i want that when user call this method then its remove previous quartz
definition and start with new cron expression.


        



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-stop-the-previous-quartz2-tp5743565.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to