Author: tveronezi
Date: Fri Aug 17 20:16:00 2012
New Revision: 1374420
URL: http://svn.apache.org/viewvc?rev=1374420&view=rev
Log:
https://issues.apache.org/jira/browse/TOMEE-228
Undeploy applications
Modified:
openejb/trunk/openejb/tomee/tomee-webapp/src/main/java/org/apache/tomee/webapp/command/impl/DeployApplication.java
Modified:
openejb/trunk/openejb/tomee/tomee-webapp/src/main/java/org/apache/tomee/webapp/command/impl/DeployApplication.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-webapp/src/main/java/org/apache/tomee/webapp/command/impl/DeployApplication.java?rev=1374420&r1=1374419&r2=1374420&view=diff
==============================================================================
---
openejb/trunk/openejb/tomee/tomee-webapp/src/main/java/org/apache/tomee/webapp/command/impl/DeployApplication.java
(original)
+++
openejb/trunk/openejb/tomee/tomee-webapp/src/main/java/org/apache/tomee/webapp/command/impl/DeployApplication.java
Fri Aug 17 20:16:00 2012
@@ -31,13 +31,25 @@ public class DeployApplication implement
@Override
public Object execute(Params params) throws Exception {
- final AppInfo info = deployer.deploy(params.getString("path"));
+ final String path = params.getString("path");
- // the path is translated from the parameter to a file path
- // the input can be "mvn:org.superbiz/rest-example.1.0/war" for
instance or an http url
- final Map<String, Object> json = new HashMap<String, Object>();
- json.put("path", info.path);
- json.put("appId", info.appId);
- return json;
+ if (params.getBoolean("undeploy")) {
+ deployer.undeploy(path);
+
+ final Map<String, Object> json = new HashMap<String, Object>();
+ json.put("path", path);
+ json.put("undeployed", Boolean.TRUE);
+ return json;
+
+ } else {
+ final AppInfo info = deployer.deploy(path);
+
+ // the path is translated from the parameter to a file path
+ // the input can be "mvn:org.superbiz/rest-example.1.0/war" for
instance or an http url
+ final Map<String, Object> json = new HashMap<String, Object>();
+ json.put("path", info.path);
+ json.put("appId", info.appId);
+ return json;
+ }
}
}