Package org.mule.api.routing

Examples of org.mule.api.routing.RoutingException


public class ExceptionThrowingOutboundRouter extends OutboundPassThroughRouter
{
    public MuleEvent process(MuleEvent event) throws MuleException
    {
        throw new RoutingException(MessageFactory.createStaticMessage("dummyException"), event, null);
    }
View Full Code Here


    public final void testRoutingExceptionNullMessageValidEndpoint() throws MuleException
    {
        OutboundEndpoint endpoint = muleContext.getEndpointFactory().getOutboundEndpoint("test://outbound");
        assertNotNull(endpoint);

        RoutingException rex = new RoutingException((MuleEvent) null, endpoint);
        assertSame(endpoint, rex.getRoute());
    }
View Full Code Here

                return null;
            }
        }
        catch (MuleException e)
        {
            throw new RoutingException(event, this, e);
        }
    }
View Full Code Here

    @Override
    public MuleEvent doCatchMessage(MuleEvent event) throws RoutingException
    {
        if (getEndpoint() == null)
        {
            throw new RoutingException(CoreMessages.noCatchAllEndpointSet(), event, getEndpoint());
        }
        try
        {
            OutboundEndpoint endpoint = getEndpoint();
            if (sendTransformed && endpoint.getTransformers() != null)
            {
                event.getMessage().applyTransformers(event, endpoint.getTransformers());
            }

            MuleEvent result = endpoint.process(event);
            if (statistics != null && statistics.isEnabled())
            {
                statistics.incrementRoutedMessage(getEndpoint());
            }
            return result;
        }
        catch (Exception e)
        {
            throw new RoutingException(event, getEndpoint(), e);

        }
    }
View Full Code Here

        {
            data = message.getPayloadAsBytes();
        }
        catch (Exception e)
        {
            throw new RoutingException(CoreMessages.failedToReadPayload(), event, next, e);
        }

        int parts = data.length / messageSize;
        if ((parts * messageSize) < data.length)
        {
View Full Code Here

            byte[] digestedBytes = md.digest(bytes);
            return (String)byteArrayToHexString.transform(digestedBytes);
        }
        catch (NoSuchAlgorithmException nsa)
        {
            throw new RoutingException(event,this, nsa);
        }
        catch (TransformerException te)
        {
            throw new RoutingException(event, this, te);
        }
    }
View Full Code Here

        {
            return mp.process(event);
        }
        catch (MuleException ex)
        {
            throw new RoutingException(event, this, ex);
        }
    }
View Full Code Here

                    return null;
                }
            }
            catch (MuleException e)
            {
                throw new RoutingException(event, this, e);
            }
        }
    }
View Full Code Here

                // ignore
            }
        }
        if (groupId == null || groupId.equals("-1"))
        {
            throw new RoutingException(CoreMessages.noCorrelationId(), event, timeoutMessageProcessor);
        }

        // indicates interleaved EventGroup removal (very rare)
        boolean lookupMiss = false;
View Full Code Here

            {
                data = message.getPayloadAsBytes();
            }
            catch (Exception e)
            {
                throw new RoutingException(CoreMessages.failedToReadPayload(), event, getRoute(0, event), e);
            }

            int parts = data.length / messageSize;
            if ((parts * messageSize) < data.length)
            {
                parts++;
            }
            int len = messageSize;
            MuleMessage part;
            int count = 0;
            int pos = 0;
            byte[] buffer;
            try
            {
                for (; count < parts; count++)
                {
                    if ((pos + len) > data.length)
                    {
                        len = data.length - pos;
                    }
                    buffer = new byte[len];
                    System.arraycopy(data, pos, buffer, 0, buffer.length);
                    pos += len;
                    part = new DefaultMuleMessage(buffer, message, muleContext);
                    part.setCorrelationId(message.getUniqueId());
                    part.setCorrelationGroupSize(parts);
                    part.setCorrelationSequence(count);

                    if (logger.isInfoEnabled())
                    {
                        logger.info(String.format("sending part %d of %d (seq # %d)", count + 1, parts, count));
                    }
                    super.route(new DefaultMuleEvent(part, event.getEndpoint(), session));
                    if (logger.isInfoEnabled())
                    {
                        logger.info("sent");
                    }
                }
            }
            catch (RoutingException e)
            {
                // we'll want to send the whole message to the Exception handler
                e = new RoutingException(e.getI18nMessage(), e.getEvent(), e.getRoute(), e.getCause());
                // e.addInfo("chunking", "true");
                // buffer = new byte[data.length - len];
                // System.arraycopy(data, len, buffer, 0, buffer.length);
                // e.addInfo("remaining data", buffer);
                throw e;
View Full Code Here

TOP

Related Classes of org.mule.api.routing.RoutingException

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.