openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1307377 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
Date Fri, 30 Mar 2012 11:50:06 GMT
Author: struberg
Date: Fri Mar 30 11:50:05 2012
New Revision: 1307377

URL: http://svn.apache.org/viewvc?rev=1307377&view=rev
Log:
OWB-657 improve performance

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java?rev=1307377&r1=1307376&r2=1307377&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
Fri Mar 30 11:50:05 2012
@@ -92,6 +92,7 @@ public class WebBeansContext
     private final ManagedBeanConfigurator managedBeanConfigurator = new ManagedBeanConfigurator(this);
     private final SecurityService securityService;
     private final LoaderService loaderService;
+    private ScannerService scannerService;
 
     public WebBeansContext()
     {
@@ -346,10 +347,15 @@ public class WebBeansContext
         return javassistProxyFactory;
     }
 
-    //candidates for fields
+
     public ScannerService getScannerService()
     {
-        return getService(ScannerService.class);
+        if (scannerService == null)
+        {
+            // lazy init
+            scannerService = getService(ScannerService.class);
+        }
+        return scannerService;
     }
 
     public ContextsService getContextsService()



Mime
View raw message