[infinispan-dev] Preliminary implementation for ISPN-244 and improvement suggestions.

Elias Ross genman at noderunner.net
Wed Dec 8 16:58:58 EST 2010

On Wed, Dec 8, 2010 at 1:05 PM, Mircea Markus <mircea.markus at jboss.com> wrote:
> Isn't this possible even now through XML?
> <marshallable id="456" typeClass="com.acme.Person"  externalizerClass="com.acme.SameExternalizer"/>
> <marshallable id="457" typeClass="com.acme.HotPerson"  externalizerClass="com.acme.SameExternalizer"/>

There are a few things that came to mind here:

1. In terms of assigning IDs, it needs to be fairly clear there's no
"global" conflict and having IDs at the annotation level makes it a
bit unclear what actual number goes with what class. Additionally,
Infinispan (and users themselves) might want to provide externalizers,
and unless there's assigned ranges to those teams, putting the ID
within the annotation it somewhat difficult to reuse these classes.
How would a team provide a combined cache from two separate instances
that happen to use different externalizers with the same ID?

Still, having ranges reserved by Infinispan itself would make sense.
If at all possible, I would restrict them to less than, say 64 or 32,
thus allowing custom types to be passed as byte values.

I feel having the IDs in one place also makes things easier to debug.
For network analysis, it's helpful as a reference.

2. Can't the configuration be simply:

<marshallable id="456" externalizerClass="com.acme.SameExternalizer"/>

and then you simply call SameExternalizer.class.getTypeParameters()[0]
to determine the type class?

More information about the infinispan-dev mailing list