Details
-
Bug
-
Resolution: Done
-
Major
-
5.2.0.M1, 5.2.0.M2, 5.2.0.CR1
-
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.