jbosscache-dev-bounces(a)lists.jboss.org wrote:
Yes, this sounds good. Make sure the Cache Loader interface
is appropriately javadoc'd to this effect though, so
implementors satisfy the contract - especially the implicit
parts about not closing the stream, not catching exceptions, etc.
We can probably implement a simple object stream wrapper class that
disables close().
> So basically the contract with object based streams obliges
> cacheloader implementors as following:
>
> - they are not allowed to close the stream
> - they should not catch any exceptions
> - they should not wrap the provided object stream
>
> And it gives us (state transfer generators/integrators) all the
> flexibility we need:
>
> - we keep control of which stream we pass
> - we keep the reference to the passed stream
> - we keep control of stream closing and exception handling
>
> If this contract is violated we lose interoperability between various
> cacheloaders, cacheloader implementations are very error prone and it
> becomes very hard for state transfer generators/integrators to
> correctly implement state transfers.