[jboss-cvs] JBossAS SVN: r80652 - in trunk: bootstrap/src/main/org/jboss/bootstrap/spi and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Nov 7 08:18:11 EST 2008


Author: ALRubinger
Date: 2008-11-07 08:18:11 -0500 (Fri, 07 Nov 2008)
New Revision: 80652

Added:
   trunk/bootstrap/src/main/org/jboss/bootstrap/spi/ServerProcess.java
Modified:
   trunk/bootstrap/src/main/org/jboss/bootstrap/AbstractServerImpl.java
   trunk/bootstrap/src/main/org/jboss/bootstrap/spi/Server.java
   trunk/server/build.xml
   trunk/server/src/main/org/jboss/Shutdown.java
   trunk/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java
Log:
[JBAS-6172] Make org.jboss.system.server.Server unaware of a Process/JVM, extend this interface in ServerProcess to add-on this knowledge

Modified: trunk/bootstrap/src/main/org/jboss/bootstrap/AbstractServerImpl.java
===================================================================
--- trunk/bootstrap/src/main/org/jboss/bootstrap/AbstractServerImpl.java	2008-11-07 13:14:21 UTC (rev 80651)
+++ trunk/bootstrap/src/main/org/jboss/bootstrap/AbstractServerImpl.java	2008-11-07 13:18:11 UTC (rev 80652)
@@ -24,7 +24,6 @@
 import java.io.File;
 import java.lang.reflect.Method;
 import java.net.URL;
-import java.net.URLClassLoader;
 import java.util.Date;
 import java.util.List;
 import java.util.Properties;
@@ -37,8 +36,8 @@
 
 import org.jboss.Version;
 import org.jboss.bootstrap.spi.Bootstrap;
-import org.jboss.bootstrap.spi.Server;
 import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.ServerProcess;
 import org.jboss.logging.Logger;
 import org.jboss.net.protocol.URLStreamHandlerFactory;
 import org.jboss.util.StopWatch;
@@ -53,7 +52,7 @@
  * @version $Revision:$
  */
 public abstract class AbstractServerImpl extends NotificationBroadcasterSupport
-   implements Server, NotificationEmitter
+   implements ServerProcess, NotificationEmitter
 {
    /** Instance logger. */
    protected Logger log;

Modified: trunk/bootstrap/src/main/org/jboss/bootstrap/spi/Server.java
===================================================================
--- trunk/bootstrap/src/main/org/jboss/bootstrap/spi/Server.java	2008-11-07 13:14:21 UTC (rev 80651)
+++ trunk/bootstrap/src/main/org/jboss/bootstrap/spi/Server.java	2008-11-07 13:18:11 UTC (rev 80652)
@@ -116,26 +116,4 @@
     * @throws IllegalStateException    No started.
     */
    void shutdown() throws IllegalStateException;
-
-   /**
-    * Shutdown the server, the JVM and run shutdown hooks.
-    *
-    * @param exitcode   The exit code returned to the operating system.
-    */
-   void exit(int exitcode);
-   /**
-    * Shutdown the server, the JVM and run shutdown hooks. Exits with code 1.
-    */
-   void exit();
-
-   /** 
-    * Forcibly terminates the currently running Java virtual machine.
-    *
-    * @param exitcode   The exit code returned to the operating system.
-    */
-   void halt(int exitcode);
-   /**
-    * Forcibly terminates the currently running Java virtual machine. Exits with code 1.
-    */
-   void halt();
 }

Added: trunk/bootstrap/src/main/org/jboss/bootstrap/spi/ServerProcess.java
===================================================================
--- trunk/bootstrap/src/main/org/jboss/bootstrap/spi/ServerProcess.java	                        (rev 0)
+++ trunk/bootstrap/src/main/org/jboss/bootstrap/spi/ServerProcess.java	2008-11-07 13:18:11 UTC (rev 80652)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bootstrap.spi;
+
+/**
+ * ServerProcess
+ * 
+ * An abstraction of an AS instance as run from within
+ * a dedicated / standalone Process (JVM)
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface ServerProcess extends Server
+{
+   /**
+    * Shutdown the server, the JVM and run shutdown hooks.
+    *
+    * @param exitcode   The exit code returned to the operating system.
+    */
+   void exit(int exitcode);
+   /**
+    * Shutdown the server, the JVM and run shutdown hooks. Exits with code 1.
+    */
+   void exit();
+
+   /** 
+    * Forcibly terminates the currently running Java virtual machine.
+    *
+    * @param exitcode   The exit code returned to the operating system.
+    */
+   void halt(int exitcode);
+   /**
+    * Forcibly terminates the currently running Java virtual machine. Exits with code 1.
+    */
+   void halt();
+   
+}

Modified: trunk/server/build.xml
===================================================================
--- trunk/server/build.xml	2008-11-07 13:14:21 UTC (rev 80651)
+++ trunk/server/build.xml	2008-11-07 13:18:11 UTC (rev 80652)
@@ -518,6 +518,7 @@
        <fileset dir="${inflated.dir}">
           <include name="org/jboss/bootstrap/spi/Server.class"/>
           <include name="org/jboss/bootstrap/spi/ServerConfig.class"/>
+       	  <include name="org/jboss/bootstrap/spi/ServerProcess.class"/>
           <include name="org/jboss/bootstrap/spi/util/ServerConfigUtil.class"/>
        </fileset>
 

Modified: trunk/server/src/main/org/jboss/Shutdown.java
===================================================================
--- trunk/server/src/main/org/jboss/Shutdown.java	2008-11-07 13:14:21 UTC (rev 80651)
+++ trunk/server/src/main/org/jboss/Shutdown.java	2008-11-07 13:18:11 UTC (rev 80652)
@@ -39,6 +39,7 @@
 import gnu.getopt.LongOpt;
 
 import org.jboss.bootstrap.spi.Server;
+import org.jboss.bootstrap.spi.ServerProcess;
 import org.jboss.naming.HttpNamingContextFactory;
 import org.jboss.system.server.ServerImplMBean;
 import org.jboss.security.SecurityAssociation;
@@ -224,9 +225,9 @@
 
       MBeanServerConnection adaptor = (MBeanServerConnection) obj;
       ServerProxyHandler handler = new ServerProxyHandler(adaptor, serverJMXName);
-      Class[] ifaces = {Server.class};
+      Class<?>[] ifaces = {ServerProcess.class};
       ClassLoader tcl = Thread.currentThread().getContextClassLoader();
-      Server server = (Server) Proxy.newProxyInstance(tcl, ifaces, handler);
+      ServerProcess server = (ServerProcess) Proxy.newProxyInstance(tcl, ifaces, handler);
 
       if (exit)
       {

Modified: trunk/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java	2008-11-07 13:14:21 UTC (rev 80651)
+++ trunk/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java	2008-11-07 13:18:11 UTC (rev 80652)
@@ -28,6 +28,7 @@
 import java.util.Date;
 import java.util.List;
 import java.util.Properties;
+
 import javax.management.ListenerNotFoundException;
 import javax.management.MBeanNotificationInfo;
 import javax.management.MBeanServer;
@@ -38,8 +39,8 @@
 import javax.management.ObjectInstance;
 import javax.management.ObjectName;
 
-import org.jboss.bootstrap.spi.Server;
 import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.ServerProcess;
 import org.jboss.classloader.spi.ClassLoaderSystem;
 import org.jboss.classloading.spi.RealClassLoader;
 import org.jboss.classloading.spi.metadata.ExportAll;
@@ -75,7 +76,7 @@
 
    /** The JMX MBeanServer which will serve as our communication bus. */
    private MBeanServer mbeanServer;
-   private Server serverImpl;
+   private ServerProcess serverImpl;
    private ServiceController controller;
    private ServerConfig serverConfig;
    private ServerConfigImplMBean serverConfigMBean;
@@ -90,11 +91,11 @@
    /** Whether to use the old classloader */
    private boolean oldClassLoader;
    
-   public Server getServerImpl()
+   public ServerProcess getServerImpl()
    {
       return serverImpl;
    }
-   public void setServerImpl(Server serverImpl)
+   public void setServerImpl(ServerProcess serverImpl)
    {
       this.serverImpl = serverImpl;
       this.notificationEmitter = (NotificationEmitter) serverImpl;




More information about the jboss-cvs-commits mailing list