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 propertyArcConfig.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 asUnremovableBeanBuildItem.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 Classes Modifier and Type Class Description static class
UnremovableBeanBuildItem.BeanClassAnnotationExclusion
static class
UnremovableBeanBuildItem.BeanClassNameExclusion
static class
UnremovableBeanBuildItem.BeanClassNamesExclusion
static class
UnremovableBeanBuildItem.BeanTypeExclusion
static class
UnremovableBeanBuildItem.BeanTypesExclusion
-
Constructor Summary
Constructors Constructor Description UnremovableBeanBuildItem(UnremovableBeanBuildItem.BeanClassNameExclusion predicate)
UnremovableBeanBuildItem(UnremovableBeanBuildItem.BeanClassNamesExclusion predicate)
UnremovableBeanBuildItem(UnremovableBeanBuildItem.BeanTypeExclusion predicate)
UnremovableBeanBuildItem(UnremovableBeanBuildItem.BeanTypesExclusion predicate)
UnremovableBeanBuildItem(Predicate<BeanInfo> predicate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UnremovableBeanBuildItem
beanClassAnnotation(String nameStartsWith)
Match class beans whose target class contains an annotation whose name starts with the specified value.static UnremovableBeanBuildItem
beanClassAnnotation(org.jboss.jandex.DotName annotationName)
Match class beans whose target class contains the specified annotation.static UnremovableBeanBuildItem
beanClassNames(String... classNames)
Match beans whose bean class matches any of the specified class names.static UnremovableBeanBuildItem
beanClassNames(Set<String> classNames)
Match beans whose bean class matches any of the specified class names.static UnremovableBeanBuildItem
beanTypes(Class<?>... types)
Match beans which have any of the specified type names in its set of bean types.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.static UnremovableBeanBuildItem
beanTypes(org.jboss.jandex.DotName... typeNames)
Match beans which have any of the specified type names in its set of bean types.Set<String>
getClassNames()
Predicate<BeanInfo>
getPredicate()
static UnremovableBeanBuildItem
targetWithAnnotation(org.jboss.jandex.DotName annotationName)
Match beans whose target (class, method or field) is annotated with the specified annotation.
-
-
-
Constructor Detail
-
UnremovableBeanBuildItem
public UnremovableBeanBuildItem(UnremovableBeanBuildItem.BeanClassNameExclusion predicate)
-
UnremovableBeanBuildItem
public UnremovableBeanBuildItem(UnremovableBeanBuildItem.BeanClassNamesExclusion predicate)
-
UnremovableBeanBuildItem
public UnremovableBeanBuildItem(UnremovableBeanBuildItem.BeanTypeExclusion predicate)
-
UnremovableBeanBuildItem
public UnremovableBeanBuildItem(UnremovableBeanBuildItem.BeanTypesExclusion predicate)
-
-
Method Detail
-
beanClassNames
public static UnremovableBeanBuildItem beanClassNames(String... classNames)
Match beans whose bean class matches any of the specified class names.- Parameters:
classNames
-- Returns:
- a new build item
-
beanClassNames
public static UnremovableBeanBuildItem beanClassNames(Set<String> classNames)
Match beans whose bean class matches any of the specified class names.- Parameters:
classNames
-- Returns:
- a new build item
-
beanTypes
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
public static UnremovableBeanBuildItem beanTypes(Class<?>... types)
Match beans which have any of the specified type names in its set of bean types.- Parameters:
typeNames
-- Returns:
- a new build item
-
beanTypes
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
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
public static UnremovableBeanBuildItem beanClassAnnotation(String nameStartsWith)
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
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
-
-