[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/servlet ...
Ron Sigal
ron_sigal at yahoo.com
Thu Aug 30 13:18:48 EDT 2007
User: rsigal
Date: 07/08/30 13:18:48
Modified: src/main/org/jboss/remoting/transport/servlet Tag:
remoting_2_x ServletServerInvoker.java
Log:
Synchronizing with branch remoting_2_2_0_GA: JBREM-714: Added special handling for VersionedMarshaller/VersionedUnMarshaller.
Revision Changes Path
No revision
No revision
1.8.4.3 +21 -4 JBossRemoting/src/main/org/jboss/remoting/transport/servlet/ServletServerInvoker.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServletServerInvoker.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/servlet/ServletServerInvoker.java,v
retrieving revision 1.8.4.2
retrieving revision 1.8.4.3
diff -u -b -r1.8.4.2 -r1.8.4.3
--- ServletServerInvoker.java 18 Jan 2007 07:37:29 -0000 1.8.4.2
+++ ServletServerInvoker.java 30 Aug 2007 17:18:48 -0000 1.8.4.3
@@ -24,9 +24,12 @@
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.Version;
import org.jboss.remoting.marshal.MarshalFactory;
import org.jboss.remoting.marshal.Marshaller;
import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.remoting.marshal.VersionedMarshaller;
+import org.jboss.remoting.marshal.VersionedUnMarshaller;
import org.jboss.remoting.marshal.http.HTTPMarshaller;
import org.jboss.remoting.marshal.http.HTTPUnMarshaller;
import org.jboss.remoting.transport.http.HTTPMetadataConstants;
@@ -103,7 +106,11 @@
ServletInputStream inputStream = request.getInputStream();
UnMarshaller unmarshaller = MarshalFactory.getUnMarshaller(HTTPUnMarshaller.DATATYPE, getSerializationType());
- Object obj = unmarshaller.read(inputStream, metadata);
+ Object obj = null;
+ if (unmarshaller instanceof VersionedUnMarshaller)
+ obj = ((VersionedUnMarshaller)unmarshaller).read(inputStream, metadata, Version.getDefaultVersion());
+ else
+ obj = unmarshaller.read(inputStream, metadata);
inputStream.close();
InvocationRequest invocationRequest = null;
@@ -143,6 +150,9 @@
response.setContentLength(iContentLength);
ServletOutputStream outputStream = response.getOutputStream();
Marshaller marshaller = MarshalFactory.getMarshaller(HTTPMarshaller.DATATYPE, getSerializationType());
+ if (marshaller instanceof VersionedMarshaller)
+ ((VersionedMarshaller) marshaller).write(invocationResponse, outputStream, Version.getDefaultVersion());
+ else
marshaller.write(invocationResponse, outputStream);
outputStream.close();
}
@@ -189,7 +199,11 @@
ServletInputStream inputStream = request.getInputStream();
UnMarshaller unmarshaller = getUnMarshaller();
- Object obj = unmarshaller.read(new ByteArrayInputStream(requestByte), metadata);
+ Object obj = null;
+ if (unmarshaller instanceof VersionedUnMarshaller)
+ obj = ((VersionedUnMarshaller)unmarshaller).read(new ByteArrayInputStream(requestByte), metadata, Version.getDefaultVersion());
+ else
+ obj = unmarshaller.read(new ByteArrayInputStream(requestByte), metadata);
inputStream.close();
boolean isError = false;
@@ -270,6 +284,9 @@
//response.setContentLength(iContentLength);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Marshaller marshaller = getMarshaller();
+ if (marshaller instanceof VersionedMarshaller)
+ ((VersionedMarshaller) marshaller).write(invocationResponse, outputStream, Version.getDefaultVersion());
+ else
marshaller.write(invocationResponse, outputStream);
retval = outputStream.toByteArray();
response.setContentLength(retval.length);
More information about the jboss-cvs-commits
mailing list