Package org.mule.api.schedule

Examples of org.mule.api.schedule.Scheduler


     *                   Failure Exception
     *                   </p>
     */
    public void schedulePoll(String flowName) throws Exception
    {
        Scheduler scheduler = getScheduler(flowName);
        scheduler.schedule();
    }
View Full Code Here


     *                   Failure Exception
     *                   </p>
     */
    public void stopPoll(String flowName) throws Exception
    {
        Scheduler scheduler = getScheduler(flowName);
        scheduler.stop();
    }
View Full Code Here

     *                   Failure Exception
     *                   </p>
     */
    public void startPoll(String flowName) throws Exception
    {
        Scheduler scheduler = getScheduler(flowName);
        scheduler.start();
    }
View Full Code Here

    public void testSchedulerCreation()
    {
        CronSchedulerFactory factory = new CronSchedulerFactory();
        factory.setExpression("my expression");

        Scheduler scheduler = factory.create("name", new PollingReceiverWorker(receiver));

        assertTrue(scheduler instanceof CronScheduler);
        assertEquals("my expression", ((CronScheduler) scheduler).getCronExpression());
    }
View Full Code Here

{

    @Override
    public Scheduler process(Object job,final Scheduler scheduler)
    {
        return new Scheduler()
        {

            @Override
            public void schedule() throws Exception
            {
View Full Code Here

    }

    @Test
    public void registerScheduler() throws MuleException
    {
        Scheduler scheduler = scheduler();
        register(scheduler);
        muleContext.getRegistry().unregisterScheduler(scheduler);
        assertNull(muleContext.getRegistry().lookupObject("schedulerName"));
    }
View Full Code Here

    }

    @Test
    public void lookupScheduler() throws MuleException
    {
        Scheduler scheduler = scheduler();
        register(scheduler);
        assertEquals(scheduler, muleContext.getRegistry().lookupScheduler(new Predicate<String>()
        {
            @Override
            public boolean evaluate(String s)
View Full Code Here

    }

    @Test
    public void unregisterScheduler() throws MuleException
    {
        Scheduler scheduler = scheduler();
        register(scheduler);

        assertEquals(scheduler, muleContext.getRegistry().lookupObject("schedulerName"));
    }
View Full Code Here

        muleContext.getRegistry().registerScheduler(scheduler);
    }

    private Scheduler scheduler()
    {
        Scheduler scheduler = mock(Scheduler.class);
        when(scheduler.getName()).thenReturn("schedulerName");
        return scheduler;
    }
View Full Code Here

        FixedFrequencySchedulerFactory factory = new FixedFrequencySchedulerFactory();
        factory.setFrequency(300);
        factory.setStartDelay(400);
        factory.setTimeUnit(TimeUnit.DAYS);

        Scheduler scheduler = factory.doCreate("name", new PollingReceiverWorker(receiver));

        assertTrue(scheduler instanceof FixedFrequencyScheduler);
        assertEquals(300, ((FixedFrequencyScheduler) scheduler).getFrequency());
        assertEquals(TimeUnit.DAYS, ((FixedFrequencyScheduler) scheduler).getTimeUnit());
        assertEquals("name", scheduler.getName());
    }
View Full Code Here

TOP

Related Classes of org.mule.api.schedule.Scheduler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.