public interface ServiceDependenciesSpec
ServiceDependencies
,
DependsOn
Modifier and Type | Method and Description |
---|---|
default ServiceDependenciesSpec |
dependsOn(Class<?> dependents,
Class<?> dependencies)
A convenience form of
dependsOn(Predicate, Predicate) where the predicates are based on compatibility with the given types. |
default <T1,T2> ServiceDependenciesSpec |
dependsOn(Class<T1> dependentsType,
Predicate<? super T1> dependents,
Class<T2> dependenciesType,
Predicate<? super T2> dependencies)
Specifies that all services that are of the given
dependentsType that match the dependents predicate are dependent on all services that are of the dependenciesType that match the dependencies predicate. |
ServiceDependenciesSpec |
dependsOn(Predicate<? super Service> dependents,
Predicate<? super Service> dependencies)
Specifies that all services that match the
dependents predicate are dependent on all services that match the dependencies predicate. |
ServiceDependenciesSpec dependsOn(Predicate<? super Service> dependents, Predicate<? super Service> dependencies) throws Exception
dependents
predicate are dependent on all services that match the dependencies
predicate.
Note that legacy Service
will be wrapped in a LegacyServiceAdapter
when supplied to the given predicates.
dependents
- the criteria for dependent servicesdependencies
- the criteria for services they depend onthis
Exception
- any thrown by either predicatedefault <T1,T2> ServiceDependenciesSpec dependsOn(Class<T1> dependentsType, Predicate<? super T1> dependents, Class<T2> dependenciesType, Predicate<? super T2> dependencies) throws Exception
dependentsType
that match the dependents
predicate are dependent on all services that are of the dependenciesType
that match the dependencies
predicate.
Note that this method is LegacyServiceAdapter
aware.
Adapted services are unpacked, and their real type (i.e. Service
implementation type) is used.
T1
- the type of dependent servicesT2
- the type of services they depend ondependents
- the criteria for dependent servicesdependencies
- the criteria for services they depend onthis
Exception
- any thrown by either predicatedefault ServiceDependenciesSpec dependsOn(Class<?> dependents, Class<?> dependencies) throws Exception
dependsOn(Predicate, Predicate)
where the predicates are based on compatibility with the given types.
All services that are type compatible with the dependents
type,
will be considered dependents of all services that are type compatible with the dependencies
type.
Note that this method is LegacyServiceAdapter
aware.
Adapted services are unpacked, and their real type (i.e. Service
implementation type) is used.
Use of this method is equivalent to annotating dependents
with DependsOn
with a value of dependencies
.
It can be useful in situations however where you are unable to modify the dependents
class.