2 Replies Latest reply on Aug 19, 2003 8:12 AM by jonlee

    Stupid Question using a java class with JBoss

    cbuckley

      I am a bit stumped right now, I need to have a java class open a local socket on the machine that is running the jboss server. I would like to have this class read in content from the socket and then pass this to a session bean, which is actually acting as a facade to my entity beans to persist the data.


      ******Question*******
      Where should this class be in the container? Outside in another vm? Any ideas would really help thanks.

        • 1. Re: Stupid Question using a java class with JBoss
          jonlee

          Theoretically, there is nothing prohibiting an EJB to being a socket client or performing RMI operations. File I/O performed within an EJB container is the only operation frowned upon. So you could directly call the class from the EJB to open the socket and read the data from within the container.

          From a purist perspective, you may want to analyse load and speed to determine whether implementing a pooling service for these socket connections would benefit your application. You would then need to consider building an MBean operated service.

          A socket connection pool does give you flexibility to change the socket end-point (if you need to change the port the service is offered on).

          • 2. Re: Stupid Question using a java class with JBoss
            jonlee

            In the same VM should give you better speed/response and reduce certain cross-VM complications.

            Hope that addresses your questions.