info.magnolia.cms.beans.config
Class ObservedManager

java.lang.Object
  extended by info.magnolia.cms.beans.config.ObservedManager
Direct Known Subclasses:
CommandsManager, ControlsManager, DialogHandlerManager, PageHandlerManager, ParagraphManager, ParagraphRendererManager, ShutdownManager, TemplateManager, TemplateRendererManager, TreeHandlerManager, VirtualURIManager

public abstract class ObservedManager
extends Object

A lot of "manager" objects are observed. Will mean that they reload the registered content after the content was changed. To centralize this code we use this abstract manager. A subclass will implement onRegister and onClear.

Author:
philipp

Field Summary
protected  org.slf4j.Logger log
           
protected  Set<String> registeredUUIDs
          UUIDs of the registered main nodes.
 
Constructor Summary
ObservedManager()
           
 
Method Summary
 void clear()
          Clears the registered UUIDs and calls onClear().
protected abstract  void onClear()
          The implementor should clear everything.
protected abstract  void onRegister(Content node)
          Registers a node.
 void register(Content node)
          Register a node.
 void reload()
          Calls onClear and reregister the nodes by calling onRegister.
protected  void reload(Content node)
          Reload a specific node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.slf4j.Logger log

registeredUUIDs

protected Set<String> registeredUUIDs
UUIDs of the registered main nodes. They will get registered again after a change.

Constructor Detail

ObservedManager

public ObservedManager()
Method Detail

register

public void register(Content node)
Register a node. The uuid is cached and then onRegister() called.

Parameters:
node - the node to register

reload

public void reload()
Calls onClear and reregister the nodes by calling onRegister.


reload

protected void reload(Content node)
Reload a specific node.

Parameters:
node -

clear

public void clear()
Clears the registered UUIDs and calls onClear().


onRegister

protected abstract void onRegister(Content node)
Registers a node.

Parameters:
node -

onClear

protected abstract void onClear()
The implementor should clear everything. If needed the nodes will get registered.



Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.