Examples of FlowConstruct


Examples of org.mule.api.construct.FlowConstruct

    }

    @Test
    public void testDefaultExceptionStrategyMultipleEndpoints() throws MuleException
    {
        FlowConstruct service;

        if (variant.equals(ConfigVariant.FLOW))
            service = muleContext.getRegistry().lookupFlowConstruct("testService2");
        else
            service = muleContext.getRegistry().lookupService("testService2");

        assertNotNull(service);
        assertNotNull(service.getExceptionListener());
        assertTrue(service.getExceptionListener() instanceof DefaultMessagingExceptionStrategy);
        DefaultMessagingExceptionStrategy exceptionListener = (DefaultMessagingExceptionStrategy) service.getExceptionListener();
        MessageProcessor mp = exceptionListener.getMessageProcessors().iterator().next();
        assertTrue(mp.getClass().getName(), mp instanceof MulticastingRouter);
        assertEquals(2, ((MulticastingRouter) mp).getRoutes().size());

        MuleClient client = muleContext.getClient();
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

    }

    @Test
    public void testStopsServiceOnException() throws MuleException, InterruptedException
    {
        final FlowConstruct service;

        if (variant.equals(ConfigVariant.FLOW))
            service = muleContext.getRegistry().lookupFlowConstruct("testService5");
        else
            service = muleContext.getRegistry().lookupService("testService5");

        MuleClient client = muleContext.getClient();
        client.dispatch("vm://in5", "test", null);

        assertExceptionMessage(client.request("vm://out5", RECEIVE_TIMEOUT));

        Prober prober = new PollingProber(5000, 100);
        prober.check(new Probe()
        {
            @Override
            public boolean isSatisfied()
            {
                return !service.getLifecycleState().isStarted();
            }

            @Override
            public String describeFailure()
            {
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

            assertEquals(2, async.getStatistics().getProcessedEvents());
            assertEquals(1, external.getStatistics().getProcessedEvents());
        }
        else
        {
            FlowConstruct async = muleContext.getRegistry().lookupFlowConstruct(
                "In-Out_Out-Only-Async-Service");
            FlowConstruct external = muleContext.getRegistry().lookupFlowConstruct("ExternalApp");

            assertEquals(2, async.getStatistics().getProcessedEvents());
            assertEquals(1, external.getStatistics().getProcessedEvents());
        }

    }
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

        @Override
        public MuleEvent aggregateEvents(EventGroup events) throws AggregationException
        {
            List<MuleEvent> eventList = new ArrayList<MuleEvent>();
            Iterator<MuleEvent> iter = null;
            FlowConstruct fc = null;
            try
            {
                iter = events.iterator(true);
            }
            catch (ObjectStoreException e)
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

            // <end id="lis_12_context_statistics"/>
        } else {
            final String flowName = payload.toString();

            // <start id="lis_12_registry_flow_statistics"/>
            final FlowConstruct flow = muleContext.getRegistry()
                    .lookupFlowConstruct(flowName);

            FlowConstructStatistics flowStatistics = flow.getStatistics();
            new XMLPrinter(xmlStatisticsWriter)
                    .print(Collections.singleton(flowStatistics));
            // <end id="lis_12_registry_flow_statistics"/>
        }
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

     */
    public static ProcessingTime newInstance(MuleEvent event)
    {
        if (event != null)
        {
            FlowConstruct fc = event.getFlowConstruct();
            if (fc != null)
            {
                FlowConstructStatistics stats = fc.getStatistics();
                if (stats != null && fc.getStatistics().isEnabled())
                {
                    return new ProcessingTime(stats, event.getMuleContext());
                }
            }
        }
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

        @SuppressWarnings("unchecked")
        Map<String, Object> properties = jobDataMap;

        MuleMessage message = new DefaultMuleMessage(payload, properties, muleContext);

        FlowConstruct flowConstruct = new DefaultLocalMuleClient.MuleClientFlowConstruct(muleContext);
        MuleEvent event = new DefaultMuleEvent(message, MessageExchangePattern.ONE_WAY, flowConstruct);

        OutboundEndpoint endpoint = getOutboundEndpoint(endpointRef);
        endpoint.process(event);
    }
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

        File target = createTestFile(testFolder1);
        // Starts file endpoint polling
        muleContext.start();

        // Exception strategy should be stopped after processing the file
        final FlowConstruct fileFlow = muleContext.getRegistry().lookupFlowConstruct("fileTest");
        prober.check(new FlowStopped(fileFlow));

        // Checks that the source file was not deleted after the exception processing
        prober.check(new FileExists(target));
    }
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

        // Starts file endpoint polling
        muleContext.start();

        // Exception strategy should be stopped after processing the file
        final FlowConstruct fileFlow = muleContext.getRegistry().lookupFlowConstruct("fileTestWithTransformation");
        prober.check(new FlowStopped(fileFlow));

        // Checks that the source file was deleted after the exception processing
        assertFalse(target.exists());
    }
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

    }

    @Override
    public void testSend() throws Exception
    {
        final FlowConstruct testSedaService = muleContext.getRegistry().lookupFlowConstruct("testComponent");
        FunctionalTestComponent testComponent = (FunctionalTestComponent) getComponent(testSedaService);
        assertNotNull(testComponent);

        final AtomicBoolean callbackMade = new AtomicBoolean(false);
        EventCallback callback = new EventCallback()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.