Getting an OpcUaServer reference

I'd like to register some DataType nodes in my own namespace when my module starts.

Is there a supported way to get a reference to the gateway's OpcUaServer? I'm assuming I'd have to reference the OPC UA module from the ModuleManager, either using getModule or resolveClass?

How does something like the BACnet driver handle this?

The only reference to OpcUaServer you get is from a DeviceContext.

The BACnet driver is actually adding an entirely new namespace and it's using private API to do it.