Package org.mule.api.transformer

Examples of org.mule.api.transformer.TransformerException


      restRes.setBody(body);
      String uuid = msg.getProperty("uuid", PropertyScope.SESSION);
      restRes.setUuid(uuid);
      restRes.setHttpHeaders((Map<String, Object>) msg.getProperty("http.headers", PropertyScope.INBOUND));
    } catch (Exception e) {
      throw new TransformerException(this, e);
    }
   
    return restRes;
  }
View Full Code Here


      String body = msg.getPayloadAsString();
      if (body != url) {
        restMsg.setBody(body);
      }
    } catch (Exception e) {
      throw new TransformerException(this, e);
    }
   
    String scheme = ((String)msg.getInboundProperty("http.context.uri")).split(":")[0];
    if ("https".equals(scheme))
      restMsg.setScheme(Scheme.HTTPS);
View Full Code Here

      throws TransformerException {
   
    Map<String, String> paramMap = null;
   
    if (!(obj instanceof Map)) {
      throw new TransformerException(null);
    } else {
      paramMap = (Map<String, String>) obj;
    }
   
    StringBuilder sb = new StringBuilder("?");
   
    for (String param : paramMap.keySet()) {
      String value = paramMap.get(param);
      if (sb.length() > 1) {
        sb.append("&");
      }
      try {
        sb.append(URLEncoder.encode(param, enc) + "=" + URLEncoder.encode(value, enc));
      } catch (UnsupportedEncodingException e) {
        throw new TransformerException((Message)null, e);
      }
    }
   
    return sb.toString();
  }
View Full Code Here

{

    @Override
    public Object transformMessage(MuleMessage message, String outputEncoding) throws TransformerException
    {
        throw new TransformerException(MessageFactory.createStaticMessage("Error"));
    }
View Full Code Here

        {
            return this.primTransform(input);
        }
        catch (CryptoFailureException e)
        {
            throw new TransformerException(this, e);
        }
    }
View Full Code Here

public class FailingTransformer extends AbstractTransformer
{

    protected Object doTransform(Object src, String encoding) throws TransformerException
    {
        throw new TransformerException(this, new Exception("Wrapped test exception"));
    }
View Full Code Here

        String title = message.getInboundProperty("title");
        String price = message.getInboundProperty("price");

        if (StringUtils.isBlank(author))
        {
            throw new TransformerException(BookstoreAdminMessages.missingAuthor(), this);
        }
        if (StringUtils.isBlank(title))
        {
            throw new TransformerException(BookstoreAdminMessages.missingTitle(), this);
        }
        if (StringUtils.isBlank(price))
        {
            throw new TransformerException(BookstoreAdminMessages.missingPrice(), this);
        }

        return new Book(author, title, Double.parseDouble(price));
    }
View Full Code Here

            {
                o = new ObjectInputStream((InputStream) src).readObject();
            }
            catch (Exception e)
            {
                throw new TransformerException(this, e);
            }
        }
        else
        {
            byte[] data = (byte[]) src;
            ByteArrayInputStream bais = new ByteArrayInputStream(data);
            try
            {
                ObjectInputStream ois = new ObjectInputStream(bais);
                o = ois.readObject();
            }
            catch (Exception e)
            {
                throw new TransformerException(this, e);
            }
        }

        RemoteInvocation ri = (RemoteInvocation) o;
        if (logger.isDebugEnabled())
View Full Code Here

        {
            return response;
        }
        else
        {
            throw new TransformerException(MessageFactory.createStaticMessage("Invalid response from service: " + response));
        }
    }
View Full Code Here

            oos.close();
            return baos.toByteArray();
        }
        catch (Exception e)
        {
            throw new TransformerException(this, e);
        }
    }
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.