james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anagha Mudigonda <anaghamudigo...@gmail.com>
Subject need suggestions for JAMES fast fail optimization
Date Wed, 03 Aug 2005 14:15:10 GMT
While I was refactoring, I have encountered the following problem.

Every Commandhandler will have specific configuration. It is best parsed by 
the Command handler implementation itself. 

Since JAMES already uses the Avalon framework's configuration class
for XML parsing, I have used the same.

import org.apache.avalon.framework.configuration.Configuration;
public interface CommandHandler {
    void configure (Configuration configuration);
    void setSMTPSession(SMTPSession session);
    void processCommand();
    void processMessage();

Though the Commandhandlers and SMTPSession are specific to Session,
their configuration is very much a one time task.

I am thinking of having one set of SMTPSession and all the
CommandHandler objects created and configured at the start up in
SMTPServer. These will cloned and handed over whenever SMTP session
objects are needed for the actual protocol session.

It would look like this


//creates the SMTPSession object and creates all the CommandHandler from
//the new config.xml 
//The commandhandlers are configured and registered with SMTPSession object

When SMTPhandler needs  SMTPSession object, it makes a *deep* copy of
the SMTPServer's SMTPSession  object.

Would like to know if there is a better technique to 
a) keep the commandhandler specific configuration parsing code encapsulated.
b) not to parse the XML configuration every time CommandHandler object
is created.


To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message