T - the type of the runtime API object exposed by the capabilitypublic static class RuntimeCapability.Builder<T> extends Object
RuntimeCapability.| Modifier and Type | Method and Description |
|---|---|
RuntimeCapability.Builder<T> |
addAdditionalRequiredPackages(String... packages)
Adds the names of any "additional" Galleon packages that must be installed in order
for this capability to function.
|
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.
|
public static RuntimeCapability.Builder<Void> of(String name)
name - the name of the capability. Cannot be null or empty.public static RuntimeCapability.Builder<Void> of(String name, boolean dynamic)
name - the name of the capability. Cannot be null or empty.dynamic - true if the capability is a base capability for dynamically named capabilitiespublic static RuntimeCapability.Builder<Void> of(String name, Class<?> serviceValueType)
name - the name of the capability. Cannot be null or empty.serviceValueType - the value type of the service installed by the capabilitypublic static RuntimeCapability.Builder<Void> of(String name, boolean dynamic, Class<?> serviceValueType)
name - the name of the capability. Cannot be null or empty.dynamic - true if the capability is a base capability for dynamically named capabilitiesserviceValueType - the value type of the service installed by the capabilitypublic static <T> RuntimeCapability.Builder<T> of(String name, T runtimeAPI)
T - the type of the runtime API object exposed by the capabilityname - the name of the capability. Cannot be null or empty.runtimeAPI - the custom API implementation exposed by the capabilitypublic static <T> RuntimeCapability.Builder<T> of(String name, boolean dynamic, T runtimeAPI)
T - the type of the runtime API object exposed by the capabilityname - the name of the capability. Cannot be null or empty.dynamic - true if the capability is a base capability for dynamically named capabilitiesruntimeAPI - the custom API implementation exposed by the capabilitypublic RuntimeCapability.Builder<T> setServiceType(Class<?> type)
type - the value type of the service installed by the capability. May be nullpublic RuntimeCapability.Builder<T> addRequirements(String... requirements)
requirements - the capability namespublic RuntimeCapability.Builder<T> setAllowMultipleRegistrations(boolean allowMultipleRegistrations)
allowMultipleRegistrations - true if the capability can legally be registered in more than
one location in the same scope; false if an attempt
to do this should result in an exceptionpublic RuntimeCapability.Builder<T> setDynamicNameMapper(Function<PathAddress,String[]> mapper)
public RuntimeCapability.Builder<T> addAdditionalRequiredPackages(String... packages)
Capability.getAdditionalRequiredPackages() for more information
on what makes a package "standard" versus "additional".packages - the package namespublic RuntimeCapability<T> build()
nullCopyright © 2018 JBoss by Red Hat. All rights reserved.