[jboss-remoting-commits] JBoss Remoting SVN: r4594 - in remoting3/trunk: api/src/main/resources/META-INF and 3 other directories.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Mon Oct 6 20:08:22 EDT 2008


Author: david.lloyd at jboss.com
Date: 2008-10-06 20:08:21 -0400 (Mon, 06 Oct 2008)
New Revision: 4594

Modified:
   remoting3/trunk/api/src/main/resources/META-INF/jboss-classloading.xml
   remoting3/trunk/build.properties
   remoting3/trunk/build.xml
   remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientImpl.java
   remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicHandler.java
   remoting3/trunk/testing-support/src/main/resources/testing.policy
Log:
Move to 1.0.0 external marshalling API


Modified: remoting3/trunk/api/src/main/resources/META-INF/jboss-classloading.xml
===================================================================
--- remoting3/trunk/api/src/main/resources/META-INF/jboss-classloading.xml	2008-10-02 05:25:36 UTC (rev 4593)
+++ remoting3/trunk/api/src/main/resources/META-INF/jboss-classloading.xml	2008-10-07 00:08:21 UTC (rev 4594)
@@ -11,6 +11,6 @@
     </capabilities>
     <requirements>
         <module name="XnioAPI" from-inclusive="true" from="1.1.0" reExport="true"/>
-        <module name="JBossMarshallingAPI" from-inclusive="true" from="1.0.0" reExport="true"/>
+        <module name="RiverAPI" from-inclusive="true" from="1.0.0" reExport="true"/>
     </requirements>
 </classloading>

Modified: remoting3/trunk/build.properties
===================================================================
--- remoting3/trunk/build.properties	2008-10-02 05:25:36 UTC (rev 4593)
+++ remoting3/trunk/build.properties	2008-10-07 00:08:21 UTC (rev 4594)
@@ -115,23 +115,21 @@
 lib.jboss-managed.local=${local.repository}/${lib.jboss-managed.local-path}
 lib.jboss-managed.remote=${remote.repository}/${lib.jboss-managed.remote-path}
 
-lib.jboss-marshalling-api.version=1.0.0.Alpha.20080923-345
-lib.jboss-marshalling-api.name=marshalling-api.jar
-lib.jboss-marshalling-api.license=lgpl
-lib.jboss-marshalling-api.dir=jboss/marshalling/${lib.jboss-marshalling-api.version}/lib
-lib.jboss-marshalling-api.path=${lib.jboss-marshalling-api.dir}/${lib.jboss-marshalling-api.name}
-lib.jboss-marshalling-api.local=${local.repository}/${lib.jboss-marshalling-api.path}
-lib.jboss-marshalling-api.remote=${remote.repository}/${lib.jboss-marshalling-api.path}
+lib.marshalling-api.version=1.0.0.Beta1
+lib.marshalling-api.name=marshalling-api.jar
+lib.marshalling-api.license=lgpl
+lib.marshalling-api.dir=jboss/marshalling/${lib.marshalling-api.version}/lib
+lib.marshalling-api.path=${lib.marshalling-api.dir}/${lib.marshalling-api.name}
+lib.marshalling-api.local=${local.repository}/${lib.marshalling-api.path}
+lib.marshalling-api.remote=${remote.repository}/${lib.marshalling-api.path}
 
-lib.jboss-serialization.version=1.1.0-snapshot-r358
-lib.jboss-serialization.name=jboss-serialization.jar
-lib.jboss-serialization.license=lgpl
-lib.jboss-serialization.local-dir=jboss-serialization/${lib.jboss-serialization.version}/lib
-lib.jboss-serialization.remote-dir=jboss/serialization/${lib.jboss-serialization.version}/lib
-lib.jboss-serialization.local-path=${lib.jboss-serialization.local-dir}/${lib.jboss-serialization.name}
-lib.jboss-serialization.remote-path=${lib.jboss-serialization.remote-dir}/${lib.jboss-serialization.name}
-lib.jboss-serialization.local=${local.repository}/${lib.jboss-serialization.local-path}
-lib.jboss-serialization.remote=${remote.repository}/${lib.jboss-serialization.remote-path}
+lib.river.version=${lib.marshalling-api.version}
+lib.river.name=river.jar
+lib.river.license=${lib.marshalling-api.license}
+lib.river.dir=${lib.marshalling-api.dir}
+lib.river.path=${lib.river.dir}/${lib.river.name}
+lib.river.local=${local.repository}/${lib.river.path}
+lib.river.remote=${remote.repository}/${lib.river.path}
 
 lib.jbossxb.version=2.0.0.CR5
 lib.jbossxb.name=jboss-xml-binding.jar
@@ -181,7 +179,7 @@
 lib.trove.local=${local.repository}/${lib.trove.path}
 lib.trove.remote=${remote.repository}/${lib.trove.path}
 
-lib.xnio.version=1.1.0.Alpha2008072901
+lib.xnio.version=1.1.0.CR1
 
 lib.xnio-api.name=xnio-api-${lib.xnio.version}.jar
 lib.xnio-api.license=lgpl

Modified: remoting3/trunk/build.xml
===================================================================
--- remoting3/trunk/build.xml	2008-10-02 05:25:36 UTC (rev 4593)
+++ remoting3/trunk/build.xml	2008-10-07 00:08:21 UTC (rev 4594)
@@ -127,30 +127,6 @@
         <get src="${remote.license.dir}/${lib.jboss-managed.license}.txt" dest="${lib.jboss-managed.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
     </target>
 
-    <!-- External library: JBoss Marshalling -->
-
-    <target name="lib.jboss-marshalling-api-check">
-        <available property="lib.jboss-marshalling-api.exists" file="${lib.jboss-marshalling-api.local}"/>
-    </target>
-
-    <target name="lib.jboss-marshalling-api" depends="lib.jboss-marshalling-api-check" unless="lib.jboss-marshalling-api.exists">
-        <mkdir dir="${local.repository}/${lib.jboss-marshalling-api.dir}"/>
-        <get src="${lib.jboss-marshalling-api.remote}" dest="${lib.jboss-marshalling-api.local}" usetimestamp="true" ignoreerrors="false"/>
-        <get src="${remote.license.dir}/${lib.jboss-marshalling-api.license}.txt" dest="${lib.jboss-marshalling-api.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
-    </target>
-
-    <!-- External library: JBoss Serialization -->
-
-    <target name="lib.jboss-serialization-check">
-        <available property="lib.jboss-serialization.exists" file="${lib.jboss-serialization.local}"/>
-    </target>
-
-    <target name="lib.jboss-serialization" depends="lib.jboss-serialization-check" unless="lib.jboss-serialization.exists">
-        <mkdir dir="${local.repository}/${lib.jboss-serialization.local-dir}"/>
-        <get src="${lib.jboss-serialization.remote}" dest="${lib.jboss-serialization.local}" usetimestamp="true" ignoreerrors="false"/>
-        <get src="${remote.license.dir}/${lib.jboss-serialization.license}.txt" dest="${lib.jboss-serialization.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
-    </target>
-
     <!-- External library: JBossXB -->
 
     <target name="lib.jbossxb-check">
@@ -163,6 +139,8 @@
         <get src="${remote.license.dir}/${lib.jbossxb.license}.txt" dest="${lib.jbossxb.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
     </target>
 
+    <!-- External library: JUnit -->
+
     <target name="lib.junit-check">
         <available property="lib.junit.exists" file="${lib.junit.local}"/>
     </target>
@@ -173,6 +151,30 @@
         <get src="${remote.license.dir}/${lib.junit.license}.txt" dest="${lib.junit.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
     </target>
 
+    <!-- External library: Marshalling API -->
+
+    <target name="lib.marshalling-api-check">
+        <available property="lib.marshalling-api.exists" file="${lib.marshalling-api.local}"/>
+    </target>
+
+    <target name="lib.marshalling-api" depends="lib.marshalling-api-check" unless="lib.marshalling-api.exists">
+        <mkdir dir="${local.repository}/${lib.marshalling-api.dir}"/>
+        <get src="${lib.marshalling-api.remote}" dest="${lib.marshalling-api.local}" usetimestamp="true" ignoreerrors="false"/>
+        <get src="${remote.license.dir}/${lib.marshalling-api.license}.txt" dest="${lib.marshalling-api.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
+    </target>
+
+    <!-- External library: River -->
+
+    <target name="lib.river-check">
+        <available property="lib.river.exists" file="${lib.river.local}"/>
+    </target>
+
+    <target name="lib.river" depends="lib.river-check" unless="lib.river.exists">
+        <mkdir dir="${local.repository}/${lib.river.dir}"/>
+        <get src="${lib.river.remote}" dest="${lib.river.local}" usetimestamp="true" ignoreerrors="false"/>
+        <get src="${remote.license.dir}/${lib.river.license}.txt" dest="${lib.river.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
+    </target>
+
     <!-- External library: Servlet API 2.4 -->
 
     <target name="lib.servlet-check">
@@ -248,7 +250,7 @@
                 debug="true">
             <compilerarg value="-Xlint:unchecked"/>
             <classpath>
-                <pathelement location="${lib.jboss-marshalling-api.local}"/>
+                <pathelement location="${lib.marshalling-api.local}"/>
                 <pathelement location="${lib.xnio-api.local}"/>
                 <path refid="util.classpath"/>
             </classpath>
@@ -280,7 +282,7 @@
                 <path refid="api.classpath"/>
                 <path refid="testing-support.classpath"/>
                 <pathelement location="${lib.junit.local}"/>
-                <pathelement location="${lib.jboss-marshalling-api.local}"/>
+                <pathelement location="${lib.marshalling-api.local}"/>
                 <pathelement location="${lib.xnio-api.local}"/>
             </classpath>
         </javac>
@@ -296,6 +298,7 @@
             <sysproperty key="build.home" value="${basedir}"/>
             <sysproperty key="ant.library.dir" value="${ant.home}/lib"/>
             <sysproperty key="lib.junit.local" value="${lib.junit.local}"/>
+            <sysproperty key="lib.marshalling-api.local" value="${lib.marshalling-api.local}"/>
             <sysproperty key="lib.xnio-api.local" value="${lib.xnio-api.local}"/>
             <jvmarg line="${test.jvmargs}"/>
             <formatter type="plain" extension="${extension}"/>
@@ -305,6 +308,7 @@
                 <path refid="util.classpath"/>
                 <pathelement location="api/target/test/classes"/>
                 <pathelement location="${lib.junit.local}"/>
+                <pathelement location="${lib.marshalling-api.local}"/>
                 <pathelement location="${lib.xnio-api.local}"/>
             </classpath>
             <batchtest fork="yes" todir="api/target/test-results"
@@ -325,7 +329,7 @@
         <antcall inheritall="true" inheritrefs="true" target="api.test.pseudotarget">
             <param name="extension" value="-security.txt"/>
             <param name="message" value="Running with security manager"/>
-            <param name="test.jvmargs" value="-Djava.security.manager=org.jboss.cx.remoting.test.support.LoggingSecurityManager -Djava.security.policy=${basedir}/testing-support/src/main/resources/testing.policy"/>
+            <param name="test.jvmargs" value="-Djava.security.manager=org.jboss.remoting.test.support.LoggingSecurityManager -Djava.security.policy=${basedir}/testing-support/src/main/resources/testing.policy"/>
         </antcall>
     </target>
 
@@ -333,7 +337,7 @@
         <delete dir="api/target"/>
     </target>
 
-    <target name="api" description="Build the API module" depends="lib.jboss-marshalling-api,lib.xnio-api,util,api.compile">
+    <target name="api" description="Build the API module" depends="lib.marshalling-api,lib.xnio-api,util,api.compile">
         <path id="api.classpath">
             <pathelement location="api/target/main/classes"/>
         </path>
@@ -404,7 +408,7 @@
                 <path refid="api.classpath"/>
                 <path refid="util.classpath"/>
                 <path refid="version.classpath"/>
-                <pathelement location="${lib.jboss-marshalling-api.local}"/>
+                <pathelement location="${lib.marshalling-api.local}"/>
                 <pathelement location="${lib.xnio-api.local}"/>
             </classpath>
         </javac>
@@ -436,7 +440,7 @@
                 <path refid="core.classpath"/>
                 <path refid="util.classpath"/>
                 <path refid="testing-support.classpath"/>
-                <pathelement location="${lib.jboss-marshalling-api.local}"/>
+                <pathelement location="${lib.marshalling-api.local}"/>
                 <pathelement location="${lib.junit.local}"/>
                 <pathelement location="${lib.xnio-api.local}"/>
             </classpath>
@@ -453,6 +457,7 @@
             <sysproperty key="build.home" value="${basedir}"/>
             <sysproperty key="ant.library.dir" value="${ant.home}/lib"/>
             <sysproperty key="lib.junit.local" value="${lib.junit.local}"/>
+            <sysproperty key="lib.marshalling-api.local" value="${lib.marshalling-api.local}"/>
             <sysproperty key="lib.xnio-api.local" value="${lib.xnio-api.local}"/>
             <jvmarg line="${test.jvmargs}"/>
             <formatter type="plain" extension="${extension}"/>
@@ -463,6 +468,7 @@
                 <path refid="util.classpath"/>
                 <pathelement location="core/target/test/classes"/>
                 <pathelement location="${lib.junit.local}"/>
+                <pathelement location="${lib.marshalling-api.local}"/>
                 <pathelement location="${lib.xnio-api.local}"/>
             </classpath>
             <batchtest fork="yes" todir="core/target/test-results"
@@ -483,7 +489,7 @@
         <antcall inheritall="true" inheritrefs="true" target="core.test.pseudotarget">
             <param name="extension" value="-security.txt"/>
             <param name="message" value="Running with security manager"/>
-            <param name="test.jvmargs" value="-Djava.security.manager=org.jboss.cx.remoting.test.support.LoggingSecurityManager -Djava.security.policy=${basedir}/testing-support/src/main/resources/testing.policy"/>
+            <param name="test.jvmargs" value="-Djava.security.manager=org.jboss.remoting.test.support.LoggingSecurityManager -Djava.security.policy=${basedir}/testing-support/src/main/resources/testing.policy"/>
         </antcall>
     </target>
 
@@ -758,7 +764,7 @@
                 <!-- TODO: marshallers should be moved to their own module -->
                 <path refid="core.classpath"/>
                 <path refid="util.classpath"/>
-                <pathelement location="${lib.jboss-marshalling-api.local}"/>
+                <pathelement location="${lib.marshalling-api.local}"/>
                 <pathelement location="${lib.xnio-api.local}"/>
             </classpath>
         </javac>
@@ -792,7 +798,8 @@
                 <path refid="util.classpath"/>
                 <path refid="testing-support.classpath"/>
                 <pathelement location="${lib.junit.local}"/>
-                <pathelement location="${lib.jboss-marshalling-api.local}"/>
+                <pathelement location="${lib.marshalling-api.local}"/>
+                <pathelement location="${lib.river.local}"/>
                 <pathelement location="${lib.xnio-standalone.local}"/>
             </classpath>
         </javac>
@@ -808,6 +815,7 @@
             <sysproperty key="build.home" value="${basedir}"/>
             <sysproperty key="ant.library.dir" value="${ant.home}/lib"/>
             <sysproperty key="lib.junit.local" value="${lib.junit.local}"/>
+            <sysproperty key="lib.marshalling-api.local" value="${lib.marshalling-api.local}"/>
             <sysproperty key="lib.xnio-standalone.local" value="${lib.xnio-standalone.local}"/>
             <jvmarg line="${test.jvmargs}"/>
             <formatter type="plain" extension="${extension}"/>
@@ -819,7 +827,8 @@
                 <path refid="util.classpath"/>
                 <pathelement location="protocol/basic/target/test/classes"/>
                 <pathelement location="${lib.junit.local}"/>
-                <pathelement location="${lib.jboss-marshalling-api.local}"/>
+                <pathelement location="${lib.marshalling-api.local}"/>
+                <pathelement location="${lib.river.local}"/>
                 <pathelement location="${lib.xnio-standalone.local}"/>
             </classpath>
             <batchtest fork="yes" todir="protocol/basic/target/test-results"
@@ -840,7 +849,7 @@
         <antcall inheritall="true" inheritrefs="true" target="protocol.basic.test.pseudotarget">
             <param name="extension" value="-security.txt"/>
             <param name="message" value="Running with security manager"/>
-            <param name="test.jvmargs" value="-Djava.security.manager=org.jboss.cx.remoting.test.support.LoggingSecurityManager -Djava.security.policy=${basedir}/testing-support/src/main/resources/testing.policy -Dsecurity.debug=policy"/>
+            <param name="test.jvmargs" value="-Djava.security.manager=org.jboss.remoting.test.support.LoggingSecurityManager -Djava.security.policy=${basedir}/testing-support/src/main/resources/testing.policy -Dsecurity.debug=policy"/>
         </antcall>
     </target>
 
@@ -848,7 +857,7 @@
         <delete dir="protocol/basic/target"/>
     </target>
 
-    <target name="protocol.basic" description="Build the protocol.basic module" depends="lib.jboss-marshalling-api,lib.xnio-api,api,core,util,protocol.basic.compile">
+    <target name="protocol.basic" description="Build the protocol.basic module" depends="lib.xnio-api,api,core,util,protocol.basic.compile">
         <path id="protocol.basic.classpath">
             <pathelement location="protocol/basic/target/main/classes"/>
         </path>
@@ -1300,7 +1309,7 @@
     <!-- JAVADOCS                                       -->
     <!-- ============================================== -->
 
-    <target name="api-javadoc" depends="api,core,standalone,util,lib.apiviz,lib.jboss-marshalling-api,lib.xnio-api">
+    <target name="api-javadoc" depends="api,core,standalone,util,lib.apiviz,lib.marshalling-api,lib.xnio-api">
         <delete dir="api/target/main/docs"/>
         <mkdir dir="api/target/main/docs"/>
         <javadoc destdir="api/target/main/docs" author="false" version="false" use="false" windowtitle="JBoss Remoting API">
@@ -1311,14 +1320,15 @@
             <doctitle><![CDATA[<h1>JBoss Remoting 3</h1>]]></doctitle>
             <bottom><![CDATA[<i>Copyright &#169; 2008 JBoss, a division of Red Hat, Inc.</i>]]></bottom>
             <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
-            <link href="http://docs.jboss.org/xnio/1.0/api/"/>
+            <link href="http://docs.jboss.org/xnio/${lib.xnio.version}/api/"/>
+            <link href="http://docs.jboss.org/river/${lib.marshalling-api.version}/api/"/>
             <classpath>
                 <path refid="core.classpath"/>
                 <path refid="api.classpath"/>
                 <path refid="standalone.classpath"/>
                 <path refid="util.classpath"/>
                 <pathelement location="${lib.xnio-api.local}"/>
-                <pathelement location="${lib.jboss-marshalling-api.local}"/>
+                <pathelement location="${lib.marshalling-api.local}"/>
             </classpath>
         </javadoc>
     </target>
@@ -1344,7 +1354,7 @@
 
     <!-- fetch: These should be the second-to-last targets in the file -->
 
-    <target name="all-fetch" description="Pre-fetch all external libraries" depends="lib.jboss-common-core,lib.jboss-common-logging-spi,lib.jboss-deployers-core-spi,lib.jboss-deployers-spi,lib.jboss-deployers-structure-spi,lib.jbossmc-kernel,lib.jboss-managed,lib.jboss-marshalling-api,lib.jbossxb,lib.servlet"/>
+    <target name="all-fetch" description="Pre-fetch all external libraries" depends="lib.jboss-common-core,lib.jboss-common-logging-spi,lib.jboss-deployers-core-spi,lib.jboss-deployers-spi,lib.jboss-deployers-structure-spi,lib.jbossmc-kernel,lib.jboss-managed,lib.jbossxb,lib.marshalling-api,lib.servlet"/>
 
     <!-- all: These should be the last targets in the file -->
 

Modified: remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientImpl.java
===================================================================
--- remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientImpl.java	2008-10-02 05:25:36 UTC (rev 4593)
+++ remoting3/trunk/core/src/main/java/org/jboss/remoting/core/ClientImpl.java	2008-10-07 00:08:21 UTC (rev 4594)
@@ -93,24 +93,26 @@
         return "client instance <" + Integer.toString(hashCode()) + ">";
     }
 
-    static final class ExternalizerImpl implements Externalizer<ClientImpl<?, ?>> {
+    static final class ExternalizerImpl implements Externalizer {
 
+        private static final long serialVersionUID = 814228455390899997L;
+
         private final EndpointImpl endpoint;
 
         ExternalizerImpl(final EndpointImpl endpoint) {
             this.endpoint = endpoint;
         }
 
-        public void writeExternal(final ClientImpl<?, ?> client, final ObjectOutput output) throws IOException {
-            output.writeObject(client.handle.getResource());
+        public void writeExternal(final Object o, final ObjectOutput output) throws IOException {
+            output.writeObject(((ClientImpl)o).handle.getResource());
         }
 
-        public ClientImpl<?, ?> createExternal(final Class<ClientImpl<?, ?>> clientClass, final ObjectInput input, final Creator creator) throws IOException, ClassNotFoundException {
+        public Object createExternal(final Class<?> aClass, final ObjectInput input, final Creator creator) throws IOException, ClassNotFoundException {
             final RequestHandler handler = (RequestHandler) input.readObject();
             return new ClientImpl(handler.getHandle(), endpoint.getExecutor());
         }
 
-        public void readExternal(final ClientImpl<?, ?> client, final ObjectInput input) throws IOException, ClassNotFoundException {
+        public void readExternal(final Object o, final ObjectInput input) throws IOException, ClassNotFoundException {
             // no op
         }
     }

Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicHandler.java
===================================================================
--- remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicHandler.java	2008-10-02 05:25:36 UTC (rev 4593)
+++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/remoting/protocol/basic/BasicHandler.java	2008-10-07 00:08:21 UTC (rev 4594)
@@ -45,6 +45,7 @@
 import org.jboss.marshalling.Unmarshaller;
 import org.jboss.marshalling.ByteOutput;
 import org.jboss.marshalling.Marshaller;
+import org.jboss.marshalling.Configuration;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.Executor;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -64,6 +65,7 @@
 
     //--== Connection configuration items ==--
     private final MarshallerFactory marshallerFactory;
+    private final Configuration configuration;
     private final int linkMetric;
     private final Executor executor;
     private final ClassLoader classLoader;
@@ -102,6 +104,7 @@
         executor = configuration.getExecutor();
         classLoader = configuration.getClassLoader();
         marshallerFactory = configuration.getMarshallerFactory();
+        this.configuration = new Configuration();
         linkMetric = configuration.getLinkMetric();
     }
 
@@ -148,17 +151,18 @@
                     }
                     final Object payload;
                     try {
-                        final Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller();
+                        final Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller(configuration);
                         try {
                             unmarshaller.start(createByteInput(buffer, true));
                             try {
                                 payload = unmarshaller.readObject();
+                                unmarshaller.finish();
                             } catch (ClassNotFoundException e) {
                                 log.trace("Class not found in one-way request for client ID %d", Integer.valueOf(clientId));
                                 break;
                             }
                         } finally {
-                            IoUtils.safeClose(unmarshaller);
+                            // TODO: IoUtils.safeClose(unmarshaller);
                         }
                     } catch (IOException ex) {
                         log.error(ex, "Failed to unmarshal a one-way request");
@@ -182,18 +186,19 @@
                     final int requestId = buffer.getInt();
                     final Object payload;
                     try {
-                        final Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller();
+                        final Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller(configuration);
                         try {
                             unmarshaller.start(createByteInput(buffer, true));
                             try {
                                 payload = unmarshaller.readObject();
+                                unmarshaller.finish();
                             } catch (ClassNotFoundException e) {
                                 log.trace("Class not found in request ID %d for client ID %d", Integer.valueOf(requestId), Integer.valueOf(clientId));
                                 // todo - send request receive failed message
                                 break;
                             }
                         } finally {
-                            IoUtils.safeClose(unmarshaller);
+                            // TODO: IoUtils.safeClose(unmarshaller);
                         }
                     } catch (IOException ex) {
                         log.trace("Failed to unmarshal a request (%s), sending %s", ex, MessageType.REQUEST_RECEIVE_FAILED);
@@ -213,18 +218,19 @@
                     }
                     final Object payload;
                     try {
-                        final Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller();
+                        final Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller(configuration);
                         try {
                             unmarshaller.start(createByteInput(buffer, true));
                             try {
                                 payload = unmarshaller.readObject();
+                                unmarshaller.finish();
                             } catch (ClassNotFoundException e) {
                                 replyHandler.handleException("Reply unmarshalling failed", e);
                                 log.trace("Class not found in reply to request ID %d", Integer.valueOf(requestId));
                                 break;
                             }
                         } finally {
-                            IoUtils.safeClose(unmarshaller);
+                            // TODO: IoUtils.safeClose(unmarshaller);
                         }
                     } catch (IOException ex) {
                         log.trace("Failed to unmarshal a reply (%s), sending a ReplyException");
@@ -271,7 +277,7 @@
                     }
                     final Throwable cause;
                     try {
-                        final Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller();
+                        final Unmarshaller unmarshaller = marshallerFactory.createUnmarshaller(configuration);
                         try {
                             unmarshaller.start(createByteInput(buffer, true));
                             try {
@@ -286,7 +292,7 @@
                                 break;
                             }
                         } finally {
-                            IoUtils.safeClose(unmarshaller);
+                            // TODO: IoUtils.safeClose(unmarshaller);
                         }
                     } catch (IOException ex) {
                         log.trace("Failed to unmarshal an exception reply (%s), sending a generic execution exception");
@@ -436,7 +442,7 @@
             buffer.put((byte) MessageType.REPLY.getId());
             buffer.putInt(requestId);
             try {
-                final org.jboss.marshalling.Marshaller marshaller = marshallerFactory.createMarshaller();
+                final org.jboss.marshalling.Marshaller marshaller = marshallerFactory.createMarshaller(configuration);
                 try {
                     final List<ByteBuffer> bufferList = new ArrayList<ByteBuffer>();
                     final ByteOutput output = createByteOutput(allocator, bufferList);
@@ -450,7 +456,7 @@
                         IoUtils.safeClose(output);
                     }
                 } finally {
-                    IoUtils.safeClose(marshaller);
+                    // TODO: IoUtils.safeClose(marshaller);
                 }
             } catch (IOException e) {
                 log.error(e, "Failed to send a reply to the remote side");
@@ -465,7 +471,7 @@
             buffer.put((byte) MessageType.REQUEST_FAILED.getId());
             buffer.putInt(requestId);
             try {
-                final org.jboss.marshalling.Marshaller marshaller = marshallerFactory.createMarshaller();
+                final org.jboss.marshalling.Marshaller marshaller = marshallerFactory.createMarshaller(configuration);
                 try {
                     final List<ByteBuffer> bufferList = new ArrayList<ByteBuffer>();
                     final ByteOutput output = createByteOutput(allocator, bufferList);
@@ -479,7 +485,7 @@
                         IoUtils.safeClose(output);
                     }
                 } finally {
-                    IoUtils.safeClose(marshaller);
+                    // TODO: IoUtils.safeClose(marshaller);
                 }
             } catch (IOException e) {
                 log.error(e, "Failed to send an exception to the remote side");
@@ -515,41 +521,6 @@
         }
     }
 
-    private int writeUTFZ(ByteBuffer buffer, CharSequence s) {
-        final int len = s.length();
-        for (int i = 0; i < len; i++) {
-            char c = s.charAt(i);
-            if (1 <= c && c < 0x80) {
-                if (buffer.hasRemaining()) {
-                    buffer.put((byte) c);
-                } else {
-                    return i;
-                }
-            } else if (c < 0x0800) {
-                if (buffer.remaining() >= 2) {
-                    buffer.put((byte) (0xc0 | (c >> 6)));
-                    buffer.put((byte) (0x80 | (c & 0x3f)));
-                } else {
-                    return i;
-                }
-            } else {
-                if (buffer.remaining() >= 3) {
-                    buffer.put((byte) (0xe0 | (c >> 12)));
-                    buffer.put((byte) (0x80 | ((c >> 6) & 0x3f)));
-                    buffer.put((byte) (0x80 | (c & 0x3f)));
-                } else {
-                    return i;
-                }
-            }
-        }
-        if (buffer.hasRemaining()) {
-            buffer.put((byte) 0);
-            return -1;
-        } else {
-            return len;
-        }
-    }
-
     // Reader utils
 
     private String readUTFZ(ByteBuffer buffer) {
@@ -641,7 +612,7 @@
             log.trace("Sending outbound one-way request of type %s", request == null ? "null" : request.getClass());
             try {
                 final List<ByteBuffer> bufferList;
-                final Marshaller marshaller = marshallerFactory.createMarshaller();
+                final Marshaller marshaller = marshallerFactory.createMarshaller(configuration);
                 try {
                     bufferList = new ArrayList<ByteBuffer>();
                     final ByteOutput output = createByteOutput(allocator, bufferList);
@@ -655,7 +626,7 @@
                         IoUtils.safeClose(output);
                     }
                 } finally {
-                    IoUtils.safeClose(marshaller);
+                    // TODO: IoUtils.safeClose(marshaller);
                 }
                 try {
                     registerWriter(channel, new SimpleWriteHandler(allocator, bufferList));
@@ -675,7 +646,7 @@
             log.trace("Sending outbound request of type %s", request == null ? "null" : request.getClass());
             try {
                 final List<ByteBuffer> bufferList;
-                final Marshaller marshaller = marshallerFactory.createMarshaller();
+                final Marshaller marshaller = marshallerFactory.createMarshaller(configuration);
                 try {
                     bufferList = new ArrayList<ByteBuffer>();
                     final ByteOutput output = createByteOutput(allocator, bufferList);
@@ -708,7 +679,7 @@
                         IoUtils.safeClose(output);
                     }
                 } finally {
-                    IoUtils.safeClose(marshaller);
+                    // TODO: IoUtils.safeClose(marshaller);
                 }
             } catch (final IOException t) {
                 log.trace(t, "receiveRequest failed with an exception");

Modified: remoting3/trunk/testing-support/src/main/resources/testing.policy
===================================================================
--- remoting3/trunk/testing-support/src/main/resources/testing.policy	2008-10-02 05:25:36 UTC (rev 4593)
+++ remoting3/trunk/testing-support/src/main/resources/testing.policy	2008-10-07 00:08:21 UTC (rev 4594)
@@ -70,3 +70,8 @@
 {
     permission java.security.AllPermission;
 };
+
+grant codeBase "file:${lib.marshalling-api.local}"
+{
+    permission java.security.AllPermission;
+};




More information about the jboss-remoting-commits mailing list