@Target(value=TYPE) @Retention(value=RUNTIME) @Inherited @Documented public @interface Bean
This annotation is not required, but each bean must be named! Instead of using annotation, name of bean may be defined during registration.
Modifier and Type | Required Element and Description |
---|---|
boolean |
active
Is active by default. *
true if annotated bean (if registered) should be active
(automatically loaded if required); false if annotated bean will not be automatically
loaded, even if it will be registered. |
String |
name
Name of bean. *
This name will be used to find bean and load configuration for the bean. |
Modifier and Type | Optional Element and Description |
---|---|
boolean |
exportable
Is bean exportable?
|
Class |
parent
Class of a parent bean. *
Returns parent class for which this bean should always be registered. * Following cases are supported: Object if bean should never be automatically registered
Kernel if bean should be automatically registered in the main/root
kernel class implementing RegistrarBean if bean should be loaded
automatically for that class |
Class[] |
parents
Classes of parent beans. *
In some cases same beans should be automatically registered for more than one class. |
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. |
public abstract String name
public abstract boolean active
true
if annotated bean (if registered) should be active
(automatically loaded if required);false
if annotated bean will not be automatically
loaded, even if it will be registered. It will require manual activation in the configuration.true
if bean should be automatically loadedpublic abstract boolean exportable
true
if bean should be available also in subkernelspublic abstract Class parent
Object
if bean should never be automatically registeredKernel
if bean should be automatically registered in the main/root
kernelRegistrarBean
if bean should be loaded
automatically for that classpublic abstract Class[] parents
parent()
public abstract Class<? extends BeanSelector>[] selectors
BeanSelector
classes which provide a logic deciding if bean should be automatically loaded
or not. * parent()
or parents()
returns correct values.Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.