Package ratpack.core.service
Interface ServiceDependenciesSpec
-
public interface ServiceDependenciesSpecAllows declaring which services depend on which services.- Since:
- 1.3
- See Also:
ServiceDependencies,DependsOn
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ServiceDependenciesSpecdependsOn(Class<?> dependents, Class<?> dependencies)A convenience form ofdependsOn(Predicate, Predicate)where the predicates are based on compatibility with the given types.default <T1,T2>
ServiceDependenciesSpecdependsOn(Class<T1> dependentsType, Predicate<? super T1> dependents, Class<T2> dependenciesType, Predicate<? super T2> dependencies)Specifies that all services that are of the givendependentsTypethat match thedependentspredicate are dependent on all services that are of thedependenciesTypethat match thedependenciespredicate.ServiceDependenciesSpecdependsOn(Predicate<? super Service> dependents, Predicate<? super Service> dependencies)Specifies that all services that match thedependentspredicate are dependent on all services that match thedependenciespredicate.
-
-
-
Method Detail
-
dependsOn
ServiceDependenciesSpec dependsOn(Predicate<? super Service> dependents, Predicate<? super Service> dependencies) throws Exception
Specifies that all services that match thedependentspredicate are dependent on all services that match thedependenciespredicate.- Parameters:
dependents- the criteria for dependent servicesdependencies- the criteria for services they depend on- Returns:
this- Throws:
Exception- any thrown by either predicate
-
dependsOn
default <T1,T2> ServiceDependenciesSpec dependsOn(Class<T1> dependentsType, Predicate<? super T1> dependents, Class<T2> dependenciesType, Predicate<? super T2> dependencies) throws Exception
Specifies that all services that are of the givendependentsTypethat match thedependentspredicate are dependent on all services that are of thedependenciesTypethat match thedependenciespredicate.- Type Parameters:
T1- the type of dependent servicesT2- the type of services they depend on- Parameters:
dependents- the criteria for dependent servicesdependencies- the criteria for services they depend on- Returns:
this- Throws:
Exception- any thrown by either predicate
-
dependsOn
default ServiceDependenciesSpec dependsOn(Class<?> dependents, Class<?> dependencies) throws Exception
A convenience form ofdependsOn(Predicate, Predicate)where the predicates are based on compatibility with the given types.All services that are type compatible with the
dependentstype, will be considered dependents of all services that are type compatible with thedependenciestype.Use of this method is equivalent to annotating
dependentswithDependsOnwith a value ofdependencies. It can be useful in situations however where you are unable to modify thedependentsclass.
-
-