Author: adietish
Date: 2011-04-14 09:54:56 -0400 (Thu, 14 Apr 2011)
New Revision: 30575
Modified:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/DetypedDeployer.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/DetypedDeployerIntegrationTest.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/internal/TypedDeployer.java
Log:
added redeploy capability to detyped deployer
Modified:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/internal/TypedDeployer.java
===================================================================
---
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/internal/TypedDeployer.java 2011-04-14
13:50:42 UTC (rev 30574)
+++
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/internal/TypedDeployer.java 2011-04-14
13:54:56 UTC (rev 30575)
@@ -70,7 +70,24 @@
}
}
-//
+ public static void replace(File file, String host, int port) throws DeployerException {
+ ModelControllerClient client = null;
+ try {
+ client = ModelControllerClient.Factory.create(host, port);
+ ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client);
+ InitialDeploymentPlanBuilder builder = manager.newDeploymentPlan();
+
+ String name = file.getName();
+ DeploymentPlan plan = builder.replace(name, file).deploy(name).build();
+ manager.execute(plan).get(TIMEOUT, TimeUnit.MILLISECONDS);
+ } catch(Exception e) {
+ throw new DeployerException(e);
+ } finally {
+ StreamUtils.safeClose(client);
+ }
+ }
+
+ //
// public static boolean isDeployed(String name, String host, int port) throws
CancellationException, IOException {
// ModelControllerClient client = ModelControllerClient.Factory.create(host, port);
// try {
Modified:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/DetypedDeployer.java
===================================================================
---
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/DetypedDeployer.java 2011-04-14
13:50:42 UTC (rev 30574)
+++
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/DetypedDeployer.java 2011-04-14
13:54:56 UTC (rev 30575)
@@ -89,7 +89,7 @@
}
}
- public static void redeploy(File file, String host, int port) throws DeployerException
{
+ public static void replace(File file, String host, int port) throws DeployerException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
Modified:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/DetypedDeployerIntegrationTest.java
===================================================================
---
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/DetypedDeployerIntegrationTest.java 2011-04-14
13:50:42 UTC (rev 30574)
+++
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/DetypedDeployerIntegrationTest.java 2011-04-14
13:54:56 UTC (rev 30575)
@@ -79,7 +79,7 @@
File warFile = DeployerTestUtils.getWarFile(MINIMALISTIC_WAR);
try {
DetypedDeployer.deploy(warFile, HOST, MGMT_PORT);
- DetypedDeployer.redeploy(warFile, HOST, MGMT_PORT);
+ DetypedDeployer.replace(warFile, HOST, MGMT_PORT);
} finally {
quietlyUndeploy(warFile);
}
Show replies by date