You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Wes McKean <wm...@logictrends.com> on 2004/01/23 21:07:11 UTC

ASN.1 Interfaces

There are two basic ASN.1 processes, encoding and decoding.  Encoding is easy and will be handled by a simple ASNEncoder class that will return a ByteBuffer of the PDU when it is complete.  I think the existing ASNEncoder interface is a good example of what this one is going to look like.

The decoder is a bit more complicated.  Again, the picture is clear.  The thread reading the ByteBuffers is going to look up the decoder by client key, and pass off the byte buffer to the decoder.  I think this should be a non-blocking operation.  The call which hands off the ByteBuffer should return immediately, allowing the reading thread to continue on.  If we do it this way, then how does the new ByteBuffer get decoded?  Will the reading thread pluck a thread from the pool, and pass the decoder off to this thread to continue decoding?  I'm OK with that.  Once the decoder realizes it has received an entire TLV tree, it will then need to notify the translator that a Tree is ready for translating.  I would assume that this would be another stage?  With its own thread pool?

Tell me what you think!  Jeff, please join us when you get a chance!

Wes