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

DefaultMarshaller does not use supplied ObjectMarshallingStrategies

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 5.2.0.CR1
    • 5.2.0.M1, 5.2.0.M2, 5.2.0.CR1
    • drools-core (expert)
    • None

    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 (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty