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, root
-
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 RootgetWriteRoot()Called by the write methods to acquire a freshRootinstance that can be used to persist the requested namespace changes (and nothing else).protected voidrefresh()Called by the write methods to refresh the state of the possible session associated with this instance.voidregisterNamespace(String prefix, String uri)voidunregisterNamespace(String prefix)-
Methods inherited from class org.apache.jackrabbit.oak.plugins.name.ReadOnlyNamespaceRegistry
checkConsistency, 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 freshRootinstance that can be used to persist the requested namespace changes (and nothing else).- Returns:
- fresh
Rootinstance
-
refresh
protected void refresh() throws RepositoryExceptionCalled 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:
registerNamespacein interfaceNamespaceRegistry- Overrides:
registerNamespacein classReadOnlyNamespaceRegistry- Throws:
RepositoryException
-
unregisterNamespace
public void unregisterNamespace(String prefix) throws RepositoryException
- Specified by:
unregisterNamespacein interfaceNamespaceRegistry- Overrides:
unregisterNamespacein classReadOnlyNamespaceRegistry- Throws:
RepositoryException
-
-