[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/marshal/compress ...
Ron Sigal
ron_sigal at yahoo.com
Wed May 9 04:30:35 EDT 2007
User: rsigal
Date: 07/05/09 04:30:35
Modified: src/main/org/jboss/remoting/marshal/compress Tag:
remoting_2_2_0_GA CompressingUnMarshaller.java
CompressingMarshaller.java
Log:
JBREM-714: Added version parameter to read()/write().
Revision Changes Path
No revision
No revision
1.6.8.1 +9 -4 JBossRemoting/src/main/org/jboss/remoting/marshal/compress/CompressingUnMarshaller.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CompressingUnMarshaller.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/marshal/compress/CompressingUnMarshaller.java,v
retrieving revision 1.6
retrieving revision 1.6.8.1
diff -u -b -r1.6 -r1.6.8.1
--- CompressingUnMarshaller.java 5 Jul 2006 17:01:47 -0000 1.6
+++ CompressingUnMarshaller.java 9 May 2007 08:30:35 -0000 1.6.8.1
@@ -23,6 +23,7 @@
package org.jboss.remoting.marshal.compress;
import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.remoting.marshal.VersionedUnMarshaller;
import org.jboss.remoting.marshal.serializable.SerializableUnMarshaller;
import org.jboss.remoting.serialization.SerializationStreamFactory;
@@ -48,7 +49,7 @@
* uses an <code>HTTPUnMarshaller</code> to restore an uncompressed input stream.
*
* @author <a href="mailto:r.sigal at computer.org">Ron Sigal</a>
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.6.8.1 $
* <p/>
* Copyright (c) 2005
* </p>
@@ -86,22 +87,26 @@
* @param inputStream <code>InputStream</code> from which marshalled form is to be retrieved
* @param metadata can be any transport specific metadata (such as headers from http transport).
* This can be null, depending on if transport supports metadata.
+ * @param version wire format version
* @return restored object
* @throws IOException if there is a problem reading from <code>inputStream</code>
* @throws ClassNotFoundException if there is a problem finding a class needed for unmarshalling
*/
- public Object read(InputStream inputStream, Map metadata) throws IOException, ClassNotFoundException
+ public Object read(InputStream inputStream, Map metadata, int version) throws IOException, ClassNotFoundException
{
GZIPInputStream gzis = new GZIPInputStream(inputStream);
ObjectInputStream ois = SerializationStreamFactory.getManagerInstance(getSerializationType()).createRegularInput(gzis);
if(wrappedUnMarshaller != null)
{
+ if (wrappedUnMarshaller instanceof VersionedUnMarshaller)
+ return ((VersionedUnMarshaller)wrappedUnMarshaller).read(ois, metadata, version);
+ else
return wrappedUnMarshaller.read(ois, metadata);
}
else
{
- return super.read(ois, metadata);
+ return super.read(ois, metadata, version);
}
}
1.6.8.1 +9 -4 JBossRemoting/src/main/org/jboss/remoting/marshal/compress/CompressingMarshaller.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CompressingMarshaller.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/marshal/compress/CompressingMarshaller.java,v
retrieving revision 1.6
retrieving revision 1.6.8.1
diff -u -b -r1.6 -r1.6.8.1
--- CompressingMarshaller.java 5 Jul 2006 17:01:47 -0000 1.6
+++ CompressingMarshaller.java 9 May 2007 08:30:35 -0000 1.6.8.1
@@ -23,6 +23,7 @@
package org.jboss.remoting.marshal.compress;
import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.VersionedMarshaller;
import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
import org.jboss.remoting.serialization.SerializationStreamFactory;
@@ -46,7 +47,7 @@
* will create a marshaller that compresses the output of an <code>HTTPMarshaller</code>.
*
* @author <a href="mailto:r.sigal at computer.org">Ron Sigal</a>
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.6.8.1 $
* <p/>
* Copyright (c) 2005
* </p>
@@ -83,8 +84,9 @@
*
* @param dataObject arbitrary object to be marshalled
* @param output <code>OutputStream</code> to which <code>output</code> is to be marshalled
+ * @param version wire format version
*/
- public void write(Object dataObject, OutputStream output) throws IOException
+ public void write(Object dataObject, OutputStream output, int version) throws IOException
{
output.flush();
;
@@ -93,11 +95,14 @@
if(wrappedMarshaller != null)
{
+ if (wrappedMarshaller instanceof VersionedMarshaller)
+ ((VersionedMarshaller) wrappedMarshaller).write(dataObject, oos, version);
+ else
wrappedMarshaller.write(dataObject, oos);
}
else
{
- super.write(dataObject, oos);
+ super.write(dataObject, oos, version);
}
gzos.finish();
More information about the jboss-cvs-commits
mailing list