This topic has not yet been written. The content below is from the topic description.
JBoss Serialization The serialization sample (found in the org.jboss.remoting.samples.serialization package) illustrates how JBoss Serialization can be used in place of the standard java serialization to allow for sending of invocation payload objects that do not implement the java.io.Serializable interface. This example is composed of three classes: SerializationClient, SerializationServer, and NonSerializablePayload. This example is exactly like the one from the simple example with two differences. The first difference is the use of JBoss Serialization to convert object instances to binary data format for wire transfer. This is accomplished by adding an extra parameter (serializationtype) to the locator url with a value of 'jboss'. Is important to note that use of JBoss Serialization requires JDK 1.5, so this example will need to be run using JDK 1.5. The second difference is instead of sending and receiving a simple String type for the remote invocation payload, will be sending and receiving an instance of the NonSerializablePayload class. There are a few important points to notice with the NonSerializablePayload class. The first is that it does NOT implement the java.io.Serializable interface. The second is that it has a void parameter constructor. This is a requirement of JBoss Serialization for object instances that do not implement the Serializable interface. However, this void parameter constructor can be private, as in the case of NonSerializablePayload, as to not change the external API of the class. To run this example, can compile both the SerializationClient and SerializationServer class, then run the SerializationServer and then the SerializationClient. Or can go to the examples directory and run the ant target 'run-serialization-server' and then in another window run the ant target 'run-serialization-client'. For example: ant run-serialization-server and then: ant run-serialization-client The output in the SerializationClient console window should look like: Calling remoting server with locator uri of: socket://localhost:5400/?serializationtype=jboss Invoking server with request of 'NonSerializablePayload - name: foo, id: 1' Invocation response: NonSerializablePayload - name: bar, id: 2 The output in the SerializationServer console window should look like: Starting remoting server with locator uri of: socket://localhost:5400/?serializationtype=jboss Invocation request is: NonSerializablePayload - name: foo, id: 1 Returning response of: NonSerializablePayload - name: bar, id: 2 Note: will have to manually shut down the SerializationServer once started.