1 7 package org.jboss.cache.optimistic; 8 9 import org.apache.commons.logging.Log; 10 import org.apache.commons.logging.LogFactory; 11 import org.jboss.cache.AbstractCacheListener; 12 import org.jboss.cache.Fqn; 13 14 17 public class TestListener extends AbstractCacheListener 18 { 19 20 Log log = LogFactory.getLog(getClass()); 21 private int nodesAdded = 0; 22 23 26 public synchronized void nodeCreated(Fqn fqn, boolean pre, boolean local) 27 { 28 if (pre) 29 { 30 nodesAdded++; 31 log.info("DataNode created " + fqn); 32 } 33 } 34 35 38 public int getNodesAdded() 39 { 40 return nodesAdded; 41 } 42 43 46 public void setNodesAdded(int nodesAdded) 47 { 48 this.nodesAdded = nodesAdded; 49 } 50 } 51 | Popular Tags |