geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r359340 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core: commands/ internal/ operations/
Date Wed, 28 Dec 2005 01:17:37 GMT
Author: sppatel
Date: Tue Dec 27 17:17:26 2005
New Revision: 359340

URL: http://svn.apache.org/viewcvs?rev=359340&view=rev
Log:
tweak IDeploymentCommand interface

Added:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DeploymentCmdStatus.java
  (with props)
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/SynchronizedDeploymentOp.java
      - copied, changed from r359121, geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/SynchronizedDeploymentOp.java
Removed:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/SynchronizedDeploymentOp.java
Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/AbstractDeploymentCommand.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DeploymentCommandFactory.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DistributeCommand.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/IDeploymentCommand.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/RedeployCommand.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/StartCommand.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/StopCommand.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/UndeployCommand.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/commands/AbstractDeploymentCommand.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/commands/AbstractDeploymentCommand.java?rev=359340&r1=359339&r2=359340&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/AbstractDeploymentCommand.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/AbstractDeploymentCommand.java
Tue Dec 27 17:17:26 2005
@@ -40,7 +40,7 @@
 abstract class AbstractDeploymentCommand implements IDeploymentCommand {
 
 	private DeploymentManager dm;
-	
+
 	private IModule module;
 
 	public AbstractDeploymentCommand(DeploymentManager dm, IModule module) {
@@ -52,7 +52,7 @@
 	public DeploymentManager getDeploymentManager() {
 		return dm;
 	}
-	
+
 	public IModule getModule() {
 		return module;
 	}

Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DeploymentCmdStatus.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/commands/DeploymentCmdStatus.java?rev=359340&view=auto
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DeploymentCmdStatus.java
(added)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DeploymentCmdStatus.java
Tue Dec 27 17:17:26 2005
@@ -0,0 +1,127 @@
+/**
+ * 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.core.commands;
+
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+
+import org.eclipse.core.runtime.IStatus;
+
+public class DeploymentCmdStatus implements IStatus {
+
+	private IStatus status;
+
+	private ProgressObject po;
+
+	public DeploymentCmdStatus(IStatus status, ProgressObject po) {
+		super();
+		this.status = status;
+		this.po = po;
+	}
+
+	public ProgressObject getProgressObject() {
+		return po;
+	}
+
+	public TargetModuleID[] getResultTargetModuleIDs() {
+		if (po != null) {
+			return po.getResultTargetModuleIDs();
+		}
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.IStatus#getChildren()
+	 */
+	public IStatus[] getChildren() {
+		return status.getChildren();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.IStatus#getCode()
+	 */
+	public int getCode() {
+		return status.getCode();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.IStatus#getException()
+	 */
+	public Throwable getException() {
+		return status.getException();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.IStatus#getMessage()
+	 */
+	public String getMessage() {
+		return status.getMessage();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.IStatus#getPlugin()
+	 */
+	public String getPlugin() {
+		return status.getPlugin();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.IStatus#getSeverity()
+	 */
+	public int getSeverity() {
+		return status.getSeverity();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.IStatus#isMultiStatus()
+	 */
+	public boolean isMultiStatus() {
+		return status.isMultiStatus();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.IStatus#isOK()
+	 */
+	public boolean isOK() {
+		return status.isOK();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.IStatus#matches(int)
+	 */
+	public boolean matches(int severityMask) {
+		return status.matches(severityMask);
+	}
+
+}

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

Propchange: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DeploymentCmdStatus.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

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

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DeploymentCommandFactory.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/commands/DeploymentCommandFactory.java?rev=359340&r1=359339&r2=359340&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DeploymentCommandFactory.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DeploymentCommandFactory.java
Tue Dec 27 17:17:26 2005
@@ -22,7 +22,6 @@
 import org.apache.geronimo.core.GeronimoConnectionFactory;
 import org.apache.geronimo.core.internal.GeronimoPlugin;
 import org.apache.geronimo.core.internal.Messages;
-import org.apache.geronimo.core.operations.SynchronizedDeploymentOp;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -31,9 +30,9 @@
 
 /**
  * 
- * This class provides static factory methods that return "synchronized" wrapper instances
of
- * JSR-88 deployment commands.
- *
+ * This class provides static factory methods that return "synchronized" wrapper
+ * instances of JSR-88 deployment commands.
+ * 
  */
 public class DeploymentCommandFactory {
 
@@ -48,7 +47,7 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static SynchronizedDeploymentOp createDistributeCommand(
+	public static IDeploymentCommand createDistributeCommand(
 			IModule module, IServer server) throws CoreException {
 		return new SynchronizedDeploymentOp(new DistributeCommand(module,
 				INSTANCE.getDeploymentManager(server)));
@@ -61,7 +60,7 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static SynchronizedDeploymentOp createStartCommand(
+	public static IDeploymentCommand createStartCommand(
 			TargetModuleID[] ids, IModule module, IServer server)
 			throws CoreException {
 		return new SynchronizedDeploymentOp(new StartCommand(ids, module,
@@ -74,7 +73,7 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static SynchronizedDeploymentOp createStopCommand(IModule module,
+	public static IDeploymentCommand createStopCommand(IModule module,
 			IServer server) throws CoreException {
 		return new SynchronizedDeploymentOp(new StopCommand(module, INSTANCE
 				.getDeploymentManager(server)));
@@ -86,7 +85,7 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static SynchronizedDeploymentOp createRedeployCommand(
+	public static IDeploymentCommand createRedeployCommand(
 			IModule module, IServer server) throws CoreException {
 		return new SynchronizedDeploymentOp(new RedeployCommand(module,
 				INSTANCE.getDeploymentManager(server)));
@@ -98,7 +97,7 @@
 	 * @return
 	 * @throws CoreException
 	 */
-	public static SynchronizedDeploymentOp createUndeployCommand(
+	public static IDeploymentCommand createUndeployCommand(
 			IModule module, IServer server) throws CoreException {
 		return new SynchronizedDeploymentOp(new UndeployCommand(module,
 				INSTANCE.getDeploymentManager(server)));

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DistributeCommand.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/commands/DistributeCommand.java?rev=359340&r1=359339&r2=359340&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DistributeCommand.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/DistributeCommand.java
Tue Dec 27 17:17:26 2005
@@ -20,8 +20,10 @@
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.Target;
-import javax.enterprise.deploy.spi.status.ProgressObject;
 
+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;
 
 class DistributeCommand extends AbstractDeploymentCommand {
@@ -35,10 +37,11 @@
 	 * 
 	 * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute()
 	 */
-	public ProgressObject execute() {
+	public IStatus execute(IProgressMonitor monitor) {
 		Target[] targets = getDeploymentManager().getTargets();
 		File jarFile = createJarFile(getModule());
-		return getDeploymentManager().distribute(targets, jarFile, null);
+		return new DeploymentCmdStatus(Status.OK_STATUS,
+				getDeploymentManager().distribute(targets, jarFile, null));
 	}
 
 	/*

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/IDeploymentCommand.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/commands/IDeploymentCommand.java?rev=359340&r1=359339&r2=359340&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/IDeploymentCommand.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/IDeploymentCommand.java
Tue Dec 27 17:17:26 2005
@@ -16,16 +16,17 @@
 package org.apache.geronimo.core.commands;
 
 import javax.enterprise.deploy.shared.CommandType;
-import javax.enterprise.deploy.spi.status.ProgressObject;
 
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.wst.server.core.IModule;
 
 public interface IDeploymentCommand {
-	
-	public ProgressObject execute();
-	
+
+	public IStatus execute(IProgressMonitor monitor);
+
 	public CommandType getCommandType();
-	
+
 	public IModule getModule();
 
 }

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/RedeployCommand.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/commands/RedeployCommand.java?rev=359340&r1=359339&r2=359340&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/RedeployCommand.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/RedeployCommand.java
Tue Dec 27 17:17:26 2005
@@ -20,8 +20,10 @@
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.status.ProgressObject;
 
+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;
 
 class RedeployCommand extends AbstractDeploymentCommand {
@@ -35,12 +37,13 @@
 	 * 
 	 * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute()
 	 */
-	public ProgressObject execute() {
+	public IStatus execute(IProgressMonitor monitor) {
 		TargetModuleID id = getTargetModuleID(getModule());
 		if (id != null) {
 			File jarFile = createJarFile(getModule());
-			return getDeploymentManager().redeploy(new TargetModuleID[] { id },
-					jarFile, null);
+			return new DeploymentCmdStatus(Status.OK_STATUS,
+					getDeploymentManager().redeploy(
+							new TargetModuleID[] { id }, jarFile, null));
 		}
 		return null;
 	}

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/StartCommand.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/commands/StartCommand.java?rev=359340&r1=359339&r2=359340&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/StartCommand.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/StartCommand.java
Tue Dec 27 17:17:26 2005
@@ -18,15 +18,18 @@
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.status.ProgressObject;
 
+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;
 
 class StartCommand extends AbstractDeploymentCommand {
 
 	TargetModuleID[] ids;
 
-	public StartCommand(TargetModuleID[] ids, IModule module, DeploymentManager dm) {
+	public StartCommand(TargetModuleID[] ids, IModule module,
+			DeploymentManager dm) {
 		super(dm, module);
 		this.ids = ids;
 	}
@@ -36,8 +39,9 @@
 	 * 
 	 * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute()
 	 */
-	public ProgressObject execute() {
-		return getDeploymentManager().start(ids);
+	public IStatus execute(IProgressMonitor monitor) {
+		return new DeploymentCmdStatus(Status.OK_STATUS,
+				getDeploymentManager().start(ids));
 	}
 
 	/*

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/StopCommand.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/commands/StopCommand.java?rev=359340&r1=359339&r2=359340&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/StopCommand.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/StopCommand.java
Tue Dec 27 17:17:26 2005
@@ -18,8 +18,10 @@
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.status.ProgressObject;
 
+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;
 
 class StopCommand extends AbstractDeploymentCommand {
@@ -28,16 +30,18 @@
 		super(dm, module);
 	}
 
-
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute()
 	 */
-	public ProgressObject execute() {
+	public IStatus execute(IProgressMonitor monitor) {
 		TargetModuleID id = getTargetModuleID(getModule());
 		if (id != null) {
-			return getDeploymentManager().stop(new TargetModuleID[] { id });
+			return new DeploymentCmdStatus(Status.OK_STATUS,
+					getDeploymentManager().stop(new TargetModuleID[] { id }));
 		}
-		return null;
+		return new DeploymentCmdStatus(Status.CANCEL_STATUS, null);
 	}
 
 	/*

Copied: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/SynchronizedDeploymentOp.java
(from r359121, geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/SynchronizedDeploymentOp.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/commands/SynchronizedDeploymentOp.java?p2=geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/SynchronizedDeploymentOp.java&p1=geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/SynchronizedDeploymentOp.java&r1=359121&r2=359340&rev=359340&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/operations/SynchronizedDeploymentOp.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/SynchronizedDeploymentOp.java
Tue Dec 27 17:17:26 2005
@@ -1,22 +1,22 @@
-package org.apache.geronimo.core.operations;
+package org.apache.geronimo.core.commands;
 
-import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.status.DeploymentStatus;
 import javax.enterprise.deploy.spi.status.ProgressEvent;
 import javax.enterprise.deploy.spi.status.ProgressListener;
 import javax.enterprise.deploy.spi.status.ProgressObject;
 
-import org.apache.geronimo.core.commands.IDeploymentCommand;
 import org.apache.geronimo.core.internal.DeploymentStatusMessageTranslator;
 import org.apache.geronimo.core.internal.GeronimoPlugin;
 import org.apache.geronimo.core.internal.Trace;
-import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
 
-public class SynchronizedDeploymentOp implements ProgressListener {
+public class SynchronizedDeploymentOp implements ProgressListener,
+		IDeploymentCommand {
 
 	private static final long TIMEOUT = 10000;
 
@@ -26,8 +26,6 @@
 
 	private IStatus status = null;
 
-	private TargetModuleID[] result;
-
 	private IProgressMonitor _monitor = null;
 
 	public SynchronizedDeploymentOp(IDeploymentCommand command) {
@@ -35,30 +33,38 @@
 		this.command = command;
 	}
 
-	public IStatus run(IProgressMonitor monitor)
-			throws CoreException {
-
-		if (monitor == null) {
-			monitor = new NullProgressMonitor();
-		}
+	public IStatus execute(IProgressMonitor monitor) {
 
 		_monitor = monitor;
 
+		if (_monitor == null) {
+			_monitor = new NullProgressMonitor();
+		}
+
 		waitThread = new WaitForNotificationThread();
 		waitThread.start();
-		ProgressObject po = command.execute();
-		po.addProgressListener(this);
 
-		try {
-			waitThread.join();
-		} catch (InterruptedException e) {
-		} finally {
-			po.removeProgressListener(this);
+		IStatus ds = command.execute(_monitor);
+		
+		ProgressObject po = null;
+
+		if (ds instanceof DeploymentCmdStatus) {
+			
+			po = ((DeploymentCmdStatus) ds).getProgressObject();
+
+			po.addProgressListener(this);
+
+			try {
+				waitThread.join();
+			} catch (InterruptedException e) {
+			} finally {
+				po.removeProgressListener(this);
+			}
+
 		}
 
-		result = po.getResultTargetModuleIDs();
+		return new DeploymentCmdStatus(status, po);
 
-		return status;
 	}
 
 	class WaitForNotificationThread extends Thread {
@@ -76,7 +82,8 @@
 		DeploymentStatus deploymentStatus = event.getDeploymentStatus();
 		if (deploymentStatus != null) {
 			String msg = DeploymentStatusMessageTranslator
-					.getTranslatedMessage(event, command.getModule().getProject());
+					.getTranslatedMessage(event, command.getModule()
+							.getProject());
 			Trace.trace(Trace.INFO, msg);
 			_monitor.subTask(msg);
 			if (command.getCommandType() == deploymentStatus.getCommand()) {
@@ -93,8 +100,12 @@
 		}
 	}
 
-	public TargetModuleID[] getResultTargetModuleIDs() {
-		return result;
+	public CommandType getCommandType() {
+		return command.getCommandType();
+	}
+
+	public IModule getModule() {
+		return command.getModule();
 	}
 
 }

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/UndeployCommand.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/commands/UndeployCommand.java?rev=359340&r1=359339&r2=359340&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/UndeployCommand.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/commands/UndeployCommand.java
Tue Dec 27 17:17:26 2005
@@ -18,8 +18,10 @@
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.status.ProgressObject;
 
+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;
 
 class UndeployCommand extends AbstractDeploymentCommand {
@@ -33,12 +35,15 @@
 	 * 
 	 * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute()
 	 */
-	public ProgressObject execute() {
+	public IStatus execute(IProgressMonitor monitor) {
 		TargetModuleID id = getTargetModuleID(getModule());
 		if (id != null) {
-			return getDeploymentManager().undeploy(new TargetModuleID[] { id });
+			return new DeploymentCmdStatus(Status.OK_STATUS,
+					getDeploymentManager()
+							.undeploy(new TargetModuleID[] { id }));
 		}
-		return null;
+		return new DeploymentCmdStatus(Status.OK_STATUS, null);
+
 	}
 
 	/*

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=359340&r1=359339&r2=359340&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
Tue Dec 27 17:17:26 2005
@@ -20,6 +20,7 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.enterprise.deploy.spi.TargetModuleID;
 import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException;
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
@@ -28,8 +29,9 @@
 import javax.management.remote.JMXServiceURL;
 
 import org.apache.geronimo.core.GeronimoConnectionFactory;
+import org.apache.geronimo.core.commands.DeploymentCmdStatus;
 import org.apache.geronimo.core.commands.DeploymentCommandFactory;
-import org.apache.geronimo.core.operations.SynchronizedDeploymentOp;
+import org.apache.geronimo.core.commands.IDeploymentCommand;
 import org.apache.geronimo.gbean.GBeanQuery;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
@@ -225,29 +227,32 @@
 	}
 
 	private void doDeploy(IModule module) throws CoreException {
-		SynchronizedDeploymentOp op = DeploymentCommandFactory
+		IDeploymentCommand op = DeploymentCommandFactory
 				.createDistributeCommand(module, getServer());
-		IStatus status = op.run(_monitor);
+		IStatus status = op.execute(_monitor);
 
 		if (!status.isOK()) {
 			doFail(status, Messages.DISTRIBUTE_FAIL);
 		}
 
-		op = DeploymentCommandFactory.createStartCommand(op
-				.getResultTargetModuleIDs(), module, getServer());
+		if (status instanceof DeploymentCmdStatus) {
+			TargetModuleID[] ids = ((DeploymentCmdStatus) status).getResultTargetModuleIDs();
+ 
+			op = DeploymentCommandFactory.createStartCommand(ids, module, getServer());
 
-		status = op.run(_monitor);
+			status = op.execute(_monitor);
 
-		if (!status.isOK()) {
-			doFail(status, Messages.START_FAIL);
+			if (!status.isOK()) {
+				doFail(status, Messages.START_FAIL);
+			}
 		}
 	}
 
 	private void doRedeploy(IModule module) throws CoreException {
-		SynchronizedDeploymentOp op = DeploymentCommandFactory
-				.createRedeployCommand(module, getServer());
+		IDeploymentCommand op = DeploymentCommandFactory.createRedeployCommand(
+				module, getServer());
 
-		IStatus status = op.run(_monitor);
+		IStatus status = op.execute(_monitor);
 
 		if (!status.isOK()) {
 			doFail(status, Messages.REDEPLOY_FAIL);
@@ -256,10 +261,10 @@
 
 	private void doUndeploy(IModule module) throws CoreException,
 			DeploymentManagerCreationException {
-		SynchronizedDeploymentOp op = DeploymentCommandFactory
-				.createStopCommand(module, getServer());
+		IDeploymentCommand op = DeploymentCommandFactory.createStopCommand(
+				module, getServer());
 
-		IStatus status = op.run(_monitor);
+		IStatus status = op.execute(_monitor);
 
 		if (!status.isOK()) {
 			doFail(status, Messages.STOP_FAIL);
@@ -268,7 +273,7 @@
 		op = DeploymentCommandFactory
 				.createUndeployCommand(module, getServer());
 
-		status = op.run(_monitor);
+		status = op.execute(_monitor);
 
 		if (!status.isOK()) {
 			doFail(status, Messages.UNDEPLOY_FAIL);



Mime
View raw message