Package org.jboss.as.controller.registry
Class AbstractModelResource
- java.lang.Object
-
- org.jboss.as.controller.registry.ResourceProvider.ResourceProviderRegistry
-
- org.jboss.as.controller.registry.AbstractModelResource
-
public abstract class AbstractModelResource extends ResourceProvider.ResourceProviderRegistry implements Resource
AbstractResourceimplementation.Concurrency note: this class is *not* thread safe
- Author:
- Emanuel Muckenhuber
-
-
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 Modifier Constructor Description protectedAbstractModelResource()protectedAbstractModelResource(boolean runtimeOnly)protectedAbstractModelResource(boolean runtimeOnly, String... orderedChildTypes)protectedAbstractModelResource(boolean runtimeOnly, Set<String> orderedChildTypes)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Resourceclone()Creates and returns a copy of this resource.protected voidcloneProviders(AbstractModelResource clone)ResourcegetChild(PathElement address)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.protected ResourceProvidergetOrCreateProvider(String type)Set<String>getOrderedChildTypes()Return the child types for which the order matters.protected ResourceProvidergetProvider(String type)booleanhasChild(PathElement address)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.booleanisProxy()Gets whether operations against this resource will be proxied to a remote process.booleanisRuntime()Gets whether this resource only exists in the runtime and has no representation in the persistent configuration model.Resourcenavigate(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)ResourceremoveChild(PathElement address)Remove a child resource.ResourcerequireChild(PathElement address)Get a single child of this resource with the given address.-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.as.controller.registry.Resource
getModel, isModelDefined, shallowCopy, writeModel
-
-
-
-
Constructor Detail
-
AbstractModelResource
protected AbstractModelResource()
-
AbstractModelResource
protected AbstractModelResource(boolean runtimeOnly)
-
AbstractModelResource
protected AbstractModelResource(boolean runtimeOnly, String... orderedChildTypes)
-
-
Method Detail
-
getChild
public Resource getChild(PathElement address)
Description copied from interface:ResourceGet a single child of this resource with the given address. If no such child exists this will returnnull.
-
hasChild
public boolean hasChild(PathElement address)
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.
-
requireChild
public Resource requireChild(PathElement address)
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:
address- the path element- Returns:
- the resource
-
hasChildren
public boolean hasChildren(String childType)
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
-
navigate
public Resource navigate(PathAddress address)
Description copied from interface:ResourceNavigate the resource tree.
-
getChildrenNames
public Set<String> getChildrenNames(String childType)
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
public Set<String> getChildTypes()
Description copied from interface:ResourceGet a list of registered child types for this resource.- Specified by:
getChildTypesin interfaceResource- Returns:
- the registered child types
-
getChildren
public Set<Resource.ResourceEntry> getChildren(String childType)
Description copied from interface:ResourceGet the children for a given type.- Specified by:
getChildrenin interfaceResource- Parameters:
childType- the child type- Returns:
- the registered children
-
registerChild
public void registerChild(PathElement address, Resource resource)
Description copied from interface:ResourceRegister a child resource.- Specified by:
registerChildin interfaceResource- Parameters:
address- the addressresource- the resource
-
registerChild
public void registerChild(PathElement address, int index, Resource resource)
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
public Resource removeChild(PathElement address)
Description copied from interface:ResourceRemove a child resource.- Specified by:
removeChildin interfaceResource- Parameters:
address- the address- Returns:
- the resource
-
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.
-
getOrderedChildTypes
public Set<String> 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
-
registerResourceProvider
protected void registerResourceProvider(String type, ResourceProvider provider)
- Specified by:
registerResourceProviderin classResourceProvider.ResourceProviderRegistry
-
getProvider
protected final ResourceProvider getProvider(String type)
-
getOrCreateProvider
protected ResourceProvider getOrCreateProvider(String type)
-
clone
public abstract Resource clone()
Description copied from interface:ResourceCreates and returns a copy of this resource.
-
cloneProviders
protected void cloneProviders(AbstractModelResource clone)
-
-