本文整理汇总了Java中org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager.execute方法的典型用法代码示例。如果您正苦于以下问题:Java ServerDeploymentManager.execute方法的具体用法?Java ServerDeploymentManager.execute怎么用?Java ServerDeploymentManager.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager
的用法示例。
在下文中一共展示了ServerDeploymentManager.execute方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
@Override
public void setup(final ManagementClient managementClient, final String containerId) throws Exception {
final ServerDeploymentManager manager = ServerDeploymentManager.Factory
.create(managementClient.getControllerClient());
final DeploymentPlan plan = manager.newDeploymentPlan()
.add(new File("src/test/resources/isolations/" + TEST_DS_XML)).andDeploy().build();
final Future<ServerDeploymentPlanResult> future = manager.execute(plan);
final ServerDeploymentPlanResult result = future.get(20, SECONDS);
final ServerDeploymentActionResult actionResult = result.getDeploymentActionResult(plan.getId());
if (actionResult != null) {
final Throwable deploymentException = actionResult.getDeploymentException();
if (deploymentException != null) {
throw new RuntimeException(deploymentException);
}
}
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:17,代码来源:ReadUncommittedTestCase.java
示例2: setup
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
@Override
public void setup(final ManagementClient managementClient, final String containerId) throws Exception {
final ServerDeploymentManager manager = ServerDeploymentManager.Factory
.create(managementClient.getControllerClient());
final DeploymentPlan plan = manager.newDeploymentPlan()
.add(new File("src/test/resources/distributed/" + TEXTS_DS_XML)).andDeploy().build();
final Future<ServerDeploymentPlanResult> future = manager.execute(plan);
final ServerDeploymentPlanResult result = future.get(20, SECONDS);
final ServerDeploymentActionResult actionResult = result.getDeploymentActionResult(plan.getId());
if (actionResult != null) {
final Throwable deploymentException = actionResult.getDeploymentException();
if (deploymentException != null) {
throw new RuntimeException(deploymentException);
}
}
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:17,代码来源:DistributedTestCase.java
示例3: setup
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
@Override
public void setup(final ManagementClient managementClient, final String containerId) throws Exception {
copy(new File("src/test/resources/application-users.properties").toPath(),
new File("target/wildfly-10.1.0.Final/standalone/configuration/application-users.properties")
.toPath(),
REPLACE_EXISTING);
copy(new File("src/test/resources/application-roles.properties").toPath(),
new File("target/wildfly-10.1.0.Final/standalone/configuration/application-roles.properties")
.toPath(),
REPLACE_EXISTING);
final ServerDeploymentManager manager = ServerDeploymentManager.Factory
.create(managementClient.getControllerClient());
final DeploymentPlan plan = manager.newDeploymentPlan().add(new File("src/test/resources/" + FORUMS_DS_XML))
.andDeploy().build();
final Future<ServerDeploymentPlanResult> future = manager.execute(plan);
final ServerDeploymentPlanResult result = future.get(20, SECONDS);
final ServerDeploymentActionResult actionResult = result.getDeploymentActionResult(plan.getId());
if (actionResult != null) {
final Throwable deploymentException = actionResult.getDeploymentException();
if (deploymentException != null) {
throw new RuntimeException(deploymentException);
}
}
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:25,代码来源:ApplicationTestCase.java
示例4: deploy
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
private static void deploy(ServerDeploymentManager deploymentManager, String runtimeName, InputStream input) throws Throwable {
ServerDeploymentPlanResult planResult;
List<DeploymentAction> actions = new ArrayList<>();
DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
AddDeploymentPlanBuilder addBuilder = builder.add(runtimeName, input);
actions.add(addBuilder.getLastAction());
builder = addBuilder.andDeploy();
actions.add(builder.getLastAction());
DeploymentPlan plan = builder.build();
Future<ServerDeploymentPlanResult> future = deploymentManager.execute(plan);
planResult = future.get();
for (DeploymentAction action : actions) {
ServerDeploymentActionResult actionResult = planResult.getDeploymentActionResult(action.getId());
if (actionResult.getDeploymentException() != null) {
throw actionResult.getDeploymentException();
}
}
}
示例5: undeployAndRemoveDeployment
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
private void undeployAndRemoveDeployment(String deploymentName) {
final ModelControllerClient client = managementClient.getControllerClient();
final ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client);
Future<ServerDeploymentPlanResult> future = manager.execute(manager.newDeploymentPlan()
.undeploy(deploymentName)
.remove(deploymentName)
.build());
awaitDeploymentExecution(future);
File deploymentFile = new File("target/archives/" + deploymentName);
if (deploymentFile.exists()) {
cleanFile(deploymentFile);
}
}
示例6: testDeployment
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
@Test
public void testDeployment() throws Exception {
final ModelControllerClient client = managementClient.getControllerClient();
final ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client);
//Deploy
Future<?> future = manager.execute(
manager.newDeploymentPlan().add(testDeploymentFile.getName(), testDeploymentFile.getFile()).deploy(testDeploymentFile.getName()).build());
awaitDeploymentExecution(future);
//Check there
ModelNode findDeployment = Util.createEmptyOperation(READ_RESOURCE_OPERATION,
PathAddress.pathAddress(DEPLOYMENT, testDeploymentFile.getName()));
Assert.assertTrue(
managementClient.executeForResult(findDeployment).isDefined());
//Undeploy
future = manager.execute(manager.newDeploymentPlan().undeploy(testDeploymentFile.getName()).remove(testDeploymentFile.getName()).build());
awaitDeploymentExecution(future);
//Check deployment is gone
ModelNode result = client.execute(findDeployment);
Assert.assertEquals(FAILED, result.get(OUTCOME).asString());
}
示例7: testUniqueRuntimeName
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
@Test
public void testUniqueRuntimeName() throws Exception {
final JavaArchive archive1 = ServiceActivatorDeploymentUtil.createServiceActivatorDeploymentArchive("test-deployment1.jar", properties);
final JavaArchive archive2 = ServiceActivatorDeploymentUtil.createServiceActivatorDeploymentArchive("test-deployment2.jar", properties2);
archive2.addAsManifestResource(DeploymentTestCase.class.getPackage(), "marker.txt", "marker.txt");
final ModelControllerClient client = managementClient.getControllerClient();
final ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client);
try (InputStream is1 = archive1.as(ZipExporter.class).exportAsInputStream();
InputStream is2 = archive2.as(ZipExporter.class).exportAsInputStream();) {
Future<?> future = manager.execute(manager.newDeploymentPlan()
.add("test-deployment1.jar", "test-deployment.jar", is1)
.add("test-deployment2.jar", "test-deployment.jar", is2)
.build());
awaitDeploymentExecution(future);
checkDeploymentStatus(client, "test-deployment1.jar", "STOPPED");
checkDeploymentStatus(client, "test-deployment2.jar", "STOPPED");
future = manager.execute(manager.newDeploymentPlan().deploy("test-deployment1.jar").build());
awaitDeploymentExecution(future);
future = manager.execute(manager.newDeploymentPlan().deploy("test-deployment2.jar").build());
awaitDeploymentExecution(future);
checkDeploymentStatus(client, "test-deployment1.jar", "OK");
checkDeploymentStatus(client, "test-deployment2.jar", "STOPPED");
future = manager.execute(manager.newDeploymentPlan()
.undeploy("test-deployment1.jar")
.remove("test-deployment1.jar")
.undeploy("test-deployment2.jar")
.remove("test-deployment2.jar")
.build());
awaitDeploymentExecution(future);
}
}
示例8: cleanUp
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
private void cleanUp(String deployment) {
ModelNode op = new ModelNode();
op.get(OP).set(READ_RESOURCE_OPERATION);
op.get(OP_ADDR).set(ModelDescriptionConstants.DEPLOYMENT, deployment);
ModelControllerClient client = managementClient.getControllerClient();
ModelNode result;
try {
result = client.execute(op);
} catch (IOException e) {
throw new RuntimeException(e);
}
if (result != null && Operations.isSuccessfulOutcome(result)) {
ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client);
Future<?> future = manager.execute(manager.newDeploymentPlan()
.undeploy(deployment)
.remove(deployment)
.build());
awaitDeploymentExecution(future);
}
String jbossBaseDir = System.getProperty("jboss.home");
Assert.assertNotNull(jbossBaseDir);
Path dataDir = new File(jbossBaseDir).toPath().resolve("standalone").resolve("data");
if (Files.exists(dataDir)) { cleanFile(dataDir.resolve("managed-exploded").toFile()); }
File archivesDir = new File("target", "archives");
if (Files.exists(archivesDir.toPath())) { cleanFile(archivesDir); }
}
示例9: explodeDeploymentContentAndGetOutcome
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
private boolean explodeDeploymentContentAndGetOutcome(String deploymentName, String archivePath) throws IOException {
final ModelControllerClient client = managementClient.getControllerClient();
final ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client);
DeploymentPlan plan = manager.newDeploymentPlan()
.undeploy(deploymentName)
.explodeDeploymentContent(deploymentName, archivePath)
.deploy(deploymentName)
.build();
Future<ServerDeploymentPlanResult> future = manager.execute(plan);
return awaitDeploymentExecution(future).getDeploymentActionResult(plan.getDeploymentActions().get(plan.getDeploymentActions().size() - 1).getId()).getResult() == ServerUpdateActionResult.Result.EXECUTED;
}
示例10: addDeployment
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
private void addDeployment() throws IOException {
final ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(managementClient.getControllerClient());
final JavaArchive archive = ServiceActivatorDeploymentUtil.createServiceActivatorDeploymentArchive(
"test-http-deployment.jar", properties);
try (InputStream is = archive.as(ZipExporter.class).exportAsInputStream()) {
Future<?> future = manager.execute(manager.newDeploymentPlan()
.add("test-http-deployment.jar", is)
.build());
awaitDeploymentExecution(future);
}
}
示例11: safeGet
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
private static void safeGet(ServerDeploymentManager sdm, DeploymentPlan plan) {
Future<ServerDeploymentPlanResult> future = sdm.execute(plan);
try {
future.get();
} catch (Exception ignored) {
// ignore
}
}
示例12: safeGetWithTimeout
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
private static void safeGetWithTimeout(ServerDeploymentManager sdm, DeploymentPlan plan) {
Future<ServerDeploymentPlanResult> future = sdm.execute(plan);
try {
future.get(1L, TimeUnit.MILLISECONDS);
} catch (Exception ignored) {
// ignore
}
}
示例13: safeCancel
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
private static void safeCancel(ServerDeploymentManager sdm, DeploymentPlan plan) {
Future<ServerDeploymentPlanResult> future = sdm.execute(plan);
try {
future.cancel(true);
} catch (Exception ignored) {
// ignore
}
}
示例14: removeDeployment
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager; //导入方法依赖的package包/类
private void removeDeployment() {
final ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(managementClient.getControllerClient());
Future<?> future = manager.execute(manager.newDeploymentPlan().remove("test-deployment.jar").build());
awaitDeploymentExecution(future);
}