Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.soa.esb.actions.scripting
Class ScriptingAction

    java.lang.Object
      org.jboss.soa.esb.actions.AbstractActionLifecycle
          org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
              org.jboss.soa.esb.actions.scripting.ScriptingAction

All Implemented Interfaces:
  ActionLifecycle, ActionPipelineProcessor

    public class ScriptingAction

extends AbstractActionPipelineProcessor

BSF Scripting action pipeline processor.

Based on `GroovyActionProcessor` by Gregory Pierce and Tom Fennelly.

     <action name="helloWorld" class="org.jboss.soa.esb.actions.scripting.ScriptingAction">
         <property name="script" value="/scripts/helloWorld.bsh"/>
         <-- The language property is not required; it is deduced via the script extension but can be overridden -->
         <property name="language" value="beanshell"/>
     </action>

The `Message` is bound on the script under the name "message". The `ConfigTree` is bound under the name "config". The `MessagePayloadProxy` is bound under the name "payloadProxy".

The script can also be supplied to this action as the message payload, allowing you to dynamically supply the action with a script.

The following are the supported scripting languages, although the developer is responsible for including the appropriate 3rd party libraries (from bsf.jar's org/apache/bsf/Languages.properties):

     # List of script types and their associated scripting engines
     #
     # languageDescriptor = engineClass, ext1|ext2|... {, codebaseURL, ...}
     #
     # where exti are extensions for the language. Note that we leave
     # all the engines enabled now and allow them to fail at load time.
     # This way engines can be added by just adding to the classpath
     # without having to edit this file. Cheating, really, but it works.
     #
     javascript = org.apache.bsf.engines.javascript.JavaScriptEngine, js
     jacl = org.apache.bsf.engines.jacl.JaclEngine, jacl
     netrexx = org.apache.bsf.engines.netrexx.NetRexxEngine, nrx
     java = org.apache.bsf.engines.java.JavaEngine, java
     javaclass = org.apache.bsf.engines.javaclass.JavaClassEngine, class
     bml = org.apache.bml.ext.BMLEngine, bml
     vbscript = org.apache.bsf.engines.activescript.ActiveScriptEngine, vbs
     jscript = org.apache.bsf.engines.activescript.ActiveScriptEngine, jss
     perlscript = org.apache.bsf.engines.activescript.ActiveScriptEngine, pls
     perl = org.apache.bsf.engines.perl.PerlEngine, pl
     jpython = org.apache.bsf.engines.jpython.JPythonEngine, py
     jython = org.apache.bsf.engines.jython.JythonEngine, py
     lotusscript = org.apache.bsf.engines.lotusscript.LsEngine, lss
     xslt = org.apache.bsf.engines.xslt.XSLTEngine, xslt
     pnuts = pnuts.ext.PnutsBSFEngine, pnut
     beanbasic = org.apache.bsf.engines.beanbasic.BeanBasicEngine, bb
     beanshell = bsh.util.BeanShellBSFEngine, bsh
     ruby = org.jruby.javasupport.bsf.JRubyEngine, rb
     judoscript = com.judoscript.BSFJudoEngine, judo|jud

Author:
  dward at jboss.org

Field Summary

Fields inherited from interface org.jboss.soa.esb.actions.ActionPipelineProcessor
`PROCESS_EXCEPTION_METHOD, PROCESS_METHOD, PROCESS_SUCCESS_METHOD`

Constructor Summary
`ScriptingAction(ConfigTree config)`

Method Summary
`void` | `initialise()` Initialise the action instance.
`Message` | `process(Message message)` Perform the action processing on the specified message.

Methods inherited from class org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
`processException, processSuccess`

Methods inherited from class org.jboss.soa.esb.actions.AbstractActionLifecycle
`destroy`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.jboss.soa.esb.actions.ActionLifecycle
`destroy`

Constructor Detail

### ScriptingAction

    public ScriptingAction(ConfigTree config)

Method Detail

### initialise

    public void initialise()
                    throws ActionLifecycleException

  Description copied from class: `AbstractActionLifecycle`
  Initialise the action instance.

  This method is called after the action instance has been instantiated so that configuration options can be validated.

  Specified by:
    `initialise` in interface `ActionLifecycle`
  Overrides:
    `initialise` in class `AbstractActionLifecycle`
  Throws:
    `ActionLifecycleException` - for errors during initialisation.

### process

    public Message process(Message message)
                    throws ActionProcessingException

  Description copied from interface: `ActionPipelineProcessor`
  Perform the action processing on the specified message. This method is invoked for each message passing throught the pipeline.

  Parameters:
    `message` - The current message being processed.
  Returns:
    The message to be passed to the next stage of the pipeline.
  Throws:
    `ActionProcessingException` - for errors during processing.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD