net.larsan.norna.base
Interface Delegator

All Superinterfaces:
Context, Namespace

public interface Delegator
extends Context

A delegator is a context node which is responsible for a sub-context namespace. A delegator can be posted on the context namespace and will be called for all sub-paths in that particular namespace. This can be used by services to use Norna URL addressing for it's sub-services. An example might be useful:

A service (at context URL 'norna://localhost/service/pop-store') wants to offer a POP mail store service. It has a set of users who all has an 'INBOX' through the service. The inbox service now posts an implementation of the Delegator interface through it's context on this path:

       users/
 
When another service wants to access the inbox for user 'adam' it asks its local context for this URL:
       norna://localhost/services/pop-store/users/adam/INBOX
 
The context will realize that '/services/pop-store/users/adam/INBOX' does not exist as a context or an object in a context and search recursively backwards in the URL path until it finds the delegator at '/services/pop-store/users/'. That Delegator will then be called by the framework with this URL:
       adam/INBOX
 
The URLs passed into methods of this interface is guarranteed to be relative to the context Namespace ID and passed in without a preceeding slash.

It is illegal to post a delegator on anything else than 'node' paths in the namespace URL addressing system. If a service attempt to post a delegator at a leaf URL such as:

       users/admin
 
the framework is free either to ignore the posting, throw an exception or silently rewrite the URL to:
       users/admin/
 
e.g. append a trailing slash. However, the last method is not recomended except for system services known by the framework on beforehand. The preferred way on handling an illega path is by an illegal argument exception.

Version:
Alpha-0.2 / 2002-10-06 21:37
Author:
Lars J. Nilsson
See Also:
Context

Methods inherited from interface net.larsan.norna.Context
getNamespaceID
 
Methods inherited from interface net.larsan.norna.Namespace
bind, lookup, unbind