org.mule.module.scripting.expression
Class AbstractScriptExpressionEvaluator
java.lang.Object
org.mule.module.scripting.expression.AbstractScriptExpressionEvaluator
- All Implemented Interfaces:
- MuleContextAware, ExpressionEvaluator, Disposable, NamedObject
- Direct Known Subclasses:
- GroovyExpressionEvaluator
public abstract class AbstractScriptExpressionEvaluator
- extends Object
- implements ExpressionEvaluator, Disposable, MuleContextAware
An abstract ExpressionEvaluator
that can be used for any JSR-233 script engine.
If a POJO is passed in it is accessible from the 'payload' namespace. If a MuleMessage
instance is used then
it is accessible from the message' namespace and the 'payload' namespace is also available.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cache
protected Map cache
muleContext
protected MuleContext muleContext
AbstractScriptExpressionEvaluator
public AbstractScriptExpressionEvaluator()
setMuleContext
public void setMuleContext(MuleContext context)
- Specified by:
setMuleContext
in interface MuleContextAware
evaluate
public Object evaluate(String expression,
MuleMessage message)
- Extracts a single property from the message
- Specified by:
evaluate
in interface ExpressionEvaluator
- Parameters:
expression
- the property expression or expressionmessage
- the message to extract from
- Returns:
- the result of the extraction or null if the property was not found
getScript
protected Scriptable getScript(String expression)
dispose
public void dispose()
- A lifecycle method where implementor should free up any resources. If an
exception is thrown it should just be logged and processing should continue.
This method should not throw Runtime exceptions.
- Specified by:
dispose
in interface Disposable
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.