geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r409202 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
Date Wed, 24 May 2006 16:43:54 GMT
Author: sppatel
Date: Wed May 24 09:43:54 2006
New Revision: 409202

URL: http://svn.apache.org/viewvc?rev=409202&view=rev
Log:
GERONIMODEVTOOLS-73

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java?rev=409202&r1=409201&r2=409202&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
Wed May 24 09:43:54 2006
@@ -24,6 +24,7 @@
 
 import javax.enterprise.deploy.spi.Target;
 import javax.management.MBeanServerConnection;
+import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.management.remote.JMXConnector;
 import javax.management.remote.JMXConnectorFactory;
@@ -33,6 +34,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanQuery;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.PersistentConfigurationList;
@@ -173,19 +175,27 @@
 	 * @see org.eclipse.wst.server.core.internal.IModulePublishHelper#getPublishDirectory(org.eclipse.wst.server.core.IModule[])
 	 */
 	public IPath getPublishDirectory(IModule[] module) {
-		IPath path = null;
-		if (module.length == 1) {
-			try {
-				String configId = getConfigId(module[0]);
-				ObjectName on = Configuration.getConfigurationObjectName(URI.create(configId));
-				GBeanData data = kernel.getGBeanData(on);
-				URL url = (URL) data.getAttribute("baseURL");
-				return new Path(url.getFile());
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
+		if(module == null || module.length == 0)
+			return null;
+		
+		try {
+			String configId = getConfigId(module[0]);
+			ObjectName on = Configuration.getConfigurationObjectName(URI.create(configId));
+			GBeanData data = kernel.getGBeanData(on);
+			URL url = (URL) data.getAttribute("baseURL");
+			IPath modulePath = new Path(url.getFile());
+			if(module.length == 2) {
+				modulePath = modulePath.append(module[1].getName());
+			} 
+		} catch (MalformedObjectNameException e) {
+			e.printStackTrace();
+		} catch (GBeanNotFoundException e) {
+			e.printStackTrace();
+		} catch (InternalKernelException e) {
+			e.printStackTrace();
 		}
-		return path;
+		
+		return null;
 	}
 	
 	/* (non-Javadoc)



Mime
View raw message