Cayenne
  1. Cayenne
  2. CAY-1629

[PATCH] Can't add custom Hessian serializers to the client

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1B1
    • Fix Version/s: 3.1B1
    • Component/s: ROP
    • Labels:
    • Environment:
      Mac 10.6

      Description

      There isn't any way to register custom Hessian serializers to the client in an ROP setup. They can be registered with the server by doing this:

      public class SampleServlet extends ROPHessianServlet {
      public void init(ServletConfig configuration) throws ServletException

      { super.init(configuration); getSerializerFactory().addFactory(new MySerializerFactory()); }

      }

      The attached patch saves and exposes a reference to the serializerFactory on the client so that the same thing can be done there as well, like so:

      ClientRuntime clientRuntime = new ClientRuntime(...);
      ((HessianConnection) clientRuntime.getConnection()).getSerializerFactory().addFactory(new MySerializerFactory());

      In either case these custom serializers will not be reflected when using the static methods in HessianUtil since those factories are completely internal. This could be considered an existing bug since the server already supports adding custom factories. Perhaps the better solution would be to make the CLIENT_SERIALIZER_FACTORIES and SERVER_SERIALIZER_FACTORIES variables modifiable, but that feels ugly.

      For the time being though, the patch provides some essential functionality that is missing.

        Activity

        Hide
        John Huss added a comment -

        Patch to expose the serializer factory on the client

        Show
        John Huss added a comment - Patch to expose the serializer factory on the client

          People

          • Assignee:
            Unassigned
            Reporter:
            John Huss
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.5h
              0.5h
              Remaining:
              Remaining Estimate - 0.5h
              0.5h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development