org.mule.components.script.jsr223
Class ScriptMessageBuilder

java.lang.Object
  extended byorg.mule.components.builder.AbstractMessageBuilder
      extended byorg.mule.components.script.jsr223.ScriptMessageBuilder
All Implemented Interfaces:
Callable, Initialisable, MessageBuilder, UMODescriptorAware, UMOEventListener

public class ScriptMessageBuilder
extends AbstractMessageBuilder
implements Initialisable

A message builder component that can execute message building as a script.


Field Summary
protected  Scriptable scriptable
          Delegating script component that actually does the work
 
Fields inherited from class org.mule.components.builder.AbstractMessageBuilder
descriptor, logger
 
Constructor Summary
ScriptMessageBuilder()
           
 
Method Summary
 Object buildMessage(UMOMessage request, UMOMessage response)
           
protected  void compileScript(javax.script.Compilable compilable)
           
protected  javax.script.ScriptEngine createScriptEngine()
           
protected  Object evaluteScript(javax.script.Bindings namespace)
           
 javax.script.CompiledScript getCompiledScript()
           
 javax.script.ScriptEngine getScriptEngine()
           
 String getScriptFile()
           
 String getScriptText()
           
 void initialise()
          Method used to perform any initialisation work.
protected  void populateBindings(javax.script.Bindings namespace, UMOEventContext context)
           
protected  void populateBindings(javax.script.Bindings namespace, UMOMessage request, UMOMessage response)
           
protected  Object runScript(javax.script.Bindings namespace)
           
 void setCompiledScript(javax.script.CompiledScript compiledScript)
           
 void setScriptEngine(javax.script.ScriptEngine scriptEngine)
           
 void setScriptEngineName(String scriptEngineName)
           
 void setScriptFile(String scriptFile)
           
 void setScriptText(String scriptText)
           
 
Methods inherited from class org.mule.components.builder.AbstractMessageBuilder
onCall, setDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scriptable

protected Scriptable scriptable
Delegating script component that actually does the work

Constructor Detail

ScriptMessageBuilder

public ScriptMessageBuilder()
Method Detail

buildMessage

public Object buildMessage(UMOMessage request,
                           UMOMessage response)
                    throws MessageBuilderException
Specified by:
buildMessage in interface MessageBuilder
Throws:
MessageBuilderException

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown

populateBindings

protected void populateBindings(javax.script.Bindings namespace,
                                UMOMessage request,
                                UMOMessage response)

getScriptEngine

public javax.script.ScriptEngine getScriptEngine()

setScriptEngine

public void setScriptEngine(javax.script.ScriptEngine scriptEngine)

getCompiledScript

public javax.script.CompiledScript getCompiledScript()

setCompiledScript

public void setCompiledScript(javax.script.CompiledScript compiledScript)

getScriptText

public String getScriptText()

setScriptText

public void setScriptText(String scriptText)

getScriptFile

public String getScriptFile()

setScriptFile

public void setScriptFile(String scriptFile)

setScriptEngineName

public void setScriptEngineName(String scriptEngineName)

populateBindings

protected void populateBindings(javax.script.Bindings namespace,
                                UMOEventContext context)

compileScript

protected void compileScript(javax.script.Compilable compilable)
                      throws javax.script.ScriptException
Throws:
javax.script.ScriptException

evaluteScript

protected Object evaluteScript(javax.script.Bindings namespace)
                        throws javax.script.ScriptException
Throws:
javax.script.ScriptException

runScript

protected Object runScript(javax.script.Bindings namespace)
                    throws javax.script.ScriptException
Throws:
javax.script.ScriptException

createScriptEngine

protected javax.script.ScriptEngine createScriptEngine()


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.