Examples of FlowConstruct


Examples of org.mule.api.construct.FlowConstruct

    }

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

        assertNotNull(testComponent);

        final AtomicBoolean callbackMade = new AtomicBoolean(false);
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

        return exceptionThrown;
    }

    public String getProcessorPath()
    {
        FlowConstruct fc = getSource().getFlowConstruct();
        if (!(fc instanceof MessageProcessorPathResolver))
        {
            return null;
        }
        return ((MessageProcessorPathResolver) fc).getProcessorPath(processor);
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

    }

    protected MuleEvent createMockEvent()
    {
        MuleEvent event = mock(MuleEvent.class);
        FlowConstruct flowConstruct = mock(FlowConstruct.class);
        when(flowConstruct.getName()).thenReturn("myFlow");
        MuleMessage message = createMockMessage();
        Mockito.when(event.getFlowConstruct()).thenReturn(flowConstruct);
        Mockito.when(event.getMessage()).thenReturn(message);
        return event;
    }
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

    final public MuleEvent handleException(Exception exception, MuleEvent event)
    {
        try
        {
            muleContext.getNotificationManager().fireNotification(new ExceptionStrategyNotification(event, ExceptionStrategyNotification.PROCESS_START));
            FlowConstruct flowConstruct = event.getFlowConstruct();
            fireNotification(exception);
            logException(exception);
            processStatistics(event);
            event.getMessage().setExceptionPayload(new DefaultExceptionPayload(exception));
            event = beforeRouting(exception, event);
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

     * @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 = event.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

Examples of org.mule.api.construct.FlowConstruct

    }

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

Examples of org.mule.api.construct.FlowConstruct

        {
            return doProcessFlowEndingWithOneWayEndpointReturnsNull(event);
        }
        else
        {
            FlowConstruct flowConstruct = event.getFlowConstruct();
            boolean flowConstructIsNotAService = !(flowConstruct instanceof Service);
            MuleEvent copy = null;
           
            for (int i = 0; i < processors.size(); i++)
            {
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

     * Using old implementation 100% as is.
     */
    private MuleEvent doProcessFlowEndingWithOneWayEndpointReturnsNull(MuleEvent event)
        throws MessagingException
    {
        FlowConstruct flowConstruct = event.getFlowConstruct();
        MuleEvent currentEvent = event;
        MuleEvent resultEvent;
        MuleEvent copy = null;
        Iterator<MessageProcessor> processorIterator = processors.iterator();
        MessageProcessor processor = null;
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

        Service serviceNoExceptionStrategyInModel = muleContext.getRegistry().lookupService("serviceNoExceptionStrategyInModel");
        MessagingExceptionHandler serviceNoExceptionStrategyInModelExceptionListener = serviceNoExceptionStrategyInModel.getExceptionListener();
        assertThat(serviceNoExceptionStrategyInModelExceptionListener, instanceOf(CustomExceptionStrategy.class));
        assertThat(usedExceptionStrategies.add(serviceNoExceptionStrategyInModelExceptionListener),is(true));

        FlowConstruct flowNoExceptionStrategy = muleContext.getRegistry().lookupFlowConstruct("flowNoExceptionStrategy");
        MessagingExceptionHandler flowNoExceptionStrategyExceptionListener = flowNoExceptionStrategy.getExceptionListener();
        assertThat(flowNoExceptionStrategyExceptionListener, instanceOf(CustomExceptionStrategy.class));
        assertThat(usedExceptionStrategies.add(flowNoExceptionStrategyExceptionListener),is(true));

        FlowConstruct flowExceptionStrategy = muleContext.getRegistry().lookupFlowConstruct("flowExceptionStrategy");
        MessagingExceptionHandler flowExceptionStrategyExceptionListener = flowExceptionStrategy.getExceptionListener();
        assertThat(flowExceptionStrategyExceptionListener, instanceOf(CatchMessagingExceptionStrategy.class));
        assertThat(usedExceptionStrategies.add(flowExceptionStrategyExceptionListener),is(true));

    }
View Full Code Here

Examples of org.mule.api.construct.FlowConstruct

    protected MessageReceiver createMessageReciever(MessageExchangePattern mep) throws MuleException
    {
        AbstractConnector connector = Mockito.mock(AbstractConnector.class);
        Mockito.when(connector.getSessionHandler()).thenReturn(new NullSessionHandler());

        FlowConstruct flowConstruct = Mockito.mock(FlowConstruct.class);

        InboundEndpoint endpoint = Mockito.mock(InboundEndpoint.class);
        Mockito.when(endpoint.getExchangePattern()).thenReturn(mep);
        Mockito.when(endpoint.getConnector()).thenReturn(connector);
        Mockito.when(endpoint.getEndpointURI()).thenReturn(new MuleEndpointURI("test://test", muleContext));
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.