本文整理汇总了Java中org.jboss.as.controller.client.helpers.domain.DomainDeploymentManager类的典型用法代码示例。如果您正苦于以下问题:Java DomainDeploymentManager类的具体用法?Java DomainDeploymentManager怎么用?Java DomainDeploymentManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DomainDeploymentManager类属于org.jboss.as.controller.client.helpers.domain包,在下文中一共展示了DomainDeploymentManager类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDeploymentManager
import org.jboss.as.controller.client.helpers.domain.DomainDeploymentManager; //导入依赖的package包/类
@Override
public DomainDeploymentManager getDeploymentManager() {
if (deploymentManager == null) {
synchronized (this) {
if (deploymentManager == null) {
deploymentManager = new DomainDeploymentManagerImpl(this);
}
}
}
return deploymentManager;
}
示例2: executePlan
import org.jboss.as.controller.client.helpers.domain.DomainDeploymentManager; //导入依赖的package包/类
private void executePlan(final DomainDeploymentManager manager, final DeploymentPlan plan)
throws DeploymentExecutionException, ExecutionException, InterruptedException
{
if (plan.getDeploymentActions().size() > 0)
{
final DeploymentPlanResult planResult = manager.execute(plan).get();
final Map<UUID, DeploymentActionResult> actionResults = planResult
.getDeploymentActionResults();
for (UUID uuid : actionResults.keySet())
{
final Map<String, ServerGroupDeploymentActionResult> groupDeploymentActionResults = actionResults
.get(uuid).getResultsByServerGroup();
for (String serverGroup2 : groupDeploymentActionResults.keySet())
{
final Map<String, ServerUpdateResult> serverUpdateResults = groupDeploymentActionResults
.get(serverGroup2).getResultByServer();
for (String server : serverUpdateResults.keySet())
{
final Throwable t = serverUpdateResults.get(server).getFailureResult();
if (t != null)
{
throw new DeploymentExecutionException(t, "Error executing %s", type);
}
}
}
}
}
}
示例3: testGracefulShutdownDomainLevel
import org.jboss.as.controller.client.helpers.domain.DomainDeploymentManager; //导入依赖的package包/类
@Test
public void testGracefulShutdownDomainLevel() throws Exception {
DomainClient client = domainMasterLifecycleUtil.getDomainClient();
DomainDeploymentManager deploymentManager = client.getDeploymentManager();
DeploymentPlan plan = deploymentManager.newDeploymentPlan().add(WEB_SUSPEND_JAR, createDeployment().as(ZipExporter.class).exportAsInputStream())
.andDeploy().toServerGroup(MAIN_SERVER_GROUP)
.build();
deploymentManager.execute(plan).get();
final String address = "http://" + TestSuiteEnvironment.getServerAddress() + ":8080/web-suspend";
ExecutorService executorService = Executors.newSingleThreadExecutor();
try {
Future<Object> result = executorService.submit(new Callable<Object>() {
@Override
public Object call() throws Exception {
return HttpRequest.get(address, 60, TimeUnit.SECONDS);
}
});
Thread.sleep(1000); //nasty, but we need to make sure the HTTP request has started
ModelNode op = new ModelNode();
op.get(ModelDescriptionConstants.OP).set("stop-servers");
op.get(ModelDescriptionConstants.TIMEOUT).set(60);
op.get(ModelDescriptionConstants.BLOCKING).set(false);
client.execute(op);
//make sure requests are being rejected
final HttpURLConnection conn = (HttpURLConnection) new URL(address).openConnection();
try {
conn.setDoInput(true);
int responseCode = conn.getResponseCode();
Assert.assertEquals(503, responseCode);
} finally {
conn.disconnect();
}
//make sure the server is still up, and trigger the actual shutdown
HttpRequest.get(address + "?" + TestUndertowService.SKIP_GRACEFUL + "=true", 10, TimeUnit.SECONDS);
Assert.assertEquals(SuspendResumeHandler.TEXT, result.get());
//make sure our initial request completed
Assert.assertEquals(SuspendResumeHandler.TEXT, result.get());
} finally {
plan = deploymentManager.newDeploymentPlan().undeploy(WEB_SUSPEND_JAR)
.andRemoveUndeployed()
.toServerGroup(MAIN_SERVER_GROUP)
.build();
deploymentManager.execute(plan).get();
}
}
示例4: ArchiveDeployer
import org.jboss.as.controller.client.helpers.domain.DomainDeploymentManager; //导入依赖的package包/类
/**
* Creates a new deployer.
*
* @param deploymentManager the deployment manager to use
*
* @see #ArchiveDeployer(ManagementClient)
* @deprecated the {@link DomainDeploymentManager} will no longer be used in future releases, use the
* {@link #ArchiveDeployer(ManagementClient)} constructor
*/
@Deprecated
public ArchiveDeployer(DomainDeploymentManager deploymentManager) {
Assert.checkNotNullParam("deploymentManager", deploymentManager);
this.deploymentManagerDeprecated = deploymentManager;
this.deploymentManager = null;
}