Package org.mule.api.construct

Examples of org.mule.api.construct.FlowConstruct


    }


    private static String getFlowConstructName(MessageProcessorCall call)
    {
        FlowConstruct flowConstruct = call.getFlowConstruct();
        if (flowConstruct == null)
        {
            return "";
        }
        return flowConstruct.getName();
    }
View Full Code Here


        assertEquals("the-value", customStore.getCustomProperty());
    }

    private IdempotentMessageFilter idempotentMessageFilterFromFlow(String flowName) throws Exception
    {
        FlowConstruct flow = getFlowConstruct(flowName);
        assertTrue(flow instanceof Flow);

        Flow simpleFlow = (Flow) flow;
        List<MessageProcessor> processors = simpleFlow.getMessageProcessors();
        assertEquals(1, processors.size());
View Full Code Here

        installCustomExceptionHandler();
    }

    private void installCustomExceptionHandler() throws Exception
    {
        FlowConstruct flow = getFlowConstruct("filter");
        assertNotNull(flow);

        Flow simpleFlow = (Flow) flow;
        simpleFlow.setExceptionListener(new TestMessagingExceptionHandler(exceptionHandlerLatch));
    }
View Full Code Here

        System.out.println("muleContext1 = " + muleContext1);
        assertNotSame(muleContext1, muleContext);
        assertNotSame(privApp.getDeploymentClassLoader(), dummyApp.getDeploymentClassLoader());
        final Collection<FlowConstruct> flowConstructs = dummyApp.getMuleContext().getRegistry().lookupObjects(FlowConstruct.class);
        assertFalse("No FlowConstructs found in the sibling app", flowConstructs.isEmpty());
        FlowConstruct fc = flowConstructs.iterator().next();
        assertTrue(fc instanceof SimpleService);
        SimpleService service = (SimpleService) fc;
        // note that we don't have this class available to this test directly
        Class<?> clazz = ((JavaComponent) service.getComponent()).getObjectType();
        assertEquals("Wrong component implementation class", "org.mule.module.launcher.EchoTest", clazz.getName());
View Full Code Here

     */
    public static ProcessingTime newInstance(MuleSession session, MuleContext muleContext)
    {
        if (session != null)
        {
            FlowConstruct fc = session.getFlowConstruct();
            if (fc != null)
            {
                FlowConstructStatistics stats = fc.getStatistics();
                if (stats != null && fc.getStatistics().isEnabled())
                {
                    return new ProcessingTime(stats, muleContext);
                }
            }

View Full Code Here

     * @throws org.mule.api.MuleException if there is no outbound endpoint configured
     *             on the service or the events fails during dispatch
     */
    public void dispatchEvent(MuleMessage message) throws MuleException
    {
        FlowConstruct flowConstruct = session.getFlowConstruct();
        if (flowConstruct == null)
        {
            throw new IllegalStateException(CoreMessages.objectIsNull("flowConstruct").getMessage());
        }
        else if (!(flowConstruct instanceof Service))
        {
            throw new UnsupportedOperationException(
                "EventContext.dispatchEvent is only supported when flow constuct is a Service");
        }
        else
        {
            MessageProcessor processor = ((Service) flowConstruct).getOutboundMessageProcessor();
            if (processor == null)
            {
                throw new EndpointNotFoundException(
                    CoreMessages.noOutboundRouterSetOn(flowConstruct.getName()));
            }
            processor.process(new DefaultMuleEvent(message, RequestContext.getEvent()));
        }
    }
View Full Code Here

    protected void handleGroupExpiry(EventGroup group) throws MessagingException
    {
        removeEventGroup(group);

        final FlowConstruct service = group.toArray()[0].getFlowConstruct();

        if (isFailOnTimeout())
        {
            final MuleMessageCollection messageCollection = group.toMessageCollection();
            muleContext.fireNotification(new RoutingNotification(messageCollection, null,
View Full Code Here

        }
    }
   
    public void testRegisterUnregister() throws MuleException, Exception
    {
        FlowConstruct construct = getFlowConstruct();
        muleContext.getRegistry().registerFlowConstruct(construct);
        assertNotNull(muleContext.getRegistry().lookupFlowConstruct(construct.getName()));
    }   
View Full Code Here

        return new DefaultMessageProcessorChainBuilder().chain(messageProcessors).build();
    }
   
    protected MuleEvent doProcess(MuleEvent event) throws MuleException
    {
        FlowConstruct flowConstruct = event.getFlowConstruct();
        MuleEvent currentEvent = event;
        MuleEvent resultEvent;
        MuleEvent copy = null;
        Iterator<MessageProcessor> processorIterator = processors.iterator();
        while (processorIterator.hasNext())
View Full Code Here

     * make sure your component is declared as a singleton, otherwise this will not
     * work.
     */
    protected Object getComponent(String serviceName) throws Exception
    {
        final FlowConstruct flowConstruct = muleContext.getRegistry().lookupObject(serviceName);

        if (flowConstruct != null)
        {
            return getComponent(flowConstruct);
        }
View Full Code Here

TOP

Related Classes of org.mule.api.construct.FlowConstruct

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.