net.larsan.norna
Interface Context
- All Superinterfaces:
- Namespace
- All Known Subinterfaces:
- Delegator
- public interface Context
- extends Namespace
A context is a named subpart of a Norna Namespace. A context is equivalent to a node in
a hierarcic model which can contain other nodes as well as a set of leafs. A context is anchored
within its namespace on a non-mutable address which is its Namespace ID.
A discussion on Norna namespace addressing and IDs can be found in the Namespace documentation
but a context differs from a namespace on the following points:
- A context is responsible for security checks in it's subspace. In effect
this means that each context implementation should use the permission framework
of the Java 2 platform for security measures if it keeps sub-context which must be
protected.
- Address URLs may be resolved relative to the context. E.g. where the
address 'services/calc' would be illegal in a
Namespace method invocation
it is perfectly legal in a context. Since contexts are bound to a praticular namespace
the address '/services/calc' is also legal and is resolved agains the namespace root.
The context may use the ContextPermission to check access to its methods. This permission
checks that the caller has permission to access a particular address in the context subspace. Normally
services only have full access to the context they are provided with including its subspace. Thus a
service whose context is named
/services/mailbox/
will usually be free to use any subspace such as
/services/mailbox/username/INBOX
but will probaly not be permitted access to
/services/jsp/parser/
Since a context is bound to a specific namespace it is possible to resolve names more freely than a
namespace would usually permit. An URL can be relative to the context or the namespace root
or be given absolute. For example, for a context named
norna://localhost/system/log/
The three following URLs all point to the same object:
filter/simple
/system/log/filter/simple
norna://localhost/system/log/filter/simple
- Version:
- Alpha-0.2 / 2002-10-06 21:37
- Author:
- Lars J. Nilsson
- See Also:
ContextPermission
|
Method Summary |
java.lang.String |
getNamespaceID()
Get a context Namespace ID. |
getNamespaceID
public java.lang.String getNamespaceID()
- Get a context Namespace ID. This is the
Namespace URL where the context is mounted. All method
invocations on this context may be resolved relative to this name or the root of the parent
namespace.
- Returns:
- The context name, e.g. its URL mount point