You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by sp...@apache.org on 2006/10/06 16:09:45 UTC
svn commit: r453604 - in
/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands:
RedeployCommand.java UndeployCommand.java
Author: sppatel
Date: Fri Oct 6 07:09:44 2006
New Revision: 453604
URL: http://svn.apache.org/viewvc?view=rev&rev=453604
Log:
get configId from map first, then from plan
Modified:
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/UndeployCommand.java
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?view=diff&rev=453604&r1=453603&r2=453604
==============================================================================
--- 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 Fri Oct 6 07:09:44 2006
@@ -19,6 +19,7 @@
import javax.enterprise.deploy.spi.TargetModuleID;
import org.apache.geronimo.st.core.DeploymentUtils;
+import org.apache.geronimo.st.core.IGeronimoServer;
import org.apache.geronimo.st.core.ModuleArtifactMapper;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -40,8 +41,19 @@
*/
public IStatus execute(IProgressMonitor monitor) throws TargetModuleIdNotFoundException, CoreException {
String configId = ModuleArtifactMapper.getInstance().resolve(getServer(), getModule());
- TargetModuleID id = DeploymentUtils.getTargetModuleID(getDeploymentManager(), configId);
- return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().redeploy(new TargetModuleID[] { id }, getTargetFile(), null));
+
+ if(configId == null) {
+ IGeronimoServer gs = (IGeronimoServer) getServer().getAdapter(IGeronimoServer.class);
+ configId = gs.getVersionHandler().getConfigID(getModule());
+ }
+
+ TargetModuleID[] ids = null;
+ if(configId != null) {
+ TargetModuleID id = DeploymentUtils.getTargetModuleID(getDeploymentManager(), configId);
+ ids = new TargetModuleID[] {id};
+ }
+
+ return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().redeploy(ids, getTargetFile(), null));
}
/*
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?view=diff&rev=453604&r1=453603&r2=453604
==============================================================================
--- 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 Fri Oct 6 07:09:44 2006
@@ -19,6 +19,8 @@
import javax.enterprise.deploy.spi.TargetModuleID;
import org.apache.geronimo.st.core.DeploymentUtils;
+import org.apache.geronimo.st.core.IGeronimoServer;
+import org.apache.geronimo.st.core.ModuleArtifactMapper;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -38,7 +40,18 @@
* @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
*/
public IStatus execute(IProgressMonitor monitor) throws TargetModuleIdNotFoundException, CoreException {
- TargetModuleID id = DeploymentUtils.getTargetModuleID(getServer(), getModule());
+ String configId = ModuleArtifactMapper.getInstance().resolve(getServer(), getModule());
+
+ if(configId == null) {
+ IGeronimoServer gs = (IGeronimoServer) getServer().getAdapter(IGeronimoServer.class);
+ configId = gs.getVersionHandler().getConfigID(getModule());
+ }
+
+ if(configId == null) {
+ //TODO Throw exception or handle TargetModuleIdNotFoundException in parent
+ }
+
+ TargetModuleID id = DeploymentUtils.getTargetModuleID(getDeploymentManager(), configId);
return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().undeploy(new TargetModuleID[] { id }));
}