Is the default context handled differently than other contexts?
All MOs are registered in a specific context or in the default context. I expected that a request would only be successful if the requested MO was in the same context as specified in the request. But the request is also successful if it specifies a context other than the default context even if the MO is registered in the default context. Is that really correct?
RFC3411 §3.3 is not very clear regarding this but he image shows no special behavior for the default context.
That makes sense. But how can I add a ManagedObject to the default context? DefaultMOServer.register() treats context null equally to context "" (if ((context == null) || (context.length() == 0)) {...}).
I think you are right. I mixed up AGENT++ and SNMP4J-Agent. In the latter we simplified the handling because the more complex differentiation between "" and null confused users when SNMP4J-Agent was introduced, if I remember it correctly.
To use the differentiation anyway, you would need to overwrite the register and unregister methods of the DefaultMOServer to not handle "" as null for the context value when registering and unregistering ManagedObjects.