Class RuntimeCapability.Builder<T>
- java.lang.Object
-
- org.jboss.as.controller.capability.RuntimeCapability.Builder<T>
-
- Type Parameters:
T- the type of the runtime API object exposed by the capability
- Enclosing class:
- RuntimeCapability<T>
public static class RuntimeCapability.Builder<T> extends Object
Builder for aRuntimeCapability.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RuntimeCapability.Builder<T>addRequirements(String... requirements)Adds the names of other capabilities that this capability requires.RuntimeCapability.Builder<T>addRequirements(NullaryServiceDescriptor<?>... requirements)Adds the names of other capabilities that this capability requires.RuntimeCapability<T>build()Builds the capability.static RuntimeCapability.Builder<Void>of(String name)Create a builder for a non-dynamic capability with no custom runtime API.static RuntimeCapability.Builder<Void>of(String name, boolean dynamic)Create a builder for a possibly dynamic capability with no custom runtime API.static RuntimeCapability.Builder<Void>of(String name, boolean dynamic, Class<?> serviceValueType)Create a builder for a possibly dynamic capability that installs a service with the given value type.static <T> RuntimeCapability.Builder<T>of(String name, boolean dynamic, T runtimeAPI)Create a builder for a possibly dynamic capability that provides the given custom runtime API.static RuntimeCapability.Builder<Void>of(String name, Class<?> serviceValueType)Create a builder for a non-dynamic capability that installs a service with the given value type.static <T> RuntimeCapability.Builder<T>of(String name, T runtimeAPI)Create a builder for a non-dynamic capability that provides the given custom runtime API.static RuntimeCapability.Builder<Void>of(BinaryServiceDescriptor<?> descriptor)Creates a builder for a dynamic capability using the name and type of the specified service descriptor.static RuntimeCapability.Builder<Void>of(NullaryServiceDescriptor<?> descriptor)Creates a builder for a non-dynamic capability using the name and type of the specified service descriptor.static RuntimeCapability.Builder<Void>of(QuaternaryServiceDescriptor<?> descriptor)Creates a builder for a dynamic capability using the name and type of the specified service descriptor.static RuntimeCapability.Builder<Void>of(TernaryServiceDescriptor<?> descriptor)Creates a builder for a dynamic capability using the name and type of the specified service descriptor.static RuntimeCapability.Builder<Void>of(UnaryServiceDescriptor<?> descriptor)Creates a builder for a dynamic capability using the name and type of the specified service descriptor.RuntimeCapability.Builder<T>setAllowMultipleRegistrations(boolean allowMultipleRegistrations)Sets whether this capability can be registered at more than one point within the same overall scope.RuntimeCapability.Builder<T>setDynamicNameMapper(Function<PathAddress,String[]> mapper)RuntimeCapability.Builder<T>setServiceType(Class<?> type)Sets that the capability installs a service with the given value type.RuntimeCapability.Builder<T>setStability(Stability stability)Sets the stability level of this capability.
-
-
-
Method Detail
-
of
public static RuntimeCapability.Builder<Void> of(String name)
Create a builder for a non-dynamic capability with no custom runtime API.- Parameters:
name- the name of the capability. Cannot benullor empty.- Returns:
- the builder
-
of
public static RuntimeCapability.Builder<Void> of(String name, boolean dynamic)
Create a builder for a possibly dynamic capability with no custom runtime API.- Parameters:
name- the name of the capability. Cannot benullor empty.dynamic-trueif the capability is a base capability for dynamically named capabilities- Returns:
- the builder
-
of
public static RuntimeCapability.Builder<Void> of(String name, Class<?> serviceValueType)
Create a builder for a non-dynamic capability that installs a service with the given value type.- Parameters:
name- the name of the capability. Cannot benullor empty.serviceValueType- the value type of the service installed by the capability- Returns:
- the builder
-
of
public static RuntimeCapability.Builder<Void> of(String name, boolean dynamic, Class<?> serviceValueType)
Create a builder for a possibly dynamic capability that installs a service with the given value type.- Parameters:
name- the name of the capability. Cannot benullor empty.dynamic-trueif the capability is a base capability for dynamically named capabilitiesserviceValueType- the value type of the service installed by the capability- Returns:
- the builder
-
of
public static <T> RuntimeCapability.Builder<T> of(String name, T runtimeAPI)
Create a builder for a non-dynamic capability that provides the given custom runtime API.- Type Parameters:
T- the type of the runtime API object exposed by the capability- Parameters:
name- the name of the capability. Cannot benullor empty.runtimeAPI- the custom API implementation exposed by the capability- Returns:
- the builder
-
of
public static <T> RuntimeCapability.Builder<T> of(String name, boolean dynamic, T runtimeAPI)
Create a builder for a possibly dynamic capability that provides the given custom runtime API.- Type Parameters:
T- the type of the runtime API object exposed by the capability- Parameters:
name- the name of the capability. Cannot benullor empty.dynamic-trueif the capability is a base capability for dynamically named capabilitiesruntimeAPI- the custom API implementation exposed by the capability- Returns:
- the builder
-
of
public static RuntimeCapability.Builder<Void> of(NullaryServiceDescriptor<?> descriptor)
Creates a builder for a non-dynamic capability using the name and type of the specified service descriptor.- Parameters:
descriptor- the service descriptor of this capability- Returns:
- the builder
-
of
public static RuntimeCapability.Builder<Void> of(UnaryServiceDescriptor<?> descriptor)
Creates a builder for a dynamic capability using the name and type of the specified service descriptor.- Parameters:
descriptor- the service descriptor of this capability- Returns:
- the builder
-
of
public static RuntimeCapability.Builder<Void> of(BinaryServiceDescriptor<?> descriptor)
Creates a builder for a dynamic capability using the name and type of the specified service descriptor.- Parameters:
descriptor- the service descriptor of this capability- Returns:
- the builder
-
of
public static RuntimeCapability.Builder<Void> of(TernaryServiceDescriptor<?> descriptor)
Creates a builder for a dynamic capability using the name and type of the specified service descriptor.- Parameters:
descriptor- the service descriptor of this capability- Returns:
- the builder
-
of
public static RuntimeCapability.Builder<Void> of(QuaternaryServiceDescriptor<?> descriptor)
Creates a builder for a dynamic capability using the name and type of the specified service descriptor.- Parameters:
descriptor- the service descriptor of this capability- Returns:
- the builder
-
setServiceType
public RuntimeCapability.Builder<T> setServiceType(Class<?> type)
Sets that the capability installs a service with the given value type.- Parameters:
type- the value type of the service installed by the capability. May benull- Returns:
- the builder
-
addRequirements
public RuntimeCapability.Builder<T> addRequirements(String... requirements)
Adds the names of other capabilities that this capability requires. The requirement for these capabilities will automatically be registered when this capability is registered.- Parameters:
requirements- the capability names- Returns:
- the builder
-
addRequirements
public RuntimeCapability.Builder<T> addRequirements(NullaryServiceDescriptor<?>... requirements)
Adds the names of other capabilities that this capability requires. The requirement for these capabilities will automatically be registered when this capability is registered.- Parameters:
requirements- the capability names- Returns:
- the builder
-
setAllowMultipleRegistrations
public RuntimeCapability.Builder<T> setAllowMultipleRegistrations(boolean allowMultipleRegistrations)
Sets whether this capability can be registered at more than one point within the same overall scope.- Parameters:
allowMultipleRegistrations-trueif the capability can legally be registered in more than one location in the same scope;falseif an attempt to do this should result in an exception- Returns:
- the builder
-
setDynamicNameMapper
public RuntimeCapability.Builder<T> setDynamicNameMapper(Function<PathAddress,String[]> mapper)
-
setStability
public RuntimeCapability.Builder<T> setStability(Stability stability)
Sets the stability level of this capability.- Parameters:
stability- a stability level- Returns:
- a reference to this builder
-
build
public RuntimeCapability<T> build()
Builds the capability.- Returns:
- the capability. Will not return
null
-
-