Package org.mule.transport

Examples of org.mule.transport.PollingReceiverWorker


    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


        });
    }

    private CronScheduler createVoidScheduler()
    {
        CronScheduler scheduler = new CronScheduler("name", new PollingReceiverWorker(receiver), "0/1 * * * * ?");
        scheduler.setMuleContext(muleContext);
        return scheduler;
    }
View Full Code Here

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException
    {

        PollingReceiverWorker work = (PollingReceiverWorker) getSchedulerWork(context);
        if (work != null)
        {
            work.run();
        }

    }
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

    public void testDefaultValues()
    {
        FixedFrequencySchedulerFactory factory = new FixedFrequencySchedulerFactory();


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

        assertTrue(scheduler instanceof FixedFrequencyScheduler);
        assertEquals(1000, ((FixedFrequencyScheduler) scheduler).getFrequency());
        assertEquals(TimeUnit.MILLISECONDS, ((FixedFrequencyScheduler) scheduler).getTimeUnit());
    }
View Full Code Here

        scheduler.stop();
    }

    private FixedFrequencyScheduler createVoidScheduler()
    {
        return new FixedFrequencyScheduler("name", 10, 50, new PollingReceiverWorker(receiver), TimeUnit.HOURS);
    }
View Full Code Here

TOP

Related Classes of org.mule.transport.PollingReceiverWorker

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.