[OJB-developers] PersistenceBrokerServlet
Brought to you by:
thma
From: <Joa...@tp...> - 2002-05-13 10:29:19
|
Hy, I'm once again working on the PersistenceBrokerServlet. And once again I have to do some refactoring to enable code-reuse. I thought that I have to write another PersistenceBrokerClient to enable using HTTP as the transport protocol for reuse but fortunately this has proven to be unnecessary. In fact I found a way to handle this case quite easily. I don't know if it really is as good as I think it is, therefore I'll describe it here and just request some comments before I check it in: - Created a ServerConnection interface that has three functions getInputStream, getOutputStream and close. - I turned ServerEntry into an Interface that has a single Method getConnection() that returns a ServerConnection - Wrote two implementation for ServerEntry: SocketServerEntry and HttpServerEntry - Both ServerEntry implementations have a private inner class that are implementations of ServerConnection. - Changed ServerPool to let the parsing of the configuration be done by the ServerEntry implementations (it only looks wether the location starts with http:// or https://, if so it hands it to HttpServerEntry, otherwise SocketServerEntry gets it). - Change PersistenceBrokerClient to handle ServerConnections instead of Sockets (not much of a change, since the interface is almost identical). I still haven't got a working Implementation of PersistenceBrokerServlet, but that should work today. All JUnit test work fine (nothing else was expected as my changes don't change any behaviour, but only syntax & structure). btw, in ClassDescriptor.java multiArgumentConstructor was made non-transient. That broke C/S-mode. I think makeing both multiArgumentConstructor and alreadyLookedup transient should fix the problem and work just fine. btw2, hsqldb seems to have problems with the nested inner join syntax ... at least it breaks on some JUnits tests that work just fine on MySQL. (I'll try to reproduce this later and post a seperate bug report if needed). regards Joachim Sauer |