Package org.jboss.soa.esb.actions

Examples of org.jboss.soa.esb.actions.ActionProcessingException


            Object content;
           
            try {
                content = payloadProxy.getPayload(message);
            } catch (MessageDeliverException e) {
                throw new ActionProcessingException(e);
            }

            route(content);
      } else {
        route(message);
View Full Code Here


            Object content;
           
            try {
                content = payloadProxy.getPayload(message);
            } catch (MessageDeliverException e) {
                throw new ActionProcessingException(e);
            }

            logger.info("EchoRouter currently routing message " + message + " with payload <<" + content + ">>");
    }
View Full Code Here

     
      for(int i = 0; i < paramResolvers.length; i++) {
        try {
          params[i] = paramResolvers[i].getParam(message);
        } catch (MessageDeliverException e) {
          throw new ActionProcessingException("Error resolving method parameter from ESB message.", e);
        }
      }
     
      processResult = processMethod.invoke(bean, params);           
    } catch (IllegalArgumentException e) {
      throw new ActionProcessingException("Bean Action '" + actionName + "' exception.", e);
    } catch (IllegalAccessException e) {
      throw new ActionProcessingException("Bean Action '" + actionName + "' exception.", e);
    } catch (InvocationTargetException e) {
      Throwable targetException = e.getTargetException();
      if(targetException instanceof ActionProcessingException) {
        throw (ActionProcessingException) targetException;
      } else if (targetException instanceof RuntimeException) {
        throw (RuntimeException) targetException;
      } else {
        throw new ActionProcessingException("Bean Action '" + actionName + "' exception.", targetException);
      }
    }
   
    if(processResult == null && processMethod.getReturnType() != void.class) {
      // Terminate the pipeline...
      return null;
    }
   
    if(processResult instanceof Message) {
      return (Message) processResult;
    } else if(processResult != null) {
      try {
        payloadProxy.setPayload(message, processResult);
      } catch (MessageDeliverException e) {
        throw new ActionProcessingException("Error injecting 'out' payload into ESB message.", e);
      }
    }
   
    return message;
  }
View Full Code Here

            log.error(errorMsg, e);
            throw new ValidationException(errorMsg, e);
        }
        catch (IOException e)
        {
            throw new ActionProcessingException(e.getMessage(), e);
        }
    }
View Full Code Here

        {
            payload = payloadProxy.getPayload(message);
        }
        catch (final MessageDeliverException e)
        {
            throw new ActionProcessingException(e.getMessage(), e);
        }

        if (payload instanceof byte[])
        {
            return new String((byte[]) payload);
        }
        else if (payload instanceof String)
        {
            return (String) payload;
        }
        else
        {
            throw new ActionProcessingException("Message payload must be either a byte[] or a String. The payload type was '" + payload.getClass().getName() + "'");
        }
    }
View Full Code Here

        Object object;
        try {
            object = payloadProxy.getPayload(message);
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }

        XStream xstream = createXStreamInstance();
       
        if(classAlias == null) {
            if(excludePackage) {
                xstream.alias(object.getClass().getSimpleName(), object.getClass());
            } else {
                xstream.alias(object.getClass().getName(), object.getClass());
            }
        } else {
            xstream.alias(classAlias, object.getClass());
        }
        XStreamConfigurator.addClassAliases(classAliases, xstream);
        XStreamConfigurator.addFieldAliases(fieldAliases, xstream);
        XStreamConfigurator.addImplicitCollections(implicitCollections, xstream);
        XStreamConfigurator.addConverters(converters, xstream);
       
        try {
            String xml = xstream.toXML(object);
            payloadProxy.setPayload(message, xml);
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }

        return message;
    }
View Full Code Here

        {
            emailer.sendEmail(config, object);
        }
        catch (MessageDeliverException e)
        {
            throw new ActionProcessingException("Exception while trying to send email.", e);
        }
    }
View Full Code Here

        {
            emailer.sendEmail(message);
        }
        catch (final MessageDeliverException e)
        {
            throw new ActionProcessingException(e.getMessage(), e);
        }
       
        return message;
    }
View Full Code Here

        Object oCurr = null;
        try {
            oCurr = payloadProxy.getPayload(message);
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }

      Class oCurrClass = (null==oCurr) ? null : oCurr.getClass();
        StringBuffer csv = new StringBuffer();
        boolean hasAppendStarted = false; // Have we appended a value yet?
       
        for(String methodName : propertyMethodNames) {
            Method method;

            if(hasAppendStarted) {
                csv.append(",");
            }
            hasAppendStarted = true;

            // Get the bean method....
            try {
                method = oCurrClass.getMethod(methodName, new Class[] {});
            } catch (Exception e) {
              String exceptionMessage = "Bean method: " + methodName + " not found/accessible on message object " + oCurr.getClass().getName();
                logger.error(exceptionMessage, e);
                if(failOnMissingProperty) {
                  throw new ActionProcessingException(exceptionMessage, e);
                }
                csv.append("<no-such-property>");
                continue;
            }

            // Call the bean method and add the toString of the return to the CSV string....
            try {
                Object value = method.invoke(oCurr, new Object[] {});
                // TODO: Some sort of encoding is required here to make a proper CSV string...
                csv.append(value != null?value.toString():"");
            } catch (Exception e) {
                logger.error("Exception calling bean method: " + methodName, e);
            }
        }

        try {
            payloadProxy.setPayload(message, csv.toString());
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }

        return message;
    }
View Full Code Here

      {
          stats = (StatsMBean)MBeanProxyExt.create(StatsMBean.class, StatsMBean.objectName, server);
      }
      catch (final MalformedObjectNameException mone)
      {
          throw new ActionProcessingException("Error creating MBean proxy", mone) ;
      }
      stats.setExecutedVersion("scope1");
      return message;
   }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.actions.ActionProcessingException

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.