geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r627596 - in /geronimo/server/branches/2.1: buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/
Date Wed, 13 Feb 2008 21:40:21 GMT
Author: gawor
Date: Wed Feb 13 13:40:12 2008
New Revision: 627596

URL: http://svn.apache.org/viewvc?rev=627596&view=rev
Log:
use specified credentials instead of the default credentials (GERONIMO-3845)

Modified:
    geronimo/server/branches/2.1/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
    geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java

Modified: geronimo/server/branches/2.1/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java?rev=627596&r1=627595&r2=627596&view=diff
==============================================================================
--- geronimo/server/branches/2.1/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
(original)
+++ geronimo/server/branches/2.1/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
Wed Feb 13 13:40:12 2008
@@ -61,14 +61,16 @@
     private Throwable lastError;
 
     public ServerProxy(final JMXServiceURL url, final Map environment) throws Exception {
-        init(url, environment);
+        assert url != null;
+        assert environment != null;
+
+        this.url = url;
+        this.environment = environment;
+        
+        log.debug("Initialized with URL: " + url + ", environment: " + environment);
     }
 
     public ServerProxy(final String hostname, final int port, final String username, final
String password) throws Exception {
-        //
-        // TODO: Check if this is the right way to build up the URI
-        //
-        
         this("service:jmx:rmi://" + hostname + "/jndi/rmi://" + hostname + ":" + port + "/JMXConnector",
username, password);
     }
 
@@ -77,19 +79,9 @@
         assert username != null;
         assert password != null;
         
-        Map env = new HashMap();
-        env.put("jmx.remote.credentials", new String[] {username, password});
-
-        init(new JMXServiceURL(url), env);
-    }
-
-    private void init(final JMXServiceURL url, final Map environment) throws Exception {
-        assert url != null;
-        assert environment != null;
-        
-        this.url = url;
+        this.url = new JMXServiceURL(url);
         this.environment = new HashMap();
-        this.environment.put("jmx.remote.credentials", new String[] {"system", "manager"});
+        this.environment.put("jmx.remote.credentials", new String[] {username, password});
 
         log.debug("Initialized with URL: " + url + ", environment: " + environment);
     }

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java?rev=627596&r1=627595&r2=627596&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java
Wed Feb 13 13:40:12 2008
@@ -62,14 +62,16 @@
     private Throwable lastError;
 
     public ServerProxy(final JMXServiceURL url, final Map environment) throws Exception {
-        init(url, environment);
-    }
+        assert url != null;
+        assert environment != null;
 
-    public ServerProxy(final String hostname, final int port, final String username, final
String password) throws Exception {
-        //
-        // TODO: Check if this is the right way to build up the URI
-        //
+        this.url = url;
+        this.environment = environment;
         
+        log.debug("Initialized with URL: " + url + ", environment: " + environment);
+    }
+
+    public ServerProxy(final String hostname, final int port, final String username, final
String password) throws Exception {        
         this("service:jmx:rmi://" + hostname + "/jndi/rmi://" + hostname + ":" + port + "/JMXConnector",
username, password);
     }
 
@@ -78,19 +80,9 @@
         assert username != null;
         assert password != null;
         
-        Map env = new HashMap();
-        env.put("jmx.remote.credentials", new String[] {username, password});
-
-        init(new JMXServiceURL(url), env);
-    }
-
-    private void init(final JMXServiceURL url, final Map environment) throws Exception {
-        assert url != null;
-        assert environment != null;
-        
-        this.url = url;
+        this.url = new JMXServiceURL(url);
         this.environment = new HashMap();
-        this.environment.put("jmx.remote.credentials", new String[] {"system", "manager"});
+        this.environment.put("jmx.remote.credentials", new String[] {username, password});
 
         log.debug("Initialized with URL: " + url + ", environment: " + environment);
     }



Mime
View raw message