Package org.mule.api.transformer

Examples of org.mule.api.transformer.TransformerException


    protected Session getSession() throws TransformerException
    {
        if (null == endpoint)
        {
            throw new TransformerException(this,
                    new IllegalStateException("The transformer is no associated with an endpoint."));
        }
        Connector connector = endpoint.getConnector();
        if (!(connector instanceof AbstractMailConnector))
        {
            throw new TransformerException(this,
                    new IllegalStateException("The transformer is not associated with an email endpoint."));
        }
        try
        {
            return ((AbstractMailConnector) connector).getSessionDetails(endpoint).getSession();
        }
        catch (UnsupportedEncodingException e)
        {
            throw new TransformerException(this, e);
        }
    }
View Full Code Here


            mime.writeTo(baos);
            return baos.toByteArray();
        }
        catch (Exception e)
        {
            throw new TransformerException(this, e);
        }
    }
View Full Code Here

                    entry.addLink(link.toString());
                }
            }
            else
            {
                throw new TransformerException(CoreMessages.propertyHasInvalidValue("entry-property.name", argName), this);
            }

        }

        if (TYPE_ENTRY.equals(getReturnDataType()))
View Full Code Here

                }
            };
        }
        catch (Exception e)
        {
            throw new TransformerException(this, e);
        }
    }
View Full Code Here

            // MultiPart content
            return "";
        }
        catch (Exception e)
        {
            throw new TransformerException(this, e);
        }
    }
View Full Code Here

            //we only need to check for the registered source types
            return doc.getRoot();
        }
        catch (Exception e)
        {
            throw new TransformerException(this, e);
        }
    }
View Full Code Here

        {
            is = httpMethod.getResponseBodyAsStream();
        }
        catch (IOException e)
        {
            throw new TransformerException(this, e);
        }
       
        if (is == null)
        {
            msg = NullPayload.getInstance();
View Full Code Here

                return baos.toByteArray();
            }
            catch (Exception e)
            {
                throw new TransformerException(this, e);
            }
            finally
            {
                IOUtils.closeQuietly(inputStream);
            }

        }
        else
        {
            throw new TransformerException(
                MessageFactory.createStaticMessage("Message is not an instance of java.io.InputStream"), this);
        }
    }
View Full Code Here

            }
            return response;
        }
        catch (Exception e)
        {
            throw new TransformerException(this, e);
        }

    }
View Full Code Here

        }

        Map customHeaders = msg.getOutboundProperty(HttpConnector.HTTP_CUSTOM_HEADERS_MAP_PROPERTY);
        if (customHeaders != null)
        {
            throw new TransformerException(HttpMessages.customHeaderMapDeprecated(), this);
        }

        //attach the outbound properties to the message
        for (String headerName : msg.getOutboundPropertyNames())
        {
            Object v = msg.getOutboundProperty(headerName);
            if (v != null)
            {
                response.setHeader(new Header(headerName, v.toString()));
            }
        }

        // Mule properties
        String user = msg.getOutboundProperty(MuleProperties.MULE_USER_PROPERTY);
        if (user != null)
        {
            response.setHeader(new Header(CUSTOM_HEADER_PREFIX + MuleProperties.MULE_USER_PROPERTY, user));
        }
        if (msg.getCorrelationId() != null)
        {
            response.setHeader(new Header(CUSTOM_HEADER_PREFIX + MuleProperties.MULE_CORRELATION_ID_PROPERTY,
                    msg.getCorrelationId()));
            response.setHeader(new Header(CUSTOM_HEADER_PREFIX
                    + MuleProperties.MULE_CORRELATION_GROUP_SIZE_PROPERTY,
                    String.valueOf(msg.getCorrelationGroupSize())));
            response.setHeader(new Header(CUSTOM_HEADER_PREFIX
                    + MuleProperties.MULE_CORRELATION_SEQUENCE_PROPERTY,
                    String.valueOf(msg.getCorrelationSequence())));
        }
        if (msg.getReplyTo() != null)
        {
            response.setHeader(new Header(CUSTOM_HEADER_PREFIX + MuleProperties.MULE_REPLY_TO_PROPERTY,
                    msg.getReplyTo().toString()));
        }

        try
        {
            response.setBody(msg);
        }
        catch (Exception e)
        {
            throw new TransformerException(this, e);
        }

        return response;
    }
View Full Code Here

TOP

Related Classes of org.mule.api.transformer.TransformerException

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.