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
- XML configuration serialization format
configuration JMX Open Type Descriptor
list of Phoenix Blocks it depends on.
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
- 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”)