Author: jason.greene(a)jboss.com
Date: 2008-10-21 16:46:27 -0400 (Tue, 21 Oct 2008)
New Revision: 6990
Modified:
pojo/branches/2.2/pom.xml
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/AdvisedPojoHandler.java
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/CollectionClassHandler.java
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/InternalHelper.java
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/ObjectGraphHandler.java
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/PojoCacheDelegate.java
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/interceptors/PojoTxSynchronizationHandler.java
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/memory/PersistentReference.java
Log:
Fix PCACHE-74 (updating AOP)
Fix PCACHE-75
Prepare for GA
Modified: pojo/branches/2.2/pom.xml
===================================================================
--- pojo/branches/2.2/pom.xml 2008-10-20 21:52:11 UTC (rev 6989)
+++ pojo/branches/2.2/pom.xml 2008-10-21 20:46:27 UTC (rev 6990)
@@ -4,9 +4,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-pojo-version>2.2.0.CR7</jbosscache-pojo-version>
- <jbosscache-core-version>2.2.0.CR7</jbosscache-core-version>
- <jboss.aop.version>2.0.0.CR15</jboss.aop.version>
+ <jbosscache-pojo-version>2.2.0.GA</jbosscache-pojo-version>
+ <jbosscache-core-version>2.2.0.GA</jbosscache-core-version>
+ <jboss.aop.version>2.0.0.GA</jboss.aop.version>
</properties>
<parent>
<groupId>org.jboss.cache</groupId>
Modified:
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/AdvisedPojoHandler.java
===================================================================
---
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/AdvisedPojoHandler.java 2008-10-20
21:52:11 UTC (rev 6989)
+++
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/AdvisedPojoHandler.java 2008-10-21
20:46:27 UTC (rev 6990)
@@ -195,10 +195,8 @@
}
// Need to make sure this is behind put such that obj.toString is done correctly.
- if (log.isDebugEnabled())
- {
- log.debug("internalPut(): inserting with fqn: " + fqn);
- }
+ if (log.isTraceEnabled())
+ log.trace("internalPut(): inserting with fqn: " + fqn);
}
@Override
@@ -236,9 +234,9 @@
// Remember to remove the interceptor from in-memory object but make sure it
belongs to me first.
if (interceptor != null)
{
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("regularRemoveObject(): removed cache interceptor fqn: "
+ fqn + " interceptor: " + interceptor);
+ log.trace("regularRemoveObject(): removed cache interceptor fqn: "
+ fqn + " interceptor: " + interceptor);
}
util_.detachInterceptor(advisor, interceptor);
}
Modified:
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/CollectionClassHandler.java
===================================================================
---
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/CollectionClassHandler.java 2008-10-20
21:52:11 UTC (rev 6989)
+++
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/CollectionClassHandler.java 2008-10-21
20:46:27 UTC (rev 6990)
@@ -107,9 +107,9 @@
if (obj instanceof Map)
{
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("collectionPutObject(): aspectized obj is a Map type of size:
" + ((Map) obj).size());
+ log.trace("collectionPutObject(): aspectized obj is a Map type of size:
" + ((Map) obj).size());
}
// Let's replace it with a proxy if necessary
@@ -140,9 +140,9 @@
}
else if (obj instanceof List)
{
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("collectionPutObject(): aspectized obj is a List type of size:
"
+ log.trace("collectionPutObject(): aspectized obj is a List type of size:
"
+ ((List) obj).size());
}
@@ -174,9 +174,9 @@
}
else if (obj instanceof Set)
{
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("collectionPutObject(): aspectized obj is a Set type of size:
"
+ log.trace("collectionPutObject(): aspectized obj is a Set type of size:
"
+ ((Set) obj).size());
}
Modified: pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/InternalHelper.java
===================================================================
---
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/InternalHelper.java 2008-10-20
21:52:11 UTC (rev 6989)
+++
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/InternalHelper.java 2008-10-21
20:46:27 UTC (rev 6990)
@@ -329,8 +329,8 @@
{
final int RETRY = 5;
- if (log.isDebugEnabled())
- log.debug("lockPojo(): id:" + id);
+ if (log.isTraceEnabled())
+ log.trace("lockPojo(): id:" + id);
boolean isNeeded = true;
int retry = 0;
Modified:
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/ObjectGraphHandler.java
===================================================================
---
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/ObjectGraphHandler.java 2008-10-20
21:52:11 UTC (rev 6989)
+++
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/ObjectGraphHandler.java 2008-10-21
20:46:27 UTC (rev 6990)
@@ -84,9 +84,9 @@
protected Object remove(Fqn<?> fqn, Reference reference, Object pojo)
throws CacheException
{
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("remove(): removing object fqn: " + reference
+ log.trace("remove(): removing object fqn: " + reference
+ " Will just de-reference it.");
}
removeFromReference(fqn, reference);
Modified:
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/PojoCacheDelegate.java
===================================================================
---
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/PojoCacheDelegate.java 2008-10-20
21:52:11 UTC (rev 6989)
+++
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/impl/PojoCacheDelegate.java 2008-10-21
20:46:27 UTC (rev 6990)
@@ -68,9 +68,9 @@
if (pojo != null)
{
// we already have an advised instance
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("getObject(): id: " + fqn + " retrieved from
existing instance directly. ");
+ log.trace("getObject(): id: " + fqn + " retrieved from
existing instance directly. ");
}
return pojo;
}
@@ -105,9 +105,9 @@
boolean allowArray = source instanceof ArrayInterceptable;
if (oldValue == obj && skipDuplicateAttach(obj, allowArray))
{
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("putObject(): id: " + fqn + " pojo is already in the
cache. Return right away.");
+ log.trace("putObject(): id: " + fqn + " pojo is already in the
cache. Return right away.");
}
return obj;
}
@@ -132,8 +132,8 @@
else
{
internalFqn = createInternalFqn(fqn, obj);
- if (log.isDebugEnabled())
- log.debug("attach(): id: " + fqn + " will store the pojo in
the internal area: " + internalFqn);
+ if (log.isTraceEnabled())
+ log.trace("attach(): id: " + fqn + " will store the pojo in
the internal area: " + internalFqn);
handler.put(internalFqn, reference, obj);
@@ -186,9 +186,9 @@
// store PojoReference
pojoReference.setFqn(internalFqn);
internal_.putPojoReference(fqn, pojoReference, field);
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("put(): inserting PojoReference with id: " + fqn);
+ log.trace("put(): inserting PojoReference with id: " + fqn);
}
// store obj in the internal fqn
return internalFqn;
@@ -203,7 +203,8 @@
Node base = cache.getRoot().getChild(f);
if (base == null)
{
- log.debug("The node retrieved is null from fqn: " + f);
+ if (log.isTraceEnabled())
+ log.trace("The node retrieved is null from fqn: " + f);
return;
}
base.addChild(child);
@@ -236,9 +237,9 @@
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("removeObject(): removing object from id: " + fqn
+ log.trace("removeObject(): removing object from id: " + fqn
+ " with the corresponding internal id: " + internalFqn);
}
@@ -278,9 +279,9 @@
}
findChildObjects(fqn, map);
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("_findObjects(): id: " + fqn + " size of pojos found:
" + map.size());
+ log.trace("_findObjects(): id: " + fqn + " size of pojos found:
" + map.size());
}
return map;
}
@@ -298,8 +299,8 @@
return null;
}
- if (log.isDebugEnabled())
- log.debug("getObject(): id: " + fqn + " with a corresponding
internal id: " + internalFqn);
+ if (log.isTraceEnabled())
+ log.trace("getObject(): id: " + fqn + " with a corresponding
internal id: " + internalFqn);
/**
* Reconstruct the managed POJO
Modified:
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/interceptors/PojoTxSynchronizationHandler.java
===================================================================
---
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/interceptors/PojoTxSynchronizationHandler.java 2008-10-20
21:52:11 UTC (rev 6989)
+++
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/interceptors/PojoTxSynchronizationHandler.java 2008-10-21
20:46:27 UTC (rev 6990)
@@ -67,9 +67,14 @@
break;
case Status.STATUS_MARKED_ROLLBACK:
case Status.STATUS_ROLLEDBACK:
- log.debug("Running Pojo rollback phase");
+ if (log.isTraceEnabled())
+ log.trace("Running Pojo rollback phase");
+
runRollbackPhase();
- log.debug("Finished rollback phase");
+
+ if (log.isTraceEnabled())
+ log.trace("Finished rollback phase");
+
break;
default:
Modified:
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java
===================================================================
---
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java 2008-10-20
21:52:11 UTC (rev 6989)
+++
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java 2008-10-21
20:46:27 UTC (rev 6990)
@@ -680,7 +680,8 @@
{
if (Boolean.TRUE.equals(registrationDone) && registerPlainCache)
{
- log.debug("Registered in JMX under " + cacheObjectName);
+ if (log.isDebugEnabled())
+ log.debug("Registered in JMX under " + cacheObjectName);
if (plainCacheWrapper != null)
{
@@ -719,7 +720,7 @@
registered = false;
}
- // ---------------------------------------------------- NotificationEmitter
+ // ---------------------------------------------------- NotificationEmitter
public void removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
@@ -849,7 +850,7 @@
CacheJmxWrapper plainCache = new CacheJmxWrapper();
plainCache.setRegisterInterceptors(getRegisterInterceptors());
plainCache.setCache(pojoCache.getCache());
- // It shouldn't send out lifecycle state change notifications for itself;
+ // It shouldn't send out lifecycle state change notifications for itself;
// we do it
plainCache.setDisableStateChangeNotifications(true);
@@ -878,7 +879,8 @@
{
ObjectName ourName = new ObjectName(cacheObjectName);
ObjectName plainName = JmxUtil.getPlainCacheObjectName(ourName);
- log.debug("Registering plain cache under name " +
plainName.getCanonicalName());
+ if (log.isDebugEnabled())
+ log.debug("Registering plain cache under name " +
plainName.getCanonicalName());
org.jboss.cache.jmx.JmxUtil.registerCacheMBean(server, plainCacheWrapper,
plainName.getCanonicalName());
plainCacheRegistered = true;
return true;
@@ -896,7 +898,8 @@
{
if (registerPlainCache && plainCacheRegistered && server != null)
{
- log.debug("Unregistering plain cache");
+ if (log.isDebugEnabled())
+ log.debug("Unregistering plain cache");
try
{
org.jboss.cache.jmx.JmxUtil.unregisterCacheMBean(server,
plainCacheWrapper.getCacheObjectName());
@@ -939,7 +942,7 @@
if (plainCacheWrapper != null)
{
long now = System.currentTimeMillis();
-
+
AttributeChangeNotification stateChangeNotification = new
AttributeChangeNotification(
this,
plainCacheWrapper.getNextNotificationSequenceNumber(), now, msg,
@@ -947,7 +950,7 @@
new Integer(oldState), new Integer(newState)
);
stateChangeNotification.setUserData(t);
-
+
plainCacheWrapper.sendNotification(stateChangeNotification);
}
}
Modified:
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/memory/PersistentReference.java
===================================================================
---
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/memory/PersistentReference.java 2008-10-20
21:52:11 UTC (rev 6989)
+++
pojo/branches/2.2/src/main/java/org/jboss/cache/pojo/memory/PersistentReference.java 2008-10-21
20:46:27 UTC (rev 6990)
@@ -42,7 +42,7 @@
public static final int REFERENCE_SOFT = 2;
private static final Log log = LogFactory.getLog(PersistentReference.class);
- private static final boolean isDebug = log.isDebugEnabled();
+ private static final boolean isTrace = log.isTraceEnabled();
private WeakReference classReference;
private Reference referencedObject;
@@ -86,7 +86,7 @@
{
try
{
- if (isDebug) log.debug("Reference on " + this.getClass().getName()
+ " being rebuilt");
+ if (isTrace) log.trace("Reference on " + this.getClass().getName()
+ " being rebuilt");
// Return ths value straight from the rebuild, to guarantee the value is not
destroyed if a GC happens during the rebuild reference
return rebuildReference();