JBoss Community

AS 7 Deployment APIs

reply from Alexey Loubyansky in JBoss AS7 Development - View the full discussion

Looks good!

DeploymentPlan plan = deploymentManager.newDeploymentPlan()

                                       .withGlobalRollback()

                                       .add(war).andDeploy()

                                       .add(ear).andDeploy();

 

The main part of the API is in the Builder interfaces that start from the return value from StandaloneDeploymentManager.newDeploymentPlan(). There are five basic operations:

 

  • add -- makes deployment content available to the standalone server or to the domain controller
  • deploy -- instruction that previously added content should be deployed on a standalone server or to one or more server groups
  • undeploy -- instruction that previously deployed content should be undeployed from a standalone server or from one or more server groups
  • replace -- atomic deply+undeploy. So if rollback is enabled and deploying the new content fails, the old content would be deployed
  • remove -- remove no longer deployed content from the repository where the standalone server or domain controller keeps content.

 

I tried to create a fluent API so following one directive to the builder, logically coherent other directives become available, e.g.

 

add(war).andDeploy()

Wouldn't having deploy([name,] war) be simpler? Same for replace.

Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community