public class SimpleResourceDefinition extends Object implements ResourceDefinition
ResourceDefinition
.Constructor and Description |
---|
SimpleResourceDefinition(PathElement pathElement,
DescriptionProvider descriptionProvider)
ResourceDefinition that uses the given {code descriptionProvider} to describe the resource. |
SimpleResourceDefinition(PathElement pathElement,
ResourceDescriptionResolver descriptionResolver)
ResourceDefinition that uses the given {code descriptionResolver} to configure a
DefaultResourceDescriptionProvider to describe the resource. |
SimpleResourceDefinition(PathElement pathElement,
ResourceDescriptionResolver descriptionResolver,
OperationStepHandler addHandler,
OperationStepHandler removeHandler)
ResourceDefinition that uses the given {code descriptionResolver} to configure a
DefaultResourceDescriptionProvider to describe the resource. |
SimpleResourceDefinition(PathElement pathElement,
ResourceDescriptionResolver descriptionResolver,
OperationStepHandler addHandler,
OperationStepHandler removeHandler,
OperationEntry.Flag addRestartLevel,
OperationEntry.Flag removeRestartLevel)
ResourceDefinition that uses the given {code descriptionResolver} to configure a
DefaultResourceDescriptionProvider to describe the resource. |
Modifier and Type | Method and Description |
---|---|
DescriptionProvider |
getDescriptionProvider(ImmutableManagementResourceRegistration resourceRegistration)
Gets a
DescriptionProvider for the given resource. |
protected static EnumSet<OperationEntry.Flag> |
getFlagsSet(OperationEntry.Flag... vararg) |
PathElement |
getPathElement()
Gets the path element that describes how to navigate to this resource from its parent resource, or
null
if this is a definition of a root resource. |
ResourceDescriptionResolver |
getResourceDescriptionResolver()
Gets the
ResourceDescriptionResolver used by this resource definition, or null
if a ResourceDescriptionResolver is not used. |
protected void |
registerAddOperation(ManagementResourceRegistration registration,
OperationStepHandler handler,
OperationEntry.Flag... flags) |
void |
registerAttributes(ManagementResourceRegistration resourceRegistration)
Register operations associated with this resource.
|
void |
registerChildren(ManagementResourceRegistration resourceRegistration)
Register child resources associated with this resource.
|
void |
registerOperations(ManagementResourceRegistration resourceRegistration)
Register operations associated with this resource.
|
protected void |
registerRemoveOperation(ManagementResourceRegistration registration,
OperationStepHandler handler,
OperationEntry.Flag... flags) |
public SimpleResourceDefinition(PathElement pathElement, DescriptionProvider descriptionProvider)
ResourceDefinition
that uses the given {code descriptionProvider} to describe the resource.pathElement
- the path. Cannot be null
.descriptionProvider
- the description provider. Cannot be null
IllegalArgumentException
- if any parameter is null
.public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver)
ResourceDefinition
that uses the given {code descriptionResolver} to configure a
DefaultResourceDescriptionProvider
to describe the resource.pathElement
- the path. Cannot be null
.descriptionResolver
- the description resolver to use in the description provider. Cannot be null
IllegalArgumentException
- if any parameter is null
.public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver, OperationStepHandler addHandler, OperationStepHandler removeHandler)
ResourceDefinition
that uses the given {code descriptionResolver} to configure a
DefaultResourceDescriptionProvider
to describe the resource.pathElement
- the path. Cannot be null
.descriptionResolver
- the description resolver to use in the description provider. Cannot be null
*addHandler
- a handler to register
for the resource "add" operation.
Can be removeHandler
- a handler to register
for the resource "remove" operation.
Can be IllegalArgumentException
- if any parameter is null
.public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver, OperationStepHandler addHandler, OperationStepHandler removeHandler, OperationEntry.Flag addRestartLevel, OperationEntry.Flag removeRestartLevel)
ResourceDefinition
that uses the given {code descriptionResolver} to configure a
DefaultResourceDescriptionProvider
to describe the resource.pathElement
- the path. Cannot be null
.descriptionResolver
- the description resolver to use in the description provider. Cannot be null
*addHandler
- a handler to register
for the resource "add" operation.
Can be removeHandler
- a handler to register
for the resource "remove" operation.
Can be IllegalArgumentException
- if any parameter is null
.public PathElement getPathElement()
ResourceDefinition
null
if this is a definition of a root resource.getPathElement
in interface ResourceDefinition
null
if this is a definition of a root resource.public DescriptionProvider getDescriptionProvider(ImmutableManagementResourceRegistration resourceRegistration)
ResourceDefinition
DescriptionProvider
for the given resource.getDescriptionProvider
in interface ResourceDefinition
resourceRegistration
- the resource. Cannot be null
null
public void registerOperations(ManagementResourceRegistration resourceRegistration)
registerOperations
in interface ResourceDefinition
resourceRegistration
- a ManagementResourceRegistration
created from this definitionpublic void registerAttributes(ManagementResourceRegistration resourceRegistration)
ResourceDefinition
registerAttributes
in interface ResourceDefinition
resourceRegistration
- a ManagementResourceRegistration
created from this definitionpublic void registerChildren(ManagementResourceRegistration resourceRegistration)
ResourceDefinition
registerChildren
in interface ResourceDefinition
resourceRegistration
- a ManagementResourceRegistration
created from this definitionpublic ResourceDescriptionResolver getResourceDescriptionResolver()
ResourceDescriptionResolver
used by this resource definition, or null
if a ResourceDescriptionResolver
is not used.null
protected void registerAddOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags)
protected void registerRemoveOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags)
protected static EnumSet<OperationEntry.Flag> getFlagsSet(OperationEntry.Flag... vararg)
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.