Package org.jboss.as.controller.registry
Class DelegatingResource
java.lang.Object
org.jboss.as.controller.registry.ResourceProvider.ResourceProviderRegistry
org.jboss.as.controller.registry.DelegatingResource
public class DelegatingResource
extends ResourceProvider.ResourceProviderRegistry
implements Resource
Resource implementation that simply delegates to another
Resource. Intended as a convenience class to allow overriding
of standard behaviors and also as a means to support a copy-on-write/publish-on-commit
semantic for the management resource tree.- Author:
- Brian Stansberry (c) 2014 Red Hat Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceProvides a delegate for use by aDelegatingResource.Nested classes/interfaces inherited from interface org.jboss.as.controller.registry.Resource
Resource.Factory, Resource.NoSuchResourceException, Resource.ResourceEntry, Resource.Tools -
Constructor Summary
ConstructorsConstructorDescriptionDelegatingResource(DelegatingResource.ResourceDelegateProvider delegateProvider) Creates a new DelegatingResource with a possibly changing delegate.DelegatingResource(Resource delegate) Creates a new DelegatingResource with a fixed delegate. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of this resource.getChild(PathElement element) Get a single child of this resource with the given address.getChildren(String childType) Get the children for a given type.getChildrenNames(String childType) Get the children names for a given type.Get a list of registered child types for this resource.org.jboss.dmr.ModelNodegetModel()Get the local model.Return the child types for which the order matters.booleanhasChild(PathElement element) Determine whether this resource has a child with the given address.booleanhasChildren(String childType) Determine whether this resource has any child of a given type.booleanDetermine whether the model of this resource is defined.booleanisProxy()Gets whether operations against this resource will be proxied to a remote process.booleanGets whether this resource only exists in the runtime and has no representation in the persistent configuration model.navigate(PathAddress address) Navigate the resource tree.voidregisterChild(PathElement address, int index, Resource resource) Register a child resourcevoidregisterChild(PathElement address, Resource resource) Register a child resource.protected voidregisterResourceProvider(String type, ResourceProvider provider) removeChild(PathElement address) Remove a child resource.requireChild(PathElement element) Get a single child of this resource with the given address.voidwriteModel(org.jboss.dmr.ModelNode newModel) Write the model.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.as.controller.registry.Resource
shallowCopy
-
Constructor Details
-
DelegatingResource
Creates a new DelegatingResource with a fixed delegate.- Parameters:
delegate- the delegate. Cannot benull
-
DelegatingResource
Creates a new DelegatingResource with a possibly changing delegate.- Parameters:
delegateProvider- provider of the delegate. Cannot benull
-
-
Method Details
-
clone
Description copied from interface:ResourceCreates and returns a copy of this resource. -
getChild
Description copied from interface:ResourceGet a single child of this resource with the given address. If no such child exists this will returnnull. -
getChildren
Description copied from interface:ResourceGet the children for a given type.- Specified by:
getChildrenin interfaceResource- Parameters:
childType- the child type- Returns:
- the registered children
-
getChildrenNames
Description copied from interface:ResourceGet the children names for a given type.- Specified by:
getChildrenNamesin interfaceResource- Parameters:
childType- the child type- Returns:
- the names of registered child resources
-
getChildTypes
Description copied from interface:ResourceGet a list of registered child types for this resource.- Specified by:
getChildTypesin interfaceResource- Returns:
- the registered child types
-
getModel
public org.jboss.dmr.ModelNode getModel()Description copied from interface:ResourceGet the local model. -
hasChild
Description copied from interface:ResourceDetermine whether this resource has a child with the given address. In case thePathElementhas a wildcard as value, it will determine whether this resource has any resources of a given type. -
hasChildren
Description copied from interface:ResourceDetermine whether this resource has any child of a given type.- Specified by:
hasChildrenin interfaceResource- Parameters:
childType- the child type- Returns:
trueif there is any child of the given type
-
isModelDefined
public boolean isModelDefined()Description copied from interface:ResourceDetermine whether the model of this resource is defined.- Specified by:
isModelDefinedin interfaceResource- Returns:
trueif the local model is defined
-
isProxy
public boolean isProxy()Description copied from interface:ResourceGets whether operations against this resource will be proxied to a remote process. -
isRuntime
public boolean isRuntime()Description copied from interface:ResourceGets whether this resource only exists in the runtime and has no representation in the persistent configuration model. -
registerChild
Description copied from interface:ResourceRegister a child resource.- Specified by:
registerChildin interfaceResource- Parameters:
address- the addressresource- the resource
-
registerChild
Description copied from interface:ResourceRegister a child resource- Specified by:
registerChildin interfaceResource- Parameters:
address- the addressindex- the index at which to add the resource. Existing children with this index and higher will be shifted one uoresource- the resource
-
removeChild
Description copied from interface:ResourceRemove a child resource.- Specified by:
removeChildin interfaceResource- Parameters:
address- the address- Returns:
- the resource
-
requireChild
Description copied from interface:ResourceGet a single child of this resource with the given address. If no such child exists a, an exception is thrown.- Specified by:
requireChildin interfaceResource- Parameters:
element- the path element- Returns:
- the resource
-
writeModel
public void writeModel(org.jboss.dmr.ModelNode newModel) Description copied from interface:ResourceWrite the model.- Specified by:
writeModelin interfaceResource- Parameters:
newModel- the new model
-
registerResourceProvider
- Specified by:
registerResourceProviderin classResourceProvider.ResourceProviderRegistry
-
getOrderedChildTypes
Description copied from interface:ResourceReturn the child types for which the order matters.- Specified by:
getOrderedChildTypesin interfaceResource- Returns:
trueif the order of the children matters. If there are no ordered children and empty set is returned. This method should never returnnull
-