org.mule.components.script.jsr223
Class Scriptable

java.lang.Object
  extended byorg.mule.components.script.jsr223.Scriptable
All Implemented Interfaces:
Initialisable
Direct Known Subclasses:
ScriptComponent, ScriptConfigurationBuilder

public class Scriptable
extends Object
implements Initialisable

A JSR 223 Script component. Allows any JSR 223 compliant script engines such as javaScript, Groovy or Rhino to be embedded as Mule components.


Field Summary
protected  Log logger
          logger used by this class
 
Constructor Summary
Scriptable()
           
 
Method Summary
protected  javax.script.CompiledScript compileScript(javax.script.Compilable compilable)
           
protected  javax.script.CompiledScript compileScript(javax.script.Compilable compilable, Reader scriptReader)
           
protected  javax.script.CompiledScript compileScript(Reader scriptReader)
           
protected  javax.script.ScriptEngine createScriptEngine()
           
protected  Object evaluteScript(javax.script.Bindings bindings)
           
 javax.script.CompiledScript getCompiledScript()
           
 javax.script.ScriptEngine getScriptEngine()
           
 String getScriptEngineName()
           
 String getScriptFile()
           
 String getScriptText()
           
 void initialise()
          Method used to perform any initialisation work.
 Object runScript(javax.script.Bindings bindings)
           
 Object runScript(javax.script.CompiledScript compiledScript, javax.script.Bindings bindings)
           
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected transient Log logger
logger used by this class

Constructor Detail

Scriptable

public Scriptable()
Method Detail

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

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)

getScriptEngineName

public String getScriptEngineName()

compileScript

protected javax.script.CompiledScript compileScript(javax.script.Compilable compilable,
                                                    Reader scriptReader)
                                             throws javax.script.ScriptException
Throws:
javax.script.ScriptException

compileScript

protected javax.script.CompiledScript compileScript(Reader scriptReader)
                                             throws javax.script.ScriptException
Throws:
javax.script.ScriptException

compileScript

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

evaluteScript

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

runScript

public Object runScript(javax.script.Bindings bindings)
                 throws javax.script.ScriptException
Throws:
javax.script.ScriptException

runScript

public Object runScript(javax.script.CompiledScript compiledScript,
                        javax.script.Bindings bindings)
                 throws javax.script.ScriptException
Throws:
javax.script.ScriptException

createScriptEngine

protected javax.script.ScriptEngine createScriptEngine()


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