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>
Builder for a
RuntimeCapability.-
Method Summary
Modifier and TypeMethodDescriptionaddRequirements(String... requirements) Adds the names of other capabilities that this capability requires.addRequirements(NullaryServiceDescriptor<?>... requirements) Adds the names of other capabilities that this capability requires.build()Builds the capability.static RuntimeCapability.Builder<Void>Create a builder for a non-dynamic capability with no custom runtime API.static RuntimeCapability.Builder<Void>Create a builder for a possibly dynamic capability with no custom runtime API.static RuntimeCapability.Builder<Void>Create a builder for a possibly dynamic capability that installs a service with the given value type.static <T> RuntimeCapability.Builder<T>Create a builder for a possibly dynamic capability that provides the given custom runtime API.static RuntimeCapability.Builder<Void>Create a builder for a non-dynamic capability that installs a service with the given value type.static <T> RuntimeCapability.Builder<T>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.setAllowMultipleRegistrations(boolean allowMultipleRegistrations) Sets whether this capability can be registered at more than one point within the same overall scope.setDynamicNameMapper(Function<PathAddress, String[]> mapper) setServiceType(Class<?> type) Sets that the capability installs a service with the given value type.setStability(Stability stability) Sets the stability level of this capability.
-
Method Details
-
of
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
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
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
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
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
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
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
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
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
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
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
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
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
-
setStability
Sets the stability level of this capability.- Parameters:
stability- a stability level- Returns:
- a reference to this builder
-
build
Builds the capability.- Returns:
- the capability. Will not return
null
-