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