Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-2976

DefaultMarshaller does not use supplied ObjectMarshallingStrategies

    XMLWordPrintable

Details

    Description

      DefaultMarshaller.java does not use the supplied ObjectMarshallingStrategy as far as I can tell.

      When you create a Marshaller like this:

      final Marshaller marshaller = MarshallerFactory.newMarshaller(knowledgeBase, new ObjectMarshallingStrategy[] { myStrategy });
      assert marshaller != null;
      

      And then use it like this (or similar):

      final ByteArrayOutputStream baos = new ByteArrayOutputStream();
      final ObjectOutputStream oos = new ObjectOutputStream(baos);
      final DroolsObjectOutputStream doos = new DroolsObjectOutputStream(oos);
      marshaller.marshall(doos, this.droolsSession);
      

      ...the supplied strategy's read() and write() methods are never called.

      This is because DefaultMarshaller.java line 132 does not use the DefaultMarshaller's strategy, but the strategy of the incoming StatefulKnowledgeSession instead.

      Attachments

        Activity

          People

            mproctor@redhat.com Mark Proctor
            ljnelson+github@gmail.com Laird Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: