Package tigase.kernel.beans
Annotation Type Bean
-
@Target(TYPE) @Retention(RUNTIME) @Inherited @Documented public @interface BeanDefines name of bean.This annotation is not required, but each bean must be named! Instead of using annotation, name of bean may be defined during registration.
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description booleanactiveIs active by default. *
trueif annotated bean (if registered) should be active (automatically loaded if required);falseif annotated bean will not be automatically loaded, even if it will be registered.java.lang.StringnameName of bean. *
This name will be used to find bean and load configuration for the bean.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanexportableIs bean exportable?java.lang.ClassparentClass of a parent bean. *
Returns parent class for which this bean should always be registered. *
Following cases are supported:Objectif bean should never be automatically registeredKernelif bean should be automatically registered in the main/root kernel class implementingRegistrarBeanif bean should be loaded automatically for that classjava.lang.Class[]parentsClasses of parent beans. *
In some cases same beans should be automatically registered for more than one class.java.lang.Class<? extends BeanSelector>[]selectorsAutomatic registration selectors. *
In some cases it is required/useful to decide if beans should be registered automatically depending on more global configuration option.
-
-
-
-
active
boolean active
Is active by default. *
trueif annotated bean (if registered) should be active (automatically loaded if required);falseif annotated bean will not be automatically loaded, even if it will be registered. It will require manual activation in the configuration.
- Returns:
trueif bean should be automatically loaded
-
-
-
parent
java.lang.Class parent
Class of a parent bean. *
Returns parent class for which this bean should always be registered. *
Following cases are supported:Objectif bean should never be automatically registeredKernelif bean should be automatically registered in the main/root kernel- class implementing
RegistrarBeanif bean should be loaded automatically for that class
- Returns:
- parent class for which this class should be automatically registered
- Default:
- java.lang.Object.class
-
-
-
parents
java.lang.Class[] parents
Classes of parent beans. *
In some cases same beans should be automatically registered for more than one class. This method allows to return more than one class.- Returns:
- array of classes for which this class should be automatically registered
- See Also:
parent()
- Default:
- {}
-
-
-
selectors
java.lang.Class<? extends BeanSelector>[] selectors
Automatic registration selectors. *
In some cases it is required/useful to decide if beans should be registered automatically depending on more global configuration option. This method returns array ofBeanSelectorclasses which provide a logic deciding if bean should be automatically loaded or not. *
Will only work ifparent()orparents()returns correct values.- Returns:
- array of classes deciding if bean should be automatically loaded.
- Default:
- {}
-
-