Differences between revisions 15 and 16
Revision 15 as of 2005-06-14 11:58:34
Size: 2760
Editor: proxy0-hh
Comment:
Revision 16 as of 2009-09-20 22:58:47
Size: 2776
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Member of [:../: New SMTP Block] 's [http://c2.com/cgi/wiki?ChainOfResponsibilityPattern Chain Of Reposiblity]. Member of [[../| New SMTP Block]] 's [[http://c2.com/cgi/wiki?ChainOfResponsibilityPattern|Chain Of Reposiblity]].
Line 5: Line 5:
Processes [http://www.faqs.org/rfcs/rfc2821.html SMTP protocol commands] one at a time. Processes [[http://www.faqs.org/rfcs/rfc2821.html|SMTP protocol commands]] one at a time.
Line 7: Line 7:
Follows [http://www.picocontainer.org/Setter+Injection Setter Injection] pattern for receiving both configuration parameters and [http://loom.codehaus.org/Component+layers Phoenix Blocks] it depends on. Follows [[http://www.picocontainer.org/Setter+Injection|Setter Injection]] pattern for receiving both configuration parameters and [[http://loom.codehaus.org/Component+layers|Phoenix Blocks]] it depends on.
Line 11: Line 11:
[:../: New SMTP Block] introspects implementing class for each of its subordinate ProtocolLet -s and deducts its [[../| New SMTP Block]] introspects implementing class for each of its subordinate ProtocolLet -s and deducts its
Line 13: Line 13:
 * configuration [http://docs.jboss.org/jbossas/javadoc/3.2.7/jmx/javax/management/openmbean/OpenType.html JMX Open Type Descriptor]
 * list of [http://loom.codehaus.org/Component+layers Phoenix Blocks] it depends on.
 * configuration [[http://docs.jboss.org/jbossas/javadoc/3.2.7/jmx/javax/management/openmbean/OpenType.html|JMX Open Type Descriptor]]
 * list of [[http://loom.codehaus.org/Component+layers|Phoenix Blocks]] it depends on.
Line 24: Line 24:
[:../: New SMTP Block] [[../| New SMTP Block]]
Line 28: Line 28:
[:../: New SMTP Block]'s JMX facility
 * exposes all of the configuration as a single [http://docs.jboss.org/jbossas/javadoc/3.2.7/jmx/javax/management/openmbean/OpenType.html Open Type] JMX attribute
[[../| New SMTP Block]]'s JMX facility
 * exposes all of the configuration as a single [[http://docs.jboss.org/jbossas/javadoc/3.2.7/jmx/javax/management/openmbean/OpenType.html|Open Type]] JMX attribute
Line 65: Line 65:
(Compiled from [wiki:FastFail FastFail] and [http://mail-archives.apache.org/mod_mbox/james-server-dev/200506.mbox/%3cOF3C9E9454.0BC764AD-ON80257019.002CAB01-80257019.002E29DE@slc.co.uk%3e  "07 Jun 2005 message on server-dev”]) (Compiled from [[FastFail|FastFail]] and [[http://mail-archives.apache.org/mod_mbox/james-server-dev/200506.mbox/%3cOF3C9E9454.0BC764AD-ON80257019.002CAB01-80257019.002E29DE@slc.co.uk%3e|"07 Jun 2005 message on server-dev”]])

Definition

Member of New SMTP Block 's Chain Of Reposiblity.

Processes SMTP protocol commands one at a time.

Follows Setter Injection pattern for receiving both configuration parameters and Phoenix Blocks it depends on.

Implementation Details

New SMTP Block introspects implementing class for each of its subordinate ProtocolLet -s and deducts its

TODO: choose a way to distinguish setters for injecting configuration values from those for injecting dependencies. Alternative approaches are:

  • use some naming convention, like injectFoo, setFooDependency

  • for Java 1.5 use annotations
  • use metadata files, like .xinfo
  • consider that every setter coupled with getter is a configuration value and every one without is a dependency

Lifecycle

New SMTP Block

  • reads XML configuration from file
  • instantiates ProtocolLet

New SMTP Block's JMX facility

  • exposes all of the configuration as a single Open Type JMX attribute

  • when administrator alters configuration by specifing a new value for this attribute
    • creates a new instance of the same ProtocolLet

    • configures it according to the new configuration
    • decomissions the old instance and replaces it with the new one
  • upon invocation of a special JMX method saves configuration back to file in XML format

Interfaces

Each ProtocolLet implements at least one of the following interfaces

  interface ConnectionHandler (
    RulesResponce onConnection(Socket)
  }

  interface CommandsHandler {
    RulesResponce Map getCommands()
  }

  interface CommandHandler {
    RulesResponce onCommand(...)
  }

  interface MessageHandler {
    RulesResponce onMessage(...)
  }

  RulesResponse {
    boolean getSuccess();
    SMTPResponseCode getSMTPResponseCode();
    DSNResponseCode getDSNResponseCode();
    String getMessage();
    boolean isResponseMultiline();
  }

(Compiled from FastFail and "07 Jun 2005 message on server-dev”)

SummerOfCode2005/SergeyLubinskiyFastFail/ProtocolLet (last edited 2009-09-20 22:58:47 by localhost)