geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r344232 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core: GeronimoConnectionFactory.java internal/GeronimoServer.java internal/GeronimoServerBehaviour.java
Date Mon, 14 Nov 2005 21:01:06 GMT
Author: sppatel
Date: Mon Nov 14 13:01:03 2005
New Revision: 344232

URL: http://svn.apache.org/viewcvs?rev=344232&view=rev
Log:
fix hardcoded urls

Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/GeronimoConnectionFactory.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServer.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/GeronimoConnectionFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/GeronimoConnectionFactory.java?rev=344232&r1=344231&r2=344232&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/GeronimoConnectionFactory.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/GeronimoConnectionFactory.java
Mon Nov 14 13:01:03 2005
@@ -11,12 +11,13 @@
 import javax.enterprise.deploy.spi.factories.DeploymentFactory;
 
 import org.apache.geronimo.core.internal.GeronimoServer;
+import org.apache.geronimo.core.internal.Trace;
 import org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl;
 import org.eclipse.wst.server.core.IServer;
 
 public class GeronimoConnectionFactory {
 
-	private final static String DEFAULT_URI = "deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector";
+	//private final static String DEFAULT_URI = "deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector";
 
 	private HashMap connections = new HashMap();
 
@@ -46,7 +47,9 @@
 				factory = new DeploymentFactoryImpl();
 			}
 			mgr.registerDeploymentFactory(factory);
-			dm = mgr.getDeploymentManager(DEFAULT_URI, getUserName(server),
+			String deployerURL = getDeployerURL(server);
+			Trace.trace(Trace.INFO, "DeployerURL: " + deployerURL);
+			dm = mgr.getDeploymentManager(deployerURL, getUserName(server),
 					getPassword(server));
 			connections.put(server.getId(), dm);
 		}
@@ -57,6 +60,10 @@
 	public void destroy(IServer server) {
 		connections.remove(server.getId());
 	}
+	
+	private String getDeployerURL(IServer server) {
+		return "deployer:geronimo:jmx:rmi://" + server.getHost()  + "/jndi/rmi://" + server.getHost()
+ ":" + getRMINamingPort(server) + "/JMXConnector";
+	}
 
 	private DeploymentFactory discoverDeploymentFactory(IServer server) {
 
@@ -94,6 +101,12 @@
 		GeronimoServer gserver = (GeronimoServer) server
 				.getAdapter(GeronimoServer.class);
 		return gserver.getAdminPassword();
+	}
+	
+	public String getRMINamingPort(IServer server) {
+		GeronimoServer gserver = (GeronimoServer) server
+				.getAdapter(GeronimoServer.class);
+		return gserver.getRMINamingPort();
 	}
 
 }

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServer.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServer.java?rev=344232&r1=344231&r2=344232&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServer.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServer.java
Mon Nov 14 13:01:03 2005
@@ -28,6 +28,8 @@
     public static final String PROPERTY_ADMIN_ID = "adminID";
 
     public static final String PROPERTY_ADMIN_PW = "adminPassword";
+    
+    public static final String PROPERY_RMI_PORT = "rmiport";
 
     /*
      * (non-Javadoc)
@@ -72,6 +74,10 @@
     public String getAdminPassword() {
         return (String) getServerInstanceProperties().get(PROPERTY_ADMIN_PW);      
     }
+    
+    public String getRMINamingPort() {
+        return (String) getServerInstanceProperties().get(PROPERY_RMI_PORT);    
+    }
 
     public void setAdminID(String value) {
         getServerInstanceProperties().put(PROPERTY_ADMIN_ID, value);    
@@ -80,4 +86,10 @@
     public void setAdminPassword(String value) {
         getServerInstanceProperties().put(PROPERTY_ADMIN_PW, value);    
     }
+
+    public void setRMINamingPort(String value) {
+        getServerInstanceProperties().put(PROPERY_RMI_PORT, value);    
+    }
+    
+    
 }

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java?rev=344232&r1=344231&r2=344232&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
Mon Nov 14 13:01:03 2005
@@ -79,6 +79,11 @@
 		// kill the process
 		super.stop(true);
 	}
+	
+	private String getJMXServiceURL() {
+		String host = getServer().getHost();
+		return "service:jmx:rmi://" + host + "/jndi/rmi://" + host + ":" + getRMINamingPort() +
"/JMXConnector";
+	}
 
 	private Kernel getKernel() {
 
@@ -90,8 +95,9 @@
 			map.put("jmx.remote.credentials", new String[] { getUserName(),
 					getPassword() });
 			try {
-				JMXServiceURL address = new JMXServiceURL(
-						"service:jmx:rmi://localhost/jndi/rmi:/JMXConnector");
+				String url = getJMXServiceURL();
+				Trace.trace(Trace.INFO, url);
+				JMXServiceURL address = new JMXServiceURL(url);
 				do {
 					try {
 
@@ -281,6 +287,10 @@
 
 	public String getPassword() {
 		return GeronimoConnectionFactory.getInstance().getPassword(getServer());
+	}
+	
+	public String getRMINamingPort() {
+		return GeronimoConnectionFactory.getInstance().getRMINamingPort(getServer());
 	}
 
 }



Mime
View raw message