[ http://issues.apache.org/jira/browse/DIRMINA-210?page=comments#action_12378632 ]
peter royal commented on DIRMINA-210: ------------------------------------- (Raw notes from IRC discussion) [09:49am] proyal: trustin, i like your idea about ByteBuffer.allocate, but i'd want to keep the existing way of doing it via statics, rather than having it check to the current thread.. ByteBuffer.allocate() would basically be a deprecated way.. IoSession.getAllocator().allocate() would be preferred (when the user wants pooling) [09:50am] luke_red5: 205 isnt critical for us, but I guess it would effect the spring api part [09:50am] trustin: proyal, yes it's simpler way for us. But IoSession.getAllocator().allocate() takes more time to type hmm.. [09:50am] trustin: luke_red5, yes it's an API addition. [09:51am] luke_red5: i guess integration isnt that core to mina, at least i dont mind updating as we go [09:51am] vrm: I don't care much about memory pooling optimisations, I would hate to need to type IoSession.getAllocator().allocate() [09:51am] proyal: trustin: right, that's the downside, more typing.. [09:51am] trustin: You're right. It's a good-to-have feature. [09:52am] proyal: i'm also 100% fine with leaving ByteBuffer allocation as-is [09:52am] trustin: Perhaps we could provide a method in IoHandlerAdapter. [09:52am] trustin: IoHandlerAdapter.allocate(session, size)? [09:52am] trustin: as a static method? [09:53am] proyal: trustin, heck, ByteBuffer.allocate( session, size) then.. [09:53am] trustin: ahhh you're right, proyal [09:53am] trustin: that would be very nice. [09:53am] proyal: dunno if that's mixing the two interfaces together unnecessarily then.. [09:53am] luke_red5: will it still be possible to allocate without a session [09:53am] proyal: but the general idea is fine [09:53am] doniv: that will create an unnecessary dep [09:53am] trustin: hmm right. [09:54am] trustin: though they are in the same package. [09:54am] doniv: starts getting ugly when u test bytebuffer [09:54am] trustin: It might be OK because these static methods are just a utility. hmm... [09:54am] trustin: yeah we'll need a mock object. [09:56am] proyal: luke_red5: yes, would be able to allocate w/o a session, just that there would be an Allocator per-IoHandler or such [09:56am] luke_red5: can someone tell me why the session is needed to be passed in. Will you set the allocator for the session? [09:56am] luke_red5: ok you answered before i asked [09:56am] proyal: so you could always instantiate your own allocator and allocate from that > Investigate removal of static methods in ByteBuffer > --------------------------------------------------- > > Key: DIRMINA-210 > URL: http://issues.apache.org/jira/browse/DIRMINA-210 > Project: Directory MINA > Type: Improvement > Reporter: peter royal > Assignee: peter royal > > The removal of the static methods in ByteBuffer should be investigated. > Since the ByteBufferAllocator exists, that interface could be used directly. > For backwards compatibility ( and simple cases ), the static methods could be > retained and use a supplied instance. > Potentially, the MINA internals could all access buffers via the allocator, > leaving only user-code to use the optional static methods (after statically > supplying the allocator). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
