Am Freitag, den 21.04.2006, 13:27 +0200 schrieb Stefano Bagnara: > Hi all, > > I would like to change something in the current handlerchain code > (formerly known as fastfail code). > > 1) Move some code from the SMTPHandler to the DataCmdHandler. I think > that the MessageHandler stuff (onMessage calls) should be inside the > DataCmdHandler itself.
Thats probaly right > > 2) Split currently provided command handlers into multiple command > handlers: the current handler already support multiple handlers per > command, it simply stop after the first handler writing something as > response. Yes that seems a good point. So we can write "diffrent Handler plugins" per cmd! That is a very good point cause we can move some checks thats optional to new handlers which will us allow to add new features without touching the "mainHandlers" . > > 3) Add an init(SMTPSession session) method to the CmdHandler interface: > implementing this method handlers could add informations to the session > when initialized and, for example, the EHLO handler could add ESMTP > extension headers based on data wrote in SMTPSession.state by the single > CmdHandlers. Can you explain a bit more? is that like the session.getState().put(object) method ? > > 4) still evaluating it: Add a return value to the init method of the > CmdHandler, or a new method, to ask the CmdHandler what command/commands > it handle and > remove the need to use the "command" parameter for CmdHandler. When no > command is specified the handler automatically bind that CmdHandler to > all the declared commands. > > 5) still evaluating it: Add a way to bind to specific events and not in > "chain". I want to write code that is called anyway when a given > command is received (maybe onCommandPre), some code that is executed > only if previous commandhandler did not reply (current onCommand) and > some code that is called just after a commandhandler has replied (maybe > onCommandPost). onCommandPre and onCommandPost would ALL be executed > every time. (setup, clean up things) > > Maybe the init, onCommandPre, onCommandPost should be implemented as > listeners and a CmdHandler implementing this listeners would be notified > on these events. > > What do you think? Sound sounds nice. bye Norman
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil