[jboss-as7-dev] Programmable deploying HOWTO

Dominik Pospisil dpospisi at redhat.com
Mon Oct 24 11:07:46 EDT 2011


Really quick example:

		 File deployment = new File("pathToYourDeployment");

        ModelNode addDeploymentOp = createOpNode("deployment=deployment.war", "add");
        addDeploymentOp.get("content").get(0).get("input-stream-index").set(0);
        
        DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
        builder.setOperationName("deploy");
        builder.addNode("deployment", "deployment.war");

        
        ModelNode[] steps = new ModelNode[2];
        steps[0] = addDeploymentOp;
        steps[1] = builder.buildRequest();


        ModelNode compositeOp = new ModelNode();
        compositeOp.get("operation").set("composite");
        for(ModelNode step : steps) {
            compositeOp.get("steps").add(step);
        }
        
        OperationBuilder ob = new OperationBuilder(compositeOp);
        ob.addInputStream(new FileInputStream(deployment));
        
        modelControllerClient.execute(ob.build());


- Dominik




On Monday, October 24, 2011 09:47:29 Pavel Janousek wrote:
> Hello,
> 
> is there any useful guide or some more specific docs for programmable
> deploying of some EAR/JAR etc.? I've understood which options I have for to
> do this. I prefer a way via ModelControllerClient => the same way as CLI
> works.
> 
> I think I've grasped what and how CLI works and does deploy/undeploy some -
> let say WAR artifact (= WebApp for ex.) and I can extract code technique
> from it. But if there is more elegant and better way which depends only on
> a small number of AS7 artifacts, it will be great.
> 
> I need this because I'll develop some performance tests for RESTEasy
> sub-system, including WebApp deploying time etc.
> 
> I think, the second reasonable way (with comparable overhead as previous) to
> do thing like this is use the HTTP deploying management, but I didn't found
> any docs about this.
> 
> Could you please point me out to some useful info or example for study?
> 
> Thank you,
> 
> --
> Pavel Janousek
> Senior JBoss QA Engineer
> 
> 
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-as7-dev/attachments/20111024/53b02401/attachment.html 


More information about the jboss-as7-dev mailing list