1 Reply Latest reply on Sep 27, 2002 11:04 AM by Juha Lindfors

    When to use MBean?

    Brian Silberbauer Newbie

      Hi

      I have a requirement to pass a request from an html form to socket using a proprietory protocol. I am contemplating using an MBean, but there are two things that I'm not too sure about. Firstly, how would a session bean comunicate with the MBean and secondly would it be better to create a URLConnection and pool it as a resource?

      Any comments would be greatful, I'm in a bit of a minefield at the moment..

      Brian

        • 1. Re: When to use MBean?
          Juha Lindfors Master

          You should be able to connect to an MBean from a session by looking up the connector from JNDI:

          String serverName = InetAddress.getLocalHost().getHostName();
          String connectorName = "jmx:" +serverName+ ":rmi";
          RMIConnector server = (RMIConnector) new InitialContext().lookup(connectorName);
          server.invoke(someObjectName, "someOperation", args, sign);