本文整理汇总了Java中org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult类的典型用法代码示例。如果您正苦于以下问题:Java ServerDeploymentActionResult类的具体用法?Java ServerDeploymentActionResult怎么用?Java ServerDeploymentActionResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServerDeploymentActionResult类属于org.jboss.as.controller.client.helpers.standalone包,在下文中一共展示了ServerDeploymentActionResult类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult; //导入依赖的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.ServerDeploymentActionResult; //导入依赖的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.ServerDeploymentActionResult; //导入依赖的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.ServerDeploymentActionResult; //导入依赖的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: getActionResult
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult; //导入依赖的package包/类
private ServerDeploymentActionResult getActionResult(UUID actionId, ModelNode actionResultNode) {
ServerDeploymentActionResult actionResult = null;
String outcome = actionResultNode.hasDefined("outcome") ? actionResultNode.get("outcome").asString() : null;
if (outcome == null || "cancelled".equals(outcome)) {
actionResult = new SimpleServerDeploymentActionResult(actionId, Result.NOT_EXECUTED);
} else if ("failed".equals(outcome)) {
Exception e = actionResultNode.hasDefined("failure-description") ? new Exception(actionResultNode.get("failure-description").toString()) : null;
if (actionResultNode.hasDefined("rolled-back") && actionResultNode.get("rolled-back").asBoolean()) {
if (e == null) {
actionResult = new SimpleServerDeploymentActionResult(actionId, Result.ROLLED_BACK);
} else {
actionResult = new SimpleServerDeploymentActionResult(actionId, Result.ROLLED_BACK, e);
}
} else {
actionResult = new SimpleServerDeploymentActionResult(actionId, e);
}
} else {
actionResult = new SimpleServerDeploymentActionResult(actionId, Result.EXECUTED);
}
// FIXME deal with shutdown possibilities
return actionResult;
}
示例6: getResultFromNode
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult; //导入依赖的package包/类
private ServerDeploymentPlanResult getResultFromNode(ModelNode planResultNode) {
UUID planId = plan.getId();
Map<UUID, ServerDeploymentActionResult> actionResults = new HashMap<UUID, ServerDeploymentActionResult>();
List<DeploymentActionImpl> actions = plan.getDeploymentActionImpls();
for (int i = 0; i < actions.size(); i++) {
DeploymentActionImpl action = actions.get(i);
UUID actionId = action.getId();
ModelNode actionResultNode = planResultNode.get("step-" + (i + 1));
actionResults.put(actionId, getActionResult(actionId, actionResultNode));
}
return new DeploymentPlanResultImpl(planId, actionResults);
}
示例7: DeploymentPlanResultImpl
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult; //导入依赖的package包/类
public DeploymentPlanResultImpl(UUID planId, Map<UUID, ServerDeploymentActionResult> actionResults) {
Assert.checkNotNullParam("planId", planId);
Assert.checkNotNullParam("actionResults", actionResults);
this.planId = planId;
this.actionResults = actionResults;
}
示例8: getDeploymentActionResult
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult; //导入依赖的package包/类
@Override
public ServerDeploymentActionResult getDeploymentActionResult(UUID deploymentAction) {
return actionResults.get(deploymentAction);
}