Annotation Interface Bean


Annotation used to configure a bean. Typically used in conjunction with Factory.

@Factory
public class MyFactory {

    @Bean
    public MyBean myBean() {
        // create the bean
    }
}
Since:
1.0
Author:
Graeme Rocher
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The name of a public, no-argument method of the bean type to invoke when the bean is destroyed.
    Class<?>[]
     
  • Element Details

    • preDestroy

      String preDestroy
      The name of a public, no-argument method of the bean type to invoke when the bean is destroyed. Can be declared on the bean class itself or on the factory method or field that produces the bean. A name that resolves to no such method is a compilation error.
      Returns:
      The method to invoke to destroy the bean
      Default:
      ""
    • typed

      Class<?>[] typed
      Returns:
      Limits the types exposed by this been to the given type or types.
      Since:
      3.0.0
      Default:
      {}