6 Replies Latest reply on Sep 17, 2012 4:30 AM by pragalathan

    JBoss6 MainDeployer equivalent in Jboss as7?

    pragalathan

      Hi,

      I'm working on Netbeans-JBoss AS7 Integration. Im struck with RMI concepts. Netbeans uses RMI to manage the app servers.

      I see that it is all together changed between Jboss6 and 7. I could find the JBoss6 jboss.system:type=ServerConfig equivalent for Jboss7 as jboss.as:core-service=server-environment, to get the information about the server instance.

       

      For querying deployment information, in JBoss6 the following commands are used.

      MBeanServerConnection.invoke(new ObjectName("jboss.system:service=MainDeployer"),"getDeployment", new Object[] {deployedFile.getCanonicalFile().toURL()} , new String[] {"java.net.URL"});

       

      I could not find JBoss 7 counter part. Is there a detailed RMI documentaion for Jboss7?

      I read from the forum that RMI is not the backbone for JBoss7(https://community.jboss.org/message/743999#743999). However, changing the entire (Jboss-Netbeans) module wont be a good idea at this juncture.

      Any help is appreciated.

       

       

       

        • 1. Re: JBoss6 MainDeployer equivalent in Jboss as7?
          wdfink

          JBoss AS7 is a (mostly) new implementation so everything might be different.

          So what you want to achieve? Most of the administration can be managed by the CLI or even the management API.

          • 2. Re: JBoss6 MainDeployer equivalent in Jboss as7?
            alesj

            Perhaps look at how IntelliJ does it (afaik, it's oss), or how Arquillian remote container is impled.

            • 3. Re: JBoss6 MainDeployer equivalent in Jboss as7?
              pragalathan

              @Wolf-Dieter Fink

              Thanks for the reply.

              Netbeans has a functionality to

              • register a jboss server instance
              • start/stop server
              • deploy/undeploy modules
              • run server in debug mode, etc

               

              The entire idea behind this, is built on RMI. Becaue of this, JBoss As 7 is not recognized as a valid server. So I have modified the plugin code (http://netbeans.org/bugzilla/show_bug.cgi?id=200132) to register, start and stop the new AS 7.

              However, the remaining part of the code looks for certain RMI attributes/operation (such as the one I asked) for deployment management.

               

              I clearly understand that CLI is the best way to handle this. However, at this point, rewriting the entire plugin may not be feasible unless otherwise RMI is not possible at all in AS 7.

               

              Need your advice and direction.

               

              @Ales Justin

              Can you please give me the link for IntellJ plugin source?

              • 4. Re: JBoss6 MainDeployer equivalent in Jboss as7?
                sfcoy

                You can use the ModelControllerClient for this purpose. We're doing something like the following in an embedded solution:

                 

                {code:java}    ModelControllerClient modelControllerClient = ModelControllerClient.Factory.create(InetAddress.getByName("localhost"), 9999);

                    ModelControllerClientServerDeploymentManager deploymentManager = new ModelControllerClientServerDeploymentManager(

                                                    modelControllerClient);

                    DeploymentPlanBuilder deploymentPlanBuilder = deploymentManager.newDeploymentPlan();

                    for (File deployment : deployments) {

                         deploymentPlanBuilder = deploymentPlanBuilder.add(deployment).andDeploy();

                    }

                    DeploymentPlan deploymentPlan = deploymentPlanBuilder.build();

                    Future<ServerDeploymentPlanResult> deploymentResult = deploymentManager.execute(deploymentPlan);

                    ServerDeploymentPlanResult result = deploymentResult.get(2, TimeUnit.MINUTES);

                    for (DeploymentAction deploymentAction : deploymentPlan.getDeploymentActions()) {

                         ServerDeploymentActionResult deploymentActionResult = result.getDeploymentActionResult(deploymentAction.getId());

                    }

                {code}

                 

                 

                I found many of the clues for this in the JBoss Tools source.

                1 of 1 people found this helpful
                • 5. Re: JBoss6 MainDeployer equivalent in Jboss as7?
                  pragalathan

                  The problem I have is, I wont be able to use these classes as I cant introduce dependency on any particular version of JBoss client jar files.  Because this module should be able to register any version of JBoss instance with the IDE.

                  Is there any other way to query the status of the server/applications without introducing dependency?

                  • 6. Re: JBoss6 MainDeployer equivalent in Jboss as7?
                    pragalathan

                    Thanks guys for your inputs. I found jsr88 being useful for this requirement. So i started using JSR88Client.

                    More details at https://community.jboss.org/wiki/JSR88Client