First, let me say thanks for mina. It's saved me weeks of work, and is truly jaw-dropping awesome.
My question is probably more of a generic Java/design question, but I'm starting to feel like an idiot for not being able to come up with a solution. I'm implementing a small client server application, and would like to provide an API that can be used to do small integration work when needed, so that I don't have to implement every feature request. Ideally, I'd like to hide any mina implementation details so that the user never sees it (and has no access to it), and would like to know if anyone has done something similiar. I started out with a class that extends IoHandlerAdapter, but that of course makes the functions from IoHandlerAdapter available to any user of the class since they are all public. After that, I implemented a session instance in the API class, but lost the ability to get notified of events. Currently I'm creating a session for every API call, and then close the session when the call is done, which is expensive. Ideally I would like to keep just one session for all the calls call write(Object) to contact the server and messageReceived() to handle the response. Does anyone have any idea what would be the best way to try and implement something like this? Lion
