Author: manik.surtani(a)jboss.com
Date: 2008-04-30 10:29:13 -0400 (Wed, 30 Apr 2008)
New Revision: 5772
Modified:
core/trunk/src/main/java/org/jboss/cache/DataContainer.java
core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java
core/trunk/src/main/java/org/jboss/cache/eviction/BaseEvictionAlgorithm.java
core/trunk/src/main/java/org/jboss/cache/eviction/BaseSortedEvictionAlgorithm.java
core/trunk/src/main/java/org/jboss/cache/eviction/ExpirationAlgorithm.java
core/trunk/src/main/java/org/jboss/cache/eviction/FIFOAlgorithm.java
core/trunk/src/main/java/org/jboss/cache/eviction/LFUAlgorithm.java
core/trunk/src/main/java/org/jboss/cache/eviction/LRUAlgorithm.java
core/trunk/src/main/java/org/jboss/cache/eviction/NodeEntry.java
core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
core/trunk/src/main/java/org/jboss/cache/loader/AbstractCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/AsyncCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/C3p0ConnectionFactory.java
core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java
core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/ManagedConnectionFactory.java
core/trunk/src/main/java/org/jboss/cache/loader/NonManagedConnectionFactory.java
core/trunk/src/main/java/org/jboss/cache/loader/SingletonStoreCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/s3/S3CacheLoader.java
core/trunk/src/main/java/org/jboss/cache/lock/IdentityLock.java
core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java
core/trunk/src/main/java/org/jboss/cache/lock/LockUtil.java
core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNodeImpl.java
core/trunk/src/main/java/org/jboss/cache/transaction/GenericTransactionManagerLookup.java
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java
core/trunk/src/main/java/org/jboss/cache/util/BeanUtils.java
Log:
static loggers and trace optimisations
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-04-30 14:04:04 UTC
(rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-04-30 14:29:13 UTC
(rev 5772)
@@ -6,7 +6,6 @@
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.marshall.NodeData;
import org.jboss.cache.optimistic.DataVersion;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -28,7 +27,7 @@
{
// TODO: 2.2.0: Refactor and standardise method names, consolidate where possible. A
lot of these can be moved into commands.
private static final Log log = LogFactory.getLog(DataContainer.class);
- private static boolean trace;
+ private static boolean trace = log.isTraceEnabled();
private Configuration configuration;
@@ -44,12 +43,6 @@
this.configuration = configuration;
}
- @Start
- public void start()
- {
- trace = log.isTraceEnabled();
- }
-
/**
* Set<Fqn> of Fqns of the topmost node of internal regions that should
* not included in standard state transfers.
Modified: core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java 2008-04-30 14:04:04 UTC
(rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java 2008-04-30 14:29:13 UTC
(rev 5772)
@@ -32,8 +32,7 @@
*/
public class LifecycleManager
{
- private static Log log = LogFactory.getLog(LifecycleManager.class);
-
+ private static final Log log = LogFactory.getLog(LifecycleManager.class);
private CacheStatus cacheStatus;
/* dependencies*/
@@ -238,22 +237,6 @@
correctRootNodeType();
- switch (configuration.getCacheMode())
- {
- case LOCAL:
- log.debug("cache mode is local, will not create the channel");
- break;
- case REPL_SYNC:
- case REPL_ASYNC:
- case INVALIDATION_ASYNC:
- case INVALIDATION_SYNC:
- // reconfigure log category so that the instance name is reflected as well.
- configureLogCategory();
- break;
- default:
- throw new IllegalArgumentException("cache mode " +
configuration.getCacheMode() + " is invalid");
- }
-
startManualComponents();
// start any eviction threads.
@@ -314,9 +297,6 @@
*/
private void internalCreate() throws CacheException
{
- // Include our clusterName in our log category
- configureLogCategory();
-
componentRegistry.wire();
correctRootNodeType();
@@ -409,38 +389,6 @@
if (!tempRootType.equals(currentRootType)) dataContainer.setRoot(tempRoot);
}
- /**
- * Set our log category to include our clusterName, if we have one.
- */
- private void configureLogCategory()
- {
- StringBuilder category = new StringBuilder(getClass().getName());
- if (configuration != null)
- {
- if (rpcManager != null)
- {
- String clusterName = configuration.getClusterName();
- if (clusterName != null)
- {
- category.append('.');
- category.append(clusterName);
- if (rpcManager.getLocalAddress() != null)
- {
- category.append('.');
-
category.append(rpcManager.getLocalAddress().toString().replace('.',
'_'));
- }
- }
- }
- else
- {
- // we're in LOCAL mode
- category.append("_LOCAL");
- }
- }
- // replace .s with _s otherwise Log4J will strip them out
- log = LogFactory.getLog(category.toString());
- }
-
private void startManualComponents()
{
// these 2 components need to be started manually since they can only be started
after ALL other components have started.
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/BaseEvictionAlgorithm.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/eviction/BaseEvictionAlgorithm.java 2008-04-30
14:04:04 UTC (rev 5771)
+++
core/trunk/src/main/java/org/jboss/cache/eviction/BaseEvictionAlgorithm.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -30,6 +30,7 @@
public abstract class BaseEvictionAlgorithm implements EvictionAlgorithm
{
private static final Log log = LogFactory.getLog(BaseEvictionAlgorithm.class);
+ private static final boolean trace = log.isTraceEnabled();
/**
* Mapped region.
@@ -105,7 +106,7 @@
this.initialize(region);
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("process(): region: " + region.getFqn());
}
@@ -177,7 +178,7 @@
}
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("processed " + count + " node events in region: "
+ region.getFqn());
}
@@ -219,7 +220,7 @@
*/
protected boolean evictCacheNode(Fqn fqn)
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Attempting to evict cache node with fqn of " + fqn);
}
@@ -241,7 +242,7 @@
return false;
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Eviction of cache node with fqn of " + fqn + "
successful");
}
@@ -251,7 +252,7 @@
protected void processMarkInUseNodes(Fqn fqn, long inUseTimeout) throws
EvictionException
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Marking node " + fqn + " as in use with a usage
timeout of " + inUseTimeout);
}
@@ -265,7 +266,7 @@
protected void processUnmarkInUseNodes(Fqn fqn) throws EvictionException
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Unmarking node " + fqn + " as in use");
}
@@ -293,7 +294,7 @@
{
Fqn fqn = evictedEventNode.getFqn();
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Adding node " + fqn + " with " + numAddedElements
+ " elements to eviction queue");
}
@@ -311,7 +312,7 @@
{
ne.setNumberOfElements(ne.getNumberOfElements() + numAddedElements);
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Queue already contains " + ne.getFqn() + "
processing it as visited");
}
@@ -326,7 +327,7 @@
evictionQueue.addNodeEntry(ne);
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace(ne.getFqn() + " added successfully to eviction queue");
}
@@ -351,7 +352,7 @@
{
Fqn fqn = evictedEventNode.getFqn();
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Removing node " + fqn + " from eviction queue and
attempting eviction");
}
@@ -373,7 +374,7 @@
}
else
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("processRemoveNodes(): Can't find node associated with
fqn: " + fqn
+ "Could have been evicted earlier. Will just continue.");
@@ -381,7 +382,7 @@
return;
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace(fqn + " removed from eviction queue");
}
@@ -446,7 +447,7 @@
NodeEntry ne = evictionQueue.getNodeEntry(fqn);
if (ne == null)
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Adding element " + fqn + " for a node that
doesn't exist yet. Process as an add.");
}
@@ -489,14 +490,14 @@
if (fqn == null)
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Recycle queue is empty");
}
break;
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("emptying recycle bin. Evict node " + fqn);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/eviction/BaseSortedEvictionAlgorithm.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/eviction/BaseSortedEvictionAlgorithm.java 2008-04-30
14:04:04 UTC (rev 5771)
+++
core/trunk/src/main/java/org/jboss/cache/eviction/BaseSortedEvictionAlgorithm.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -8,7 +8,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.Fqn;
import org.jboss.cache.Region;
@@ -26,6 +25,7 @@
public abstract class BaseSortedEvictionAlgorithm extends BaseEvictionAlgorithm
{
private static final Log log = LogFactory.getLog(BaseSortedEvictionAlgorithm.class);
+ private static final boolean trace = log.isTraceEnabled();
@Override
public void process(Region region) throws EvictionException
@@ -42,8 +42,6 @@
int count = 0;
while ((node = region.takeLastEventNode()) != null)
{
- Fqn fqn = node.getFqn();
-
count++;
switch (node.getEventType())
{
@@ -71,7 +69,7 @@
}
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Eviction nodes visited or added requires resort of queue "
+ evictionNodesModified);
}
@@ -79,7 +77,7 @@
this.resortEvictionQueue(evictionNodesModified);
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("processed " + count + " node events");
}
@@ -108,7 +106,7 @@
((SortedEvictionQueue) evictionQueue).resortEvictionQueue();
long end = System.currentTimeMillis();
- if (log.isTraceEnabled())
+ if (trace)
{
long diff = end - begin;
log.trace("Took " + diff + "ms to sort queue with " +
getEvictionQueue().getNumberOfNodes() + " elements");
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/ExpirationAlgorithm.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/ExpirationAlgorithm.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/ExpirationAlgorithm.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -52,6 +52,7 @@
{
private static final Log log = LogFactory.getLog(ExpirationAlgorithm.class);
+ private static final boolean trace = log.isTraceEnabled();
private ExpirationConfiguration config;
@@ -93,7 +94,7 @@
private void setExpiration(Fqn fqn, Long l)
{
ExpirationEntry ee = new ExpirationEntry(fqn, l);
- if (log.isTraceEnabled())
+ if (trace)
log.trace("adding eviction entry: " + ee);
set.add(ee);
}
@@ -138,7 +139,7 @@
}
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("processed " + count + " node events in region: "
+ region.getFqn());
}
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/FIFOAlgorithm.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/FIFOAlgorithm.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/FIFOAlgorithm.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -20,6 +20,7 @@
public class FIFOAlgorithm extends BaseEvictionAlgorithm
{
private static final Log log = LogFactory.getLog(FIFOAlgorithm.class);
+ private static final boolean trace = log.isTraceEnabled();
@Override
@@ -39,7 +40,7 @@
if (isYoungerThanMinimumTimeToLive(ne)) return false;
FIFOConfiguration config = (FIFOConfiguration) region.getEvictionPolicyConfig();
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Deciding whether node in queue " + ne.getFqn() + "
requires eviction.");
}
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/LFUAlgorithm.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/LFUAlgorithm.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/LFUAlgorithm.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -35,11 +35,12 @@
public class LFUAlgorithm extends BaseSortedEvictionAlgorithm
{
private static final Log log = LogFactory.getLog(LFUAlgorithm.class);
+ private static final boolean trace = log.isTraceEnabled();
@Override
protected boolean shouldEvictNode(NodeEntry ne)
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Deciding whether node in queue " + ne.getFqn() + "
requires eviction.");
}
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/LRUAlgorithm.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/LRUAlgorithm.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/LRUAlgorithm.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -23,6 +23,7 @@
public class LRUAlgorithm extends BaseEvictionAlgorithm
{
private static final Log log = LogFactory.getLog(LRUAlgorithm.class);
+ private static final boolean trace = log.isTraceEnabled();
@Override
protected EvictionQueue setupEvictionQueue(Region region) throws EvictionException
@@ -45,13 +46,13 @@
if (config.getTimeToLiveSeconds() != 0)
{
long idleTime = currentTime - entry.getModifiedTimeStamp();
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Node " + entry.getFqn() + " has been idle for
" + idleTime + "ms");
}
if ((idleTime >= (config.getTimeToLiveSeconds() * 1000)))
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Node " + entry.getFqn() + " should be evicted
because of idle time");
log.trace("Time to live in millies is: " +
(config.getTimeToLiveSeconds() * 1000));
@@ -64,13 +65,13 @@
if (config.getMaxAgeSeconds() != 0)
{
long objectLifeTime = currentTime - entry.getCreationTimeStamp();
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Node " + entry.getFqn() + " has been alive for
" + objectLifeTime + "ms");
}
if ((objectLifeTime >= (config.getMaxAgeSeconds() * 1000)))
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Node " + entry.getFqn() + " should be evicted
because of max age");
}
@@ -78,7 +79,7 @@
}
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Node " + entry.getFqn() + " should not be
evicted");
}
@@ -161,7 +162,7 @@
while (evictionQueue.getNumberOfNodes() > maxNodes)
{
ne = (NodeEntry) it.next();
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Node " + ne.getFqn() + " will be evicted because of
exceeding the maxNode limit." +
" maxNode: " + maxNodes + " but current queue size is:
" + evictionQueue.getNumberOfNodes());
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/NodeEntry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/NodeEntry.java 2008-04-30 14:04:04
UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/NodeEntry.java 2008-04-30 14:29:13
UTC (rev 5772)
@@ -1,7 +1,5 @@
package org.jboss.cache.eviction;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jboss.cache.Fqn;
/**
@@ -22,7 +20,6 @@
private boolean currentlyInUse = false;
EvictionQueue queue;
- private static Log log = LogFactory.getLog(NodeEntry.class);
/**
* Private constructor that automatically sets the creation time stamp of the node
entry.
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -79,6 +79,7 @@
Map<Class, Class<? extends ComponentFactory>> defaultFactories = null;
private static final Log log = LogFactory.getLog(ComponentRegistry.class);
+ private static final boolean trace = log.isTraceEnabled();
private Bootstrap bootstrap;
// cache of reflection methods to call during injections. These will be emptied when
start() is called.
@@ -173,14 +174,14 @@
// this will make sure all dependent components are stopped or set to CONSTRUCTED
so they can be re-wired later.
Component c = new Component(name, component, type);
Component old = componentLookup.get(name);
- if (log.isTraceEnabled())
+ if (trace)
log.trace("Registering component " + c + " under name " +
name + " replacing old component " + old);
if (old != null)
{
// if they are equal don't bother
if (old.instance.equals(component))
{
- if (log.isTraceEnabled())
+ if (trace)
log.trace("Attempting to register a component equal to one that
already exists under the same name (" + name + "). Not doing anything.");
return;
}
@@ -321,7 +322,7 @@
}
else if (attemptedFactoryConstruction)
{
- if (log.isTraceEnabled()) log.trace("Registering a null for component
" + componentNameToUse);
+ if (trace) log.trace("Registering a null for component " +
componentNameToUse);
registerNullComponent(componentNameToUse, componentClass);
}
}
@@ -447,17 +448,17 @@
*/
public void wireDependencies(Object target) throws ConfigurationException
{
- //if (log.isTraceEnabled()) log.trace("Inspecting class " +
target.getClass());
+ //if (trace) log.trace("Inspecting class " + target.getClass());
try
{
// look in caches first
List<CachedMethod> methods = lookupInjectionMethods(target.getClass());
- //if (log.isTraceEnabled()) log.trace("Found method set containing " +
methods.size() + " methods that need injection: " + methods);
+ //if (trace) log.trace("Found method set containing " + methods.size()
+ " methods that need injection: " + methods);
// search for anything we need to inject
for (CachedMethod method : methods)
{
- //if (log.isTraceEnabled()) log.trace("Method " + method + "
needs some other components injected!");
+ //if (trace) log.trace("Method " + method + " needs some other
components injected!");
performInjection(method, target);
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/AbstractCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/AbstractCacheLoader.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/loader/AbstractCacheLoader.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -48,6 +48,7 @@
protected CacheSPI cache;
protected RegionManager regionManager;
private static final Log log = LogFactory.getLog(AbstractCacheLoader.class);
+ private static final boolean trace = log.isTraceEnabled();
/**
* HashMap<Object,List<Modification>>. List of open transactions. Note
that this is purely transient, as
* we don't use a log, recovery is not available
@@ -249,7 +250,7 @@
{
List<NodeData> list = new LinkedList<NodeData>();
getNodeDataList(fqn, list);
- if (log.isTraceEnabled()) log.trace("Loading state of " + list.size() +
" nodes into stream");
+ if (trace) log.trace("Loading state of " + list.size() + " nodes
into stream");
cache.getMarshaller().objectToObjectStream(list, out, fqn);
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/AsyncCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/AsyncCacheLoader.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/loader/AsyncCacheLoader.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -80,6 +80,7 @@
{
private static final Log log = LogFactory.getLog(AsyncCacheLoader.class);
+ private static final boolean trace = log.isTraceEnabled();
private static AtomicInteger threadId = new AtomicInteger(0);
@@ -258,7 +259,7 @@
{
throw new CacheException("AsyncCacheLoader stopped; no longer accepting
more entries.");
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Enqueuing modification " + mod);
}
@@ -322,9 +323,9 @@
try
{
- if (log.isTraceEnabled()) log.trace("process remaining batch " +
mods.size());
+ if (trace) log.trace("process remaining batch " + mods.size());
put(mods);
- if (log.isTraceEnabled()) log.trace("process remaining queued " +
queue.size());
+ if (trace) log.trace("process remaining queued " + queue.size());
while (!queue.isEmpty())
{
run0();
@@ -346,7 +347,7 @@
mods.add(m);
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Calling put(List) with " + mods.size() + "
modifications");
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/C3p0ConnectionFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/C3p0ConnectionFactory.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/loader/C3p0ConnectionFactory.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -24,6 +24,7 @@
public class C3p0ConnectionFactory extends NonManagedConnectionFactory
{
private static final Log log = LogFactory.getLog(C3p0ConnectionFactory.class);
+ private static final boolean trace = log.isTraceEnabled();
private DataSource ds;
@@ -89,7 +90,7 @@
public Connection checkoutConnection() throws SQLException
{
Connection connection = ds.getConnection();
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Connection checked out: " + connection);
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -65,7 +65,7 @@
*/
public class CacheLoaderManager
{
- private static Log log = LogFactory.getLog(CacheLoaderManager.class);
+ private static final Log log = LogFactory.getLog(CacheLoaderManager.class);
private CacheLoaderConfig config;
private CacheSPI cache;
private CacheLoader loader;
Modified: core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -49,7 +49,8 @@
@ThreadSafe
public class ClusteredCacheLoader extends AbstractCacheLoader
{
- private static Log log = LogFactory.getLog(ClusteredCacheLoader.class);
+ private static final Log log = LogFactory.getLog(ClusteredCacheLoader.class);
+ private static final boolean trace = log.isTraceEnabled();
private StripedLock lock = new StripedLock();
private ClusteredCacheLoaderConfig config;
private CommandsFactory commandsFactory;
@@ -110,7 +111,7 @@
private Object callRemote(DataCommand dataCommand) throws Exception
{
- if (log.isTraceEnabled()) log.trace("cache=" + cache.getLocalAddress() +
"; calling with " + dataCommand);
+ if (trace) log.trace("cache=" + cache.getLocalAddress() + "; calling
with " + dataCommand);
List<Address> mbrs = cache.getMembers();
ClusteredGetCommand clusteredGet = commandsFactory.buildClusteredGetCommand(false,
dataCommand);
List resps = null;
@@ -155,7 +156,7 @@
// keep looping to see if anyone else responded
}
- if (log.isTraceEnabled()) log.trace("got responses " + resps);
+ if (trace) log.trace("got responses " + resps);
return result;
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -36,7 +36,6 @@
@ThreadSafe
public class JDBCCacheLoader extends AdjListJDBCCacheLoader
{
-
private static final Log log = LogFactory.getLog(JDBCCacheLoader.class);
private JDBCCacheLoaderConfig config;
Modified: core/trunk/src/main/java/org/jboss/cache/loader/ManagedConnectionFactory.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/loader/ManagedConnectionFactory.java 2008-04-30
14:04:04 UTC (rev 5771)
+++
core/trunk/src/main/java/org/jboss/cache/loader/ManagedConnectionFactory.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -24,6 +24,7 @@
public class ManagedConnectionFactory implements ConnectionFactory
{
private static final Log log = LogFactory.getLog(ManagedConnectionFactory.class);
+ private static final boolean trace = log.isTraceEnabled();
private DataSource dataSource;
private String datasourceName;
@@ -42,7 +43,7 @@
{
ctx = new InitialContext();
dataSource = (DataSource) ctx.lookup(datasourceName);
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Datasource lookup for " + datasourceName + "
succeded: " + dataSource);
}
@@ -71,7 +72,7 @@
throws SQLException
{
Connection connection = dataSource.getConnection();
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Connection checked out: " + connection);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/NonManagedConnectionFactory.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/loader/NonManagedConnectionFactory.java 2008-04-30
14:04:04 UTC (rev 5771)
+++
core/trunk/src/main/java/org/jboss/cache/loader/NonManagedConnectionFactory.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -22,6 +22,7 @@
class NonManagedConnectionFactory implements ConnectionFactory
{
private static final Log log = LogFactory.getLog(NonManagedConnectionFactory.class);
+ private static final boolean trace = log.isTraceEnabled();
static final ThreadLocal<Connection> connection = new
ThreadLocal<Connection>();
@@ -62,7 +63,7 @@
and to trace log the connection opening in JDBCCacheLoader. */
connection.set(con);
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("opened tx connection: tx=" + tx + ", con=" +
con);
}
@@ -86,7 +87,7 @@
}
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("using connection: " + con);
}
@@ -110,7 +111,7 @@
try
{
con.commit();
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("committed tx=" + tx + ", con=" + con);
}
@@ -132,7 +133,7 @@
try
{
con.rollback();
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("rolledback tx=" + tx + ", con=" + con);
}
@@ -155,7 +156,7 @@
{
con.close();
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("closed non tx connection: " + con);
}
@@ -195,7 +196,7 @@
{
try
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Attempting to load driver: " + drv);
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/SingletonStoreCacheLoader.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/loader/SingletonStoreCacheLoader.java 2008-04-30
14:04:04 UTC (rev 5771)
+++
core/trunk/src/main/java/org/jboss/cache/loader/SingletonStoreCacheLoader.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -2,10 +2,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.Modification;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.CacheSPI;
import org.jboss.cache.config.CacheLoaderConfig;
import
org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig;
import org.jboss.cache.notifications.annotation.CacheListener;
@@ -23,6 +23,7 @@
import java.util.Map;
import java.util.Set;
import java.util.Vector;
+import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -30,7 +31,6 @@
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import java.util.concurrent.Callable;
/**
* SingletonStoreCacheLoader is a delegating cache loader used for situations when only
one node should interact with
@@ -56,6 +56,7 @@
* Log instance.
*/
private static final Log log = LogFactory.getLog(SingletonStoreCacheLoader.class);
+ private static final boolean trace = log.isTraceEnabled();
/**
* Name of thread that should pushing in-memory state to cache loader.
@@ -86,7 +87,7 @@
/**
* Whether the the current node is the coordinator and therefore
SingletonStoreCacheLoader is active. Being active
- * means delegating calls to the underlying cache loader.
+ * means delegating calls to the underlying cache loader.
*/
private boolean active;
@@ -109,7 +110,7 @@
/**
* Sets the config for SingletonStoreCacheLoader and for the delegating cache loader.
*/
- @Override
+ @Override
public void setConfig(CacheLoaderConfig.IndividualCacheLoaderConfig config)
{
super.setConfig(config);
@@ -117,7 +118,7 @@
SingletonStoreConfig ssc = config.getSingletonStoreConfig();
if (ssc instanceof SingletonStoreDefaultConfig)
{
- this.config = (SingletonStoreDefaultConfig)ssc;
+ this.config = (SingletonStoreDefaultConfig) ssc;
}
else if (ssc != null)
{
@@ -140,7 +141,7 @@
{
super.setCache(c);
- c.addCacheListener(new SingletonStoreListener());
+ c.addCacheListener(new SingletonStoreListener());
}
/**
@@ -198,7 +199,7 @@
* Factory method for the creation of a Callable task in charge of pushing in-memory
state to cache loader.
*
* @return new instance of Callable<?> whose call() method either throws an
exception or returns null if the task
- * was successfull.
+ * was successfull.
*/
protected Callable<?> createPushStateTask()
{
@@ -230,7 +231,7 @@
*
* @param node instance of NodeSPI to push to the cache loader
* @throws Exception if there's any issues reading the data from the cache or
pushing the node's data to the cache
- * loader.
+ * loader.
*/
protected void pushState(NodeSPI node) throws Exception
{
@@ -251,15 +252,15 @@
//Map.Entry entry = (Map.Entry) aChildren;
pushState(aChildren);
}
- }
+ }
/**
* Method that waits for the in-memory to cache loader state to finish. This
method's called in case a push state
* is already in progress and we need to wait for it to finish.
*
- * @param future instance of Future representing the on going push task
+ * @param future instance of Future representing the on going push task
* @param timeout time to wait for the push task to finish
- * @param unit instance of TimeUnit representing the unit of timeout
+ * @param unit instance of TimeUnit representing the unit of timeout
*/
protected void awaitForPushToFinish(Future future, int timeout, TimeUnit unit)
{
@@ -281,7 +282,7 @@
{
/* Re-assert the thread's interrupted status */
Thread.currentThread().interrupt();
- if (log.isTraceEnabled()) log.trace("wait for state push to cache loader to
finish was interrupted");
+ if (trace) log.trace("wait for state push to cache loader to finish was
interrupted");
}
}
@@ -318,9 +319,9 @@
/**
* Waits, within a time constraint, for a task to finish.
*
- * @param future represents the task waiting to finish.
+ * @param future represents the task waiting to finish.
* @param timeout maximum time to wait for the time to finish.
- * @param unit instance of TimeUnit representing the unit of timeout
+ * @param unit instance of TimeUnit representing the unit of timeout
* @throws Exception if any issues are reported while waiting for the task to finish
*/
private void waitForTaskToFinish(Future future, int timeout, TimeUnit unit) throws
Exception
@@ -341,14 +342,14 @@
{
/* Re-assert the thread's interrupted status */
Thread.currentThread().interrupt();
- if (log.isTraceEnabled()) log.trace("task was interrupted");
+ if (trace) log.trace("task was interrupted");
}
finally
{
/* no-op if task is completed */
future.cancel(true); /* interrupt if running */
}
- }
+ }
/**
* Indicates whether the current nodes is the coordinator of the cluster.
@@ -417,7 +418,7 @@
/**
* Calls the underlying cache loader's operation if the current node is the
coordinator.
- */
+ */
@Override
public Object remove(Fqn fqn, Object key) throws Exception
{
@@ -431,7 +432,7 @@
/**
* Calls the underlying cache loader's operation if the current node is the
coordinator.
- */
+ */
@Override
public void remove(Fqn fqn) throws Exception
{
@@ -443,7 +444,7 @@
/**
* Calls the underlying cache loader's operation if the current node is the
coordinator.
- */
+ */
@Override
public void removeData(Fqn fqn) throws Exception
{
@@ -455,7 +456,7 @@
/**
* Calls the underlying cache loader's operation if the current node is the
coordinator.
- */
+ */
@Override
public void prepare(Object tx, List<Modification> modifications, boolean
one_phase) throws Exception
{
@@ -467,7 +468,7 @@
/**
* Calls the underlying cache loader's operation if the current node is the
coordinator.
- */
+ */
@Override
public void commit(Object tx) throws Exception
{
@@ -479,7 +480,7 @@
/**
* Calls the underlying cache loader's operation if the current node is the
coordinator.
- */
+ */
@Override
public void rollback(Object tx)
{
@@ -491,7 +492,7 @@
/**
* Calls the underlying cache loader's operation if the current node is the
coordinator.
- */
+ */
@Override
public void storeEntireState(ObjectInputStream is) throws Exception
{
@@ -503,7 +504,7 @@
/**
* Calls the underlying cache loader's operation if the current node is the
coordinator.
- */
+ */
@Override
public void storeState(Fqn subtree, ObjectInputStream is) throws Exception
{
@@ -515,7 +516,7 @@
/**
* Calls the underlying cache loader's operation if the current node is the
coordinator.
- */
+ */
@Override
public String toString()
{
@@ -574,7 +575,7 @@
}
/**
- * Exception representing any issues that arise from pushing the in-memory state to
the cache loader.
+ * Exception representing any issues that arise from pushing the in-memory state to
the cache loader.
*/
public static class PushStateException extends Exception
{
Modified: core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -60,6 +60,7 @@
public class JdbmCacheLoader extends AbstractCacheLoader
{
private static final Log log = LogFactory.getLog(JdbmCacheLoader.class);
+ private static final boolean trace = log.isTraceEnabled();
private static final String KEYS = "K";
private static final String NODE = "N";
@@ -216,7 +217,7 @@
config = new JdbmCacheLoaderConfig(base);
}
- if (log.isTraceEnabled()) log.trace("Configuring cache loader with location =
" + config.getLocation());
+ if (trace) log.trace("Configuring cache loader with location = " +
config.getLocation());
}
public IndividualCacheLoaderConfig getConfig()
@@ -261,7 +262,7 @@
throws Exception
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("getChildrenNames " + name);
}
@@ -332,7 +333,7 @@
if (tree.find(name) == null)
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("get, no node: " + name);
}
@@ -359,7 +360,7 @@
}
}
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("get " + name + " map=" + map);
}
@@ -403,7 +404,7 @@
makeNode(name);
Fqn rec = key(name, key);
Object oldValue = insert(rec, value);
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("put " + rec + " value=" + value + "
old=" + oldValue);
}
@@ -424,7 +425,7 @@
private void put0(Fqn name, Map<?, ?> values) throws Exception
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("put " + name + " values=" + values);
}
@@ -481,7 +482,7 @@
private void erase0(Fqn name, boolean self)
throws IOException
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("erase " + name + " self=" + self);
}
@@ -515,7 +516,7 @@
private Object eraseKey0(Fqn name, Object key)
throws IOException
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("eraseKey " + name + " key " + key);
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/s3/S3CacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/s3/S3CacheLoader.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/loader/s3/S3CacheLoader.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -61,6 +61,7 @@
public class S3CacheLoader extends AbstractCacheLoader
{
private static final Log log = LogFactory.getLog(S3CacheLoader.class);
+ private static final boolean trace = log.isTraceEnabled();
/**
* Max number of dummy parent nodes to cache.
@@ -163,7 +164,7 @@
config = new S3LoaderConfig(base);
}
- if (log.isTraceEnabled())
+ if (trace)
log.trace("config=" + config);
}
@@ -214,7 +215,7 @@
{
String children = children(name);
ListResponse response = connection.list(getBucket(), children);
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("getChildrenNames " + name + " response=" +
response);
}
@@ -247,7 +248,7 @@
GetStreamResponse response = connection.getStream(getBucket(), key(name));
try
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("get " + name + " response=" + response);
}
@@ -279,7 +280,7 @@
public boolean exists(Fqn name) throws Exception
{
Response response = connection.head(getBucket(), key(name));
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("exists " + name + " response=" + response);
}
@@ -324,7 +325,7 @@
private void put0(Fqn name, S3Object obj) throws Exception
{
Response response = connection.put(getBucket(), key(name), obj);
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("put " + name + " obj=" + obj + "
response=" + response);
}
@@ -438,7 +439,7 @@
}
}
Response response = connection.delete(getBucket(), key(name));
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("delete " + name + " response=" + response);
}
Modified: core/trunk/src/main/java/org/jboss/cache/lock/IdentityLock.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/IdentityLock.java 2008-04-30 14:04:04
UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/lock/IdentityLock.java 2008-04-30 14:29:13
UTC (rev 5772)
@@ -71,7 +71,7 @@
private boolean PRINT_LOCK_DETAILS =
Boolean.getBoolean("print_lock_details");
private static final Log log = LogFactory.getLog(IdentityLock.class);
- private static boolean trace = log.isTraceEnabled();
+ private static final boolean trace = log.isTraceEnabled();
private final LockStrategy lock_;
private final LockMap map_;
private final boolean mustReacquireRead_;
Modified: core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java 2008-04-30 14:04:04 UTC
(rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java 2008-04-30 14:29:13 UTC
(rev 5772)
@@ -25,7 +25,7 @@
*/
public class LockManager
{
- private static Log log = LogFactory.getLog(LockManager.class);
+ private static final Log log = LogFactory.getLog(LockManager.class);
private static final boolean trace = log.isTraceEnabled();
private Configuration configuration;
Modified: core/trunk/src/main/java/org/jboss/cache/lock/LockUtil.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/LockUtil.java 2008-04-30 14:04:04 UTC
(rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/lock/LockUtil.java 2008-04-30 14:29:13 UTC
(rev 5772)
@@ -14,6 +14,7 @@
public abstract class LockUtil
{
private final static Log log = LogFactory.getLog(StateTransferManager.class);
+ private static final boolean trace = log.isTraceEnabled();
private static interface TransactionLockStatus extends Status
{
@@ -66,7 +67,7 @@
TransactionManager tm,
Object localAddress)
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Attempting to acquire lock for node " + node.getFqn() +
" from owner " + curOwner);
@@ -100,7 +101,7 @@
broken = true;
}
- if (broken && log.isTraceEnabled())
+ if (broken && trace)
{
log.trace("Broke lock for node " + node.getFqn() +
" held by owner " + curOwner);
@@ -174,7 +175,7 @@
case Status.STATUS_UNKNOWN:
if (tryCount == 0)
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Attempting to break transaction lock held "
+
" by " + gtx + " by rolling back local
tx");
@@ -223,7 +224,7 @@
if (tryCount == 0 && localTx)
{
// We can still abort the commit
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("Attempting to break transaction lock held "
+
"by " + gtx + " by marking local tx as
" +
Modified: core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNodeImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNodeImpl.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNodeImpl.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -37,6 +37,7 @@
{
private static final Log log = LogFactory.getLog(WorkspaceNodeImpl.class);
+ private static final boolean trace = log.isTraceEnabled();
private NodeSPI<K, V> node;
private TransactionWorkspace workspace;
@@ -378,7 +379,7 @@
{
getChildrenAddedSet().add(child.getFqn());
if (childrenRemoved != null) childrenRemoved.remove(child.getFqn());
- if (log.isTraceEnabled()) log.trace("Adding child " + child.getFqn());
+ if (trace) log.trace("Adding child " + child.getFqn());
}
public void clearData()
Modified:
core/trunk/src/main/java/org/jboss/cache/transaction/GenericTransactionManagerLookup.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/transaction/GenericTransactionManagerLookup.java 2008-04-30
14:04:04 UTC (rev 5771)
+++
core/trunk/src/main/java/org/jboss/cache/transaction/GenericTransactionManagerLookup.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -30,7 +30,7 @@
public class GenericTransactionManagerLookup implements TransactionManagerLookup
{
- private static Log log = LogFactory.getLog(GenericTransactionManagerLookup.class);
+ private static final Log log =
LogFactory.getLog(GenericTransactionManagerLookup.class);
/**
* JNDI lookups performed?
@@ -51,14 +51,14 @@
* JNDI locations for TransactionManagers we know of
*/
private static String[][] knownJNDIManagers =
- {
- {"java:/TransactionManager", "JBoss, JRun4"},
- {"java:comp/TransactionManager", "Resin 3.x"},
- {"java:pm/TransactionManager", "Borland, Sun"},
- {"java:appserver/TransactionManager", "Sun
Glassfish"},
- {"javax.transaction.TransactionManager", "BEA
WebLogic"},
- {"java:comp/UserTransaction", "Resin, Orion, JOnAS
(JOTM)"},
- };
+ {
+ {"java:/TransactionManager", "JBoss, JRun4"},
+ {"java:comp/TransactionManager", "Resin 3.x"},
+ {"java:pm/TransactionManager", "Borland, Sun"},
+ {"java:appserver/TransactionManager", "Sun
Glassfish"},
+ {"javax.transaction.TransactionManager", "BEA
WebLogic"},
+ {"java:comp/UserTransaction", "Resin, Orion, JOnAS
(JOTM)"},
+ };
/**
* WebSphere 5.1 and 6.0 TransactionManagerFactory
@@ -127,7 +127,7 @@
catch (NamingException e)
{
log.debug("Failed to perform a lookup for [" + knownJNDIManager[0]
+ " (" + knownJNDIManager[1]
- + ")]");
+ + ")]");
continue;
}
if (jndiObject instanceof TransactionManager)
@@ -179,7 +179,7 @@
catch (Exception ex)
{
log.error("Found WebSphere TransactionManager factory class [" +
clazz.getName()
- + "], but couldn't invoke its static
'getTransactionManager' method", ex);
+ + "], but couldn't invoke its static
'getTransactionManager' method", ex);
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -52,6 +52,7 @@
{
private static final Log log = LogFactory.getLog(TransactionEntry.class);
+ private static final boolean trace = log.isTraceEnabled();
/**
* Local transaction
@@ -209,7 +210,6 @@
public void releaseAllLocksLIFO(Object owner)
{
- boolean trace = log.isTraceEnabled();
synchronized (locks)
{
// Copying out to an array is faster than creating an ArrayList and iterating,
@@ -240,7 +240,7 @@
for (NodeLock lock : locks)
{
lock.release(owner);
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("releasing lock for " + lock.getFqn() + " ("
+ lock + ")");
}
@@ -314,7 +314,7 @@
*/
public void undoOperations()
{
- if (log.isTraceEnabled())
+ if (trace)
{
log.trace("undoOperations " + modificationList);
}
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java 2008-04-30
14:04:04 UTC (rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java 2008-04-30
14:29:13 UTC (rev 5772)
@@ -35,7 +35,7 @@
public class TransactionTable
{
private static final Log log = LogFactory.getLog(TransactionTable.class);
- private static boolean trace;
+ private static final boolean trace = log.isTraceEnabled();
/**
* Mapping between local (javax.transaction.Transaction)
@@ -61,7 +61,6 @@
this.transactionManager = transactionManager;
this.rpcManager = rpcManager;
isOptimisticLocking = configuration.isNodeLockingOptimistic();
- trace = log.isTraceEnabled();
}
/**
Modified: core/trunk/src/main/java/org/jboss/cache/util/BeanUtils.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/BeanUtils.java 2008-04-30 14:04:04 UTC
(rev 5771)
+++ core/trunk/src/main/java/org/jboss/cache/util/BeanUtils.java 2008-04-30 14:29:13 UTC
(rev 5772)
@@ -1,8 +1,5 @@
package org.jboss.cache.util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import java.lang.reflect.Method;
import java.util.Locale;
@@ -14,8 +11,6 @@
*/
public class BeanUtils
{
- private static Log log = LogFactory.getLog(BeanUtils.class);
-
/**
* Retrieves a setter name based on a field name passed in
*