Class ExtensionResource
- java.lang.Object
-
- org.jboss.as.controller.extension.ExtensionResource
-
- All Implemented Interfaces:
Cloneable
,Resource
,Resource.ResourceEntry
public class ExtensionResource extends Object implements Resource.ResourceEntry
- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.as.controller.registry.Resource
Resource.Factory, Resource.NoSuchResourceException, Resource.ResourceEntry, Resource.Tools
-
-
Constructor Summary
Constructors Constructor Description ExtensionResource(String moduleName, ExtensionRegistry extensionRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtensionResource
clone()
Creates and returns a copy of this resource.boolean
equals(Object object)
Resource
getChild(PathElement element)
Get a single child of this resource with the given address.Set<Resource.ResourceEntry>
getChildren(String childType)
Get the children for a given type.Set<String>
getChildrenNames(String childType)
Get the children names for a given type.Set<String>
getChildTypes()
Get a list of registered child types for this resource.org.jboss.dmr.ModelNode
getModel()
Get the local model.String
getName()
Get the name this resource was registered under.Set<String>
getOrderedChildTypes()
Return the child types for which the order matters.PathElement
getPathElement()
Get the path element this resource was registered under.boolean
hasChild(PathElement element)
Determine whether this resource has a child with the given address.boolean
hasChildren(String childType)
Determine whether this resource has any child of a given type.int
hashCode()
boolean
isModelDefined()
Determine whether the model of this resource is defined.boolean
isProxy()
Gets whether operations against this resource will be proxied to a remote process.boolean
isRuntime()
Gets whether this resource only exists in the runtime and has no representation in the persistent configuration model.Resource
navigate(PathAddress address)
Navigate the resource tree.void
registerChild(PathElement address, int index, Resource resource)
Register a child resourcevoid
registerChild(PathElement address, Resource resource)
Register a child resource.Resource
removeChild(PathElement address)
Remove a child resource.Resource
requireChild(PathElement element)
Get a single child of this resource with the given address.void
writeModel(org.jboss.dmr.ModelNode newModel)
Write the model.-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.as.controller.registry.Resource
shallowCopy
-
-
-
-
Constructor Detail
-
ExtensionResource
public ExtensionResource(String moduleName, ExtensionRegistry extensionRegistry)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:Resource.ResourceEntry
Get the name this resource was registered under.- Specified by:
getName
in interfaceResource.ResourceEntry
- Returns:
- the resource name
-
getPathElement
public PathElement getPathElement()
Description copied from interface:Resource.ResourceEntry
Get the path element this resource was registered under.- Specified by:
getPathElement
in interfaceResource.ResourceEntry
- Returns:
- the path element
-
getModel
public org.jboss.dmr.ModelNode getModel()
Description copied from interface:Resource
Get the local model.
-
writeModel
public void writeModel(org.jboss.dmr.ModelNode newModel)
Description copied from interface:Resource
Write the model.- Specified by:
writeModel
in interfaceResource
- Parameters:
newModel
- the new model
-
isModelDefined
public boolean isModelDefined()
Description copied from interface:Resource
Determine whether the model of this resource is defined.- Specified by:
isModelDefined
in interfaceResource
- Returns:
true
if the local model is defined
-
hasChild
public boolean hasChild(PathElement element)
Description copied from interface:Resource
Determine whether this resource has a child with the given address. In case thePathElement
has a wildcard as value, it will determine whether this resource has any resources of a given type.
-
getChild
public Resource getChild(PathElement element)
Description copied from interface:Resource
Get a single child of this resource with the given address. If no such child exists this will returnnull
.
-
requireChild
public Resource requireChild(PathElement element)
Description copied from interface:Resource
Get a single child of this resource with the given address. If no such child exists a, an exception is thrown.- Specified by:
requireChild
in interfaceResource
- Parameters:
element
- the path element- Returns:
- the resource
-
hasChildren
public boolean hasChildren(String childType)
Description copied from interface:Resource
Determine whether this resource has any child of a given type.- Specified by:
hasChildren
in interfaceResource
- Parameters:
childType
- the child type- Returns:
true
if there is any child of the given type
-
navigate
public Resource navigate(PathAddress address)
Description copied from interface:Resource
Navigate the resource tree.
-
getChildTypes
public Set<String> getChildTypes()
Description copied from interface:Resource
Get a list of registered child types for this resource.- Specified by:
getChildTypes
in interfaceResource
- Returns:
- the registered child types
-
getChildrenNames
public Set<String> getChildrenNames(String childType)
Description copied from interface:Resource
Get the children names for a given type.- Specified by:
getChildrenNames
in interfaceResource
- Parameters:
childType
- the child type- Returns:
- the names of registered child resources
-
getChildren
public Set<Resource.ResourceEntry> getChildren(String childType)
Description copied from interface:Resource
Get the children for a given type.- Specified by:
getChildren
in interfaceResource
- Parameters:
childType
- the child type- Returns:
- the registered children
-
registerChild
public void registerChild(PathElement address, Resource resource)
Description copied from interface:Resource
Register a child resource.- Specified by:
registerChild
in interfaceResource
- Parameters:
address
- the addressresource
- the resource
-
registerChild
public void registerChild(PathElement address, int index, Resource resource)
Description copied from interface:Resource
Register a child resource- Specified by:
registerChild
in 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
public Resource removeChild(PathElement address)
Description copied from interface:Resource
Remove a child resource.- Specified by:
removeChild
in interfaceResource
- Parameters:
address
- the address- Returns:
- the resource
-
isRuntime
public boolean isRuntime()
Description copied from interface:Resource
Gets whether this resource only exists in the runtime and has no representation in the persistent configuration model.
-
isProxy
public boolean isProxy()
Description copied from interface:Resource
Gets whether operations against this resource will be proxied to a remote process.
-
clone
public ExtensionResource clone()
Description copied from interface:Resource
Creates and returns a copy of this resource.
-
getOrderedChildTypes
public Set<String> getOrderedChildTypes()
Description copied from interface:Resource
Return the child types for which the order matters.- Specified by:
getOrderedChildTypes
in interfaceResource
- Returns:
true
if the order of the children matters. If there are no ordered children and empty set is returned. This method should never returnnull
-
-