Top Description Methods
org.springframework.context.annotation

public @Interface Role

extends Annotation
Annotations
@Target:TYPE, METHOD
@Retention:RUNTIME
@Documented
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target, org.springframework.beans.factory.config.BeanDefinition

Indicates the 'role' hint for a given bean.

May be used on any class directly or indirectly annotated with org.springframework.stereotype.Component or on methods annotated with Bean.

If this annotation is not present on a Component or Bean definition, the default value of BeanDefinition#ROLE_APPLICATION will apply.

If Role is present on a @Configuration class, this indicates the role of the configuration class bean definition and does not cascade to all @Bean methods defined within. This behavior is different from the behavior of the @Lazy annotation, for example.

Author
Chris Beams
Since
3.1
See Also
BeanDefinition#ROLE_APPLICATION, BeanDefinition#ROLE_INFRASTRUCTURE, BeanDefinition#ROLE_SUPPORT, Bean

Method Summary

Modifier and TypeMethod and Description
public int
value()

Set the role hint for the associated bean.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public int value()

Set the role hint for the associated bean.

See Also
BeanDefinition#ROLE_APPLICATION, BeanDefinition#ROLE_INFRASTRUCTURE, BeanDefinition#ROLE_SUPPORT