-
1. Re: AdvancedExternalizer<T> registration of closed-source Object
cotton.ben May 23, 2013 1:22 PM (in response to cotton.ben)Actually, is it really even possible to do JBoss Marshalling protocol for Closed-Source objects via AdvancedExternalizable? Somebody, somewhere, must write an implementation of a MyObjectExternalizer.class to operate on the internal composite object graph of org.closedsource.MyObject.class, correct?
-
2. Re: AdvancedExternalizer<T> registration of closed-source Object
william.burns May 23, 2013 4:58 PM (in response to cotton.ben)You can use an AdvancedExternalizer for any given class assuming you have the ability to do the following:
- Retrieve all state for a given instance of the class and be able to serialize all such state
- Be able to create a new instance on the deserialization side with the provided state. You would hopefully be able to use a visible constructor on the class, Builder or Factory to do so.
There are a few examples in infinispan itself where we have AdvancedExternalizers configured for classes that we cannot modify the source. A good example is the org.infinispan.marshall.exts.MapExternalizer class which is used to serialize an implementation of java.util.HashMap and java.util.TreeMap.
Given the advanced externalizer class you could register it either via xml with the class name or passing an instance to the builder as in your example.
-
3. Re: AdvancedExternalizer<T> registration of closed-source Object
cotton.ben May 23, 2013 5:24 PM (in response to william.burns)- [...]
- Be able to create a new instance on the deserialization side with the provided state. You would hopefully be able to use a visible constructor on the class, Builder or Factory to do so.
Thanks William. Let me try this tactic via the public Constructor.
-
4. Re: AdvancedExternalizer<T> registration of closed-source Object
cotton.ben May 23, 2013 5:53 PM (in response to cotton.ben)It worked. Wow, lucky me.
700% "speed" improvement in my tests when compared with default JDK 7 java.io. Serializable/Externalizble. :-)
The Constructor tactic you provided me in this forum reply is *the* missing link to this puzzle. . You guys might consider enhancing the "how to do AdvancedExternalizer with Closed-Source objects" part of the documentation at https://community.jboss.org/servlet/JiveServlet/download/819120-88703/Plugging%20Infinispan%20With%20User%20Defined%20Externalizers-v6-20130522_1350.pdf to share this tactic with all.
Thanks again!