db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r377106 - in /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker: locking/LockManagerInMemoryImpl.java metadata/SuperReferenceDescriptor.java
Date Sun, 12 Feb 2006 01:45:37 GMT
Author: arminw
Date: Sat Feb 11 17:45:35 2006
New Revision: 377106

URL: http://svn.apache.org/viewcvs?rev=377106&view=rev
Log:
cleanup logging

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/locking/LockManagerInMemoryImpl.java
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/SuperReferenceDescriptor.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/locking/LockManagerInMemoryImpl.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/locking/LockManagerInMemoryImpl.java?rev=377106&r1=377105&r2=377106&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/locking/LockManagerInMemoryImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/locking/LockManagerInMemoryImpl.java
Sat Feb 11 17:45:35 2006
@@ -18,9 +18,9 @@
 import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.LinkedHashMap;
 
 import org.apache.commons.collections.list.TreeList;
 import org.apache.commons.lang.SystemUtils;
@@ -38,7 +38,7 @@
  */
 public class LockManagerInMemoryImpl implements LockManager, Configurable, Serializable
 {
-    private transient Logger log;
+    private Logger log = LoggerFactory.getLogger(LockManagerInMemoryImpl.class);
     /** The period to search for timed out locks. */
     private long cleanupFrequency = 10000; // milliseconds.
     /** The number of lock entries to check for timeout */
@@ -65,15 +65,6 @@
     {
     }
 
-    private Logger getLog()
-    {
-        if(log == null)
-        {
-            log = LoggerFactory.getLogger(LockManagerInMemoryImpl.class);
-        }
-        return log;
-    }
-
     /** The period to search for timed out locks. */
     public long getCleanupFrequency()
     {
@@ -131,7 +122,7 @@
     /** NOOP */
     public void setBlockTimeout(long timeout)
     {
-        getLog().info("block-timeout setting is not supported");
+        log.info("block-timeout setting is not supported");
     }
 
     public String getLockInfo()
@@ -153,7 +144,7 @@
 
     public boolean readLock(final Object key, final Object resourceId, final int isolationLevel)
     {
-        if(getLog().isDebugEnabled()) getLog().debug("LM.readLock(tx-" + key + ", " + resourceId
+ ")");
+        if(log.isDebugEnabled()) log.debug("LM.readLock(tx-" + key + ", " + resourceId +
")");
         checkTimedOutLocks();
         LockEntry reader = new LockEntry(resourceId,
                 key,
@@ -184,7 +175,7 @@
 
     public boolean releaseLock(final Object key, final Object resourceId)
     {
-        if(getLog().isDebugEnabled()) getLog().debug("LM.releaseLock(tx-" + key + ", " +
resourceId + ")");
+        if(log.isDebugEnabled()) log.debug("LM.releaseLock(tx-" + key + ", " + resourceId
+ ")");
 
         synchronized(resourceLockMap)
         {
@@ -196,7 +187,7 @@
     /** @see LockManager#releaseLocks(Object) */
     public void releaseLocks(final Object key)
     {
-        if(getLog().isDebugEnabled()) getLog().debug("LM.releaseLocks(tx-" + key + ")");
+        if(log.isDebugEnabled()) log.debug("LM.releaseLocks(tx-" + key + ")");
         checkTimedOutLocks();
         doReleaseLocks(key);
         //System.out.println("resourceLockMap: " + resourceLockMap.size());
@@ -205,7 +196,7 @@
 
     public boolean writeLock(final Object key, final Object resourceId, final int isolationLevel)
     {
-        if(getLog().isDebugEnabled()) getLog().debug("LM.writeLock(tx-" + key + ", " + resourceId
+ ")");
+        if(log.isDebugEnabled()) log.debug("LM.writeLock(tx-" + key + ", " + resourceId +
")");
         checkTimedOutLocks();
         LockEntry writer = new LockEntry(resourceId,
                 key,
@@ -237,14 +228,14 @@
 
     public boolean upgradeLock(final Object key, final Object resourceId, final int isolationLevel)
     {
-        if(getLog().isDebugEnabled()) getLog().debug("LM.upgradeLock(tx-" + key + ", " +
resourceId + ")");
+        if(log.isDebugEnabled()) log.debug("LM.upgradeLock(tx-" + key + ", " + resourceId
+ ")");
         return writeLock(key, resourceId, isolationLevel);
     }
 
     /** @see LockManager#hasWrite(Object, Object) */
     public boolean hasWrite(final Object key, final Object resourceId)
     {
-        if(getLog().isDebugEnabled()) getLog().debug("LM.hasWrite(tx-" + key + ", " + resourceId
+ ")");
+        if(log.isDebugEnabled()) log.debug("LM.hasWrite(tx-" + key + ", " + resourceId +
")");
         checkTimedOutLocks();
 
         ObjectLocks objectLocks;
@@ -261,14 +252,14 @@
 
     public boolean hasUpgrade(final Object key, final Object resourceId)
     {
-        if(getLog().isDebugEnabled()) getLog().debug("LM.hasUpgrade(tx-" + key + ", " + resourceId
+ ")");
+        if(log.isDebugEnabled()) log.debug("LM.hasUpgrade(tx-" + key + ", " + resourceId
+ ")");
         return hasWrite(key, resourceId);
     }
 
     /** @see LockManager#hasRead(Object, Object) */
     public boolean hasRead(final Object key, final Object resourceId)
     {
-        if(getLog().isDebugEnabled()) getLog().debug("LM.hasRead(tx-" + key + ", " + resourceId
+ ')');
+        if(log.isDebugEnabled()) log.debug("LM.hasRead(tx-" + key + ", " + resourceId + ')');
         checkTimedOutLocks();
 
         ObjectLocks objectLocks;

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/SuperReferenceDescriptor.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/SuperReferenceDescriptor.java?rev=377106&r1=377105&r2=377106&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/SuperReferenceDescriptor.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/SuperReferenceDescriptor.java
Sat Feb 11 17:45:35 2006
@@ -37,7 +37,7 @@
  */
 public class SuperReferenceDescriptor extends ObjectReferenceDescriptor
 {
-    private transient Logger log;
+    private Logger log = LoggerFactory.getLogger(SuperReferenceDescriptor.class);
 
     public static final String SUPER_FIELD_INTERNAL_NAME = "ojbSuperFieldInternal";
     public static final String SUPER_FIELD_NAME = RepositoryElements.TAG_SUPER;
@@ -78,9 +78,9 @@
         if(result == null || result.size() == 0)
         {
             FieldDescriptor[] pks = getClassDescriptor().getPkFields();
-            if(getLog().isDebugEnabled())
+            if(log.isDebugEnabled())
             {
-                getLog().debug("Automatically assign FK's for this super-reference, used
fields will be: " + ArrayUtils.toString(pks));
+                log.debug("Automatically assign FK's for this super-reference, used fields
will be: " + ArrayUtils.toString(pks));
             }
             for(int i = 0; i < pks.length; i++)
             {
@@ -111,42 +111,42 @@
 
     public void setLazy(boolean lazy)
     {
-        getLog().debug("Property 'lazy' is immutable, will ignore setting");
+        log.debug("Property 'lazy' is immutable, will ignore setting");
     }
 
     public void setCascadeRetrieve(boolean b)
     {
-        getLog().debug("Property 'CascadeRetrieve' is immutable, will ignore setting");
+        log.debug("Property 'CascadeRetrieve' is immutable, will ignore setting");
     }
 
     public void setCascadingStore(int cascade)
     {
-        getLog().debug("Property 'CascadingStore' is immutable, will ignore setting");
+        log.debug("Property 'CascadingStore' is immutable, will ignore setting");
     }
 
     public void setCascadingStore(String value)
     {
-        getLog().debug("Property 'CascadingStore' is immutable, will ignore setting");
+        log.debug("Property 'CascadingStore' is immutable, will ignore setting");
     }
 
     public void setCascadingDelete(int cascade)
     {
-        getLog().debug("Property 'CascadingDelete' is immutable, will ignore setting");
+        log.debug("Property 'CascadingDelete' is immutable, will ignore setting");
     }
 
     public void setCascadingDelete(String value)
     {
-        getLog().debug("Property 'CascadingDelete' is immutable, will ignore setting");
+        log.debug("Property 'CascadingDelete' is immutable, will ignore setting");
     }
 
     public void setCascadeStore(boolean cascade)
     {
-        getLog().debug("Property 'CascadeStore' is immutable, will ignore setting");
+        log.debug("Property 'CascadeStore' is immutable, will ignore setting");
     }
 
     public void setCascadeDelete(boolean cascade)
     {
-        getLog().debug("Property 'CascadeDelete' is immutable, will ignore setting");
+        log.debug("Property 'CascadeDelete' is immutable, will ignore setting");
     }
 
     public SuperReferenceField getInheritanceField()
@@ -188,15 +188,6 @@
         return pf;
     }
 
-    private Logger getLog()
-    {
-        if(log == null)
-        {
-            log = LoggerFactory.getLogger(SuperReferenceDescriptor.class);
-        }
-        return log;
-    }
-
 
     //====================================================
     // inner class
@@ -204,7 +195,7 @@
 
     public static final class SuperReferenceField extends AnonymousPersistentField
     {
-        private transient Logger log;
+        private Logger log = LoggerFactory.getLogger(SuperReferenceField.class);
 
         private SuperReferenceDescriptor superRef;
 
@@ -214,15 +205,6 @@
             this.superRef = superRef;
         }
 
-        private Logger getLog()
-        {
-            if(log == null)
-            {
-                log = LoggerFactory.getLogger(SuperReferenceField.class);
-            }
-            return log;
-        }
-
         /**
          * Field values of 'value' (base object) are copied to 'obj' (derived object)
          * then obj is saved in a map
@@ -276,7 +258,7 @@
         void copyFields(final ClassDescriptor targetCld, final Object target, final ClassDescriptor
sourceCld,
                         final Object source)
         {
-            if(getLog().isDebugEnabled())
+            if(log.isDebugEnabled())
             {
                 String msg = ("Copy fields from " + SystemUtils.LINE_SEPARATOR
                         + "source object '" + (source != null ? source.getClass().getName()
: null) + "'" + SystemUtils.LINE_SEPARATOR
@@ -284,7 +266,7 @@
                         + "to target object '" + (target != null ? target.getClass().getName()
: null) + "'" + SystemUtils.LINE_SEPARATOR
                         + "using target fields declared in '" + targetCld.getClassNameOfObject()
+ "'" + SystemUtils.LINE_SEPARATOR
                         + "the fields to copy are declared in '" + targetCld.getClassNameOfObject());
-                getLog().debug(msg);
+                log.debug(msg);
             }
             /*
             arminw:
@@ -338,7 +320,7 @@
 //        void copyFields(final ClassDescriptor targetCld, final Object target, final ClassDescriptor
sourceCld,
 //                        final Object source, final boolean targetIsSuper, final boolean
javaInheritance)
 //        {
-//            if(getLog().isDebugEnabled())
+//            if(log.isDebugEnabled())
 //            {
 //                String msg = ("Copy fields from " + SystemUtils.LINE_SEPARATOR
 //                        + "source object '" + (source != null ? source.getClass().getName()
: null) + "'" + SystemUtils.LINE_SEPARATOR
@@ -347,7 +329,7 @@
 //                        + "using target fields declared in '" + targetCld.getClassNameOfObject()
+ "'" + SystemUtils.LINE_SEPARATOR
 //                        + "the fields to copy are declared in '" + (targetIsSuper ? targetCld.getClassNameOfObject()
: sourceCld.getClassNameOfObject()) + "' class" + SystemUtils.LINE_SEPARATOR
 //                        + "the used classes are associated by java inheritance: " + javaInheritance
+ SystemUtils.LINE_SEPARATOR);
-//                getLog().debug(msg);
+//                log.debug(msg);
 //            }
 //            /*
 //            arminw:



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message