2 Replies Latest reply on Jul 25, 2006 6:39 PM by kukeltje

    Remote accessible MBean

    literadix

      Hi there,

      I have noticed that there is no ready to use given way from within the project to remotly access an jBPM instance. I would suggest that someone (me) implements such a mbean. This way users could access jBPM instances by an jndi service locator which is remote accessible. What is the optinion about this? Is this worthy or has someone any oter kind of solution. As far as I can see an other way would be to expose the jBPM working instance by custom proxies like statefull session beans.


      A way to deploy such a MBean would be:

       <!-- jBPM Service -->
       <mbean code="org.jbpm.db.jmx.JbpmRemoteService"
       name="jboss.jbpm:name=DefaultJbpm,service=JbpmRemoteService"
       description="Default jBPM Service">
       <attribute name="JndiName">java:/jbpm/JbpmRemoteService</attribute>
       <depends>jboss:service=Naming</depends>
       <depends>jboss.jca:service=DataSourceBinding,name=JbpmDS</depends>
       </mbean>
      
       <!-- jBPM Service RMI Connector Proxy-->
       <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
       name="jboss.jmx:type=adaptor,name=JbpmRemoteServiceTarget,protocol=jrmp,service=proxyFactory">
      
       <!-- Use the standard JRMPInvoker -->
       <depends optional-attribute-name="InvokerName">
       jboss:service=invoker,type=jrmp
       </depends>
      
       <!-- The target MBean -->
       <depends optional-attribute-name="TargetName">
       jboss.jbpm:name=DefaultJbpm,service=JbpmRemoteService
       </depends>
      
       <!-- Where to bind the proxy factory -->
       <attribute name="JndiName">JbpmRemoteServiceTarget</attribute>
      
       <!-- Invoke target method instead of invoke(Invocation mi) -->
       <attribute name="InvokeTargetMethod">true</attribute>
      
       <!-- Comma-separated list of exported interfaces -->
       <attribute name="ExportedInterfaces">
       org.jbpm.db.jmx.JbpmRemoteServiceMBean
       </attribute>
      
       <!-- client-side interceptors -->
       <attribute name="ClientInterceptors">
       <interceptors>
       <interceptor>
       org.jboss.proxy.ClientMethodInterceptor
       </interceptor>
       <interceptor>
       org.jboss.proxy.SecurityInterceptor
       </interceptor>
       <interceptor>
       org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor
       </interceptor>
       <interceptor>
       org.jboss.invocation.InvokerInterceptor
       </interceptor>
       </interceptors>
       </attribute>
      
       </mbean>
      


      Accessing such a remotly exposed service would be as easy as:

      Hashtable<String, String> env = new Hashtable<String, String>();
       env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
       env.put(Context.PROVIDER_URL,"jnp://localhost");
      
      InitialContext ic = new InitialContext(env);
      
      JbpmRemoteServiceMBean service = (JbpmRemoteServiceMBean)ic.lookup("JbpmRemoteServiceTarget");
      


      Giving my best,

      M.A. Bednarz
      Germany, Hannover
      http://www.literadix.de

        • 1. Re: Remote accessible MBean

          Has there been any advancement in this area, or is there another current way of accessing the JBPM objects through some RMI or other simple call?

          James Ratcliff

          • 2. Re: Remote accessible MBean
            kukeltje

            if you do not mind using jms (which by itself is accessible via rmi) and do not mind a little experimentation (since it is not fully developed/documented yet), the commandExcecutor via jms is an option. See the testcases and small example in the 3.2 codebase