Deployment 除了热部署,在jboss服务器中部署还有其他选项吗?

Deployment 除了热部署,在jboss服务器中部署还有其他选项吗?,deployment,jboss,Deployment,Jboss,我想知道除了热部署以外,在jboss服务器上部署的方法有哪些。只有在jboss运行时,部署才被认为是热的。如果不想进行热部署,可以关闭部署扫描程序[1]或停止JBoss并部署工件 [1] https://community.jboss.org/wiki/ConfiguringTheDeploymentScannerInConfjbossSystemxml 让客户和建筑商制定计划: ModelControllerClient client = ModelControllerClient.Fact

我想知道除了热部署以外,在jboss服务器上部署的方法有哪些。

只有在jboss运行时,部署才被认为是热的。如果不想进行热部署,可以关闭部署扫描程序[1]或停止JBoss并部署工件

[1] https://community.jboss.org/wiki/ConfiguringTheDeploymentScannerInConfjbossSystemxml

让客户和建筑商制定计划:

ModelControllerClient client = ModelControllerClient.Factory.create(host, port);
ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client);
DeploymentPlanBuilder builder = manager.newDeploymentPlan();
执行任何类型操作的方法在这里实现了一些操作:

public DeployementActionStatus execute(Type deploy) throws IOException
{
    List<Throwable> errors = new LinkedList<Throwable>();
    DeployementActionStatus status = DeployementActionStatus.SUCCESS;

    switch (deploy)
    {
    case DEPLOY:
        if (archive != null)
        {
            plan = builder.add(archive).deploy(archive.getName()).build();
        }
        else
        {
            return DeployementActionStatus.FAILURE;
        }

        break;
    case REDEPLOY:
    {
        if (archive != null)
        {
            plan = builder.redeploy(archive.getName()).build();
        }
        else
        {
            return DeployementActionStatus.FAILURE;
        }

        break;
    }
    case UNDEPLOY:
    {
        plan = builder.undeploy(getApplicationName()).build();
        break;
    }
    case REMOVE:
    {
        plan = builder.remove(getApplicationName()).build();
        break;
    }

    default:
        plan = null;
        break;
    }
    if (plan == null)
    {
        throw new IllegalStateException("Invalid type: " + deploy);
    }

    if (plan.getDeploymentActions().size() > 0)
    {
        try
        {
            final ServerDeploymentPlanResult planResult = manager.execute(plan).get();

            // Check the results
            for (DeploymentAction action : plan.getDeploymentActions())
            {
                final ServerDeploymentActionResult actionResult = planResult.getDeploymentActionResult(action
                        .getId());
                final ServerUpdateActionResult.Result result = actionResult.getResult();
                switch (result)
                {
                case FAILED:
                case NOT_EXECUTED:
                case ROLLED_BACK:
                {
                    log.error(actionResult.getDeploymentException());
                    if (actionResult.getDeploymentException().getMessage() != null
                            && actionResult.getDeploymentException().getMessage().contains("Duplicate"))
                    {
                        status = DeployementActionStatus.FAILURE_ALREADY_DEPLOYED;
                    }
                    else
                    {
                        status = DeployementActionStatus.FAILURE;
                    }
                    break;
                }
                case CONFIGURATION_MODIFIED_REQUIRES_RESTART:
                    // Should show warning
                    break;
                default:
                    break;
                }
            }

        }
        catch (InterruptedException e)
        {
            errors.add(e);
            status = DeployementActionStatus.FAILURE;
        }
        catch (ExecutionException e)
        {
            errors.add(e);
            status = DeployementActionStatus.FAILURE;
        }
        catch (Exception e)
        {
            if (e instanceof RuntimeException)
            {
                status = DeployementActionStatus.CONNECTION_TO_SERVER_FAILED;
            }
        }
    }
    return status;
}