openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r959596 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: config/WebBeansFinder.java intercept/InterceptorHandler.java
Date Thu, 01 Jul 2010 11:10:39 GMT
Author: struberg
Date: Thu Jul  1 11:10:38 2010
New Revision: 959596

URL: http://svn.apache.org/viewvc?rev=959596&view=rev
Log:
OWB-397 remove logger again but keep classloader caching

We need to remove the logger again because it costs
too much performance.

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansFinder.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansFinder.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansFinder.java?rev=959596&r1=959595&r2=959596&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansFinder.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansFinder.java
Thu Jul  1 11:10:38 2010
@@ -22,7 +22,6 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.webbeans.exception.WebBeansException;
-import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.util.Asserts;
 import org.apache.webbeans.util.WebBeansUtil;
 
@@ -35,8 +34,6 @@ import org.apache.webbeans.util.WebBeans
  */
 public final class WebBeansFinder
 {   
-    private static WebBeansLogger logger = WebBeansLogger.getLogger(WebBeansFinder.class);
-    
     /**
      * Keys --> ClassLoaders
      * Values --> Maps of singleton class name with object
@@ -93,11 +90,6 @@ public final class WebBeansFinder
                     //Create instance
                     object = clazz.newInstance();
 
-                    if (logger.wblWillLogDebug())
-                    {
-                        logger.debug("creating a new " + singletonName + ", object " + object.hashCode()
+ " in classloader " + formatClassloader(classLoader));
-                    }
-
                     //Save it
                     managerMap.put(singletonName, object);
 
@@ -115,10 +107,6 @@ public final class WebBeansFinder
                     throw new WebBeansException("Class not found exception in creating instance
with class : " + singletonName, e);
                 }
             }
-            else if (logger.wblWillLogDebug())
-            {
-                logger.debug("returning existing object (" + object.hashCode() + ") for "
+ singletonName + " in classloader " + classLoader);
-            }
         }
 
         return object;
@@ -150,7 +138,7 @@ public final class WebBeansFinder
     
     /**
      * Clear all deployment instances when the application is undeployed.
-     * @param classloader of the deployment
+     * @param classLoader of the deployment
      */
     public static void clearInstances(ClassLoader classLoader)
     {
@@ -160,14 +148,5 @@ public final class WebBeansFinder
             singletonMap.remove(classLoader);
         }
     }
-    
-    /**
-     * Formats the toString method of Classloader to a single line
-     * @param cl classloader to be formatted
-     * @return formatted string
-     */
-    public static String formatClassloader(ClassLoader cl)
-    {
-        return cl.toString().replaceAll("\\s\\s+|\\n|\\r", " ");
-    }
+
 }
\ No newline at end of file

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java?rev=959596&r1=959595&r2=959596&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
Thu Jul  1 11:10:38 2010
@@ -187,7 +187,8 @@ public abstract class InterceptorHandler
             
             if(ClassUtil.isObjectMethod(methodName) && !methodName.equals("toString"))
             {
-                logger.trace("Calling method on proxy is restricted except Object.toString(),
but current method is Object. [{0}]", methodName);
+                // we must not log in this place because this almost takes away half of the
performance! 
+                // logger.trace("Calling method on proxy is restricted except Object.toString(),
but current method is Object. [{0}]", methodName);
             }
             
             else if (bean instanceof InjectionTargetBean<?>)



Mime
View raw message