geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r537166 - in /geronimo/server/trunk: configs/openejb/src/plan/plan.xml modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
Date Fri, 11 May 2007 11:40:44 GMT
Author: sppatel
Date: Fri May 11 04:40:43 2007
New Revision: 537166

URL: http://svn.apache.org/viewvc?view=rev&rev=537166
Log:
MEJB support

Added:
    geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
  (with props)
Modified:
    geronimo/server/trunk/configs/openejb/src/plan/plan.xml

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=537166&r1=537165&r2=537166
==============================================================================
--- geronimo/server/trunk/configs/openejb/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/openejb/src/plan/plan.xml Fri May 11 04:40:43 2007
@@ -72,6 +72,12 @@
             <name>OpenEjbSystem</name>
         </dependency>
     </gbean>
+    
+    <gbean name="ejb/mgmt/MEJB" class="org.apache.geronimo.openejb.MEJBGBean">
+        <reference name="StatelessContainer">
+            <name>DefaultStatelessContainer</name>
+        </reference>
+    </gbean>
 
 <!--
     <gbean name="StatelessEjbContainer" class="org.apache.openejb.slsb.DefaultStatelessEjbContainerGBean">

Added: geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java?view=auto&rev=537166
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
(added)
+++ geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
Fri May 11 04:40:43 2007
@@ -0,0 +1,71 @@
+/**
+ * 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.openejb;
+
+import javax.management.j2ee.Management;
+import javax.management.j2ee.ManagementHome;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.openejb.assembler.classic.EjbJarInfo;
+import org.apache.openejb.config.EjbModule;
+import org.apache.openejb.jee.EjbJar;
+import org.apache.openejb.jee.StatelessBean;
+import org.apache.openejb.mgmt.MEJBBean;
+
+public class MEJBGBean implements GBeanLifecycle {
+	
+    public static final GBeanInfo GBEAN_INFO;
+    
+    private EjbContainer ejbContainer;
+    
+    public MEJBGBean(EjbContainer ejbContainer) {
+    	this.ejbContainer = ejbContainer;
+    }
+    
+	public void doStart() throws Exception {
+		EjbJar ejbJar = new EjbJar();
+        StatelessBean bean = ejbJar.addEnterpriseBean(new StatelessBean("MEJB",MEJBBean.class.getName()));
+        bean.setHomeAndRemote(ManagementHome.class, Management.class);
+      
+        ClassLoader cl = MEJBBean.class.getClassLoader();
+        OpenEjbSystem openEjbSystem = ejbContainer.getOpenEjbSystem();
+        EjbJarInfo ejbJarInfo = openEjbSystem.configureApplication(new EjbModule(cl, getClass().getSimpleName(),
null, ejbJar, null));
+        openEjbSystem.createEjbJar(ejbJarInfo, cl);
+	}
+
+    static {
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(MEJBGBean.class);
+        infoBuilder.addReference("StatelessContainer", EjbContainer.class);
+        infoBuilder.setConstructor(new String[]{"StatelessContainer"});
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+	public void doStop() throws Exception {
+		
+	}
+	
+	public void doFail() {
+		
+	}
+
+}

Propchange: geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message