You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2015/04/29 22:28:08 UTC

svn commit: r1676850 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config: OpenWebBeansConfiguration.java WebBeansContext.java

Author: struberg
Date: Wed Apr 29 20:28:08 2015
New Revision: 1676850

URL: http://svn.apache.org/r1676850
Log:
improve configuration

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java
    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/OpenWebBeansConfiguration.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java?rev=1676850&r1=1676849&r2=1676850&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java Wed Apr 29 20:28:08 2015
@@ -169,48 +169,21 @@ public class OpenWebBeansConfiguration
             properties = System.getProperties();
         }
         
-        String value = properties.getProperty(CONVERSATION_PERIODIC_DELAY);
-        setPropertyFromSystemProperty(CONVERSATION_PERIODIC_DELAY, value);        
-        
-        value = properties.getProperty(USE_EJB_DISCOVERY);
-        setPropertyFromSystemProperty(USE_EJB_DISCOVERY, value);
-
-        value = properties.getProperty(CONTAINER_LIFECYCLE);
-        setPropertyFromSystemProperty(CONTAINER_LIFECYCLE, value);
-
-        value = properties.getProperty(APPLICATION_IS_JSP);
-        setPropertyFromSystemProperty(APPLICATION_IS_JSP, value);
-
-        value = properties.getProperty(TRANSACTION_SERVICE);
-        setPropertyFromSystemProperty(TRANSACTION_SERVICE, value);
-
-        value = properties.getProperty(VALIDATOR_SERVICE);
-        setPropertyFromSystemProperty(VALIDATOR_SERVICE, value);
-
-        value = properties.getProperty(SECURITY_SERVICE);
-        setPropertyFromSystemProperty(SECURITY_SERVICE, value);
-
-        value = properties.getProperty(RESOURCE_INJECTION_SERVICE);
-        setPropertyFromSystemProperty(RESOURCE_INJECTION_SERVICE, value);
-
-        value = properties.getProperty(CONVERSATION_SERVICE);
-        setPropertyFromSystemProperty(CONVERSATION_SERVICE, value);
-
-        value = properties.getProperty(CONTEXTS_SERVICE);
-        setPropertyFromSystemProperty(CONTEXTS_SERVICE, value);
-
-        value = properties.getProperty(SCANNER_SERVICE);
-        setPropertyFromSystemProperty(SCANNER_SERVICE, value);
-
-        value = properties.getProperty(JNDI_SERVICE);
-        setPropertyFromSystemProperty(JNDI_SERVICE, value);
-        
-        value = properties.getProperty(EL_ADAPTOR_CLASS);
-        setPropertyFromSystemProperty(EL_ADAPTOR_CLASS, value);
-
-        value = properties.getProperty(USE_BDA_BEANSXML_SCANNER);
-        setPropertyFromSystemProperty(USE_BDA_BEANSXML_SCANNER, value);
-
+        setPropertyFromSystemProperty(properties, CONVERSATION_PERIODIC_DELAY);
+        setPropertyFromSystemProperty(properties, USE_EJB_DISCOVERY);
+        setPropertyFromSystemProperty(properties, CONTAINER_LIFECYCLE);
+        setPropertyFromSystemProperty(properties, APPLICATION_IS_JSP);
+        setPropertyFromSystemProperty(properties, TRANSACTION_SERVICE);
+        setPropertyFromSystemProperty(properties, VALIDATOR_SERVICE);
+        setPropertyFromSystemProperty(properties, SECURITY_SERVICE);
+        setPropertyFromSystemProperty(properties, RESOURCE_INJECTION_SERVICE);
+        setPropertyFromSystemProperty(properties, CONVERSATION_SERVICE);
+        setPropertyFromSystemProperty(properties, CONTEXTS_SERVICE);
+        setPropertyFromSystemProperty(properties, SCANNER_SERVICE);
+        setPropertyFromSystemProperty(properties, JNDI_SERVICE);
+        setPropertyFromSystemProperty(properties, EL_ADAPTOR_CLASS);
+        setPropertyFromSystemProperty(properties, USE_BDA_BEANSXML_SCANNER);
+        setPropertyFromSystemProperty(properties, APPLICATION_SUPPORTS_CONVERSATION);
     }
 
     private Properties doPrivilegedGetSystemProperties()
@@ -229,6 +202,12 @@ public class OpenWebBeansConfiguration
     }
 
      
+    private void setPropertyFromSystemProperty(Properties systemProperties, String key)
+    {
+        String value = systemProperties.getProperty(key);
+        setPropertyFromSystemProperty(key, value);
+    }
+    
     private void setPropertyFromSystemProperty(String key, String value)
     {
         if(value != null)

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=1676850&r1=1676849&r2=1676850&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 Wed Apr 29 20:28:08 2015
@@ -48,6 +48,7 @@ import org.apache.webbeans.service.Defau
 import org.apache.webbeans.spi.BeanArchiveService;
 import org.apache.webbeans.spi.ApplicationBoundaryService;
 import org.apache.webbeans.spi.ContextsService;
+import org.apache.webbeans.spi.ConversationService;
 import org.apache.webbeans.spi.LoaderService;
 import org.apache.webbeans.spi.ScannerService;
 import org.apache.webbeans.spi.SecurityService;
@@ -71,7 +72,6 @@ public class WebBeansContext
     private final AlternativesManager alternativesManager = new AlternativesManager(this);
     private final AnnotatedElementFactory annotatedElementFactory = new AnnotatedElementFactory(this);
     private final BeanManagerImpl beanManagerImpl = new BeanManagerImpl(this);
-    private final ConversationManager conversationManager = new ConversationManager(this);
     private final CreationalContextFactory creationalContextFactory = new CreationalContextFactory(this);
     private final DecoratorsManager decoratorsManager = new DecoratorsManager(this);
     private final ExtensionLoader extensionLoader = new ExtensionLoader(this);
@@ -93,6 +93,8 @@ public class WebBeansContext
     private final DeploymentValidationService deploymentValidationService = new DeploymentValidationService(this);
     private ScannerService scannerService;
     private ContextsService contextsService;
+    private final ConversationManager conversationManager;
+    private ConversationService conversationService = null;
     private final ApplicationBoundaryService applicationBoundaryService;
 
 
@@ -140,6 +142,7 @@ public class WebBeansContext
         securityService = getService(SecurityService.class);
         applicationBoundaryService = getService(ApplicationBoundaryService.class);
         beanArchiveService = getService(BeanArchiveService.class);
+        conversationManager = new ConversationManager(this);
 
         // Allow the WebBeansContext itself to be looked up
         managerMap.put(getClass(), this);
@@ -161,6 +164,7 @@ public class WebBeansContext
         managerMap.put(SerializableBeanVault.class, serializableBeanVault);
         managerMap.put(StereoTypeManager.class, stereoTypeManager);
         managerMap.put(InterceptorResolutionService.class, interceptorResolutionService);
+
     }
 
     public static WebBeansContext getInstance()
@@ -356,6 +360,17 @@ public class WebBeansContext
         return beanArchiveService;
     }
 
+    public ConversationService getConversationService()
+    {
+        if (conversationService == null)
+        {
+            conversationService = getService(ConversationService.class);
+        }
+
+        return conversationService;
+    }
+
+
     private Object get(String singletonName)
     {
         //Load class