2 Replies Latest reply on Nov 1, 2004 11:15 PM by Brad Rust

    rmi over http (httpinvoker) selectively

    Brad Rust Newbie

      I've successfully configured a jboss 3.2.4 instance to expose my SLSB's over http. This was done following documentation and other people's posts.

      My main question is... is it possible to call my remote interfaces with RMI via JRMPInvoker soley based on jndi.properties (or appropriate ENV) changes?

      It appears that once I have these beans marked to use the invoker-proxy-binding-name bound to httpinvoker mbean, I can't go back to straight RMI. I want client->internet->server to be RMI over HTTP but I want server->server remote invocations to be RMI (1099,4444).

      The way I have things configured is this,...

      1. each session bean has a invoker-proxy-binding-name set to a invoker-proxy-binding configured to use jboss:service=invoker,type=http.
      2. http invoker service is configured close to defaults.
      3. client uses HttpNamingContextFactory and appropriate URL config to make the servlet calls

      Thanks in advance!
      Brad

        • 1. Re: rmi over http (httpinvoker) selectively
          Scott Stark Master

          You can have a component invocable by multiple transports at the same time. Here is an example from the testsuite that shows a stateless session bean with an RMI/JRMP and RMI/Socket transport active. The client chooses which transport to use by selecting the corresponding jndi-name for the ejb home binding, PooledStatelessSession=RMI/Socket, StatelessSession=RMI/JRMP:

          <?xml version="1.0"?>
          <!DOCTYPE jboss PUBLIC
           "-//JBoss//DTD JBOSS 4.0//EN"
           "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
          
          <jboss>
           <enterprise-beans>
           <session>
           <ejb-name>StatelessSession</ejb-name>
           <jndi-name>StatelessSession</jndi-name>
           <invoker-bindings>
           <invoker>
           <invoker-proxy-binding-name>stateless-pooled-invoker</invoker-proxy-binding-name>
           <jndi-name>PooledStatelessSession</jndi-name>
           </invoker>
           <invoker>
           <invoker-proxy-binding-name>stateless-rmi-invoker</invoker-proxy-binding-name>
           <jndi-name>StatelessSession</jndi-name>
           </invoker>
           </invoker-bindings>
           </session>
           </enterprise-beans>
          
           <invoker-proxy-bindings>
           <invoker-proxy-binding>
           <name>stateless-pooled-invoker</name>
           <invoker-mbean>jboss:service=invoker,type=pooled</invoker-mbean>
           <proxy-factory>org.jboss.proxy.ejb.ProxyFactory</proxy-factory>
           <proxy-factory-config>
           <client-interceptors>
           <home>
           <interceptor>org.jboss.proxy.ejb.HomeInterceptor</interceptor>
           <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
           <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>
           <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
           </home>
           <bean>
           <interceptor>org.jboss.proxy.ejb.StatelessSessionInterceptor</interceptor>
           <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
           <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>
           <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
           </bean>
           </client-interceptors>
           </proxy-factory-config>
           </invoker-proxy-binding>
           </invoker-proxy-bindings>
          </jboss>
          



          • 2. Re: rmi over http (httpinvoker) selectively
            Brad Rust Newbie

            Works great! Thanks.

            I ended up creating a custom jboss_xml.xdt and lookup.xdt xdoclet template files. They register all my remotes using the http-invoker and the standard rmi-invoker. Now my clients use their standard util classes to automagically lookup and invoke depending on some setting.