I just committed this code (CTR): http://svn.apache.org/viewvc?view=rev&revision=685510
Robert, I know this was in your roadmap too.. even if I directly committed this please take it as a proposal.
It only changes a couple of method visibility in main code so I decided to be agile and commit it, so during the review process I can even test the resulting build.
I hope this is one step in the same direction you had in your mind. Please review and tell me what you think.
This uncouple the "Handlers" from cornerstone/excalibur so that the only classes with cornerstone/excalibur depdendencies should be the "Servers".
I plan to test the resulting DelegatingSMTPServer in my environment, and if this works fine I'd like to refactor all of our existing protocol implementations by using this new "pattern".
Any objection? Stefano [EMAIL PROTECTED] ha scritto:
Author: bago Date: Wed Aug 13 04:00:58 2008 New Revision: 685510 URL: http://svn.apache.org/viewvc?rev=685510&view=rev Log: First attempt at creating a delegating socket-server. - changed some visibility from AbstractJamesHandler to allow my extension. - Introduced ProtocolHandler and ProtocolHandlerHelper interfaces. - created a DelegatingJamesHandler that expose a ProtocolHandlerHelper service to the managed "ProtocolHandler" (received in the constructor). - created a DelegatingSMTPServer that is identical to SMTPServer but manages a pool of DelegatingJamesHandler (containing SMTPProtocolHandlers) instead of SMTPHandlers. - created an SMTPProtocolHandler by cloning the current SMTPHandler. The main advantage is that SMTPProtocolHandler has no knowledge of cornerstone/excalibur because they are incapsulated in the DelegatingJamesHandler . The used interfaces are meant to make it really simple the porting of our current services to this structure. We can then refactor the interface to expose better names for methods/services. We could also move the ProtocolHandler/ProtocolHandlerHelper to a lower layer. This code is *untested*, ATM. Added: james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/DelegatingJamesHandler.java (with props) james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/ProtocolHandler.java (with props) james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/ProtocolHandlerHelper.java (with props) james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/DelegatingSMTPServer.java (with props) james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPProtocolHandler.java (with props) Modified: james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractJamesHandler.java
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
