river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter_firmst...@apache.org
Subject svn commit: r1468421 - in /river/jtsk/skunk/qa_refactor/trunk: qa/src/com/sun/jini/qa/harness/ qa/src/com/sun/jini/test/impl/end2end/e2etest/ qa/src/com/sun/jini/test/impl/reggie/ qa/src/com/sun/jini/test/share/ qa/src/com/sun/jini/test/share/reggie/ q...
Date Tue, 16 Apr 2013 14:03:36 GMT
Author: peter_firmstone
Date: Tue Apr 16 14:03:35 2013
New Revision: 1468421

URL: http://svn.apache.org/r1468421
Log:
Removing instances of Thread.start() calls in object constructors.

Added permission to policy files for HeartOfTheMachine.

Removed old duplicate qa test suite copy of Reggie that's no longer used.

Removed:
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/reggie/
Modified:
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/end2end/e2etest/Driver.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/reggie/MultihomedClientTest.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/DiscoveryProtocolSimulator.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/LookupServices.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loader.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoConnectToCodebase.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoDlPerm.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoGetClassLoader.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loader.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoConnectToCodebase.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoDlPerm.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoGetClassLoader.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loader.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoConnectToCodebase.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoDlPerm.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoGetClassLoader.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loader.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoConnectToCodebase.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoDlPerm.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoGetClassLoader.policy
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/jeri/internal/runtime/AbstractDgcClient.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/tool/ClassServer.java

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java
Tue Apr 16 14:03:35 2013
@@ -19,7 +19,10 @@
 package com.sun.jini.qa.harness;
 
 import java.io.File;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
@@ -28,17 +31,19 @@ import java.util.logging.Logger;
  */
 public class HeartOfTheMachine
 {
-    private String soul ;
+    private final String soul ;
+    private final Thread t;
 
     private HeartOfTheMachine()
     {
         soul = System.getenv("SOUL");
 
         if( soul == null ) {
+            t = null;
             return ;
         }
 
-        Thread t = new Thread( new Runnable() {
+        t = new Thread( new Runnable() {
 
             public void run()
             {
@@ -47,6 +52,9 @@ public class HeartOfTheMachine
 
         }, "no heart without soul");
         t.setDaemon(true);
+    }
+    
+    private void star(){
         t.start();
     }
 
@@ -71,14 +79,19 @@ public class HeartOfTheMachine
 
     public static void start()
     {
-        try {
-            new HeartOfTheMachine();
-        } catch( Throwable t ) {
-            //System.out.println("Heart NOT started");
-            Logger.getLogger("com.sun.jini.qa.harness").severe("Heart NOT started");
-            if (t instanceof Error) throw (Error) t;
-            if (t instanceof RuntimeException) throw (RuntimeException) t;
-        }
+        AccessController.doPrivileged(new PrivilegedAction(){
+
+            @Override
+            public Object run() {
+                try {
+                    new HeartOfTheMachine().star();
+                } catch (Exception t){
+                    Logger.getLogger("com.sun.jini.qa.harness").log(Level.SEVERE, "Heart
NOT started", t);
+                }
+                return null;
+            }
+
+        });   
     }
 
 }

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/end2end/e2etest/Driver.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/end2end/e2etest/Driver.java?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/end2end/e2etest/Driver.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/end2end/e2etest/Driver.java
Tue Apr 16 14:03:35 2013
@@ -227,6 +227,8 @@ public class Driver implements LegacyTes
 
     /**
      * Utility class to read output from a process.
+     * This class is stateless, this is the only case where it's safe to start
+     * a Thread from inside the constructor.
      */
     public static class ProcessReader {
         public ProcessReader(final InputStream input, final PrintWriter out) {

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/reggie/MultihomedClientTest.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/reggie/MultihomedClientTest.java?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/reggie/MultihomedClientTest.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/reggie/MultihomedClientTest.java
Tue Apr 16 14:03:35 2013
@@ -88,6 +88,9 @@ public class MultihomedClientTest implem
 
     }
 
+    /**
+     * Safe to start thread in constructor, it's stateless.
+     */
     public static class ProcessReader {
         public ProcessReader(final InputStream input, final PrintStream out) {
             Thread inputThread = new Thread( new Runnable() {

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/DiscoveryProtocolSimulator.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/DiscoveryProtocolSimulator.java?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/DiscoveryProtocolSimulator.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/DiscoveryProtocolSimulator.java
Tue Apr 16 14:03:35 2013
@@ -219,25 +219,14 @@ public class DiscoveryProtocolSimulator 
     /** Interval to wait in between sending multicast announcements */
     private long multicastAnnouncementInterval = 1000 * 60 * 2;
 
-
-    public DiscoveryProtocolSimulator(QAConfig config,
-                                      String[] memberGroups,
-				      AdminManager manager)
-                                       throws ActivationException, IOException, TestException
-    {
-        this(config,memberGroups,manager,0);
-    }//end constructor
     
-    public DiscoveryProtocolSimulator(QAConfig config,
-                                      String[] memberGroups,
-				      AdminManager manager,
-                                      int unicastPort)
+    public DiscoveryProtocolSimulator(QAConfig config, String[] memberGroups, int unicastPort,
LookupSimulatorProxyInterface proxy)
                                        throws ActivationException, IOException, TestException
     {
         this.memberGroups = memberGroups;
         this.unicastPort  = unicastPort;
         // start LUS before switching identity to reggie
-        lookupProxy = (LookupSimulatorProxyInterface) manager.startLookupService();
+        lookupProxy = proxy;
 	LoginContext context = null;
 	Configuration c = config.getConfiguration();
 	try {
@@ -1162,14 +1151,18 @@ public class DiscoveryProtocolSimulator 
             DEFAULT_MULTICAST_TTL = 1;
 	}
 
-        /* start the discovery-related threads */
+        /* create the discovery-related threads */
         multicastRequestThread = new MulticastThread();
         multicastAnnouncementThread = new AnnounceThread();
+        
+    }//end init
+    
+    public void start(){
         /* start the threads */
         unicastRequestThread.start();
         multicastRequestThread.start();
         multicastAnnouncementThread.start();
-    }//end init
+    }
 
 }//end class DiscoveryProtocolSimulator
 

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/LookupServices.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/LookupServices.java?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/LookupServices.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/LookupServices.java
Tue Apr 16 14:03:35 2013
@@ -20,6 +20,7 @@ package com.sun.jini.test.share;
 import com.sun.jini.qa.harness.AdminManager;
 import com.sun.jini.qa.harness.QAConfig;
 import com.sun.jini.qa.harness.TestException;
+import com.sun.jini.test.services.lookupsimulator.LookupSimulatorProxyInterface;
 import com.sun.jini.test.share.BaseQATest.LocatorGroupsPair;
 import com.sun.jini.test.share.BaseQATest.LookupListener;
 import com.sun.jini.test.spec.discoveryservice.AbstractBaseTest.LDSEventListener;
@@ -539,7 +540,8 @@ public class LookupServices {
                                   +"sync on lookupList --> granted");
                 /* Use either a random or an explicit locator port */
                 generator = new DiscoveryProtocolSimulator
-                                               (config,memberGroups, manager, port);
+                                               (config,memberGroups, port, (LookupSimulatorProxyInterface)
manager.startLookupService());
+                generator.start();
                 genMap.put( generator, memberGroups );
                 lookupProxy = generator.getLookupProxy();
                 lookupList.add( lookupProxy );

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loader.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loader.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loader.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loader.policy
Tue Apr 16 14:03:35 2013
@@ -36,6 +36,7 @@ grant codebase "file:${com.sun.jini.test
 
 grant codebase "file:${com.sun.jini.qa.harness.harnessJar}" {
     permission net.jini.loader.DownloadPermission;
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };
 
 grant codebase "file:${com.sun.jini.qa.harness.testJar}" {

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoConnectToCodebase.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoConnectToCodebase.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoConnectToCodebase.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoConnectToCodebase.policy
Tue Apr 16 14:03:35 2013
@@ -140,4 +140,6 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoDlPerm.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoDlPerm.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoDlPerm.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoDlPerm.policy
Tue Apr 16 14:03:35 2013
@@ -144,4 +144,6 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoGetClassLoader.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoGetClassLoader.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoGetClassLoader.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/loaderNoGetClassLoader.policy
Tue Apr 16 14:03:35 2013
@@ -150,4 +150,6 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loader.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loader.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loader.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loader.policy
Tue Apr 16 14:03:35 2013
@@ -36,6 +36,7 @@ grant codebase "file:${com.sun.jini.test
 
 grant codebase "file:${com.sun.jini.qa.harness.harnessJar}" {
     permission net.jini.loader.DownloadPermission;
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };
 
 grant codebase "file:${com.sun.jini.qa.harness.testJar}" {

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoConnectToCodebase.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoConnectToCodebase.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoConnectToCodebase.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoConnectToCodebase.policy
Tue Apr 16 14:03:35 2013
@@ -139,4 +139,5 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoDlPerm.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoDlPerm.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoDlPerm.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoDlPerm.policy
Tue Apr 16 14:03:35 2013
@@ -145,4 +145,5 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoGetClassLoader.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoGetClassLoader.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoGetClassLoader.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassLoader/loaderNoGetClassLoader.policy
Tue Apr 16 14:03:35 2013
@@ -150,4 +150,5 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loader.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loader.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loader.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loader.policy
Tue Apr 16 14:03:35 2013
@@ -37,6 +37,7 @@ grant codebase "file:${com.sun.jini.test
 
 grant codebase "file:${com.sun.jini.qa.harness.harnessJar}" {
     permission net.jini.loader.DownloadPermission;
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };
 
 grant codebase "file:${com.sun.jini.qa.harness.testJar}" {

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoConnectToCodebase.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoConnectToCodebase.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoConnectToCodebase.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoConnectToCodebase.policy
Tue Apr 16 14:03:35 2013
@@ -140,4 +140,6 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoDlPerm.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoDlPerm.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoDlPerm.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoDlPerm.policy
Tue Apr 16 14:03:35 2013
@@ -144,4 +144,6 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoGetClassLoader.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoGetClassLoader.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoGetClassLoader.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/preferredClassProvider/loaderNoGetClassLoader.policy
Tue Apr 16 14:03:35 2013
@@ -151,4 +151,6 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loader.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loader.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loader.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loader.policy
Tue Apr 16 14:03:35 2013
@@ -169,4 +169,5 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoConnectToCodebase.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoConnectToCodebase.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoConnectToCodebase.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoConnectToCodebase.policy
Tue Apr 16 14:03:35 2013
@@ -139,4 +139,5 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoDlPerm.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoDlPerm.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoDlPerm.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoDlPerm.policy
Tue Apr 16 14:03:35 2013
@@ -144,4 +144,5 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoGetClassLoader.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoGetClassLoader.policy?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoGetClassLoader.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/loader/pref/requireDlPermProvider/loaderNoGetClassLoader.policy
Tue Apr 16 14:03:35 2013
@@ -150,4 +150,5 @@ grant { 
 
     // discovery-specific PropertyPermission needed by the harness
     permission net.jini.discovery.DiscoveryPermission "*"; 
+    permission java.lang.RuntimePermission "getenv.SOUL";
 };

Modified: river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/jeri/internal/runtime/AbstractDgcClient.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/jeri/internal/runtime/AbstractDgcClient.java?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/jeri/internal/runtime/AbstractDgcClient.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/jeri/internal/runtime/AbstractDgcClient.java
Tue Apr 16 14:03:35 2013
@@ -199,6 +199,7 @@ abstract class AbstractDgcClient {
 	    EndpointEntry entry = (EndpointEntry) endpointTable.get(endpoint);
 	    if (entry == null) {
 		entry = new EndpointEntry(endpoint);
+                entry.start();
 		endpointTable.put(endpoint, entry);
 		/*
 		 * If the endpoint table was previously empty, we are now
@@ -266,8 +267,11 @@ abstract class AbstractDgcClient {
 	    renewCleanThread = (Thread)	AccessController.doPrivileged(
 		new NewThreadAction(new RenewCleanThread(),
 				    "RenewClean-" + endpoint, true));
-	    renewCleanThread.start();
 	}
+        
+        private void start(){
+            renewCleanThread.start();
+        }
 
 	/**
 	 * Registers the live reference instances in the supplied list to

Modified: river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/tool/ClassServer.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/tool/ClassServer.java?rev=1468421&r1=1468420&r2=1468421&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/tool/ClassServer.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/tool/ClassServer.java Tue Apr 16 14:03:35
2013
@@ -206,7 +206,7 @@ public class ClassServer extends Thread 
 		       boolean verbose)
 	throws IOException
     {
-	init(port, dirlist, trees, verbose, false, null);
+	this(port, dirlist, trees, verbose, false, null);
     }
 
     /**
@@ -231,13 +231,53 @@ public class ClassServer extends Thread 
 		       boolean stoppable)
 	throws IOException
     {
-	init(port, dirlist, trees, verbose, stoppable, null);
+	this(port, dirlist, trees, verbose, stoppable, null);
+    }
+    
+    private static class Initializer {
+        int port;
+        String dirlist;
+        boolean trees;
+        boolean verbose;
+        boolean stoppable;
+        LifeCycle lifeCycle;
+        
+        Initializer(LifeCycle lifeCycle, String[] args){
+            port = DEFAULT_PORT;
+            dirlist = DEFAULT_DIR;
+            if (File.separatorChar == '\\') dirlist = DEFAULT_WIN_DIR;
+            trees = false;
+            verbose = false;
+            stoppable = false;
+            for (int i = 0; i < args.length ; i++ ) {
+                String arg = args[i];
+                if (arg.equals("-port")) {
+                    i++;
+                    port = Integer.parseInt(args[i]);
+                } else if (arg.equals("-dir") || arg.equals("-dirs")) {
+                    i++;
+                    dirlist = args[i];
+                } else if (arg.equals("-verbose")) {
+                    verbose = true;
+                } else if (arg.equals("-trees")) {
+                    trees = true;
+                } else if (arg.equals("-stoppable")) {
+                    stoppable = true;
+                } else {
+                    throw new IllegalArgumentException(arg);
+                }
+            }
+        }
+    }
+    
+    private ClassServer(Initializer init) throws IOException {
+        this(init.port, init.dirlist, init.trees, init.verbose, init.stoppable, init.lifeCycle);
     }
 
     /**
      * Do the real work of the constructor.
      */
-    private void init(int port,
+    private ClassServer(int port,
 		      String dirlist,
 		      boolean trees,
 		      boolean verbose,
@@ -291,6 +331,26 @@ public class ClassServer extends Thread 
     }
 
     /**
+     * Construct an un-started server, accepting the same command line options
+     * supported by {@link #main main}, except for the <code>-stop</code>
+     * option.  
+     * 
+     * {@link Thread#start() } must be called to start the server.
+     *
+     * @param args command line options
+     * @param lifeCycle life cycle control object, or <code>null</code>
+     * @throws IOException if the server socket cannot be created
+     * @throws IllegalArgumentException if a command line option is not
+     * understood
+     * @throws NullPointerException if <code>args</code> or any element
+     * of <code>args</code> is <code>null</code>
+     * @since 2.3.0
+     */
+    public ClassServer(LifeCycle lifeCycle, String [] args)throws IOException {
+	this(new Initializer(lifeCycle, args));
+    }
+    
+    /**
      * Construct a running server, accepting the same command line options
      * supported by {@link #main main}, except for the <code>-stop</code>
      * option.
@@ -302,34 +362,12 @@ public class ClassServer extends Thread 
      * understood
      * @throws NullPointerException if <code>args</code> or any element
      * of <code>args</code> is <code>null</code>
+     * @deprecated {@link Thread#start() } is called from within constructor, 
+     * this is non compliant with safe construction rules in the JMM.
      */
+    @Deprecated
     public ClassServer(String[] args, LifeCycle lifeCycle) throws IOException {
-	int port = DEFAULT_PORT;
-	String dirlist = DEFAULT_DIR;
-	if (File.separatorChar == '\\')
-	    dirlist = DEFAULT_WIN_DIR;
-	boolean trees = false;
-	boolean verbose = false;
-	boolean stoppable = false;
-	for (int i = 0; i < args.length ; i++ ) {
-	    String arg = args[i];
-	    if (arg.equals("-port")) {
-		i++;
-		port = Integer.parseInt(args[i]);
-	    } else if (arg.equals("-dir") || arg.equals("-dirs")) {
-		i++;
-		dirlist = args[i];
-	    } else if (arg.equals("-verbose")) {
-		verbose = true;
-	    } else if (arg.equals("-trees")) {
-		trees = true;
-	    } else if (arg.equals("-stoppable")) {
-		stoppable = true;
-	    } else {
-		throw new IllegalArgumentException(arg);
-	    }
-	}
-	init(port, dirlist, trees, verbose, stoppable, lifeCycle);
+	this(new Initializer(lifeCycle, args));
 	start();
     }
 



Mime
View raw message