peter royal wrote:
On May 2, 2006, at 1:05 PM, Alex Cruise wrote:
peter royal wrote:
Call ByteBuffer.setUseDirectBuffers( false )

and it will always use heap buffers.
Is there any way this could be made friendlier to IoC containers by making the method non-static and adding it to a longer-lived class?

Thanks,

Currently, ByteBuffer allocation is done via static methods. The way to do that would be to remove the static methods, and pass around the ByteBufferAllocator anywhere that a ByteBuffer is needed.. which will trickle around to many places in the code, alas.

If we were to do that, pre-1.0 is certainly the time.. anyone else have thoughts on this?
I think this is quite a low-level configuration like the ones (-X...) of the JVM so it shouldn't clutter the high-level API und thus make it harder to use. I don't understand why the configuration of this flag is that much different in an IoC-Container. I don't know Spring well enough, but in HiveMind this can easily be done in a clear way via configuration points. So I would vote for keeping the static methods.

Mike

Reply via email to