Package org.apache.camel.language.bean
Class BeanLanguage
java.lang.Object
org.apache.camel.support.LanguageSupport
org.apache.camel.support.TypedLanguageSupport
org.apache.camel.language.bean.BeanLanguage
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.IsSingleton,org.apache.camel.Service,org.apache.camel.spi.HasCamelContext,org.apache.camel.spi.Language,org.apache.camel.spi.PropertyConfigurer,org.apache.camel.spi.ScriptingLanguage,org.apache.camel.StaticService
@Language("bean")
public class BeanLanguage
extends org.apache.camel.support.TypedLanguageSupport
implements org.apache.camel.spi.ScriptingLanguage, org.apache.camel.spi.PropertyConfigurer, org.apache.camel.StaticService
A bean language which uses a simple text notation to invoke
methods on beans to evaluate predicates or expressions
The notation is essentially
beanName.methodName which is then invoked using the beanName to lookup in
the <a href="http://camel.apache.org/registry.html>registry then the method is invoked to evaluate the expression
using the bean integration to bind the
Exchange to the method arguments.
As of Camel 1.5 the bean language also supports invoking a provided bean by its classname or the bean itself.-
Field Summary
FieldsFields inherited from class org.apache.camel.support.LanguageSupport
RESOURCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanconfigure(org.apache.camel.CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) org.apache.camel.ExpressioncreateExpression(String expression) org.apache.camel.ExpressioncreateExpression(String expression, Object[] properties) org.apache.camel.PredicatecreatePredicate(String expression) org.apache.camel.PredicatecreatePredicate(String expression, Object[] properties) <T> TgetBean()Class<?>getRef()org.apache.camel.BeanScopegetScope()voidvoidsetBeanType(Class<?> beanType) voidvoidvoidsetScope(org.apache.camel.BeanScope scope) voidstart()voidstop()Methods inherited from class org.apache.camel.support.TypedLanguageSupport
getResultType, setResultTypeMethods inherited from class org.apache.camel.support.LanguageSupport
getCamelContext, hasSimpleFunction, isDynamicResource, isSingleton, isStaticResource, loadResource, property, setCamelContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init
-
Field Details
-
LANGUAGE
- See Also:
-
-
Constructor Details
-
BeanLanguage
public BeanLanguage()
-
-
Method Details
-
getBean
-
setBean
-
getBeanType
-
setBeanType
-
getRef
-
setRef
-
getMethod
-
setMethod
-
getScope
public org.apache.camel.BeanScope getScope() -
setScope
public void setScope(org.apache.camel.BeanScope scope) -
configure
public boolean configure(org.apache.camel.CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) - Specified by:
configurein interfaceorg.apache.camel.spi.PropertyConfigurer
-
createPredicate
- Specified by:
createPredicatein interfaceorg.apache.camel.spi.Language
-
createPredicate
- Specified by:
createPredicatein interfaceorg.apache.camel.spi.Language
-
createExpression
- Specified by:
createExpressionin interfaceorg.apache.camel.spi.Language- Overrides:
createExpressionin classorg.apache.camel.support.TypedLanguageSupport
-
createExpression
- Specified by:
createExpressionin interfaceorg.apache.camel.spi.Language
-
evaluate
- Specified by:
evaluatein interfaceorg.apache.camel.spi.ScriptingLanguage
-
start
public void start()- Specified by:
startin interfaceorg.apache.camel.Service
-
stop
public void stop()- Specified by:
stopin interfaceorg.apache.camel.Service
-