enable jBoss compile under JDK1.2

(please let me know if needed as an attachment)

Index: src/main/org/jboss/Main.java
===================================================================
RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/Main.java,v
retrieving revision 1.17
diff -u -r1.17 Main.java
--- src/main/org/jboss/Main.java 2000/10/09 20:17:11 1.17
+++ src/main/org/jboss/Main.java 2000/10/21 00:57:37
@@ -18,6 +18,7 @@
 import java.net.URL;
 import java.security.*;
 import java.util.*;
+import java.lang.reflect.Method;

 import javax.management.*;
 import javax.management.loading.*;
@@ -168,12 +169,13 @@
              // Add shutdown hook
              try
              {
-                Runtime.getRuntime().addShutdownHook(new Thread()
+                Runtime r=Runtime.getRuntime();
+  Method addShutdownHook=r.getClass().getMethod("addShutdownHook", new
Class[] {Thread.class});
+                addShutdownHook.invoke(r, new Object[]{new Thread()
                 {
                    public void run()
                    {
                        manager.stopMBeans(server);
-/*
                       err.println("Shutdown");
                       Set mBeans = server.queryNames(null, null);
                       Iterator names = mBeans.iterator();
@@ -190,9 +192,8 @@
                          }
                       }
                       err.println("Shutting done");
-*/
                    }
-                });
+                }});
                 System.out.println ("Shutdown hook added");
              } catch (Throwable e)
              {
Index: src/main/test/jboss/jmx/TestClient.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/test/jboss/jmx/TestClient.java,v
retrieving revision 1.4
diff -u -r1.4 TestClient.java
--- src/main/test/jboss/jmx/TestClient.java 2000/10/13 02:43:38 1.4
+++ src/main/test/jboss/jmx/TestClient.java 2000/10/21 00:57:40
@@ -7,6 +7,7 @@

 import java.util.Collection;
 import java.util.Iterator;
+import java.lang.reflect.Method;

 import javax.management.MBeanAttributeInfo;
 import javax.management.MBeanInfo;
@@ -187,8 +188,10 @@
    registerListeners( lConnector );
    // Add shutdown hook to remove the connection before shut down
    try {
-    Runtime.getRuntime().addShutdownHook(
-     new Thread() {
+                               Runtime r=Runtime.getRuntime();
+                          Method
addShutdownHook=r.getClass().getMethod("addShutdownHook", new Class[]
{Thread.class});
+                               addShutdownHook.invoke(r, new Object[]{new
Thread()
+          {
       public void run() {
        System.err.println( "Shutdown" );
        try {
@@ -211,6 +214,7 @@
        }
       }
      }
+                                    }
     );
     System.out.println ("Shutdown hook added");
    }


Reply via email to