On 20 Dec 2011, at 17:15, Vladimir Blagojevic wrote:
On 11-12-20 1:54 PM, Pete Muir wrote:
> That should be pretty trivial.
>
> Only hard bit is integrating this into CDI module. Vladimir, do you provide a SPI for
object instantiation and injection in the Map Reduce/Distributed Executor stuff? If so,
Kevin can probably knock it up in an hour or two + tests ;-)
>
No, I do not. I will talk to Kevin so he can let me know what he needs and then we can
take it from there!
Here is the SPI that CDI has for this purpose:
http://docs.oracle.com/javaee/6/api/javax/enterprise/inject/spi/Injection...
I would suggest modelling after it, as it's proved successful, and will make CDI
integration easy. (BTW I don't mean use it directly, I mean copy and paste it into
infinispan code). Furthermore, what I would suggest you do is support the decorator
pattern here, by creating one of these internally, and then allowing it to be got hold of
by an extension, wrapped, and handed back to you. This makes it trivial for the extension
to override the bits it wants. We also need to consider whether we want to allow
overriding the construction and destruction of the object, as I guess by default you
serialise/deserialize these? Might be useful to allow overriding anyway, in a fully
stateless model (where changes are written back to the cache).