james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Maurer ...@byteaction.de>
Subject Re: svn commit: r419010 - in /james/server/sandbox/handlerapi/src: java/org/apache/james/smtpserver/ java/org/apache/james/smtpserver/basefilter/ java/org/apache/james/smtpserver/fastfailfilter/ test/org/apache/james/smtpserver/
Date Wed, 05 Jul 2006 08:44:47 GMT
Am Mittwoch, den 05.07.2006, 10:09 +0200 schrieb Stefano Bagnara:
> Norman Maurer wrote:
> > Hi guys,
> > 
> > after reading the code a bit more i notice that the
> > setStopHandlerProcessing(boolean) and getStopHandlerProcessing() is not
> > needed on the current implementation. At the moment the
> > handlerProccessing get stoppen after a handler write a response to the
> > user. Anyway im not sure if it is the perfect behavior for a api. 
> > 
> > Any ideas if we should keep my methods in the fastfail code ? or should
> > we remove it. 
> 
> Imho the api should be as simple as possible: if we can't find a good 
> real use case that make use of that methods we should remove them.
> We are at the beginning of the work for a major release, we can safely 
> experiment: we'll probably change this more while adding more handlers.
> 
> > A Other nice solution ( which i had in mind) is to create an
> > AbstractCommandHandler which support all needed methods for a "real"
> > api. So the developer must extend it to implement a CommandHandler. I
> > will commit some code for this later. Then we can see what is better..
> > 
> > Any problems here with a Abstract class ?
> 
> Abstract classes are good.
> 
> Stefano
> 

Thx Stefano for answer. I did the last commit this mornin. Now i think
its more api like. Im not sure if we should maybe implement the
Configurable,Servicable and Initizisable interface in the Abstractclass
and provide the methods for extended classes from there. So the Handler
must not know about it. 

Another think we could think about is to create methods in the Abstract
methods which return for example the dnserver. So the commandHandler
muts not know how to lookup it ( It could do this anyway if someone
want)

Something like:

public void service(ServiceManager serviceMan) throws ServiceException {
        setDataSources((DataSourceSelector) serviceMan.lookup(DataSourceSelector.ROLE));

        setDnsServer((DNSServer) serviceMan.lookup(DNSServer.ROLE));
}

public DNSService getDnsService() {
    ..
}

public void setDnsService(DNSService dnsService) {
    this.dnsService = dnsService;
}

public DataSourceSelector getDataSourceSelector() {
..
}

public void setDataSourceSelector(DataSourceSelector dataSource) {
    this.dataSource = dataSource;
}


IF someone need a special component he could use the norman service
method to access it. IMO that make sense.

Any comments ?

bye
Norman



Mime
View raw message