I understand that the Commandhandlers and Message handlers are stateless. What I am not clear the configuration part.
With you proposed design the DataCommandHandler needs to be configured message handlers two ways <handler command="MAIL" class="my.SPFHandler"></handler> <handler command="DATA" class="org.apache.james.smtpserver.DataCmdHandler"> <!--Message handler --> <handler command="MAIL" class="my.SPFHandler"> </handler> </handler> OR The DataCommandHandler queries the SMTPSession to give list of Messagehandlers. Since the idea is to localize the message handlers this second approach will not be taken I guess. If we take the first approach we will be duplicating the configuration. How are you planning to address this? Naren -----Original Message----- From: Stefano Bagnara [mailto:[EMAIL PROTECTED] Sent: Friday, April 21, 2006 10:11 PM To: James Developers List Subject: Re: Fast-fail / Handlerchain change proposal Venkataraman, Narendra wrote: > How would we configure a handler class that implements both > CommandHandler and Message Handler? > Will the DataCommandHandler call all the commandhandlers to see if > they want add any header to final message? You can specify the same class as commandHandler and as messageHandler. Handlers are threadsafe and stateless, so they can share informations via "SMTPSession.getState". Data shared in that map would be a "shared space" in this first refactoring, but I think we will move forward by changing the whole thing using dependencies between handlers and extension points in handlers. My motto is that it is better to make some step now instead of thinking you can try to jump too long tomorrow. Refactoring in one of the best java weapons! Stefano --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]