net.larsan.norna
Interface ContextNotifier


public interface ContextNotifier

A context notifier is responsible for context changes in the namespace it governs. The exact extent of this responsibilities is up to the individual implementations. A service implementing the Delegator interface might choose to notify listeners of changes in the delegated namespace it governs but have no possibility to to the same in other contexts. The only namespace scope guarrantied is that every context implementating this interface will notify it's listeners on changes in its immediate namespace. E.g. a context implementing this interface and mounted at the context URL

       /services/photo/
 
must notify it's listeners of changes to anything up to the next context or path divider. For example, changes to objects at
       /services/photo/sun.jpg
       /services/photo/moon.gif
 
must be forwarded through this interafce to listeners, as opposed to changes to object at
       /services/photo/backup/eclipse.gif
 
which is encuraged but not required to propragate to listeners.

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

Method Summary
 void addContextListener(ContextListener listener)
          Add a context listener to this notifier.
 void addContextListener(java.lang.String regexp, ContextListener listener)
          Add a context listener to this notifier.
 void removeContextListener(ContextListener listener)
          Remove a context listener from this notifier.
 

Method Detail

addContextListener

public void addContextListener(ContextListener listener)
Add a context listener to this notifier. The listener must not be null and must only be added once. Should repeted additions of the same listener occur they must silently fail.

Parameters:
listener - Context listener to add

addContextListener

public void addContextListener(java.lang.String regexp,
                               ContextListener listener)
Add a context listener to this notifier. The listener must not be null and must only be added once. Should repeted additions of the same listener occur they must silently fail.

The regular expression filter is used on the originating URL of the event. Only If the regexp matches the URL will the event be delivered.

Parameters:
regexp - Regular expression filter
listener - Context listener to add

removeContextListener

public void removeContextListener(ContextListener listener)
Remove a context listener from this notifier. The listener must not be null. Should the listener not be regstered with this notifier this method must silently fail.

Parameters:
listener - Context listener to remove