[jboss-cvs] JBossAS SVN: r71229 - branches/JBPAPP_4_2_0_GA_CP/console/src/main/org/jboss/console/twiddle.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 25 01:45:13 EDT 2008


Author: jiwils
Date: 2008-03-25 01:45:13 -0400 (Tue, 25 Mar 2008)
New Revision: 71229

Modified:
   branches/JBPAPP_4_2_0_GA_CP/console/src/main/org/jboss/console/twiddle/Twiddle.java
Log:
When a server URL was specified, the sys props used would be lost because of the upcasting to Hashtable by InitialContext which removed the defaults.  This fix allows properties like jnp.disableDiscovery to be specified on the command line and have the desired effect.  This was a fix for [JBPAPP-689].

Modified: branches/JBPAPP_4_2_0_GA_CP/console/src/main/org/jboss/console/twiddle/Twiddle.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/console/src/main/org/jboss/console/twiddle/Twiddle.java	2008-03-25 04:49:29 UTC (rev 71228)
+++ branches/JBPAPP_4_2_0_GA_CP/console/src/main/org/jboss/console/twiddle/Twiddle.java	2008-03-25 05:45:13 UTC (rev 71229)
@@ -31,6 +31,7 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -236,7 +237,7 @@
       }
       else
       {
-         Properties props = new Properties(System.getProperties());
+         Hashtable props = new Hashtable(System.getProperties());
          props.put(Context.PROVIDER_URL, serverURL);
          ctx = new InitialContext(props);
       }
@@ -277,7 +278,7 @@
       {
          // initialize java.protocol.handler.pkgs
          initProtocolHandlers();
-         
+
          // Prosess global options
          processArguments(args);
          loadCommands();
@@ -296,7 +297,7 @@
             {
                System.out.println("Help for command: '" + command.getName() + "'");
                System.out.println();
-               
+
                command.displayHelp();
             }
             else
@@ -312,7 +313,7 @@
       {
          log.error("Command failure", e);
          System.err.println();
-         
+
          if (e instanceof NoSuchCommandException)
          {
             twiddle.displayCommandList();
@@ -324,7 +325,7 @@
             {
                System.err.println("Help for command: '" + command.getName() + "'");
                System.err.println();
-               
+
                command.displayHelp();
             }
          }
@@ -349,9 +350,9 @@
       {
          handlerPkgs = "org.jboss.net.protocol";
       }
-      System.setProperty("java.protocol.handler.pkgs", handlerPkgs);      
+      System.setProperty("java.protocol.handler.pkgs", handlerPkgs);
    }
-   
+
    private static void loadCommands() throws Exception
    {
       // load command protos from property definitions
@@ -373,7 +374,7 @@
          Class type = Class.forName(typeName);
 
          twiddle.addCommandPrototype((Command) type.newInstance());
-      }      
+      }
    }
 
    private static void displayHelp()
@@ -394,7 +395,7 @@
       out.println("    -s, --server=<url>        The JNDI URL of the remote server");
       out.println("    -a, --adapter=<name>      The JNDI name of the RMI adapter to use");
       out.println("    -u, --user=<name>         Specify the username for authentication");
-      out.println("    -p, --password=<name>     Specify the password for authentication"); 
+      out.println("    -p, --password=<name>     Specify the password for authentication");
       out.println("    -q, --quiet               Be somewhat more quiet");
       out.flush();
    }




More information about the jboss-cvs-commits mailing list