About JBoss Marshalling

JBoss Marshalling is an alternative serialization API that fixes many of the problems found in the JDK serialization API while remaining fully compatible with java.io.Serializable and its relatives, and adds several new tunable parameters and additional features, all of which are pluggable via factory configuration (externalizers, class/instance lookup tables, class resolution, and object replacement, to name a few).

This framework was inspired by the need for certain features unavailable with the standard Object*Stream classes:

  • Pluggable class resolvers, making it easy to customize classloader policy, by implementing a small interface (rather than having to subclass the Object*Stream classes)
  • Pluggable object replacement (also without subclassing)
  • Pluggable predefined class tables, which can dramatically decrease stream size and serialization time for stream types which frequently use a common set of classes
  • Pluggable predefined instance tables, which make it easy to handle remote references
  • Pluggable externalizers which may be used to serialize classes which are not Serializable, or for which an alternate strategy is needed
  • Customizable stream headers
  • Each marshaller instance is highly configurable and tunable to maximize performance based on expected usage patterns
  • A generalized API which can support many different protocol implementations, including protocols which do not necessarily provide all the above features
  • Inexpensive instance creation, beneficial to applications where many short-lived streams are used
  • Support for separate class and instance caches, if the protocol permits; useful for sending multiple messages or requests with a single stream, with separate object graphs but retaining the class cache

David M. Lloyd

JBoss Marshalling 1.2.0 Released, Website Upgraded
Jan 5, 2010 3:28 PM by David M. Lloyd
Some of you may have noticed that JBoss Marshalling 1.2.0.GA has been present in the maven repository for some time. Now that the website upgrade is complete, I'm happy to announce that it is now available from the downloads page as well.

JBoss Marshalling is a framework which wholly replaces Java Serialization with a new API and optional optimized wire format. The standard wire format can also be used as well - giving compatibility with applications using standard serialization, but without the various bugs present therein, and with a potentially significant performance advantage.

Other features that JBoss Marshalling provides which are missing from the Java Object*Stream API include:
  • Pluggable class resolvers, making it easy to customize classloader policy, by implementing a small interface (rather than having to subclass the Object*Stream classes)
  • Pluggable object replacement (also without subclassing)
  • Pluggable predefined class tables, which can dramatically decrease stream size and serialization time for stream types which frequently use a common set of classes
  • Pluggable predefined instance tables, which make it easy to handle remote references
  • Pluggable externalizers which may be used to serialize classes which are not Serializable, or for which an alternate strategy is needed
  • Customizable stream headers
  • Each marshaller instance is highly configurable and tunable to maximize performance based on expected usage patterns
  • A generalized API which can support many different protocol implementations, including protocols which do not necessarily provide all the above features
  • Inexpensive instance creation, beneficial to applications where many short-lived streams are used
  • Support for separate class and instance caches, if the protocol permits; useful for sending multiple messages or requests with a single stream, with separate object graphs but retaining the class cache
The 1.2.0 release features many more optimizations to the River protocol implementation, enhanced error reporting (the object stack is included with the exception stack trace), run-time detection of implementations via the ServiceLoader mechanism, and helper classes to simplify integration with NIO-based applications.
New XNIO, JBoss Marshalling, and More...
Sep 22, 2009 12:44 PM by David M. Lloyd
Since my last post several months ago, I've been quite busy with a number of project releases.
  • JBoss Marshalling version 1.2.0.CR3 - download here, JIRA here. Includes a much more efficient River protocol implementation, and the Java-compatible Serial implementation, both of which have been measured to outperform Java serialization by 50% or more in some cases, while retaining compliance with the Serialization specification.
  • XNIO 2.0.0.CR2 - download here, JIRA here. Includes an improved API, as well as SSL support, which I think will be quite appreciated by anyone who has ever tried to use SSLEngine with NIO.
  • JBoss LogManager 1.1.0.GA - available from the JBoss Maven Repository. A complete re-implementation of the bug-ridden JDK LogManager implementation, with additional handler types (including log4j compatibility), designed specifically to provide a highly efficient and cleanly implemented logging layer for JBossAS.
  • JBoss Logging 2.2.0.CR1 - available from the JBoss Maven Repository. An improved version of the logging facade historically used by JBoss projects which run within JBossAS. This new version improves memory usage by providing the ability for backend implementations to cache and reuse instances in a way that is not subject to the classical ClassLoader issues of other similar frameworks. Also provides logging methods which take advantage of the JDK5 java.util.Formatter class.
There are a number of other projects in the works as well, so stay tuned!
New protocols in JBoss Marshalling
Feb 6, 2009 3:35 PM by David M. Lloyd
It's official... I've checked in the first cut of the Java Serialization from-scratch implementation. It's not complete yet - it doesn't even pass all the tests (Update: everything works now - check it out from SVN and try it!) - but I expect that it will be fully functional by the 1.1.0 release (and, coincidentally, by the time I will be giving my JBoss Marshalling talk at TSSJS). Also in progress is Ron Sigal's JBoss Serialization implementation, which should be in 1.2.0 at the latest.

Look for the 1.1.0.GA release the week of February 23rd.

View more david m. lloyd