org.mmbase.module.community
Class NodeBreaker

java.lang.Object
  |
  +--org.mmbase.module.community.NodeBreaker
All Implemented Interfaces:
java.lang.Runnable

Deprecated. The NodeBreaker is a temporary solution (not the best code I ever wrote, either, but it should not be too slow and will have to do for now). It would be much better to incorporate 'expiration time' in the TemporaryNodeManager or a temporary node cloud. As such, avoid using this class in the future.

public class NodeBreaker
extends java.lang.Object
implements java.lang.Runnable

NodeBreaker stores temporary nodes with an expiration time. After this has expired the node is removed.

Version:
28 May 2001
Author:
Dirk-Jan Hoekstra, Pierre van Rooden

Constructor Summary
NodeBreaker(long checkInterval, TemporaryNodeManager tmpNodeManager)
          Deprecated. Creates a new node breaker.
 
Method Summary
 void add(java.lang.String id, long expireTime)
          Deprecated. Adds a node to be watched.
 void remove(java.lang.String id)
          Deprecated. Removes a node.
 void run()
          Deprecated. Runs the thread that checks for expired relations.
 void stop()
          Deprecated. Stop the breaker.
 boolean update(java.lang.String id, long expireTime)
          Deprecated. Updates a node to be watched, preventing it from being removed prematurely.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeBreaker

public NodeBreaker(long checkInterval,
                   TemporaryNodeManager tmpNodeManager)
Deprecated. 
Creates a new node breaker. Used by the Channel builder.
Parameters:
mmb - reference to MMBase
checkinterval - the interval at which the relation breaker checks for expired relations
tmpNodeManager - the temporary node manager that holds the relations.
Method Detail

add

public void add(java.lang.String id,
                long expireTime)
Deprecated. 
Adds a node to be watched. This method starts the breaker if it hasn't been done already.
Parameters:
id - the id of the referred node
expireTime - expiration time of the node

update

public boolean update(java.lang.String id,
                      long expireTime)
Deprecated. 
Updates a node to be watched, preventing it from being removed prematurely.
Parameters:
id - the id of the referred node
expireTime - the new expiration time of the node

remove

public void remove(java.lang.String id)
Deprecated. 
Removes a node. This also removes the node from the temporary node manager cache.
Parameters:
id - the id of the referred node

stop

public void stop()
Deprecated. 
Stop the breaker.

run

public void run()
Deprecated. 
Runs the thread that checks for expired relations.
Specified by:
run in interface java.lang.Runnable


MMBase build 1.6.5.20030923