Package org.wildfly.subsystem.service
Interface ServiceDependency<V>
- All Superinterfaces:
Consumer<org.jboss.as.controller.RequirementServiceBuilder<?>>,org.wildfly.service.Dependency<org.jboss.as.controller.RequirementServiceBuilder<?>,,V> Supplier<V>
- All Known Implementing Classes:
ServiceDependency.AbstractServiceDependency,ServiceDependency.DefaultServiceDependency,ServiceDependency.SimpleServiceDependency,ServiceDependency.SuppliedServiceDependency
public interface ServiceDependency<V>
extends org.wildfly.service.Dependency<org.jboss.as.controller.RequirementServiceBuilder<?>,V>
Encapsulates a dependency on a
Service that supplies a value.- Author:
- Paul Ferraro
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classstatic classstatic classNested classes/interfaces inherited from interface org.wildfly.service.Dependency
org.wildfly.service.Dependency.AbstractDependency<B extends org.jboss.msc.service.ServiceBuilder<?>,V extends Object>, org.wildfly.service.Dependency.DefaultDependency<B extends org.jboss.msc.service.ServiceBuilder<?>, V extends Object>, org.wildfly.service.Dependency.SimpleDependency<B extends org.jboss.msc.service.ServiceBuilder<?>, V extends Object>, org.wildfly.service.Dependency.SuppliedDependency<B extends org.jboss.msc.service.ServiceBuilder<?>, V extends Object> -
Method Summary
Modifier and TypeMethodDescriptiondefault ServiceDependency<V>default <T,R> ServiceDependency<R> combine(org.wildfly.service.Dependency<org.jboss.as.controller.RequirementServiceBuilder<?>, T> dependency, BiFunction<V, T, R> mapper) static <V> ServiceDependency<V>empty()Returns an empty pseudo-dependency whoseSupplier.get()returns null.static <V> ServiceDependency<V>Returns a pseudo-dependency whoseSupplier.get()returns the value from the specified supplier.static <T> ServiceDependency<T>from(org.wildfly.service.ServiceDependency<T> dependency) Wraps aServiceDependencyas aServiceDependency.default <R> ServiceDependency<R>static <V> ServiceDependency<V>of(V value) Returns a pseudo-dependency whoseSupplier.get()returns the specified value.static <T> ServiceDependency<T>Returns a dependency on the capability with the specified name and type, resolved against the specified references names.static <T> ServiceDependency<T>on(org.jboss.msc.service.ServiceName name) Returns a dependency on the service with the specified name.static <T> ServiceDependency<T>on(org.wildfly.service.descriptor.BinaryServiceDescriptor<T> descriptor, String parentName, String childName) Returns a dependency on the specified binary capability, resolved against the specified reference names.static <T> ServiceDependency<T>on(org.wildfly.service.descriptor.NullaryServiceDescriptor<T> descriptor) Returns a dependency on the specified capability.static <T> ServiceDependency<T>on(org.wildfly.service.descriptor.QuaternaryServiceDescriptor<T> descriptor, String ancestorName, String grandparentName, String parentName, String childName) Returns a dependency on the specified quaternary capability, resolved against the specified reference names.static <T> ServiceDependency<T>on(org.wildfly.service.descriptor.TernaryServiceDescriptor<T> descriptor, String grandparentName, String parentName, String childName) Returns a dependency on the specified ternary capability, resolved against the specified reference names.static <T> ServiceDependency<T>Returns a dependency on the specified unary capability, resolved against the specified reference name.Methods inherited from interface org.wildfly.service.Dependency
isEmpty, isPresent
-
Method Details
-
andThen
default ServiceDependency<V> andThen(Consumer<? super org.jboss.as.controller.RequirementServiceBuilder<?>> after) -
map
- Specified by:
mapin interfaceorg.wildfly.service.Dependency<org.jboss.as.controller.RequirementServiceBuilder<?>,V>
-
combine
default <T,R> ServiceDependency<R> combine(org.wildfly.service.Dependency<org.jboss.as.controller.RequirementServiceBuilder<?>, T> dependency, BiFunction<V, T, R> mapper) - Specified by:
combinein interfaceorg.wildfly.service.Dependency<org.jboss.as.controller.RequirementServiceBuilder<?>,V>
-
empty
Returns an empty pseudo-dependency whoseSupplier.get()returns null.- Type Parameters:
V- the value type- Returns:
- an empty service dependency
-
of
Returns a pseudo-dependency whoseSupplier.get()returns the specified value.- Type Parameters:
V- the value type- Parameters:
value- a service value- Returns:
- a pseudo-dependency whose
Supplier.get()returns the specified value.
-
from
Returns a pseudo-dependency whoseSupplier.get()returns the value from the specified supplier.- Type Parameters:
V- the value type- Parameters:
factory- a service value supplier- Returns:
- a pseudo-dependency whose
Supplier.get()returns the value from the specified supplier. - Throws:
NullPointerException- ifsupplierwas null
-
on
Returns a dependency on the service with the specified name.- Type Parameters:
T- the dependency type- Parameters:
name- a service name- Returns:
- a service dependency
-
from
Wraps aServiceDependencyas aServiceDependency.- Type Parameters:
T- the dependency type- Returns:
- a service dependency
- Throws:
NullPointerException- ifdependencywas null
-
on
Returns a dependency on the capability with the specified name and type, resolved against the specified references names. This method is provided for migration purposes. Users should preferServiceDescriptor-based variants of this method whenever possible.- Type Parameters:
T- the dependency type- Parameters:
capabilityName- the name of the referenced capabilitytype- the service type of the referenced capabilityreferenceNames- the reference names- Returns:
- a service dependency
-
on
static <T> ServiceDependency<T> on(org.wildfly.service.descriptor.NullaryServiceDescriptor<T> descriptor) Returns a dependency on the specified capability.- Type Parameters:
T- the dependency type- Parameters:
descriptor- the descriptor for the required service- Returns:
- a service dependency
-
on
static <T> ServiceDependency<T> on(org.wildfly.service.descriptor.UnaryServiceDescriptor<T> descriptor, String name) Returns a dependency on the specified unary capability, resolved against the specified reference name.- Type Parameters:
T- the dependency type- Parameters:
descriptor- the descriptor for the required servicename- the reference name- Returns:
- a service dependency
-
on
static <T> ServiceDependency<T> on(org.wildfly.service.descriptor.BinaryServiceDescriptor<T> descriptor, String parentName, String childName) Returns a dependency on the specified binary capability, resolved against the specified reference names.- Type Parameters:
T- the dependency type- Parameters:
descriptor- the descriptor for the required serviceparentName- the parent reference namechildName- the child reference name- Returns:
- a service dependency
-
on
static <T> ServiceDependency<T> on(org.wildfly.service.descriptor.TernaryServiceDescriptor<T> descriptor, String grandparentName, String parentName, String childName) Returns a dependency on the specified ternary capability, resolved against the specified reference names.- Type Parameters:
T- the dependency type- Parameters:
descriptor- the descriptor for the required servicegrandparentName- the grandparentName reference nameparentName- the parent reference namechildName- the child reference name- Returns:
- a service dependency
-
on
static <T> ServiceDependency<T> on(org.wildfly.service.descriptor.QuaternaryServiceDescriptor<T> descriptor, String ancestorName, String grandparentName, String parentName, String childName) Returns a dependency on the specified quaternary capability, resolved against the specified reference names.- Type Parameters:
T- the dependency type- Parameters:
descriptor- the descriptor for the required serviceancestorName- the ancestor reference namegrandparentName- the grandparent reference nameparentName- the parent reference namechildName- the child reference name- Returns:
- a service dependency
-