org.exist.storage
Class NotificationService

java.lang.Object
  extended by java.util.AbstractMap
      extended by java.util.IdentityHashMap
          extended by org.exist.storage.NotificationService
All Implemented Interfaces:
Serializable, Cloneable, Map

public class NotificationService
extends IdentityHashMap

Global notification service for document updates. Other classes can subscribe to this service to be notified of document modifications, removals or additions.

Author:
wolf
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry, AbstractMap.SimpleImmutableEntry
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry
 
Constructor Summary
NotificationService()
           
 
Method Summary
 void debug()
           
 void notifyMove(NodeId oldNodeId, StoredNode newNode)
          Notify all subscribers that a node has been moved.
 void notifyUpdate(DocumentImpl document, int event)
          Notify all subscribers that a document has been updated/removed or a new document has been added.
 void subscribe(UpdateListener listener)
          Subscribe an UpdateListener to receive notifications.
 void unsubscribe(UpdateListener listener)
          Unsubscribe an UpdateListener.
 
Methods inherited from class java.util.IdentityHashMap
clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotificationService

public NotificationService()
Method Detail

subscribe

public void subscribe(UpdateListener listener)
Subscribe an UpdateListener to receive notifications.

Parameters:
listener -

unsubscribe

public void unsubscribe(UpdateListener listener)
Unsubscribe an UpdateListener.

Parameters:
listener -

notifyUpdate

public void notifyUpdate(DocumentImpl document,
                         int event)
Notify all subscribers that a document has been updated/removed or a new document has been added.

Parameters:
document -
event -

notifyMove

public void notifyMove(NodeId oldNodeId,
                       StoredNode newNode)
Notify all subscribers that a node has been moved. Nodes may be moved during a defragmentation run.


debug

public void debug()


Copyright (C) Wolfgang Meier. All rights reserved.