Class ReadWriteNamespaceRegistry
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.name.ReadOnlyNamespaceRegistry
-
- org.apache.jackrabbit.oak.plugins.name.ReadWriteNamespaceRegistry
-
- All Implemented Interfaces:
NamespaceRegistry
,NamespaceConstants
public abstract class ReadWriteNamespaceRegistry extends ReadOnlyNamespaceRegistry
Writable namespace registry. Mainly for use to implement the full JCR API.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.oak.plugins.name.ReadOnlyNamespaceRegistry
namespaces, nsdata
-
Fields inherited from interface org.apache.jackrabbit.oak.spi.namespace.NamespaceConstants
NAMESPACE_OAK, NAMESPACE_REP, NAMESPACE_SV, NAMESPACE_XMLNS, NAMESPACES_PATH, PREFIX_OAK, PREFIX_REP, PREFIX_SV, PREFIX_XMLNS, REP_NAMESPACES, REP_NSDATA, REP_PREFIXES, REP_URIS, RESERVED_PREFIXES, RESERVED_URIS
-
Fields inherited from interface javax.jcr.NamespaceRegistry
NAMESPACE_EMPTY, NAMESPACE_JCR, NAMESPACE_MIX, NAMESPACE_NT, NAMESPACE_XML, PREFIX_EMPTY, PREFIX_JCR, PREFIX_MIX, PREFIX_NT, PREFIX_XML
-
-
Constructor Summary
Constructors Constructor Description ReadWriteNamespaceRegistry(Root root)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Root
getWriteRoot()
Called by the write methods to acquire a freshRoot
instance that can be used to persist the requested namespace changes (and nothing else).protected void
refresh()
Called by the write methods to refresh the state of the possible session associated with this instance.void
registerNamespace(String prefix, String uri)
void
unregisterNamespace(String prefix)
-
Methods inherited from class org.apache.jackrabbit.oak.plugins.name.ReadOnlyNamespaceRegistry
checkConsistency, getPrefix, getPrefixes, getURI, getURIs
-
-
-
-
Constructor Detail
-
ReadWriteNamespaceRegistry
public ReadWriteNamespaceRegistry(Root root)
-
-
Method Detail
-
getWriteRoot
protected abstract Root getWriteRoot()
Called by the write methods to acquire a freshRoot
instance that can be used to persist the requested namespace changes (and nothing else).- Returns:
- fresh
Root
instance
-
refresh
protected void refresh() throws RepositoryException
Called by the write methods to refresh the state of the possible session associated with this instance. The default implementation of this method does nothing, but a subclass can use this callback to keep a session in sync with the persisted namespace changes.- Throws:
RepositoryException
- if the session could not be refreshed
-
registerNamespace
public void registerNamespace(String prefix, String uri) throws RepositoryException
- Specified by:
registerNamespace
in interfaceNamespaceRegistry
- Overrides:
registerNamespace
in classReadOnlyNamespaceRegistry
- Throws:
RepositoryException
-
unregisterNamespace
public void unregisterNamespace(String prefix) throws RepositoryException
- Specified by:
unregisterNamespace
in interfaceNamespaceRegistry
- Overrides:
unregisterNamespace
in classReadOnlyNamespaceRegistry
- Throws:
RepositoryException
-
-