geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1028550 - in /geronimo/server/trunk/plugins/openwebbeans: geronimo-openwebbeans-builder/ geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/ geronimo-openwebbeans/src/main/java/org/apache/geronimo/openw...
Date Thu, 28 Oct 2010 23:52:20 GMT
Author: djencks
Date: Thu Oct 28 23:52:20 2010
New Revision: 1028550

URL: http://svn.apache.org/viewvc?rev=1028550&view=rev
Log:
GERONIMo-5050 bind BeanManager in jndi

Added:
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansNamingBuilder.java
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/BeanManagerReference.java
Modified:
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/pom.xml
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java
    geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/src/main/plan/plan.xml

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/pom.xml?rev=1028550&r1=1028549&r2=1028550&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/pom.xml (original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/pom.xml Thu Oct
28 23:52:20 2010
@@ -52,6 +52,12 @@
             <version>${project.version}</version>
         </dependency>
         
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-naming-builder</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
     </dependencies>
 
 </project>

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java?rev=1028550&r1=1028549&r2=1028550&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java
Thu Oct 28 23:52:20 2010
@@ -35,6 +35,7 @@ import org.apache.geronimo.gbean.annotat
 import org.apache.geronimo.gbean.annotation.ParamReference;
 import org.apache.geronimo.j2ee.annotation.Holder;
 import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.EJBModule;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
@@ -61,16 +62,15 @@ public class OpenWebBeansModuleBuilderEx
     private static final Logger log = LoggerFactory.getLogger(OpenWebBeansModuleBuilderExtension.class);
 
     private final Environment defaultEnvironment;
-    private final NamingBuilder namingBuilders;
+    //only plausible naming builder is ours that adds BeanManager entry
+    private final NamingBuilder namingBuilders  = new OpenWebBeansNamingBuilder();
 
     //this is the geronimo copy
     private static final String CONTEXT_LISTENER_NAME = WebBeansConfigurationListener.class.getName();
 
     public OpenWebBeansModuleBuilderExtension(
-            @ParamAttribute(name = "defaultEnvironment") Environment defaultEnvironment,
-            @ParamReference(name = "NamingBuilders", namingType = NameFactory.MODULE_BUILDER)
NamingBuilder namingBuilders) {
+            @ParamAttribute(name = "defaultEnvironment") Environment defaultEnvironment)
{
         this.defaultEnvironment = defaultEnvironment;
-        this.namingBuilders = namingBuilders;
     }
 
     public void createModule(Module module, Bundle bundle, Naming naming, ModuleIDBuilder
idBuilder)
@@ -109,6 +109,12 @@ public class OpenWebBeansModuleBuilderEx
             // not a web module, nothing to do
             return;
         }
+
+        for (Object subModule: module.getModules()) {
+            if (subModule instanceof EJBModule) {
+                return;
+            }
+        }
         
         WebModule webModule = (WebModule) module;
                 

Added: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansNamingBuilder.java?rev=1028550&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansNamingBuilder.java
(added)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansNamingBuilder.java
Thu Oct 28 23:52:20 2010
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.openwebbeans.deployment;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
+import org.apache.geronimo.openwebbeans.BeanManagerReference;
+import org.apache.openejb.jee.InjectionTarget;
+import org.apache.openejb.jee.JndiConsumer;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class OpenWebBeansNamingBuilder extends AbstractNamingBuilder {
+    @Override
+    public void buildNaming(JndiConsumer specDD, XmlObject plan, Module module, Map<EARContext.Key,
Object> sharedContext) throws DeploymentException {
+        put("java:comp/BeanManager", new BeanManagerReference(), module.getJndiContext(),
Collections.<InjectionTarget>emptyList(), sharedContext);
+    }
+
+    @Override
+    public QNameSet getSpecQNameSet() {
+        return null;
+    }
+
+    @Override
+    public QNameSet getPlanQNameSet() {
+        return null;
+    }
+}

Added: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/BeanManagerReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/BeanManagerReference.java?rev=1028550&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/BeanManagerReference.java
(added)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/BeanManagerReference.java
Thu Oct 28 23:52:20 2010
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.openwebbeans;
+
+import javax.naming.NamingException;
+import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.xbean.naming.reference.SimpleReference;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class BeanManagerReference extends SimpleReference {
+
+    @Override
+    public Object getContent() throws NamingException {
+        return BeanManagerImpl.getManager();
+    }
+}

Modified: geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/src/main/plan/plan.xml?rev=1028550&r1=1028549&r2=1028550&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/src/main/plan/plan.xml
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/openwebbeans-deployer/src/main/plan/plan.xml
Thu Oct 28 23:52:20 2010
@@ -21,9 +21,6 @@
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
 
     <gbean name="OpenWebBeansModuleBuilderExtension" class="org.apache.geronimo.openwebbeans.deployment.OpenWebBeansModuleBuilderExtension">
-        <reference name="NamingBuilders">
-            <name>NamingBuilders</name>
-        </reference>
         <xml-attribute name="defaultEnvironment">
             <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
                 <dependencies>



Mime
View raw message