[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/impl ...
Manik Surtani
msurtani at jboss.com
Thu Jan 11 08:49:23 EST 2007
User: msurtani
Date: 07/01/11 08:49:23
Modified: src-50/org/jboss/cache/pojo/impl PojoCacheImpl.java
Log:
Changed CacheImpl ctor to be protected, and changed cache factories accordingly
Revision Changes Path
1.30 +19 -13 JBossCache/src-50/org/jboss/cache/pojo/impl/PojoCacheImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PojoCacheImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/impl/PojoCacheImpl.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- PojoCacheImpl.java 3 Jan 2007 08:55:37 -0000 1.29
+++ PojoCacheImpl.java 11 Jan 2007 13:49:23 -0000 1.30
@@ -15,10 +15,10 @@
import org.jboss.cache.Cache;
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Version;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.DefaultCacheFactory;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.pojo.CachedType;
import org.jboss.cache.pojo.PojoCache;
@@ -42,7 +42,7 @@
* Implementation class for PojoCache interface
*
* @author Ben Wang
- * @version $Id: PojoCacheImpl.java,v 1.29 2007/01/03 08:55:37 bwang Exp $
+ * @version $Id: PojoCacheImpl.java,v 1.30 2007/01/11 13:49:23 msurtani Exp $
*/
public class PojoCacheImpl implements PojoCache, Observer
{
@@ -69,8 +69,8 @@
{
try
{
-// cache_ = new PojoTreeCache();
-// cache_.setConfiguration(new XmlConfigurationParser().parseFile(configStr));
+ // cache_ = new PojoTreeCache();
+ // cache_.setConfiguration(new XmlConfigurationParser().parseFile(configStr));
XmlConfigurationParser parser = new XmlConfigurationParser();
Configuration expected = parser.parseFile(configStr);
@@ -157,7 +157,7 @@
{
try
{
- Object pojo = find(id); // TODO need optimization here since it will be redundant here
+ Object pojo = find(id);// TODO need optimization here since it will be redundant here
if (pojo == null) return pojo;
notifyDetach(pojo, true);
@@ -167,7 +167,7 @@
}
catch (CacheException e)
{
- e.printStackTrace(); // TODO
+ e.printStackTrace();// TODO
throw new PojoCacheException("PojoTreeCache: " + e);
}
}
@@ -197,7 +197,7 @@
}
catch (CacheException e)
{
- e.printStackTrace(); // TODO
+ e.printStackTrace();// TODO
throw new PojoCacheException("PojoTreeCache: " + e);
}
}
@@ -225,7 +225,7 @@
}
catch (CacheException e)
{
- e.printStackTrace(); // TODO
+ e.printStackTrace();// TODO
throw new PojoCacheException("PojoTreeCache: " + e);
}
}
@@ -326,9 +326,9 @@
// Configurable option to see if we want to remove the cache interceptor when the pojo is
// evicted.
-// if(detachPojoWhenEvicted_) removeCacheInterceptor = true;
+ // if(detachPojoWhenEvicted_) removeCacheInterceptor = true;
delegate_.setBulkRemove(false);
-// return delegate_._removeObject(fqn, removeCacheInterceptor);
+ // return delegate_._removeObject(fqn, removeCacheInterceptor);
return null;
}
@@ -364,12 +364,14 @@
*/
public void fireChange(Subject subject, Field modifiedField, boolean pre)
{
- boolean isLocal = true; // TODO Not yet supported. Always true now.
+ boolean isLocal = true;// TODO Not yet supported. Always true now.
if (hasListeners)
{
for (Iterator it = listeners.iterator(); it.hasNext();)
+ {
((PojoCacheListener) it.next()).modify((Object) subject, modifiedField, pre, isLocal);
}
+ }
}
@@ -378,26 +380,30 @@
if (pojo == null) return;
if (!shouldNotify(pojo)) return;
- boolean isLocal = true; // TODO Not yet supported. Always true now.
+ boolean isLocal = true;// TODO Not yet supported. Always true now.
if (hasListeners)
{
for (Iterator it = listeners.iterator(); it.hasNext();)
+ {
((PojoCacheListener) it.next()).attach(pojo, pre, isLocal);
}
}
+ }
private void notifyDetach(Object pojo, boolean pre)
{
if (pojo == null) return;
if (!shouldNotify(pojo)) return;
- boolean isLocal = true; // TODO Not yet supported. Always true now.
+ boolean isLocal = true;// TODO Not yet supported. Always true now.
if (hasListeners)
{
for (Iterator it = listeners.iterator(); it.hasNext();)
+ {
((PojoCacheListener) it.next()).detach(pojo, pre, isLocal);
}
}
+ }
/**
* Decide whether we want to emit notification event or not.
More information about the jboss-cvs-commits
mailing list