Package org.jboss.soa.esb.actions

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


            {
                instance = ActionProcessorMethodInfo.getActionClassInstance(config, constructor) ;
            }
            catch (final ConfigurationException ce)
            {
                throw new ActionProcessingException("Unexpected exception creating action class instance", ce) ;
            }
           
            messageInstanceMap.put(message, instance) ;
            return methodInfo.processMethods(instance, message) ;
        }
View Full Code Here


                    {
                        return null ;
                    }
                    else
                    {
                        throw new ActionProcessingException("Unexpected response type from processor: " + response) ;
                    }
                }
                catch (final IllegalAccessException iae)
                {
                    throw new ActionProcessingException("Illegal access from processor", iae) ;
                }
                catch (final InvocationTargetException ite)
                {
                    final Throwable th = ite.getTargetException() ;
                    if (th instanceof ActionProcessingException)
                    {
                        throw (ActionProcessingException)th ;
                    }
                    else if (th instanceof RuntimeException)
                    {
                        throw (RuntimeException)th ;
                    }
                    else if (th instanceof Error)
                    {
                        throw (Error)th ;
                    }
                    else
                    {
                        throw new ActionProcessingException("Unexpected invocation target exception from processor", th) ;
                    }
                }
            }
        }
        return currentMessage ;
View Full Code Here

        Object instance = constructor.newInstance();
        BeanConfigurator configurator = new ActionBeanConfigurator(config, instance);
        configurator.configure();
        return methodInfo.processMethods(instance, message);
      } catch (Exception e) {
        throw new ActionProcessingException(e);
      }
    } else {
      return message;
    }
  }
View Full Code Here

        Object object = null;

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

        Object processor = getObjectToInvoke();
    Method m = this.setUpMethod(processor);
   
    Object result;
    try {
      result = m.invoke(processor, new Object[] { object });
    } catch (IllegalArgumentException e) {
      throw new ActionProcessingException("Invalid arguments for class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
     
    } catch (IllegalAccessException e) {
      throw new ActionProcessingException("No access for class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
     
    } catch (InvocationTargetException e) {
      throw new ActionProcessingException("Invocation problem with class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
     
    }

        try {
            payloadProxy.setPayload(message, result);
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }
       
        return message;
  }
View Full Code Here

  protected Object getObjectToInvoke()  throws ActionProcessingException {
    Object processor = null;
    try {
      processor = processorClass.newInstance();
    } catch (InstantiationException e) {
      throw new ActionProcessingException("Could not invoke class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
    } catch (IllegalAccessException e) {
      throw new ActionProcessingException("Could not access class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
    }
    return processor;
  }
View Full Code Here

        byte[] bytes;
       
        try {
            bytes = (byte[]) payloadProxy.getPayload(message);
        } catch(ClassCastException e) {
            throw new ActionProcessingException("Message must be an array of bytes. Is " + message.getClass().getName());
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }

        try {
            payloadProxy.setPayload(message, new String(bytes, encoding));
          return message;
        } catch (UnsupportedEncodingException e) {
            throw new ActionProcessingException("Unable to decode byte[] to String. Unsupported character encoding configuration: " + encoding, e);
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }
    }
View Full Code Here

                        method = methodFactory.getMethod(payloadStr, "application/x-java-serialized-object", Charset.defaultCharset().toString());
                    } else {
                        method = methodFactory.getMethod(payload.toString(), "text/xml", "UTF-8");
                    }
                } catch (ParserConfigurationException e) {
                    throw new ActionProcessingException(e);
                }
            }

            try {
                setRequestHeaders(method, message);
               
                int responseCode = httpclient.executeMethod(method);
                if(responseCode != HttpStatus.SC_OK) {
                    logger.warn("Received status code '" + responseCode + "' on HTTP " + method + " request to '" + endpointUrl + "'.");
                }
                attachResponseDetails(message, method, responseCode);

                InputStream resultStream = method.getResponseBodyAsStream();
                try {
                    byte[] bytes = readStream(resultStream);

                    if(responseType == ResponseType.STRING) {
                        getPayloadProxy().setPayload(message, new String(bytes, method.getResponseCharSet()));
                    } else {
                        getPayloadProxy().setPayload(message, bytes);
                    }
                } catch (MessageDeliverException e) {
                    throw new ActionProcessingException("problem setting message payload: " + e.getMessage(), e);
                } finally {
                    closeStream(resultStream);
                }
            } finally {
                method.releaseConnection();
            }
        } catch (IOException e) {
            throw new ActionProcessingException("problem processing HTTP I/O: " + e.getMessage(), e);
        }

        return message;
    }
View Full Code Here

        Object object;

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

        try {
      Object toObject = incomingType.newInstance();
      toObject = fromXmlToObject( object.toString(), toObject );
     
      payloadProxy.setPayload(message, toObject);
    } catch (InstantiationException e) {
      logger.error( e );
      throw new ActionProcessingException("Could not invoke for Arg: " + getName(),e );
    } catch (IllegalAccessException e) {
      logger.error( e );
      throw new ActionProcessingException("Could not access for Arg: " + getName(),e );
    } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }

        return message;
  }
View Full Code Here

            try {
                Class<?> clazz = ClassUtil.forName( className, getClass() );
                xstream.alias((String)me.getKey(), clazz );
            } catch (ClassNotFoundException e) {
                logger.error("ClassNotFoundException: ", e);
                throw new ActionProcessingException("Could not add alias : " + (String)me.getKey() + ", class : " + className ,e );
            }
        }
    }
View Full Code Here

        Class<?> clazz = ClassUtil.forName( converterClass, getClass() );
            xstream.registerConverter((Converter)clazz.newInstance());
           
      } catch (ClassNotFoundException e) {
        logger.error("ClassNotFoundException: ", e);
        throw new ActionProcessingException("Could not register converter : " + converterClass.getClass().getName(),e );
      } catch (InstantiationException e)
      {
        logger.error("InstantiationException: ", e);
      } catch (IllegalAccessException e)
      {
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.