Package org.jboss.soa.esb.actions

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


        // we have an error!
        if(resourceConfig != null) {
            try {
                smooks = SmooksResource.createSmooksResource(resourceConfig);
            } catch (final LifecycleResourceException lre) {
                throw new ActionLifecycleException("Unexpected exception creating smooks lifecycle resource", lre);
            } catch (final IOException ie) {
                throw new ActionLifecycleException("Unexpected IO exception accessing smooks resource: " + resourceConfig, ie);
            } catch (final SAXException saxe) {
                throw new ActionLifecycleException("Unexpected exception parsing smooks resource: " + resourceConfig, saxe);
            }
        } else {
            throw new ActionLifecycleException("Invalid " + getClass().getSimpleName() + " action configuration.  No 'resource-config' specified on the action.");
        }
       
        logger.info("Smooks configurations are now loaded.");
    }
View Full Code Here


                }
            };
           
            setSoapUIInvoker(soapUIInvoker);
        } catch (ConfigurationException e) {
            throw new ActionLifecycleException("Failed to initialize SoapUIInvoker.", e);
        }
    }
View Full Code Here

        }
        source = "Embedded script in message" ;
      }
      else
      {
        throw new ActionLifecycleException("'script' not configured on the action and message based scripting is not enabled ('supportMessageBasedScripting=false').");
      }
    }
    else
    {
      InputStream scriptStream = null;
      try
      {
        scriptStream = ClassUtil.getResourceAsStream(scriptPath, ScriptingAction.class);
        if (scriptStream != null)
        {
          scriptStream = new BufferedInputStream(scriptStream);
          script = new String( StreamUtils.readStream(scriptStream) );
        }
        else
        {
          throw new ActionLifecycleException("script '" + scriptPath + "' not found on classpath");
        }
      }
      catch (Throwable t)
      {
        throw new ActionLifecycleException(t);
      }
      finally
      {
        try { if (scriptStream != null) scriptStream.close(); } catch (Throwable t) {}
      }
      source = scriptPath ;
    }
    this.source = source ;
    // attempt to get the language
    language = getAttribute("language");
    if (language == null && script != null)
    {
      // the language attribute was not set but we found the script from the scriptPath,
      // so deduce the extension from the scriptPath
      int pos = scriptPath.lastIndexOf('.');
      if (pos > -1 && pos < scriptPath.length()-1)
        language = scriptPath.substring( pos+1, scriptPath.length() ).toLowerCase();
    }
    if (language != null)
    {
      if ( EXTN2LANG.containsKey(language) )
      {
        // either the user set the language property to the extension OR
        // the language property was not set and we deduced the extension...
        // either way, we now know two things:
        // 1) we need to swap out the extension for the language
        // 2) the language is already registered with BSF
        language = EXTN2LANG.get(language);
      }
      else
      {
        // here we still need to make sure the language is registered with BSF
        if ( !BSFManager.isLanguageRegistered(language) )
          throw new ActionLifecycleException("language '" + language + "' not registered");
      }
    }
    else
    {
      throw new ActionLifecycleException("language not specified");
    }
  }
View Full Code Here

            boolean supportMessageBasedScripting = configTree.getBooleanAttribute("supportMessageBasedScripting", false);
            if(supportMessageBasedScripting) {
                logger.info("No Groovy script specified on action config " + configTree.getAttribute("name")
                        + ". Expecting Groovy script to be in message.");
            } else {
                throw new ActionLifecycleException("'script' not configured on the action and message based scripting is not enabled ('supportMessageBasedScripting=false').");
            }
        }
    }
View Full Code Here

    @Initialize
    public void init2(ConfigTree config) throws ActionLifecycleException {
      this.config = config;
      init2Called = true;
      if(throwInitException) {
        throw new ActionLifecycleException("init exception");
      }
    }       
View Full Code Here

    ConfigTree configTree = createConfig();
   
    ComponentWithLifecycle component = new ComponentWithLifecycle();
   
    // Set the exception...
    component.lifecycleException = new ActionLifecycleException("Xception");
   
    Configurator.configure(component, configTree);
   
    try {
      Configurator.initialise(component, configTree);
View Full Code Here

                transformers.add(xslTemplate.newTransformer());
            }
        }
        catch (final TransformerConfigurationException e)
        {
            throw new ActionLifecycleException(e.getMessage(), e);
        }
    }
View Full Code Here

                Schema schema = schemaFactory.newSchema(new StreamSource(ClassUtil.getResourceAsStream(schemaFile, getClass())));
                validationFactory.setSchema(schema);
              }
              catch (SAXException e)
              {
                throw new ActionLifecycleException("problem creating schema '" + schemaFile + "'", e);
              }
            }
          }
          // else { DTD validation }
        }
View Full Code Here

            stream = StreamUtils.getResource(templateFile);
            return factory.newTemplates(new StreamSource(stream));
        }
        catch (final ConfigurationException e)
        {
            throw new ActionLifecycleException(e.getMessage(), e);
        }
        finally
        {
            if (stream != null)
            {
View Full Code Here

    {
        _logger.info("initialise() invoked - config="+configTree);
        try {
            messageFacade   = MessageFacade.getFacade(configTree);
        } catch (ConfigurationException ce) {
            throw new ActionLifecycleException(ce.getMessage(), ce);
        }
    }
View Full Code Here

TOP

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

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.