Dear Emmanuel,

thanks for answer.

On Mon 31.08.2009 09:30, Emmanuel Lecharny wrote:
What your call the 'backend' is in fact your application. Consider
MINA as a part of it, and then the messageReceive will be able to
invoke the part of the application that deal with the received XML

I think i call it remote-server-protocol.

Maybe a picture will help.

http://none.at/MyProtoConv.jpg

The easiest way to do that is to have a class in your application that
extends the IoHandler interface : it will handle the messageReceived
event.

I have a used the IoHandlerAdapter isn't it enough?
I use the IoHandler, I yust want to reuse the connection which I have
created at server startup time.

BR

Aleks

Aleksandar Lazic wrote:
Dear list member,

I need do develop a middleware which converts a textline protocol to a
xml-protocol.

The first part is done.
Receiving the textline protocol
(ProtocolCodecFilter(Textline,MyDecoder_based on Textline)).

Now I get the received message into my handler and need to send the data
to the backend.

I would like to limit the connnections to the backend as follows.

Psydocode
###
main(){
remote_session_object = new XML-Protocol(...);
IoAcceptor acceptor = new NioSocketAcceptor();
.
.
???.setAttribute("MyObject", remote_session_object);
.
.
acceptor.setHandler(MyHandler);
.
.
}

class MyHandler extends IoHandlerAdapter {
    @Override
    public void messageReceived(IoSession session, Object message) {
remote_session_object = (ML-Protocol) session.getAttribute("MyObject");
    }
}
###

So that I have one connection to the backend and get only the object.

I hope I have explained it understandable.

Please can anybody point me to the right javadoc or example ;-)

Many thanks

Aleks





Reply via email to