Shortcut access to global NamespaceStorage
Most of our namespaces are stored in StorageType.GLOBAL. Accessing that
requires walking the NamespaceStorage tree completely towards its root,
which takes a lot of time.
This is highlighted by the fact that yang-parser-reactor already
performs this walk in order to find the actual behaviour, which is
stored in BuildGlobalContext -- which happens to also be the GLOBAL
NamespaceStorage object.
The result of that walk is NamespaceAccess, which is always instantiated
from a place which has immediate access to BuildGlobalContext -- either
it is BuildGlobalContext itself or it is SourceSpecificContext.
This patch introduces NamespaceBehaviour.GlobalStorageAccess, which
allows users to acquire the global NamespaceStorage and modifies
NamespaceBehaviour methods to require an instance of this interface.
NamespaceAccesss is extended to implement GlobalStorageAccess and taught
to pass itself to the backing NamespaceBehaviour.
JIRA: YANGTOOLS-1497
Change-Id: I74ac1a31176e8f3fc33875dff775965d1129391f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>