james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harmeet Bedi" <hb...@yahoo.com>
Subject Proposal to factor Common code in James Protocol Servers into AbstractService.
Date Wed, 02 May 2001 12:11:44 GMT
There is a some common code in

james/pop3server/POP3Server.java
james/smtpserver/SMTPServer.java
james/remotemanager/RemoteManager.java
james/imapserver/IMAPServer.java
james/nntpserver/NNTPServer.java

All of these classes derive from
avalon/cornerstone/services/connection/AbstractService.

If the base class handled <configure> then the only code needed would be
implementation of
    protected ConnectionHandlerFactory createFactory();

I don't think this vastly improves the James system but it would have these
benefits:
- duplication would be removed. This would mean consistent behaviour and
better maintainability.
- If the code could be factored into Avalon, other prototocol servers that
are not related to James but do similar things to POP, SMTP etc. could reuse
the same pattern.
- Avalon Stack will be more full featured and would capture the code pattern
better. This may make Avalon more attractive.




Here is a specific proposal.
a) have AbstractService handle configure and any other code in James
protocol servers for logging etc.
b) James protocol servers POP3Server etc. will only implement 1 method
<createFactory>. Nothing else.

This is not directly related to the 'Logging' emails but, but by reducing
code it would be easier to spot inconsistencies.

thoughts, votes ?

Harmeet


----- Original Message -----
From: "Peter Donald" <donaldp@apache.org>
To: <james-dev@jakarta.apache.org>
Sent: Wednesday, May 02, 2001 3:08 AM
Subject: Re: Logging


> At 10:23  2/5/01 +0000, Charles Benett wrote:
> >How can we get the logging from SMTPHandler into the smtpserver.log and
> >that from POP3Handler into the POP3server.log? At the moment they mainly
> >log to connections.log.
>
> ug thats a bug in cornerstone.blocks.connection I think. You should be
able
> to fix it by removing the line "setupLogger( m_handler );" in
> cornerstone.blocks.connection.ConnectionRunner.run().
>
> >I thought this was a case of calling setupLogger(this, smtp) to create a
> >category connections.smtp. Then in server.xml, category smtpserver and
> >category connections.smtp could be pointed at the same target.
>
> If that was called from a block named "connections" then this would be the
> case. However the handler is created in block smtpserver so that should be
> fine (once you fix the above bug).
>
> >(And my
> >Avalon question was: could we till do that under your new proposal).
>
> yep. About the only differency is that default category priority (ie
> debug/warn) for smtp will be taken from connections category.
>
> >However, looking today, SMTPHandler extends BaseConnectionHandler. But
> >BaseConnectionHandler is logging to the right log (line 71) whereas
> >SMTPHandler and POP3Handler aren't. As they all use getLogger(), I'm
> >mystified as to how they can be logging to different places.
>
> basically SMTP/POP3Handlers have setLogger() called multiple times and
> second time wipes out original logger object ;/
> Cheers,
>
> Pete
>
> *-----------------------------------------------------*
> | "Faced with the choice between changing one's mind, |
> | and proving that there is no need to do so - almost |
> | everyone gets busy on the proof."                   |
> |              - John Kenneth Galbraith               |
> *-----------------------------------------------------*
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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


Mime
View raw message