5 Replies Latest reply on Jul 14, 2006 11:53 PM by tom.elrod

    who creates servlet server invoker?

    mazz

      I'm looking at the ServerInvokerServlet code. It creates an MBean proxy to an MBean instance of a ServletServerInvoker and it uses that proxy to actually process the request.

      But I don't see where that ServletServerInvoker MBean is actually created and registered in the MBeanServer. I looked for all references to ServletServerInvoker and ServletServerInvokerMBean and I can't find who actually creates that Mbean. The docs don't mention the need to explicitly deploy one so I'm assuming something else will do it. What's the magic?

        • 1. Re: who creates servlet server invoker?

          This is done via JBoss mbean service (Connector) being deployed (see http://labs.jboss.com/portal/jbossremoting/docs/guide/ch04.html#d0e858 for example). This means that in order for the servlet part (ServerInvokerServlet) to be able to find the deployed remoting servlet invoker, must be done this way.

          I really don't like this approach (especially since depends on jmx), so am working on another way that will not require jmx (or mbean service deployment). Gets pretty sticky though as separation of classloaders can come into play, which makes it difficult.

          • 2. Re: who creates servlet server invoker?
            mazz

            OK, so the Connector sees that its transport is "servlet" so it knows to create and register a ServletServerInvoker MBean. I couldn't find that code. But I believe you :-)

            As for the JMX dependency - I doubt at this stage you'll be able to remove all the JMX dependencies from Remoting.

            • 3. Re: who creates servlet server invoker?

              The Connector calls on the InvokerRegistry to create the server invoker for the 'servlet' transport.

              Yeah, JMX dependency is going to take a while to totally remove from remoting (as discovery depends on it heavily), but think make sense to remove it in the case if possible. Otherwise won't be able to use servlet transport outside of JBossAS (and even then, JBossAS 5 may not work using the old approach anyhow).

              • 4. Re: who creates servlet server invoker?
                mazz

                You can still use servlet transport for other app servers - all you have to do is make ServerInvokerServlet extensible :-)

                Refactor it so there is a protected method "getMBeanServer()". Then subclass it where that method returns the JBoss MBeanServer - that's the one we'd use for JBossAS. Other people can then subclass it to return their app server's MBeanServer (or any MBeanServer that they know contains the servlet server invoker MBean). We'd have a different subclass for JBoss5 if its different.

                • 5. Re: who creates servlet server invoker?