Trait

org.springframework.scala.context.function

FunctionalConfiguration

Related Doc: package function

Permalink

trait FunctionalConfiguration extends DelayedInit

Base trait used to declare one or more Spring Beans that may be processed by the Spring container. For example:

class PersonConfiguration extends FunctionalConfiguration {
  bean() {
    new Person("John", "Doe")
  }
}

Besides the bean method, the FunctionalConfiguration trait also offers methods to register singletons, prototypes, importing XML or @Configuration classes, bean profiles and more.

Note

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.

Linear Supertypes
DelayedInit, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. FunctionalConfiguration
  2. DelayedInit
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def bean[T](name: String = "", aliases: Seq[String] = Seq(), scope: String = ..., lazyInit: Boolean = false)(beanFunction: ⇒ T)(implicit arg0: ClassTag[T]): BeanLookupFunction[T]

    Permalink

    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.

    T

    the bean type

    name

    the name of the bean. If not specified, a name will be generated.

    aliases

    aliases for the bean, if any

    scope

    the scope. Defaults to singleton.

    lazyInit

    whether the bean is to be lazily initialized. Defaults to false.

    beanFunction

    the bean creation function

    returns

    a function that returns the registered bean

    Attributes
    protected
  6. def beanFactory: BeanFactory

    Permalink

    Returns the bean factory associated with this functional configuration.

    Returns the bean factory associated with this functional configuration.

    returns

    the bean factory

    Attributes
    protected
  7. def beanRegistry: BeanDefinitionRegistry

    Permalink

    Returns the bean registry associated with this functional configuration.

    Returns the bean registry associated with this functional configuration.

    returns

    the bean registry

    Attributes
    protected
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def delayedInit(body: ⇒ Unit): Unit

    Permalink
    Definition Classes
    FunctionalConfiguration → DelayedInit
  10. def environment: Environment

    Permalink

    Returns the environment associated with this functional configuration.

    Returns the environment associated with this functional configuration.

    returns

    the environment

    Attributes
    protected
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def getBean[T](name: String)(implicit tag: scala.reflect.api.JavaUniverse.TypeTag[T]): T

    Permalink

    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.

    name

    the name of the bean to retrieve

    tag

    an implicit TypeTag representing the type of the specified type parameter.

    returns

    an instance of the bean

    Exceptions thrown

    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

  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. def importClass[T]()(implicit arg0: ClassTag[T]): Unit

    Permalink

    Imports one @Configuration class containing @Bean definitions using a class tag.

    Imports one @Configuration class containing @Bean definitions using a class tag.

    T

    @Configuration class to import

    Attributes
    protected
  18. def importClass(annotatedClasses: Class[_]*): Unit

    Permalink

    Imports one or more @Configuration classes containing @Bean definitions.

    Imports one or more @Configuration classes containing @Bean definitions.

    This method provides functionality similar to the org.springframework.context.annotation.Import annotation used in Java org.springframework.context.annotation.Configuration classes.

    annotatedClasses

    the @Configuration classes to import

    Attributes
    protected
  19. def importXml(resources: String*): Unit

    Permalink

    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 <import/> 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.

    resources

    the resource paths to import. Resource-loading prefixes such as classpath: and file:, etc may be used.

    Attributes
    protected
  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def onRegister(function: (GenericApplicationContext, BeanNameGenerator) ⇒ Unit): Unit

    Permalink

    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.

    function

    the function to be added

  25. def profile[T](profiles: String*)(function: ⇒ T): Option[T]

    Permalink

    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.

    T

    the bean type

    profiles

    the set of profiles for which this

    function

    the bean lookup function

    returns

    an option value containing the specified bean lookup function; or None if the given profiles are not active

    Attributes
    protected
  26. def prototype[T](name: String = "", aliases: Seq[String] = Seq(), lazyInit: Boolean = false)(beanFunction: ⇒ T)(implicit arg0: ClassTag[T]): BeanLookupFunction[T]

    Permalink

    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.

    T

    the bean type

    name

    the name of the bean. If not specified, a name will be generated.

    aliases

    aliases for the bean, if any

    lazyInit

    whether the bean is to be lazily initialized. Defaults to false.

    beanFunction

    the bean creation function

    returns

    a function that returns the registered bean

    Attributes
    protected
  27. def singleton[T](name: String = "", aliases: Seq[String] = Seq(), lazyInit: Boolean = false)(beanFunction: ⇒ T)(implicit arg0: ClassTag[T]): BeanLookupFunction[T]

    Permalink

    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.

    T

    the bean type

    name

    the name of the bean. If not specified, a name will be generated.

    aliases

    aliases for the bean, if any

    lazyInit

    whether the bean is to be lazily initialized. Defaults to false.

    beanFunction

    the bean creation function

    returns

    a function that returns the registered bean

    Attributes
    protected
  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DelayedInit

Inherited from AnyRef

Inherited from Any

Ungrouped