geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r498948 - in /geronimo/server/trunk: configs/openejb/src/plan/plan.xml modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
Date Tue, 23 Jan 2007 08:13:30 GMT
Author: dblevins
Date: Tue Jan 23 00:13:28 2007
New Revision: 498948

URL: http://svn.apache.org/viewvc?view=rev&rev=498948
Log:
Fix to ensure proper container types are created.

Modified:
    geronimo/server/trunk/configs/openejb/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java

Modified: geronimo/server/trunk/configs/openejb/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/openejb/src/plan/plan.xml?view=diff&rev=498948&r1=498947&r2=498948
==============================================================================
--- geronimo/server/trunk/configs/openejb/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/openejb/src/plan/plan.xml Tue Jan 23 00:13:28 2007
@@ -28,24 +28,28 @@
 
     <gbean name="DefaultStatelessContainer" class="org.apache.geronimo.openejb.EjbContainer">
         <attribute name="id">Default Stateless Container</attribute>
+        <attribute name="type">STATELESS</attribute>
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>
     </gbean>
     <gbean name="DefaultStatefulContainer" class="org.apache.geronimo.openejb.EjbContainer">
         <attribute name="id">Default Stateful Container</attribute>
+        <attribute name="type">STATEFUL</attribute>
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>
     </gbean>
     <gbean name="DefaultBMPContainer" class="org.apache.geronimo.openejb.EjbContainer">
         <attribute name="id">Default BMP Container</attribute>
+        <attribute name="type">BMP_ENTITY</attribute>
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>
     </gbean>
     <gbean name="DefaultCMPContainer" class="org.apache.geronimo.openejb.EjbContainer">
         <attribute name="id">Default CMP Container</attribute>
+        <attribute name="type">CMP_ENTITY</attribute>
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>
@@ -53,6 +57,7 @@
     
     <gbean name="DefaultMDBContainer" class="org.apache.geronimo.openejb.EjbContainer">
         <attribute name="id">Default MDB Container</attribute>
+        <attribute name="type">MESSAGE</attribute>
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>

Modified: geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java?view=diff&rev=498948&r1=498947&r2=498948
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
Tue Jan 23 00:13:28 2007
@@ -17,11 +17,19 @@
 package org.apache.geronimo.openejb;
 
 import java.util.Properties;
+import java.util.Map;
+import java.util.HashMap;
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.openejb.assembler.classic.ContainerInfo;
+import org.apache.openejb.assembler.classic.StatelessSessionContainerInfo;
+import org.apache.openejb.assembler.classic.StatefulSessionContainerInfo;
+import org.apache.openejb.assembler.classic.BmpEntityContainerInfo;
+import org.apache.openejb.assembler.classic.CmpEntityContainerInfo;
+import org.apache.openejb.assembler.classic.MdbContainerInfo;
+import org.apache.openejb.alt.config.Bean;
 
 /**
  * @version $Rev$ $Date$
@@ -31,7 +39,8 @@
     private String id;
     private Properties properties;
     private String provider;
-    private Class<ContainerInfo> type = ContainerInfo.class;
+    private String type;
+    private Class<? extends ContainerInfo> infoType;
 
     public OpenEjbSystem getOpenEjbSystem() {
         return openEjbSystem;
@@ -65,16 +74,35 @@
         this.provider = provider;
     }
 
-    public Class<ContainerInfo> getType() {
+    public String getType() {
         return type;
     }
 
-    public void setType(Class<ContainerInfo> type) {
+    public void setType(String type) {
         this.type = type;
+        this.infoType = getInfoType(type);
+    }
+
+    private Class<? extends ContainerInfo> getInfoType(String type) {
+        if ("STATELESS".equalsIgnoreCase(type)) return StatelessSessionContainerInfo.class;
+        if ("STATEFUL".equalsIgnoreCase(type)) return StatefulSessionContainerInfo.class;
+        if ("BMP_ENTITY".equalsIgnoreCase(type)) return BmpEntityContainerInfo.class;
+        if ("CMP_ENTITY".equalsIgnoreCase(type)) return CmpEntityContainerInfo.class;
+        if ("CMP2_ENTITY".equalsIgnoreCase(type)) return CmpEntityContainerInfo.class;
+        if ("MESSAGE".equalsIgnoreCase(type)) return MdbContainerInfo.class;
+        else return ContainerInfo.class;
+    }
+
+    public Class<? extends ContainerInfo> getInfoType() {
+        return infoType;
+    }
+
+    public void setInfoType(Class<? extends ContainerInfo> infoType) {
+        this.infoType = infoType;
     }
 
     public void doStart() throws Exception {
-        openEjbSystem.createContainer(type, id, properties, provider);
+        openEjbSystem.createContainer(infoType, id, properties, provider);
     }
 
     public void doStop() throws Exception {
@@ -91,7 +119,8 @@
         infoBuilder.addAttribute("id", String.class, true);
         infoBuilder.addAttribute("properties", Properties.class, true);
         infoBuilder.addAttribute("provider", String.class, true);
-        infoBuilder.addAttribute("type", Class.class, true);
+        infoBuilder.addAttribute("type", String.class, true);
+        infoBuilder.addAttribute("infoType", Class.class, true);
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 



Mime
View raw message