Package org.mule.transport

Examples of org.mule.transport.PollingController


    @Test
    public void overriddenMulePollingController() throws Exception
    {
        MuleContext context = new DefaultMuleContextFactory().createMuleContext();
        context.getRegistry().registerObject(MuleProperties.OBJECT_POLLING_CONTROLLER, new PollingController()
        {
            @Override
            public boolean isPrimaryPollingInstance()
            {
                return false;
View Full Code Here


        IOUtils.write(data, fos);
        IOUtils.closeQuietly(fos);

        shouldPoll = false;

        ((DefaultMuleContext) muleContext).setPollingController(new PollingController()
        {
            @Override
            public boolean isPrimaryPollingInstance()
            {
                return shouldPoll;
View Full Code Here

        }
    }

    private void overridePollingController()
    {
        PollingController overriddenPollingController = getRegistry().get(OBJECT_POLLING_CONTROLLER);
        if (overriddenPollingController != null)
        {
            this.pollingController = overriddenPollingController;
        }
    }
View Full Code Here

    }

    @Test
    public void testMuleReceiverJob() throws Exception
    {
        ((DefaultMuleContext) muleContext).setPollingController(new PollingController()
        {
            @Override
            public boolean isPrimaryPollingInstance()
            {
                return false;
            }
        });

        FunctionalTestComponent component = (FunctionalTestComponent) getComponent("quartzService1");
        assertNotNull(component);
        CountdownCallback count1 = new CountdownCallback(1000);
        component.setEventCallback(count1);

        component = (FunctionalTestComponent) getComponent("quartzService2");
        assertNotNull(component);
        CountdownCallback count2 = new CountdownCallback(1000);
        component.setEventCallback(count2);
        Thread.sleep(10000);

        assertEquals(1000, count1.getCount());
        assertEquals(1000, count2.getCount());
        ((DefaultMuleContext)muleContext).setPollingController(new PollingController()
        {
            @Override
            public boolean isPrimaryPollingInstance()
            {
                return true;
View Full Code Here

    }

    @Test
    public void testMuleSenderJob() throws Exception
    {
        ((DefaultMuleContext) muleContext).setPollingController(new PollingController()
        {
            @Override
            public boolean isPrimaryPollingInstance()
            {
                return false;
View Full Code Here

TOP

Related Classes of org.mule.transport.PollingController

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.