deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject git commit: DELTASPIKE-365 add a boot(Map) method
Date Tue, 14 May 2013 06:08:30 GMT
Updated Branches:
  refs/heads/master 439a23d21 -> 37653501d


DELTASPIKE-365 add a boot(Map) method

This is needed to startup some containers with initial properties
if they support it.


Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/37653501
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/37653501
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/37653501

Branch: refs/heads/master
Commit: 37653501dcfc08114bd23b6f4b9ec6f60b846b7a
Parents: 439a23d
Author: Mark Struberg <struberg@apache.org>
Authored: Tue May 14 08:04:54 2013 +0200
Committer: Mark Struberg <struberg@apache.org>
Committed: Tue May 14 08:04:54 2013 +0200

----------------------------------------------------------------------
 .../apache/deltaspike/cdise/api/CdiContainer.java  |   14 ++++++++++++--
 .../cdise/openejb/OpenEjbContainerControl.java     |    8 +++++++-
 .../cdise/owb/OpenWebBeansContainerControl.java    |    8 ++++++++
 .../cdise/weld/WeldContainerControl.java           |    9 +++++++++
 4 files changed, 36 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/37653501/deltaspike/cdictrl/api/src/main/java/org/apache/deltaspike/cdise/api/CdiContainer.java
----------------------------------------------------------------------
diff --git a/deltaspike/cdictrl/api/src/main/java/org/apache/deltaspike/cdise/api/CdiContainer.java
b/deltaspike/cdictrl/api/src/main/java/org/apache/deltaspike/cdise/api/CdiContainer.java
index 3b131af..62c7898 100644
--- a/deltaspike/cdictrl/api/src/main/java/org/apache/deltaspike/cdise/api/CdiContainer.java
+++ b/deltaspike/cdictrl/api/src/main/java/org/apache/deltaspike/cdise/api/CdiContainer.java
@@ -20,6 +20,7 @@ package org.apache.deltaspike.cdise.api;
 
 
 import javax.enterprise.inject.spi.BeanManager;
+import java.util.Map;
 
 
 /**
@@ -35,9 +36,9 @@ import javax.enterprise.inject.spi.BeanManager;
 public interface CdiContainer
 {
     /**
-     * <b>Booting the CdiTestContainer will scan the whole classpath
+     * <p>Booting the CdiTestContainer will scan the whole classpath
      * for Beans and extensions available.
-     * The container might throw a DeploymentException or similar on startup.</b>
+     * The container might throw a DeploymentException or similar on startup.</p>
      *
      * <p><b>Note:</b> booting the container does <i>not</i>
automatically
      * start all CDI Contexts! Depending on the underlying CDI container you
@@ -46,6 +47,15 @@ public interface CdiContainer
      * {@link ContextControl#startContexts()}</p>
      */
     void boot();
+
+    /**
+     * <p>Like {@link #boot()} but allows to pass in a configuration Map
+     * for the container.</p>
+     * <p>Please note that the configuration is container implementation dependent!</p>
+     *
+     * @param properties
+     */
+    void boot(Map<?,?> properties);
     
     /**
      * This will shutdown the underlying CDI container and stop all contexts.

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/37653501/deltaspike/cdictrl/impl-openejb/src/main/java/org/apache/deltaspike/cdise/openejb/OpenEjbContainerControl.java
----------------------------------------------------------------------
diff --git a/deltaspike/cdictrl/impl-openejb/src/main/java/org/apache/deltaspike/cdise/openejb/OpenEjbContainerControl.java
b/deltaspike/cdictrl/impl-openejb/src/main/java/org/apache/deltaspike/cdise/openejb/OpenEjbContainerControl.java
index c23cd5d..aa9dbe6 100644
--- a/deltaspike/cdictrl/impl-openejb/src/main/java/org/apache/deltaspike/cdise/openejb/OpenEjbContainerControl.java
+++ b/deltaspike/cdictrl/impl-openejb/src/main/java/org/apache/deltaspike/cdise/openejb/OpenEjbContainerControl.java
@@ -57,10 +57,16 @@ public class OpenEjbContainerControl implements CdiContainer
     @Override
     public synchronized void boot()
     {
+        boot(null);
+    }
+
+    @Override
+    public synchronized void boot(Map<?, ?> properties)
+    {
         if (openEjbContainer == null)
         {
             // this immediately boots the container
-            openEjbContainer = EJBContainer.createEJBContainer(getConfiguration());
+            openEjbContainer = EJBContainer.createEJBContainer(properties);
 
             // this magic code performs injection
             try

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/37653501/deltaspike/cdictrl/impl-owb/src/main/java/org/apache/deltaspike/cdise/owb/OpenWebBeansContainerControl.java
----------------------------------------------------------------------
diff --git a/deltaspike/cdictrl/impl-owb/src/main/java/org/apache/deltaspike/cdise/owb/OpenWebBeansContainerControl.java
b/deltaspike/cdictrl/impl-owb/src/main/java/org/apache/deltaspike/cdise/owb/OpenWebBeansContainerControl.java
index 9c45aea..7f1fa71 100644
--- a/deltaspike/cdictrl/impl-owb/src/main/java/org/apache/deltaspike/cdise/owb/OpenWebBeansContainerControl.java
+++ b/deltaspike/cdictrl/impl-owb/src/main/java/org/apache/deltaspike/cdise/owb/OpenWebBeansContainerControl.java
@@ -26,6 +26,7 @@ import org.apache.webbeans.spi.ContainerLifecycle;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.BeanManager;
+import java.util.Map;
 import java.util.Set;
 import java.util.logging.Logger;
 
@@ -68,6 +69,13 @@ public class OpenWebBeansContainerControl implements CdiContainer
     }
 
     @Override
+    public void boot(Map<?, ?> properties)
+    {
+        // we do not yet support any configuration.
+        boot();
+    }
+
+    @Override
     public synchronized void shutdown()
     {
         if (ctxCtrl != null)

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/37653501/deltaspike/cdictrl/impl-weld/src/main/java/org/apache/deltaspike/cdise/weld/WeldContainerControl.java
----------------------------------------------------------------------
diff --git a/deltaspike/cdictrl/impl-weld/src/main/java/org/apache/deltaspike/cdise/weld/WeldContainerControl.java
b/deltaspike/cdictrl/impl-weld/src/main/java/org/apache/deltaspike/cdise/weld/WeldContainerControl.java
index 65b8fd6..7c1a28a 100644
--- a/deltaspike/cdictrl/impl-weld/src/main/java/org/apache/deltaspike/cdise/weld/WeldContainerControl.java
+++ b/deltaspike/cdictrl/impl-weld/src/main/java/org/apache/deltaspike/cdise/weld/WeldContainerControl.java
@@ -26,6 +26,7 @@ import org.jboss.weld.environment.se.WeldContainer;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.BeanManager;
+import java.util.Map;
 import java.util.Set;
 import java.util.logging.Logger;
 
@@ -65,6 +66,14 @@ public class WeldContainerControl implements CdiContainer
     }
 
     @Override
+    public void boot(Map<?, ?> properties)
+    {
+        // no configuration yet. Perform default boot
+
+        boot();
+    }
+
+    @Override
     public synchronized  void shutdown()
     {
         if (ctxCtrl != null)


Mime
View raw message