Registers a bean creation function with the given name, aliases, and other attributes.
Registers a bean creation function with the given name, aliases, and other attributes.
the bean type
the name of the bean. If not specified, a name will be generated.
aliases for the bean, if any
the scope. Defaults to
.singleton
whether the bean is to be lazily initialized. Defaults to
.false
the bean creation function
a function that returns the registered bean
Returns the bean factory associated with this functional configuration.
Returns the bean factory associated with this functional configuration.
the bean factory
Returns the bean registry associated with this functional configuration.
Returns the bean registry associated with this functional configuration.
the bean registry
Returns the environment associated with this functional configuration.
Returns the environment associated with this functional configuration.
the environment
Return an instance, which may be shared or independent, of the specified bean.
Return an instance, which may be shared or independent, of the specified bean.
Translates aliases back to the corresponding canonical bean name. Will ask the parent factory if the bean cannot be found in this factory instance.
the name of the bean to retrieve
an implicit
representing the type of the specified type
parameter.TypeTag
an instance of the bean
BeanNotOfRequiredTypeException
if the bean is not of the required type
BeansException
if the bean could not be created
NoSuchBeanDefinitionException
if there's no such bean definition
Imports one
class containing @Configuration
definitions using a
class tag.@Bean
Imports one
class containing @Configuration
definitions using a
class tag.
@Bean
class to import@Configuration
Imports one or more
classes containing @Configuration
definitions.@Bean
Imports one or more
classes containing @Configuration
definitions.@Bean
This method provides functionality similar to the org.springframework.context.annotation.Import annotation used in Java org.springframework.context.annotation.Configuration classes.
the
classes to import@Configuration
Imports one or more resources containing XML bean definitions.
Imports one or more resources containing XML bean definitions.
This method provides functionality similar to the
element in Spring XML. It is typically used when
designing
org.springframework.scala.context.function.FunctionalConfiguration
classes to be bootstrapped by
org.springframework.scala.context.function.FunctionalConfigApplicationContext,
but where some XML functionality such as namespaces is still necessary.
<import/>
the resource paths to import. Resource-loading prefixes
such as
and classpath:
, etc may be used.file:
Adds a function to be applied as part of the registration process.
Adds a function to be applied as part of the registration process. Used by sub-traits to add configuration behavior.
the function to be added
Indicates that the wrapped bean(s) are eligible for registration when one or more specified profiles are active.
Indicates that the wrapped bean(s) are eligible for registration when one or more specified profiles are active.
the bean type
the set of profiles for which this
the bean lookup function
an option value containing the specified bean lookup function; or None
if
the given profiles are not active
Registers a prototype bean creation function with the given name, aliases, and other attributes.
Registers a prototype bean creation function with the given name, aliases, and other attributes.
the bean type
the name of the bean. If not specified, a name will be generated.
aliases for the bean, if any
whether the bean is to be lazily initialized. Defaults to
.false
the bean creation function
a function that returns the registered bean
Registers a singleton bean creation function with the given name, aliases, and other attributes.
Registers a singleton bean creation function with the given name, aliases, and other attributes.
the bean type
the name of the bean. If not specified, a name will be generated.
aliases for the bean, if any
whether the bean is to be lazily initialized. Defaults to
.false
the bean creation function
a function that returns the registered bean
Base trait used to declare one or more Spring Beans that may be processed by the Spring container. For example:
Besides the
bean
method, theFunctionalConfiguration
trait also offers methods to register singletons, prototypes, importing XML or@Configuration
classes, bean profiles and more.Extending this trait in a sub-trait can give initialization issues, due to the nature of the scala.DelayedInit trait used. Therefore, make sure to extend this trait in a class.