3 Replies Latest reply on Mar 13, 2013 11:27 AM by Johannes Bannhofer

    JBoss7 get Management Port programmatically

    Johannes Bannhofer Newbie

      Hi All,


      Short Environment Problem description:

      - we need to control our JMS (queuing State), we have to pause, resume queues when our system comes in a certain state -> DONE, with the JBoss Management API



      - For the connection to the Management API the management port is needed (9999), the problem is we have multiple teams with multiple JBoss 7 instances on different servers, therefore I don't want that they have to configure this port I want to obtain it programmatically within an EJB. Now it yould happen that a server instance with its configuration is copied and one instance tries to control the queues of the other one (i disabled security).


      I havend found any solution for this problem besides parsing the standalone.xml, but this is not realy an option because the management port could have been set by the startup script, therefore


      Current simplified example code:



      client = ModelControllerClient.Factory.create(InetAddress.getByName("localhost"), 9999);
      ModelNode returnVal = client.execute(operation);


      How could I get the port (9999) within an EJB, does anybody have an idea?


      kind regards Johannes