geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r497724 - /geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDaemonGBean.java
Date Fri, 19 Jan 2007 07:23:45 GMT
Author: dblevins
Date: Thu Jan 18 23:23:44 2007
New Revision: 497724

URL: http://svn.apache.org/viewvc?view=rev&rev=497724
Log:
reworked to use the ServiceManager

Modified:
    geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDaemonGBean.java

Modified: geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDaemonGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDaemonGBean.java?view=diff&rev=497724&r1=497723&r2=497724
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDaemonGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDaemonGBean.java
Thu Jan 18 23:23:44 2007
@@ -23,19 +23,21 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.management.geronimo.NetworkConnector;
-import org.apache.openejb.server.ejbd.EjbDaemon;
+import org.apache.openejb.server.ServiceManager;
+import org.apache.openejb.loader.SystemInstance;
 
 /**
  * @version $Rev$ $Date$
  */
 public class EjbDaemonGBean implements NetworkConnector, GBeanLifecycle {
-    private final EjbDaemon ejbDaemon;
     private String host;
     private int port;
     private int threads;
+    private ServiceManager serviceManager;
 
     public EjbDaemonGBean() {
-        ejbDaemon = EjbDaemon.getEjbDaemon();
+        System.setProperty("openejb.nobanner","true");
+        serviceManager = new ServiceManager();
     }
 
     public String getProtocol() {
@@ -71,17 +73,19 @@
     }
 
     public void doStart() throws Exception {
-        Properties properties = new Properties();
-        properties.setProperty("server", "org.apache.openejb.server.ejbd.EjbServer");
-        properties.setProperty("bind", host);
-        properties.setProperty("port", Integer.toString(port));
+        Properties properties = SystemInstance.get().getProperties();
+        properties.setProperty("ejbd.bind", host);
+        properties.setProperty("ejbd.port", Integer.toString(port));
         if (threads > 0) {
-            properties.setProperty("threads", Integer.toString(threads));
+            properties.setProperty("ejbd.threads", Integer.toString(threads));
         }
-        ejbDaemon.init(properties);
+
+        serviceManager.start(false);
+
     }
 
     public void doStop() throws Exception {
+        serviceManager.stop();
     }
 
     public void doFail() {



Mime
View raw message