[infinispan-dev] More on marshallers - affects cache store authors again!
Manik Surtani
manik at jboss.org
Mon May 11 13:14:58 EDT 2009
Guys
I've made a few changes regarding marshalling.
1) Removed Serializable/Externalizable where unnecessary. There may
well be more places where we can drop this interface - do let me know
if I have missed anything. The purpose of removing Serializable/
Externalizable is to force all serialization to go through the
Marshaller interface, which is tuned for performance and reduced byte
array size.
2) Some classes relied on Object serialization. Added marshall/
unmarshall methods for these. E.g., Bucket. Galder, you may want to
do the same with your JBMAR externalizers.
3) Moved (write|read)Unsigned(Int|Long) from MarshallerImpl to static
helpers on org.infinispan.io.UnsignedNumeric so that they can be
consumed from elsewhere as well, such as Galder's Externalizers. Feel
free to use these, they produce a more compact byte stream when
serializing unsigned longs and ints, especially if their value is small.
4) Renamed ObjectStreamMarshaller - a dummy marshaller for testing -
to TestObjectStreamMarshaller. Also, this marshaller now uses XStream
to write objects to an XML stream before writing the result to a JDK
ObjectOutputStream. The purpose is that the test marshaller can now
deal with non-Serializable classes. The XStream dependency is for
tests only, as you would expect.
Please revisit how your cache store implementations use streams.
Remember, never directly read to or write from a stream, use the
marshaller instead!
Cheers
--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org
More information about the infinispan-dev
mailing list