Interface ComponentDescriptor<T>
-
- Type Parameters:
T
- the component type.
- All Superinterfaces:
Comparable<Ordered>
,Ordered
- All Known Implementing Classes:
ComponentDescriptorBuilder
,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_ORDER
static 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 void
addAliases(Set<String> aliases)
Adds new aliases to reference the described component.Set<String>
aliases()
Gets the set of aliases for this component.ClassLoader
classLoader()
Gets the classloader used to load the component.default String
className()
Gets the name of the describe component.Optional<Condition>
condition()
Gets theCondition
that need to be fulfilled for this component to be eligible for use in the application.default boolean
isCloseable()
Checks if the described component implementCloseable
.boolean
isEager()
Checks if the described component should be create and configure eagerly.boolean
isPrimary()
Checks if the described component is the primary component that must be selected in the case of multiple possible implementations.boolean
isSecondary()
Checks if the described component is a secondary component that must be de-prioritize in the case of multiple possible implementations.boolean
isSingleton()
Checks if the described component is a singleton.default boolean
isVersioned()
Checks whether the described component has a valid versioned.ComponentMetadata
metadata()
Gets the component metadata.String
name()
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.Version
version()
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
null
if 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:
true
if versioned, otherwisefalse
.
-
isCloseable
default boolean isCloseable()
Checks if the described component implementCloseable
.- Returns:
true
if closeable, otherwisefalse
.
-
isSingleton
boolean isSingleton()
Checks if the described component is a singleton.- Returns:
true
if 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:
true
if 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:
true
if is secondary, otherwisefalse
.- See Also:
Qualifiers.bySecondary()
,Qualifiers.excludeSecondary()
-
isEager
boolean isEager()
Checks if the described component should be create and configure eagerly.- Returns:
true
if it s an eager component, otherwisefalse
.- See Also:
Eager
-
-