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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    bean(Class<?> type)
    Calls a method on a bean for creating the local bean
    bean(Class<?> type, String method)
    Calls a method on a bean for creating the local bean
    beanType(Class<?> type)
    To set the type (fully qualified class name) to use for creating the bean.
    end()
     
     
    org.apache.camel.RouteTemplateContext.BeanSupplier<Object>
     
     
     
     
     
     
     
    groovy(String script)
    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.
    java(String script)
    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.
    joor(String script)
    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.
    language(String language, String script)
    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.
    mvel(String script)
    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.
    ognl(String script)
    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 bean
    property(String key, String value)
    Sets a property to set on the created local bean
    void
    setBeanSupplier(org.apache.camel.RouteTemplateContext.BeanSupplier<Object> beanSupplier)
    Bean supplier that uses lambda style to create the local bean
    void
    setBeanType(Class<?> beanType)
    To set the type (fully qualified class name) to use for creating the bean.
    void
    Bean name
    void
    Optional properties to set on the created local bean
    void
    Optional properties to set on the created local bean
    void
    setScript(String script)
    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).
    type(String type)
    What type to use for creating the bean.
    type(String prefix, Class<?> type)
    What type to use for creating the bean.
    typeClass(Class<?> type)
    Creates the bean from the given class type
    Creates the bean from the given class type

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BeanFactoryDefinition

      public BeanFactoryDefinition()
  • Method Details

    • getName

      public String getName()
    • setName

      public void setName(String name)
      Bean name
    • getType

      public String getType()
    • setType

      public void setType(String type)
      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

      public void setBeanType(Class<?> beanType)
      To set the type (fully qualified class name) to use for creating the bean.
    • getBeanClass

      public Class<?> getBeanClass()
    • getProperties

      public Map<String,Object> getProperties()
    • setProperties

      public void setProperties(Map<String,Object> properties)
      Optional properties to set on the created local bean
    • getPropertyDefinitions

      public List<PropertyDefinition> getPropertyDefinitions()
    • setPropertyDefinitions

      public void setPropertyDefinitions(List<PropertyDefinition> propertyDefinitions)
      Optional properties to set on the created local bean
    • addProperty

      public void addProperty(PropertyDefinition property)
    • getBeanSupplier

      public org.apache.camel.RouteTemplateContext.BeanSupplier<Object> getBeanSupplier()
    • setBeanSupplier

      public void setBeanSupplier(org.apache.camel.RouteTemplateContext.BeanSupplier<Object> beanSupplier)
      Bean supplier that uses lambda style to create the local bean
    • getScriptLanguage

      public String getScriptLanguage()
    • setScriptLanguage

      public void setScriptLanguage(String scriptLanguage)
      The script language to use when using inlined script for creating the bean, such as groovy, java, javascript etc.
    • setScript

      public void setScript(String script)
      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

      public String getScript()
    • type

      public T type(String prefix, Class<?> 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

      public T type(String 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

      public T typeClass(Class<?> type)
      Creates the bean from the given class type
      Parameters:
      type - the type of the class to create as bean
    • typeClass

      public T typeClass(String type)
      Creates the bean from the given class type
      Parameters:
      type - the type of the class to create as bean
    • beanType

      public T beanType(Class<?> type)
      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

      public P bean(Class<?> type)
      Calls a method on a bean for creating the local bean
      Parameters:
      type - the bean class to call
    • bean

      public P bean(Class<?> type, String method)
      Calls a method on a bean for creating the local bean
      Parameters:
      type - the bean class to call
      method - the name of the method to call
    • groovy

      public P groovy(String script)
      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

      public P joor(String script)
      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

      public P java(String script)
      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

      public P language(String language, String script)
      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 language
      script - the script
    • mvel

      public P mvel(String script)
      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

      public P ognl(String script)
      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

      public T property(String key, String value)
      Sets a property to set on the created local bean
      Parameters:
      key - the property name
      value - the property value
    • properties

      public T properties(Map<String,Object> properties)
      Sets properties to set on the created local bean
    • end

      public P end()