1 Reply Latest reply on Dec 8, 2005 12:35 PM by tom.elrod

    JBoss Remoting TransporterClient

    mabacro

      I'm currently analyzing JBoss Remoting, because I want to use it in a customer project here in Germany.

      Particularly interesting are the TransporterClient and TransporterServer classes. During my first tests I noticed, that it is not possible to use remote classes which have methods that define interfaces as parameter types. I can only use methods that define concrete classes.

      The problem seems to reside in the TranporterClient class. The "NameBasedInvocation" object, which is created in the "invoke()" method uses a String array, which contains the names of the object types that were passed to the method, but the parameter signature should IMHO contain the names of the types defined in the remote class.

      So I changed the "createParamSignature()" method as follows:

       private String[] createParamSignature(Class[] args) {
       if (args == null || args.length == 0) {
       return new String[] {};
       }
       String[] paramSig = new String[args.length];
       for (int x = 0; x < args.length; x++) {
       paramSig[x] = args[x].getName();
       }
       return paramSig;
       }
      



      The "invoke()" method has to do now something like this:

      String[] paramSig = createParamSignature(method.getParameterTypes());
      


      A little testing showed that the code now works also for methods, which define interfaces in the signaure, but since I'm new to remoting and the use of proxies I would appreciate some comments on this solution. Are there any side effects which I missed?

      Thanks in advance!