Package org.wildfly.subsystem.resource
Class ResourceDescriptor.AbstractConfigurator<C extends ResourceDescriptor.Configurator<C>>
- java.lang.Object
-
- org.wildfly.subsystem.resource.ResourceDescriptor.AbstractConfigurator<C>
-
- All Implemented Interfaces:
ResourceDescriptor.Configurator<C>
- Direct Known Subclasses:
ResourceDescriptor.DefaultBuilder
- Enclosing interface:
- ResourceDescriptor
public abstract static class ResourceDescriptor.AbstractConfigurator<C extends ResourceDescriptor.Configurator<C>> extends Object implements ResourceDescriptor.Configurator<C>
An abstractResourceDescriptorconfigurator.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CaddAttribute(AttributeDefinition attribute, OperationStepHandler writeAttributeHandler)Adds the attribute with the specified custom "write-attribute" operation handler.CaddAttributes(Collection<AttributeDefinition> attributes)Adds the specified attributes to this resource descriptor.CaddCapabilities(Collection<RuntimeCapability<?>> capabilities, BiPredicate<OperationContext,Resource> filter)Adds the specified runtime capabilities to this resource.CaddCapability(RuntimeCapability<?> capability, BiPredicate<OperationContext,Resource> filter)Adds the specified conditionally-registered runtime capability to this resourceCaddModelOnlyAttributes(Collection<AttributeDefinition> attributes)Adds the specified model-only attributes (i.e.CaddReadOnlyAttributes(Collection<AttributeDefinition> attributes)Adds the specified read-only attributes to this resource descriptor.CaddResourceCapabilityReferences(Collection<ResourceCapabilityReferenceRecorder<?>> references)Adds a number of capability references that records requirements for this resource.<P extends Supplier<AttributeDefinition>>
CprovideAttributes(Collection<P> providers)Adds the specified attribute providers to this resource descriptor.<P extends Supplier<RuntimeCapability<?>>>
CprovideCapabilities(Collection<P> providers, BiPredicate<OperationContext,Resource> filter)Adds the specified conditionally-registered runtime capability providers to this resource descriptor.<P extends Supplier<AttributeDefinition>>
CprovideModelOnlyAttributes(Collection<P> providers)Adds the specified model-only attribute providers to this resource descriptor.<P extends Supplier<AttributeDefinition>>
CprovideReadOnlyAttributes(Collection<P> providers)Adds the specified read-only attribute providers to this resource descriptor.<P extends Supplier<PathElement>>
CprovideRequiredChildren(Collection<P> providers)Defines a set of required children of this resource.<P extends Supplier<PathElement>>
CprovideRequiredSingletonChildren(Collection<P> providers)Defines a set of required singleton children of this resource.CrequireChildren(Set<PathElement> paths)Defines a set of required children of this resource.CrequireSingletonChildren(Set<PathElement> paths)Defines a set of required singleton children of this resource.protected abstract Cself()CtranslateAttribute(AttributeDefinition attribute, AttributeTranslation translation)Specifies an attribute alias to another attribute of a potentially different resource.CwithAddOperationRestartFlag(OperationEntry.Flag restartFlag)Overrides the default restart flag for the "add" operation of this resource.CwithAddResourceOperationTransformation(UnaryOperator<OperationStepHandler> transformation)Applies the specified transformation to the "add" operation of this resource.CwithDeploymentChainContributor(Consumer<DeploymentProcessorTarget> contributor)Applies the specified deployment chain contributor to this resource's "add" operation.CwithOperationTransformation(UnaryOperator<OperationStepHandler> transformation)Applies the specified transformation to the "remove" and all global operations of this resource.CwithRemoveOperationRestartFlag(OperationEntry.Flag restartFlag)Overrides the default restart flag for the "remove" operation of this resource.CwithResourceTransformation(UnaryOperator<Resource> transformation)CwithRuntimeHandler(ResourceOperationRuntimeHandler runtimeHandler)Applies the specified runtime handler to the operations of this resource.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.subsystem.resource.ResourceDescriptor.Configurator
addCapabilities, addCapability, addResourceCapabilityReference, provideCapabilities, renameAttribute, requireChild, requireSingletonChild
-
-
-
-
Method Detail
-
self
protected abstract C self()
-
withRuntimeHandler
public C withRuntimeHandler(ResourceOperationRuntimeHandler runtimeHandler)
Description copied from interface:ResourceDescriptor.ConfiguratorApplies the specified runtime handler to the operations of this resource.- Specified by:
withRuntimeHandlerin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
runtimeHandler- a runtime handler.- Returns:
- a reference to this configurator
-
withAddOperationRestartFlag
public C withAddOperationRestartFlag(OperationEntry.Flag restartFlag)
Description copied from interface:ResourceDescriptor.ConfiguratorOverrides the default restart flag for the "add" operation of this resource.- Specified by:
withAddOperationRestartFlagin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
restartFlag- a restart flag- Returns:
- a reference to this configurator
-
withRemoveOperationRestartFlag
public C withRemoveOperationRestartFlag(OperationEntry.Flag restartFlag)
Description copied from interface:ResourceDescriptor.ConfiguratorOverrides the default restart flag for the "remove" operation of this resource.- Specified by:
withRemoveOperationRestartFlagin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
restartFlag- a restart flag- Returns:
- a reference to this configurator
-
addAttributes
public C addAttributes(Collection<AttributeDefinition> attributes)
Description copied from interface:ResourceDescriptor.ConfiguratorAdds the specified attributes to this resource descriptor.- Specified by:
addAttributesin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
attributes- a collection of attributes- Returns:
- a reference to this configurator
-
addAttribute
public C addAttribute(AttributeDefinition attribute, OperationStepHandler writeAttributeHandler)
Description copied from interface:ResourceDescriptor.ConfiguratorAdds the attribute with the specified custom "write-attribute" operation handler.- Specified by:
addAttributein interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
attribute- an attributewriteAttributeHandler- custom "write-attribute" operation handler- Returns:
- a reference to this configurator
-
addModelOnlyAttributes
public C addModelOnlyAttributes(Collection<AttributeDefinition> attributes)
Description copied from interface:ResourceDescriptor.ConfiguratorAdds the specified model-only attributes (i.e. with no runtime handling) to this resource descriptor.- Specified by:
addModelOnlyAttributesin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
attributes- a collection of attributes- Returns:
- a reference to this configurator
-
addReadOnlyAttributes
public C addReadOnlyAttributes(Collection<AttributeDefinition> attributes)
Description copied from interface:ResourceDescriptor.ConfiguratorAdds the specified read-only attributes to this resource descriptor.- Specified by:
addReadOnlyAttributesin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
attributes- a collection of attributes- Returns:
- a reference to this configurator
-
translateAttribute
public C translateAttribute(AttributeDefinition attribute, AttributeTranslation translation)
Description copied from interface:ResourceDescriptor.ConfiguratorSpecifies an attribute alias to another attribute of a potentially different resource.- Specified by:
translateAttributein interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
attribute- the alias attributetranslation- a description of the attribute translation- Returns:
- a reference to this configurator
-
addCapability
public C addCapability(RuntimeCapability<?> capability, BiPredicate<OperationContext,Resource> filter)
Description copied from interface:ResourceDescriptor.ConfiguratorAdds the specified conditionally-registered runtime capability to this resource- Specified by:
addCapabilityin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
capability- a runtime capabilityfilter- a predicate used to determine when the specified capability should be registered- Returns:
- a reference to this configurator
-
addCapabilities
public C addCapabilities(Collection<RuntimeCapability<?>> capabilities, BiPredicate<OperationContext,Resource> filter)
Description copied from interface:ResourceDescriptor.ConfiguratorAdds the specified runtime capabilities to this resource.- Specified by:
addCapabilitiesin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
capabilities- a collection of runtime capabilitiesfilter- a predicate used to determine when the specified capability should be registered- Returns:
- a reference to this configurator
-
requireChildren
public C requireChildren(Set<PathElement> paths)
Description copied from interface:ResourceDescriptor.ConfiguratorDefines a set of required children of this resource. Required children will be automatically added, if no child resource exists with the specified path.- Specified by:
requireChildrenin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
paths- a set of paths of the required child resources- Returns:
- a reference to this configurator
-
requireSingletonChildren
public C requireSingletonChildren(Set<PathElement> paths)
Description copied from interface:ResourceDescriptor.ConfiguratorDefines a set of required singleton children of this resource. Required singleton children will be automatically added, if no child resource exists with the same path key.- Specified by:
requireSingletonChildrenin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
paths- a set of paths of the required singleton child resources- Returns:
- a reference to this configurator
-
addResourceCapabilityReferences
public C addResourceCapabilityReferences(Collection<ResourceCapabilityReferenceRecorder<?>> references)
Description copied from interface:ResourceDescriptor.ConfiguratorAdds a number of capability references that records requirements for this resource.- Specified by:
addResourceCapabilityReferencesin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
references- a collection of capability reference recorders- Returns:
- a reference to this configurator
-
withAddResourceOperationTransformation
public C withAddResourceOperationTransformation(UnaryOperator<OperationStepHandler> transformation)
Description copied from interface:ResourceDescriptor.ConfiguratorApplies the specified transformation to the "add" operation of this resource.- Specified by:
withAddResourceOperationTransformationin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
transformation- an operation handler transformation- Returns:
- a reference to this configurator
-
withOperationTransformation
public C withOperationTransformation(UnaryOperator<OperationStepHandler> transformation)
Description copied from interface:ResourceDescriptor.ConfiguratorApplies the specified transformation to the "remove" and all global operations of this resource.- Specified by:
withOperationTransformationin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
transformation- an operation handler transformation- Returns:
- a reference to this configurator
-
withResourceTransformation
public C withResourceTransformation(UnaryOperator<Resource> transformation)
Description copied from interface:ResourceDescriptor.Configurator- Specified by:
withResourceTransformationin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
transformation- an operation handler transformation- Returns:
- a reference to this configurator
-
withDeploymentChainContributor
public C withDeploymentChainContributor(Consumer<DeploymentProcessorTarget> contributor)
Description copied from interface:ResourceDescriptor.ConfiguratorApplies the specified deployment chain contributor to this resource's "add" operation.- Specified by:
withDeploymentChainContributorin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
contributor- a deployment chain contribution- Returns:
- a reference to this configurator
-
provideAttributes
public <P extends Supplier<AttributeDefinition>> C provideAttributes(Collection<P> providers)
Description copied from interface:ResourceDescriptor.ConfiguratorAdds the specified attribute providers to this resource descriptor.- Specified by:
provideAttributesin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
providers- a collection of attribute providers- Returns:
- a reference to this configurator
-
provideModelOnlyAttributes
public <P extends Supplier<AttributeDefinition>> C provideModelOnlyAttributes(Collection<P> providers)
Description copied from interface:ResourceDescriptor.ConfiguratorAdds the specified model-only attribute providers to this resource descriptor.- Specified by:
provideModelOnlyAttributesin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
providers- a collection of attribute providers- Returns:
- a reference to this configurator
-
provideReadOnlyAttributes
public <P extends Supplier<AttributeDefinition>> C provideReadOnlyAttributes(Collection<P> providers)
Description copied from interface:ResourceDescriptor.ConfiguratorAdds the specified read-only attribute providers to this resource descriptor.- Specified by:
provideReadOnlyAttributesin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
providers- a collection of attribute providers- Returns:
- a reference to this configurator
-
provideCapabilities
public <P extends Supplier<RuntimeCapability<?>>> C provideCapabilities(Collection<P> providers, BiPredicate<OperationContext,Resource> filter)
Description copied from interface:ResourceDescriptor.ConfiguratorAdds the specified conditionally-registered runtime capability providers to this resource descriptor.- Specified by:
provideCapabilitiesin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
providers- a collection of runtime capability providersfilter- a predicate used to determine when the specified capability should be registered- Returns:
- a reference to this configurator
-
provideRequiredChildren
public <P extends Supplier<PathElement>> C provideRequiredChildren(Collection<P> providers)
Description copied from interface:ResourceDescriptor.ConfiguratorDefines a set of required children of this resource. Required children will be automatically added, if no child resource exists with the specified path.- Specified by:
provideRequiredChildrenin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
providers- a set of providers of the required child resource paths- Returns:
- a reference to this configurator
-
provideRequiredSingletonChildren
public <P extends Supplier<PathElement>> C provideRequiredSingletonChildren(Collection<P> providers)
Description copied from interface:ResourceDescriptor.ConfiguratorDefines a set of required singleton children of this resource. Required singleton children will be automatically added, if no child resource exists with the same path key.- Specified by:
provideRequiredSingletonChildrenin interfaceResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>- Parameters:
providers- a set of providers of the required singleton child resource paths- Returns:
- a reference to this configurator
-
-