3 Replies Latest reply on Dec 20, 2001 8:28 PM by moatas

    Daemon as an MBean

    moatas

      I have a serverSocket process I want t odeploy as an MBean. Once I create the ServerSocket, I do a while(true) loop and listen for connections. Do I need to put this in it's own thread? JBoss never finishes loading after this because it is in this loop.

      Jim

        • 1. Re: Daemon as an MBean
          davidjencks

          > I have a serverSocket process I want t odeploy as an
          > MBean. Once I create the ServerSocket, I do a
          > while(true) loop and listen for connections.

          Do I
          > need to put this in it's own thread?

          yes


          JBoss never
          > finishes loading after this because it is in this
          > loop.
          >
          > Jim

          • 2. Re: Daemon as an MBean
            marc.fleury

            The mbean is the right place to do that but obviously you need a new thread to listen on a socket.


            You can also instrument that socket through the MBean API and monitor that singleton

            • 3. Re: Daemon as an MBean
              moatas

              Yep, right after I posted I tried it and all worked perfectly! Thanks!

              Jim