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<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.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.
-
-
-
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
-
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
-
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)
-
build
public RuntimeCapability<T> build()
Builds the capability.- Returns:
- the capability. Will not return
null
-
-