geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r410280 - in /geronimo/devtools/eclipse-plugin/trunk: config-store-service/ plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/ plugins/org.apach...
Date Tue, 30 May 2006 13:44:38 GMT
Author: sppatel
Date: Tue May 30 06:44:37 2006
New Revision: 410280

URL: http://svn.apache.org/viewvc?rev=410280&view=rev
Log:
BUG FIX: refactor ops to provide IServer to constructors, utility method to generated exploded
ear

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java
  (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/config-store-service/pom.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/DeploymentUtils.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoConnectionFactory.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/operations/V11DeploymentPlanCreationOperation.java

Modified: geronimo/devtools/eclipse-plugin/trunk/config-store-service/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/config-store-service/pom.xml?rev=410280&r1=410279&r2=410280&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/config-store-service/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/config-store-service/pom.xml Tue May 30 06:44:37
2006
@@ -5,6 +5,14 @@
   <packaging>jar</packaging>
   <version>1.0</version>
   <name>Eclipse Aware Configuration Store Service</name>
+  <parent>
+    <groupId>org.apache.geronimo.devtools</groupId>
+    <artifactId>geronimo-eclipse-plugin</artifactId> 
+    <version>1.1</version>
+  </parent>
+  <build>
+  	<sourceDirectory>src/main/java/</sourceDirectory>
+  </build>
   <dependencies>
     <dependency>
       <groupId>geronimo</groupId>

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/DeploymentUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/DeploymentUtils.java?rev=410280&r1=410279&r2=410280&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/DeploymentUtils.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/DeploymentUtils.java
Tue May 30 06:44:37 2006
@@ -24,19 +24,26 @@
 
 import org.apache.geronimo.st.core.commands.TargetModuleIdNotFoundException;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jst.j2ee.application.internal.operations.AppClientComponentExportDataModelProvider;
 import org.eclipse.jst.j2ee.application.internal.operations.EARComponentExportDataModelProvider;
 import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentExportDataModelProvider;
 import org.eclipse.jst.j2ee.internal.ejb.project.operations.EJBComponentExportDataModelProvider;
 import org.eclipse.jst.j2ee.internal.jca.operations.ConnectorComponentExportDataModelProvider;
 import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentExportDataModelProvider;
+import org.eclipse.jst.server.core.IEnterpriseApplication;
+import org.eclipse.jst.server.core.IWebModule;
+import org.eclipse.jst.server.core.PublishUtil;
 import org.eclipse.wst.common.componentcore.ComponentCore;
 import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
 import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
 import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
 import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.util.ProjectModule;
 
 public class DeploymentUtils {
 
@@ -44,8 +51,62 @@
 
 	private DeploymentUtils() {
 	}
+	
+	public static IPath generateExplodedConfiguration(IModule module, IPath outputPath) {
+		
+		IPath output = outputPath.append(module.getName() + getModuleExtension(module));
+		try {
+			IModuleResource[] resources = getModuleResources(module);
+			PublishUtil.smartCopy(resources, output, new NullProgressMonitor());
+			if(GeronimoUtils.isEarModule(module)) {
+				IEnterpriseApplication application = (IEnterpriseApplication) module.loadAdapter(IEnterpriseApplication.class,
null);
+				if( application != null ){
+					IModule[] children = application.getModules();
+					 for (int i = 0; i < children.length; i++) {
+						 	IModule child = children[i];
+							IPath childPath = output.append(child.getName() + getModuleExtension(child));
+							IModuleResource[] childResources = getModuleResources(child);
+							PublishUtil.smartCopy(childResources, childPath, new NullProgressMonitor());
+							if(GeronimoUtils.isWebModule(child)) {
+								IWebModule webModule = (IWebModule) module.loadAdapter(IWebModule.class, null);
+								IModule[] libs = webModule.getModules();
+								IPath webLibPath = childPath.append("WEB-INF").append("lib");
+								for(int j = 0; j < libs.length; j++) {
+									IModule lib = libs[j];
+									IModuleResource[] libResources = getModuleResources(lib);
+									PublishUtil.smartCopy(libResources, webLibPath.append(lib.getName() + getModuleExtension(lib)),
new NullProgressMonitor());
+								}
+							}
+					 }
+				}
+			}
+		} catch (CoreException e) {
+			e.printStackTrace();
+		}
+		
+		return output;
+	}
+	
+	public static IModuleResource[] getModuleResources(IModule module) throws CoreException
{
+		ProjectModule pm = (ProjectModule)module.loadAdapter(ProjectModule.class, null);
+		if (pm != null) {
+			return pm.members();
+		}
+		return null;
+	}
+	
+	private static String getModuleExtension(IModule module) {
+		if(GeronimoUtils.isEarModule(module)) {
+			return ".ear";
+		}else if(GeronimoUtils.isWebModule(module)) {
+			return ".war";
+		}else if(GeronimoUtils.isRARModule(module)) {
+			return ".rar";
+		}
+		return ".jar";
+	}
 
-	public static File createJarFile(IModule module) {
+	public static File createJarFile(IModule module, IPath outputPath) {
 		IDataModel model = getExportDataModel(module);
 
 		if (model != null) {
@@ -53,10 +114,11 @@
 			IVirtualComponent comp = ComponentCore.createComponent(module.getProject());
 
 			model.setProperty(J2EEComponentExportDataModelProvider.PROJECT_NAME, module.getProject());
-			model.setProperty(J2EEComponentExportDataModelProvider.ARCHIVE_DESTINATION, STATE_LOC.append(module.getName())
+			model.setProperty(J2EEComponentExportDataModelProvider.ARCHIVE_DESTINATION, outputPath.append(module.getName())
 					+ ".zip");
 			model.setProperty(J2EEComponentExportDataModelProvider.COMPONENT, comp);
 			model.setBooleanProperty(J2EEComponentExportDataModelProvider.OVERWRITE_EXISTING, true);
+			model.setBooleanProperty(J2EEComponentExportDataModelProvider.RUN_BUILD, false);
 
 			if (model != null) {
 				try {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoConnectionFactory.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoConnectionFactory.java?rev=410280&r1=410279&r2=410280&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoConnectionFactory.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoConnectionFactory.java
Tue May 30 06:44:37 2006
@@ -57,7 +57,7 @@
 		return gServer;
 	}
 
-	protected IGeronimoServer getGeronimoServer(DeploymentManager dm) {
+	public IGeronimoServer getGeronimoServer(DeploymentManager dm) {
 		if (dm != null && connections.containsValue(dm)) {
 			Iterator i = connections.keySet().iterator();
 			while (i.hasNext()) {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java?rev=410280&r1=410279&r2=410280&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
Tue May 30 06:44:37 2006
@@ -17,25 +17,31 @@
 
 import javax.enterprise.deploy.spi.DeploymentManager;
 
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
 
 abstract class AbstractDeploymentCommand implements IDeploymentCommand {
-
-	private DeploymentManager dm;
+	
+	private IServer server;
 
 	private IModule module;
 
-	public AbstractDeploymentCommand(DeploymentManager dm, IModule module) {
+	public AbstractDeploymentCommand(IServer server, IModule module) {
 		super();
-		this.dm = dm;
+		this.server = server;
 		this.module = module;
 	}
 
-	public DeploymentManager getDeploymentManager() {
-		return dm;
+	public DeploymentManager getDeploymentManager() throws CoreException {
+		return DeploymentCommandFactory.getDeploymentManager(server);
 	}
 
 	public IModule getModule() {
 		return module;
+	}
+
+	public IServer getServer() {
+		return server;
 	}
 }

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java?rev=410280&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java
Tue May 30 06:44:37 2006
@@ -0,0 +1,71 @@
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.st.core.commands;
+
+import java.io.File;
+
+import org.apache.geronimo.st.core.DeploymentUtils;
+import org.apache.geronimo.st.core.GeronimoUtils;
+import org.apache.geronimo.st.core.internal.Trace;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.wst.common.componentcore.internal.StructureEdit;
+import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
+import org.eclipse.wst.common.componentcore.internal.impl.WorkbenchComponentImpl;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+
+abstract public class DeployCommand extends AbstractDeploymentCommand {
+
+	boolean inPlace;
+
+	/**
+	 * @param server
+	 * @param module
+	 */
+	public DeployCommand(IServer server, IModule module, boolean inPlace) {
+		super(server, module);
+	}
+
+	public File getTargetFile() {
+		File file = null;
+		if (inPlace && !GeronimoUtils.isEarModule(getModule())) {
+			StructureEdit moduleCore = StructureEdit.getStructureEditForRead(getModule().getProject());
+			try {
+				WorkbenchComponent component = moduleCore.getComponent();
+				IPath loc = ((WorkbenchComponentImpl) component).getDefaultSourceRoot();
+				file = getModule().getProject().findMember(loc).getLocation().toFile();
+			} finally {
+				if (moduleCore != null)
+					moduleCore.dispose();
+			}
+		} else {
+			String version = getServer().getRuntime().getRuntimeType().getVersion();
+			IPath outputDir = DeploymentUtils.STATE_LOC.append("server_"
+					+ getServer().getId());
+			outputDir.toFile().mkdirs();
+			if ("1.0".equals(version)) {
+				file = DeploymentUtils.createJarFile(getModule(), outputDir);
+			} else {
+				file = DeploymentUtils.generateExplodedConfiguration(getModule(), outputDir).toFile();
+			}
+		}
+		
+		Trace.trace(Trace.INFO, "File: " + file.getAbsolutePath());
+		
+		return file;
+	}
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeployCommand.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java?rev=410280&r1=410279&r2=410280&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
Tue May 30 06:44:37 2006
@@ -50,7 +50,7 @@
 	public static IDeploymentCommand createDistributeCommand(IModule module, IServer server,
boolean inPlace) throws CoreException {
 		IGeronimoServerBehavior gs = (IGeronimoServerBehavior) server.loadAdapter(IGeronimoServerBehavior.class,
null);
 		Target[] targets = gs.getTargets();
-		return new SynchronizedDeploymentOp(new DistributeCommand(module, getDeploymentManager(server),
targets, inPlace));
+		return new SynchronizedDeploymentOp(new DistributeCommand(server, module, targets, inPlace));
 	}
 
 	/**
@@ -60,9 +60,8 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static IDeploymentCommand createStartCommand(TargetModuleID[] ids,
-			IModule module, IServer server) throws CoreException {
-		return new SynchronizedDeploymentOp(new StartCommand(ids, module, getDeploymentManager(server)));
+	public static IDeploymentCommand createStartCommand(TargetModuleID[] ids, IModule module,
IServer server) throws CoreException {
+		return new SynchronizedDeploymentOp(new StartCommand(server, ids, module));
 	}
 
 	/**
@@ -71,9 +70,8 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static IDeploymentCommand createStopCommand(IModule module,
-			IServer server) throws CoreException {
-		return new SynchronizedDeploymentOp(new StopCommand(module, getDeploymentManager(server)));
+	public static IDeploymentCommand createStopCommand(IModule module, IServer server) throws
CoreException {
+		return new SynchronizedDeploymentOp(new StopCommand(server, module));
 	}
 
 	/**
@@ -82,9 +80,8 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static IDeploymentCommand createRedeployCommand(IModule module,
-			IServer server, boolean inPlace) throws CoreException {
-		return new SynchronizedDeploymentOp(new RedeployCommand(module, getDeploymentManager(server),
inPlace));
+	public static IDeploymentCommand createRedeployCommand(IModule module, IServer server, boolean
inPlace) throws CoreException {
+		return new SynchronizedDeploymentOp(new RedeployCommand(server, module, inPlace));
 	}
 
 	/**
@@ -93,9 +90,8 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static IDeploymentCommand createUndeployCommand(IModule module,
-			IServer server) throws CoreException {
-		return new SynchronizedDeploymentOp(new UndeployCommand(module, getDeploymentManager(server)));
+	public static IDeploymentCommand createUndeployCommand(IModule module, IServer server) throws
CoreException {
+		return new SynchronizedDeploymentOp(new UndeployCommand(server, module));
 	}
 
 	/**
@@ -103,10 +99,13 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static DeploymentManager getDeploymentManager(IServer server)
-			throws CoreException {
+	public static DeploymentManager getDeploymentManager(IServer server) throws CoreException
{
 		try {
-			return GeronimoConnectionFactory.getInstance().getDeploymentManager(server);
+			DeploymentManager dm = GeronimoConnectionFactory.getInstance().getDeploymentManager(server);
+			if (dm == null) {
+				throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, Messages.DM_CONNECTION_FAIL,
null));
+			}
+			return dm;
 		} catch (DeploymentManagerCreationException e) {
 			throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, Messages.DM_CONNECTION_FAIL,
e));
 		}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java?rev=410280&r1=410279&r2=410280&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
Tue May 30 06:44:37 2006
@@ -21,26 +21,20 @@
 import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.Target;
 
-import org.apache.geronimo.st.core.DeploymentUtils;
 import org.apache.geronimo.st.core.internal.Trace;
-import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.componentcore.internal.impl.WorkbenchComponentImpl;
 import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
 
-class DistributeCommand extends AbstractDeploymentCommand {
-
-	boolean inPlace;
+class DistributeCommand extends DeployCommand {
 
 	Target[] targets;
 
-	public DistributeCommand(IModule module, DeploymentManager dm, Target[] targets, boolean
inPlace) {
-		super(dm, module);
-		this.inPlace = inPlace;
+	public DistributeCommand(IServer server, IModule module, Target[] targets, boolean inPlace)
{
+		super(server, module, inPlace);
 		this.targets = targets;
 	}
 
@@ -49,30 +43,17 @@
 	 * 
 	 * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
 	 */
-	public IStatus execute(IProgressMonitor monitor) {
-		if (targets == null)
-			targets = getDeploymentManager().getTargets();
+	public IStatus execute(IProgressMonitor monitor) throws CoreException {
 
-		File file = null;
+		DeploymentManager dm = getDeploymentManager();
 
-		if (inPlace) {
-			StructureEdit moduleCore = StructureEdit.getStructureEditForRead(getModule().getProject());
-			try {
-				WorkbenchComponent component = moduleCore.getComponent();
-				IPath loc = ((WorkbenchComponentImpl) component).getDefaultSourceRoot();
-				file = getModule().getProject().findMember(loc).getLocation().toFile();
-			} finally {
-				if (moduleCore != null)
-					moduleCore.dispose();
-			}
-		} else {
-			file = DeploymentUtils.createJarFile(getModule());
-		}
+		if (targets == null)
+			targets = dm.getTargets();
 		
 		Trace.trace(Trace.INFO, "Target: " + targets[0]);
-		Trace.trace(Trace.INFO, "File: " + file.getAbsolutePath());
 
-		return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().distribute(targets,
file, null));
+		File file = getTargetFile();
+		return new DeploymentCmdStatus(Status.OK_STATUS, dm.distribute(targets, file, null));
 	}
 
 	/*

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java?rev=410280&r1=410279&r2=410280&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
Tue May 30 06:44:37 2006
@@ -22,18 +22,17 @@
 import javax.enterprise.deploy.spi.TargetModuleID;
 
 import org.apache.geronimo.st.core.DeploymentUtils;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
 
-class RedeployCommand extends AbstractDeploymentCommand {
-	
-	boolean inPlace;
+class RedeployCommand extends DeployCommand {
 
-	public RedeployCommand(IModule module, DeploymentManager dm, boolean inPlace) {
-		super(dm, module);
-		this.inPlace = inPlace;
+	public RedeployCommand(IServer server, IModule module, boolean inPlace) {
+		super(server, module, inPlace);
 	}
 
 	/*
@@ -41,17 +40,11 @@
 	 * 
 	 * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
 	 */
-	public IStatus execute(IProgressMonitor monitor)
-			throws TargetModuleIdNotFoundException {
-		
-		File file = null;
-		if(inPlace) {
-			file = getModule().getProject().getLocation().toFile();
-		} else {
-			file = DeploymentUtils.createJarFile(getModule());
-		}
-		TargetModuleID id = DeploymentUtils.getTargetModuleID(getModule(), getDeploymentManager());
-		return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().redeploy(new TargetModuleID[]
{ id }, file, null));
+	public IStatus execute(IProgressMonitor monitor) throws TargetModuleIdNotFoundException,
CoreException {
+		DeploymentManager dm = getDeploymentManager();
+		File file = getTargetFile();
+		TargetModuleID id = DeploymentUtils.getTargetModuleID(getModule(), dm);
+		return new DeploymentCmdStatus(Status.OK_STATUS, dm.redeploy(new TargetModuleID[] { id
}, file, null));
 	}
 
 	/*

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java?rev=410280&r1=410279&r2=410280&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java
Tue May 30 06:44:37 2006
@@ -16,21 +16,21 @@
 package org.apache.geronimo.st.core.commands;
 
 import javax.enterprise.deploy.shared.CommandType;
-import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.TargetModuleID;
 
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
 
 class StartCommand extends AbstractDeploymentCommand {
 
 	TargetModuleID[] ids;
 
-	public StartCommand(TargetModuleID[] ids, IModule module,
-			DeploymentManager dm) {
-		super(dm, module);
+	public StartCommand(IServer server, TargetModuleID[] ids, IModule module) {
+		super(server, module);
 		this.ids = ids;
 	}
 
@@ -39,7 +39,7 @@
 	 * 
 	 * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
 	 */
-	public IStatus execute(IProgressMonitor monitor) {
+	public IStatus execute(IProgressMonitor monitor) throws CoreException {
 		return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().start(ids));
 	}
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java?rev=410280&r1=410279&r2=410280&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java
Tue May 30 06:44:37 2006
@@ -16,19 +16,20 @@
 package org.apache.geronimo.st.core.commands;
 
 import javax.enterprise.deploy.shared.CommandType;
-import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.TargetModuleID;
 
 import org.apache.geronimo.st.core.DeploymentUtils;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
 
 class StopCommand extends AbstractDeploymentCommand {
 
-	public StopCommand(IModule module, DeploymentManager dm) {
-		super(dm, module);
+	public StopCommand(IServer server, IModule module) {
+		super(server, module);
 	}
 
 	/*
@@ -36,9 +37,7 @@
 	 * 
 	 * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
 	 */
-	public IStatus execute(IProgressMonitor monitor)
-			throws TargetModuleIdNotFoundException {
-
+	public IStatus execute(IProgressMonitor monitor) throws TargetModuleIdNotFoundException,
CoreException {
 		TargetModuleID id = DeploymentUtils.getTargetModuleID(getModule(), getDeploymentManager());
 		return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().stop(new TargetModuleID[]
{ id }));
 	}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java?rev=410280&r1=410279&r2=410280&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java
Tue May 30 06:44:37 2006
@@ -16,19 +16,20 @@
 package org.apache.geronimo.st.core.commands;
 
 import javax.enterprise.deploy.shared.CommandType;
-import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.TargetModuleID;
 
 import org.apache.geronimo.st.core.DeploymentUtils;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
 
 class UndeployCommand extends AbstractDeploymentCommand {
 
-	public UndeployCommand(IModule module, DeploymentManager dm) {
-		super(dm, module);
+	public UndeployCommand(IServer server, IModule module) {
+		super(server, module);
 	}
 
 	/*
@@ -36,9 +37,7 @@
 	 * 
 	 * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
 	 */
-	public IStatus execute(IProgressMonitor monitor)
-			throws TargetModuleIdNotFoundException {
-
+	public IStatus execute(IProgressMonitor monitor) throws TargetModuleIdNotFoundException,
CoreException {
 		TargetModuleID id = DeploymentUtils.getTargetModuleID(getModule(), getDeploymentManager());
 		return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().undeploy(new TargetModuleID[]
{ id }));
 	}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/operations/V11DeploymentPlanCreationOperation.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/operations/V11DeploymentPlanCreationOperation.java?rev=410280&r1=410279&r2=410280&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/operations/V11DeploymentPlanCreationOperation.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/operations/V11DeploymentPlanCreationOperation.java
Tue May 30 06:44:37 2006
@@ -105,7 +105,7 @@
 
 		root.setEnvironment(getConfigEnvironment("default", getComponentName(), "1.0", "car"));
 		root.setContextRoot("/" + getComponentName());
-		root.setContextPriorityClassloader(false);
+		//root.setContextPriorityClassloader(false); //TODO Replace this with inverse-classloading
 
 		documentRoot.setWebApp(root);
 		resource.getContents().add(documentRoot);



Mime
View raw message