1 Reply Latest reply on Sep 9, 2009 5:28 PM by ron_sigal

    is JBoss remoting good choice for me ?

    maestr0

      Hi,
      I'm facing a problem of implementing communication between JBoss server and java standalone (WebStart) application. What I have to do is generally sending a few object serialized to XML (2mb each) and save them in DB on the server side. I also have to have a possibility to invoke some server-side methods on the client side.

      Is jboss remoting suitable for my needs ?

      Assuming that I have a JB Remoting endpoint configured on a specific port, can many clients get connection to the endpoint in a same time? Is it thread safe ?



      How should I implement ServerInvocationHandler to invoke specified in a request method on the server side ?
      So far I do it like this:

      public Object invoke(InvocationRequest invocation) {
       Object param = invocation.getParameter();
      
       if(param instanceof ExecuteMyMethod1) {
      
       // executing myMethod1
       }
      
       if(param instanceof ExecuteMyMethod2) {
      
       // executing myMethod2
       }
      
       if(param instanceof ExecuteMyMethod3) {
      
       // executing myMethod3
       }
      
       return "blablabla";
       }
      


        • 1. Re: is JBoss remoting good choice for me ?
          ron_sigal

          I think you're on the right track.

          maestr() wrote:

          Assuming that I have a JB Remoting endpoint configured on a specific port, can many clients get connection to the endpoint in a same time?


          That's a matter of configuration, and how you do the configuration depends on the transport you're using. In the socket transport, which is the most commonly used transport, the parameter "maxPoolSize" determines the maximum number of worker threads, where each worker thread services one invocation at a time. The default value is "300", so that you could have up to 300 clients connected simultaneously.

          "maestr() wrote:

          Is it thread safe ?


          The Remoting code is thread safe. It's up to you to make your ServerInvocationHandler thread safe.

          "maestr()" wrote:

          How should I implement ServerInvocationHandler to invoke specified in a request method on the server side ?
          So far I do it like this:


          That looks reasonable. Note that, in addition to the parameter, you can pass an entire map of objects by calling

           public Object invoke(Object param, Map metadata) throws Throwable;
          


          in org.jboss.remoting.Client. In the ServerInvocationHandler the map can be retrieved with org.jboss.remoting.InvocationRequest.getRequestPayload().

          Good luck.