Package io.quarkus.arc.deployment
Class UnremovableBeanBuildItem
java.lang.Object
io.quarkus.builder.item.BuildItem
io.quarkus.builder.item.MultiBuildItem
io.quarkus.arc.deployment.UnremovableBeanBuildItem
public final class UnremovableBeanBuildItem
extends io.quarkus.builder.item.MultiBuildItem
This build item is used to exclude beans that would be normally removed if the config property
ArcConfig.removeUnusedBeans is set to true.
Consider using one of the convenient static factory methods such as beanTypes(Class...):
@BuildStep
UnremovableBeanBuildItem unremovable() {
// Any bean that has MyService in its set of bean types is considered unremovable
return UnremovableBeanBuildItem.beanTypes(MyService.class);
}
Alternatively, you could make use of the pre-built predicate classes such as UnremovableBeanBuildItem.BeanClassNameExclusion:
@BuildStep
UnremovableBeanBuildItem unremovable() {
// A bean whose bean class FQCN is equal to org.acme.MyService is considered unremovable
return new UnremovableBeanBuildItem(new BeanClassNameExclusion("org.acme.MyService"));
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic UnremovableBeanBuildItembeanClassAnnotation(String nameStartsWith) Match class beans whose target class contains an annotation whose name starts with the specified value.static UnremovableBeanBuildItembeanClassAnnotation(org.jboss.jandex.DotName annotationName) Match class beans whose target class contains the specified annotation.static UnremovableBeanBuildItembeanClassNames(String... classNames) Match beans whose bean class matches any of the specified class names.static UnremovableBeanBuildItembeanClassNames(Set<String> classNames) Match beans whose bean class matches any of the specified class names.static UnremovableBeanBuildItemMatch beans which have any of the specified type names in its set of bean types.static UnremovableBeanBuildItemMatch beans which have any of the specified type names in its set of bean types.static UnremovableBeanBuildItembeanTypes(org.jboss.jandex.DotName... typeNames) Match beans which have any of the specified type names in its set of bean types.static UnremovableBeanBuildItemtargetWithAnnotation(org.jboss.jandex.DotName annotationName) Match beans whose target (class, method or field) is annotated with the specified annotation.
-
Constructor Details
-
UnremovableBeanBuildItem
-
UnremovableBeanBuildItem
-
UnremovableBeanBuildItem
-
UnremovableBeanBuildItem
-
UnremovableBeanBuildItem
-
-
Method Details
-
getPredicate
-
getClassNames
-
beanClassNames
Match beans whose bean class matches any of the specified class names.- Parameters:
classNames-- Returns:
- a new build item
-
beanClassNames
Match beans whose bean class matches any of the specified class names.- Parameters:
classNames-- Returns:
- a new build item
-
beanTypes
@CheckReturnValue public static UnremovableBeanBuildItem beanTypes(org.jboss.jandex.DotName... typeNames) Match beans which have any of the specified type names in its set of bean types.- Parameters:
typeNames-- Returns:
- a new build item
-
beanTypes
Match beans which have any of the specified type names in its set of bean types.- Parameters:
typeNames-- Returns:
- a new build item
-
beanTypes
@CheckReturnValue public static UnremovableBeanBuildItem beanTypes(Set<org.jboss.jandex.DotName> typeNames) Match beans which have any of the specified type names in its set of bean types.- Parameters:
typeNames-- Returns:
- a new build item
-
beanClassAnnotation
@CheckReturnValue public static UnremovableBeanBuildItem beanClassAnnotation(org.jboss.jandex.DotName annotationName) Match class beans whose target class contains the specified annotation.The annotations can be declared on the class, and every nested element of the class (fields, types, methods, etc).
- Parameters:
annotationName-- Returns:
- a new build item
-
beanClassAnnotation
Match class beans whose target class contains an annotation whose name starts with the specified value.The annotations can be declared on the class, and every nested element of the class (fields, types, methods, etc).
- Parameters:
annotationName-- Returns:
- a new build item
-
targetWithAnnotation
@CheckReturnValue public static UnremovableBeanBuildItem targetWithAnnotation(org.jboss.jandex.DotName annotationName) Match beans whose target (class, method or field) is annotated with the specified annotation.- Parameters:
annotationName-- Returns:
- a new build item
-