Package org.apache.camel.model
Class BeanFactoryDefinition<T extends BeanFactoryDefinition<T,P>,P>
java.lang.Object
org.apache.camel.model.BeanFactoryDefinition<T,P>
- Type Parameters:
T
- the type of the bean factory.P
- the type of the parent node.
- Direct Known Subclasses:
RouteTemplateBeanDefinition
,TemplatedRouteBeanDefinition
@Metadata(label="configuration")
public abstract class BeanFactoryDefinition<T extends BeanFactoryDefinition<T,P>,P>
extends Object
Base class for nodes that define a bean factory.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addProperty
(PropertyDefinition property) Calls a method on a bean for creating the local beanCalls a method on a bean for creating the local beanTo set the type (fully qualified class name) to use for creating the bean.end()
Class<?>
org.apache.camel.RouteTemplateContext.BeanSupplier<Object>
getName()
getType()
Calls a groovy script for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.Calls java (Java source that is runtime compiled to Java bytecode) for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.Calls joor script (Java source that is runtime compiled to Java bytecode) for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.Calls a custom language for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.Calls a MvEL script for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.Calls a OGNL script for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.properties
(Map<String, Object> properties) Sets properties to set on the created local beanSets a property to set on the created local beanvoid
setBeanSupplier
(org.apache.camel.RouteTemplateContext.BeanSupplier<Object> beanSupplier) Bean supplier that uses lambda style to create the local beanvoid
setBeanType
(Class<?> beanType) To set the type (fully qualified class name) to use for creating the bean.void
Bean namevoid
setProperties
(Map<String, Object> properties) Optional properties to set on the created local beanvoid
setPropertyDefinitions
(List<PropertyDefinition> propertyDefinitions) Optional properties to set on the created local beanvoid
The script to execute that creates the bean when using scripting languages.void
setScriptLanguage
(String scriptLanguage) The script language to use when using inlined script for creating the bean, such as groovy, java, javascript etc.void
What type to use for creating the bean (FQN classname).What type to use for creating the bean.What type to use for creating the bean.Creates the bean from the given class typeCreates the bean from the given class type
-
Constructor Details
-
BeanFactoryDefinition
public BeanFactoryDefinition()
-
-
Method Details
-
getName
-
setName
Bean name -
getType
-
setType
What type to use for creating the bean (FQN classname). Can be prefixed with: #class or #type #class or #type then the bean is created via the fully qualified classname, such as #class:com.foo.MyBean -
setBeanType
To set the type (fully qualified class name) to use for creating the bean. -
getBeanClass
-
getProperties
-
setProperties
Optional properties to set on the created local bean -
getPropertyDefinitions
-
setPropertyDefinitions
Optional properties to set on the created local bean -
addProperty
-
getBeanSupplier
-
setBeanSupplier
public void setBeanSupplier(org.apache.camel.RouteTemplateContext.BeanSupplier<Object> beanSupplier) Bean supplier that uses lambda style to create the local bean -
getScriptLanguage
-
setScriptLanguage
The script language to use when using inlined script for creating the bean, such as groovy, java, javascript etc. -
setScript
The script to execute that creates the bean when using scripting languages. If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource. -
getScript
-
type
What type to use for creating the bean. Can be one of: #class or #type #class or #type then the bean is created via the fully qualified classname, such as #class:com.foo.MyBean -
type
What type to use for creating the bean. Can be one of: #class or #type #class or #type then the bean is created via the fully qualified classname, such as #class:com.foo.MyBean -
typeClass
Creates the bean from the given class type- Parameters:
type
- the type of the class to create as bean
-
typeClass
Creates the bean from the given class type- Parameters:
type
- the type of the class to create as bean
-
beanType
To set the type (fully qualified class name) to use for creating the bean.- Parameters:
type
- the fully qualified type of the returned bean
-
bean
Calls a method on a bean for creating the local bean- Parameters:
type
- the bean class to call
-
bean
Calls a method on a bean for creating the local bean- Parameters:
type
- the bean class to callmethod
- the name of the method to call
-
groovy
Calls a groovy script for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.- Parameters:
script
- the script
-
joor
Calls joor script (Java source that is runtime compiled to Java bytecode) for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.- Parameters:
script
- the script
-
java
Calls java (Java source that is runtime compiled to Java bytecode) for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.- Parameters:
script
- the script
-
language
Calls a custom language for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.- Parameters:
language
- the languagescript
- the script
-
mvel
Calls a MvEL script for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.- Parameters:
script
- the script
-
ognl
Calls a OGNL script for creating the local bean If the script use the prefix resource: such as resource:classpath:com/foo/myscript.groovy, resource:file:/var/myscript.groovy, then its loaded from the external resource.- Parameters:
script
- the script
-
property
Sets a property to set on the created local bean- Parameters:
key
- the property namevalue
- the property value
-
properties
Sets properties to set on the created local bean -
end
-