Interface ComponentDescriptor<T>
-
- Type Parameters:
T- the component type.
- All Superinterfaces:
Comparable<Ordered>,Ordered
- All Known Implementing Classes:
SimpleComponentDescriptor,TopologyDescriptor
public interface ComponentDescriptor<T> extends Ordered
Describes a single component managed by aComponentFactory.
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<ComponentDescriptor<?>>ORDER_BY_ORDERstatic Comparator<ComponentDescriptor<?>>ORDER_BY_VERSION-
Fields inherited from interface io.streamthoughts.azkarra.api.components.Ordered
HIGHEST_ORDER, LOWEST_ORDER
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddAliases(Set<String> aliases)Adds new aliases to reference the described component.Set<String>aliases()Gets the set of aliases for this component.ClassLoaderclassLoader()Gets the classloader used to load the component.default StringclassName()Gets the name of the describe component.Optional<Condition>condition()Gets theConditionthat need to be fulfilled for this component to be eligible for use in the application.default booleanisCloseable()Checks if the described component implementCloseable.booleanisEager()Checks if the described component should be create and configure eagerly.booleanisPrimary()Checks if the described component is the primary component that must be selected in the case of multiple possible implementations.booleanisSecondary()Checks if the described component is a secondary component that must be de-prioritize in the case of multiple possible implementations.booleanisSingleton()Checks if the described component is a singleton.default booleanisVersioned()Checks whether the described component has a valid versioned.ComponentMetadatametadata()Gets the component metadata.Stringname()Gets the name of the component.Supplier<T>supplier()Gets the supplier used to create a new component of typeComponentDescriptor.Class<T>type()Gets the type of the described component.Versionversion()Gets the version of the described component.
-
-
-
Field Detail
-
ORDER_BY_VERSION
static final Comparator<ComponentDescriptor<?>> ORDER_BY_VERSION
-
ORDER_BY_ORDER
static final Comparator<ComponentDescriptor<?>> ORDER_BY_ORDER
-
-
Method Detail
-
name
String name()
Gets the name of the component.- Returns:
- the name, or
nullif the name is not set.
-
metadata
ComponentMetadata metadata()
Gets the component metadata.- Returns:
- the
ComponentMetadata.
-
classLoader
ClassLoader classLoader()
Gets the classloader used to load the component.- Returns:
- the
ClassLoader.
-
addAliases
void addAliases(Set<String> aliases)
Adds new aliases to reference the described component.- Parameters:
aliases- the aliases to be added.
-
className
default String className()
Gets the name of the describe component.- Returns:
- the name.
-
version
Version version()
Gets the version of the described component.- Returns:
- the component version if versioned, otherwise
null.
-
supplier
Supplier<T> supplier()
Gets the supplier used to create a new component of typeComponentDescriptor.- Returns:
- the
Supplier.
-
isVersioned
default boolean isVersioned()
Checks whether the described component has a valid versioned.- Returns:
trueif versioned, otherwisefalse.
-
isCloseable
default boolean isCloseable()
Checks if the described component implementCloseable.- Returns:
trueif closeable, otherwisefalse.
-
isSingleton
boolean isSingleton()
Checks if the described component is a singleton.- Returns:
trueif is singleton, otherwisefalse.
-
isPrimary
boolean isPrimary()
Checks if the described component is the primary component that must be selected in the case of multiple possible implementations.- Returns:
trueif is primary, otherwisefalse.- See Also:
Qualifiers.byPrimary()
-
isSecondary
boolean isSecondary()
Checks if the described component is a secondary component that must be de-prioritize in the case of multiple possible implementations.- Returns:
trueif is secondary, otherwisefalse.- See Also:
Qualifiers.bySecondary(),Qualifiers.excludeSecondary()
-
isEager
boolean isEager()
Checks if the described component should be create and configure eagerly.- Returns:
trueif it s an eager component, otherwisefalse.- See Also:
Eager
-
-