[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo ...
Ben Wang
bwang at jboss.com
Wed Jul 26 03:10:26 EDT 2006
User: bwang
Date: 06/07/26 03:10:26
Modified: src-50/org/jboss/cache/pojo PojoTreeCache.java
Log:
No overriding of eviction anymore.
Revision Changes Path
1.13 +5 -111 JBossCache/src-50/org/jboss/cache/pojo/PojoTreeCache.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PojoTreeCache.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/PojoTreeCache.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- PojoTreeCache.java 20 Jul 2006 21:58:22 -0000 1.12
+++ PojoTreeCache.java 26 Jul 2006 07:10:26 -0000 1.13
@@ -11,7 +11,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.RegionNotEmptyException;
import org.jboss.cache.TreeCache;
-import org.jboss.cache.aop.statetransfer.PojoStateTransferManager;
+//import org.jboss.cache.aop.statetransfer.PojoStateTransferManager;
import org.jboss.cache.marshall.Region;
import org.jboss.cache.marshall.RegionNameConflictException;
import org.jboss.cache.pojo.eviction.AopEvictionPolicy;
@@ -49,8 +49,8 @@
@Override
public void startService() throws Exception
{
- // Replace the default state transfer manager
- setStateTransferManager(new PojoStateTransferManager(this));
+ // Replace the default state transfer manager. TODO
+// setStateTransferManager(new PojoStateTransferManager(this));
super.startService();
parseConfig();
}
@@ -71,84 +71,6 @@
// detachPojoWhenEvicted_ = XmlHelper.readBooleanContents(config_, "DetachPojoWhenEvicted");
}
- /**
- * Over-ride to make sure we are using an eviction policy specific to aop.
- */
- public void setEvictionPolicyClass(String eviction_policy_class)
- {
- this.getConfiguration().setEvictionPolicyClass(eviction_policy_class);
- if (eviction_policy_class == null || eviction_policy_class.length() == 0)
- return;
-
- try
- {
- Object obj = loadClass(eviction_policy_class).newInstance();
- if (! (obj instanceof AopEvictionPolicy))
- throw new RuntimeException("PojoCache.setEvictionPolicyClass(). Eviction policy provider:" +
- eviction_policy_class + " is not an instance of AopEvictionPolicy.");
- super.getConfiguration().setEvictionPolicyClass(eviction_policy_class);
- }
- catch (RuntimeException ex)
- {
- log.error("setEvictionPolicyClass(): failed creating instance of " + eviction_policy_class, ex);
- throw ex;
- }
- catch (Throwable t)
- {
- log.error("setEvictionPolicyClass(): failed creating instance of " + eviction_policy_class, t);
- }
- }
-
- /**
- * Override to provide aop specific eviction.
- * <p/>
- * <p/>
- * Called by eviction policy provider. Note that eviction is done only in local mode,
- * that is, it doesn't replicate the node removal. This will cause the replication nodes
- * not synchronizing, but it is ok since user is supposed to add the node again when get is
- * null. After that, the contents will be in sync.
- *
- * @param fqn Will remove everythign assoicated with this fqn.
- * @throws org.jboss.cache.CacheException
- */
- @Override
- public void evict(Fqn fqn) throws CacheException
- {
- // We will remove all children nodes as well since we assume all children nodes are part
- // of this "object" node.
- if (isAopNode(fqn))
- {
- if (log.isDebugEnabled())
- {
- log.debug("evict(): evicting whole aop node " + fqn);
- }
-// _evictObject(fqn);
- recursiveEvict(fqn);
- } else
- {
- super.evict(fqn);
- }
- }
-
- private void recursiveEvict(Fqn fqn) throws CacheException
- {
- boolean create_undo_ops = true;
- boolean sendNodeEvent = false;
- // Let's do it brute force.
- _remove(null, fqn, create_undo_ops, sendNodeEvent);
- }
-
- /**
- * Package level evict for plain cache.
- *
- * @param fqn
- * @throws CacheException
- */
- void plainEvict(Fqn fqn) throws CacheException
- {
- super.evict(fqn);
- }
-
private boolean isAopNode(Fqn fqn)
{
// Use this API so it doesn't go thru the interceptor.
@@ -161,41 +83,12 @@
return false;
}
- @Override
- protected void createEvictionPolicy()
- {
- super.createEvictionPolicy();
- this.evictionInterceptorClass = "org.jboss.cache.aop.interceptors.PojoEvictionInterceptor";
- }
-
- protected void _evictSubtree(Fqn subtree) throws CacheException
- {
-
- if (log.isTraceEnabled())
- log.trace("_evictSubtree(" + subtree + ")");
-
- // We will remove all children nodes as well since we assume all children nodes are part
- // of this "object" node.
- if (isAopNode(subtree))
- {
- if (log.isDebugEnabled())
- {
- log.debug("evict(): evicting whole aop node " + subtree);
- }
-// _evictObject(subtree);
- recursiveEvict(subtree);
- } else
- {
- super._evictSubtree(subtree);
- }
-
- }
-
/**
* Overrides the {@link TreeCache#activateRegion(String) superclass method} by
* ensuring that the internal region where information on shared object is stored
* has been activated.
*/
+ /*
@Override
public void activateRegion(String subtreeFqn) throws RegionNotEmptyException, RegionNameConflictException, CacheException
{
@@ -227,6 +120,7 @@
super.activateRegion(subtreeFqn);
}
}
+ */
public Object getLockOwner()
{
More information about the jboss-cvs-commits
mailing list