Re[2]: [Nbserver-devel] NBServer for "client" side ...
Status: Beta
Brought to you by:
szegedia
From: G Z. <zo...@ma...> - 2002-02-25 14:51:33
|
Id=E9zet Attila Szegedi level=E9b=F5l >This looks promising. I've thought about providing support for > client-side > operations (mostly since lots of servers can have "client" behavior as > well - just think of proxy servers), but haven't yet got around to doing > it. > I'll review the code soon and either incorporate it, or raise questions > :-) > > To somewhat assure yourself that you haven't broken anything, run "ant > test". > I know, i know :-) i just want to say, that i didn't make any test case ...:-) One thing, that i forget ... it would be simpler, if there is a ExtendedProtocolHandlerFactory interface which contains just one method: public ProtocolHandler createProtocolHandler (SocketChannel channel,Object attachment); and the Service.doConnect become : public void doConnect( SocketAddress address, Object attachment ) and the 'attachment' object passed through the system, so the ExtendedProtocolHandlerFactory can associate the SocketChannel with some user/ client specific data. I think, in the implementation: Service.java: private final ProtocolHandlerFactory factory; Service(...ProtocolHandlerFactory factory ...) { this.factory =3D factory; should become : private final ExtendedProtocolHandlerFactory factory; Service (...ExtendedProtocolHandlerFactory factory ... ) { this.factory =3D factory; ... Service(...ProtocolHandlerFactory factory ... ) { this.factory =3D new ProtocolHandlerWrapper( factory ); where ProtocolHandlerWrapper.java: class ProtocolHandlerWrapper implement ExtendedProtocolHandler { ProtocolHandler ph; public ProtocolHandler createProtocolHandler(SocketChannel channel,Object attachment) { return ph.createProtocolHandler(channel); } } and that so on ... :-) bye Zsombor -------------------------------------------------- http://www.mailbox.hu - Mert levelezni kell... |