users@shoal.java.net

Message serialization question

From: Jim Marino <jim.marino_at_gmail.com>
Date: Tue, 30 Sep 2008 09:38:05 -0700

Hi,

I have just started evaluating Shoal for a project that currently uses
JXTA and have a question regarding message serialization. Our runtime
uses a peer-classloader scheme similar to OSGi for isolating
extensions. Extensions can provide a number of different types of
services, such as transaction support, HTTP, security, etc. An
additional capability they may provide is the ability to send commands
from a group leader to member runtimes. Commands are sent as
messages. The actual command and message types (i.e. Java classes) are
loaded in the extension classloader and will not be visible to the
thread context classloader or the Shoal classloader (Shoal will be
loaded as another extension).


I noticed in ClusterManager.send(final ID peerid, final Serializable
msg) messages are serialized using Java serialization. Since our
message classes will be loaded in a different classloaders than the
TCCL or the Shoal classloader, we need to insert a mechanism to handle
deserialization in our peer classloader environment. Currently, we
are using JXTA for communication and have implemented a mechanism to
handle serialization/deserialization in our environment. Is there a
way our runtime can hook into Shoal to perform message serialization/
deserialization? If not, would the best approach be to encode our
message contents (either as a String or byte array) before they are
sent to Shoal and to deserialize them after our member runtime
receives notification from Shoal on the other end?

My issue is probably a general one that will be encountered by peer-
classloading based runtimes whose functionality is provided via
extensions.

Thanks,
Jim

P.S. Shoal looks like a really good technology - I like the fact that
it has a very small footprint.