You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Robert Burrell Donkin <ro...@gmail.com> on 2009/09/16 13:54:51 UTC

[smtp] Factor SMTPSession out of SMTPHandler

i'm trying to replace the helper set with a context passed into the
handleProtocol method. for SMTP, i think that the best way to do this
would be to factor the SMTPSession function out from the handler and
create a new SMTPSession each time.

opinions?
objections?

- robert

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


Re: [smtp] Factor SMTPSession out of SMTPHandler

Posted by Norman Maurer <no...@apache.org>.
Ok now I get it.. +1

Bye,
Norman

2009/9/16 Robert Burrell Donkin <ro...@gmail.com>:
> On Wed, Sep 16, 2009 at 12:58 PM, Norman Maurer <no...@apache.org> wrote:
>> Hi Robert,
>>
>> I'm not getting it. could you provide some pseudo code or just go
>> ahead and commit ? We can rollback later if it will not work out ;)
>
> POP3 and SMTP both use a design whereby the ProtocolHandler is also
> implements the session. each time that a new connection is made and
> the handleProtocol method called, logically a new session begins and
> local fields are set. i prefer a design whereby a new instance of a
> session implementation is created each time. the IMAP bridge code uses
> this design eg http://james.apache.org/server/head/xref/org/apache/james/imapserver/ImapHandler.html#115.
> i think this is easier to follow since it's obvious when the session
> is created and is destroyed without understanding the james sockets
> foo. this would also allow those fields which are immutable for the
> session to be marked final.
>
> this would mean moving the session support from SMTPHandler into a
> SMTPSessionImpl then injecting the required information on creation.
>
> - robert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

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


Re: [smtp] Factor SMTPSession out of SMTPHandler

Posted by Robert Burrell Donkin <ro...@gmail.com>.
On Wed, Sep 16, 2009 at 12:58 PM, Norman Maurer <no...@apache.org> wrote:
> Hi Robert,
>
> I'm not getting it. could you provide some pseudo code or just go
> ahead and commit ? We can rollback later if it will not work out ;)

POP3 and SMTP both use a design whereby the ProtocolHandler is also
implements the session. each time that a new connection is made and
the handleProtocol method called, logically a new session begins and
local fields are set. i prefer a design whereby a new instance of a
session implementation is created each time. the IMAP bridge code uses
this design eg http://james.apache.org/server/head/xref/org/apache/james/imapserver/ImapHandler.html#115.
i think this is easier to follow since it's obvious when the session
is created and is destroyed without understanding the james sockets
foo. this would also allow those fields which are immutable for the
session to be marked final.

this would mean moving the session support from SMTPHandler into a
SMTPSessionImpl then injecting the required information on creation.

- robert

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


Re: [smtp] Factor SMTPSession out of SMTPHandler

Posted by Norman Maurer <no...@apache.org>.
Hi Robert,

I'm not getting it. could you provide some pseudo code or just go
ahead and commit ? We can rollback later if it will not work out ;)

Bye,
Norman

2009/9/16 Robert Burrell Donkin <ro...@gmail.com>:
> i'm trying to replace the helper set with a context passed into the
> handleProtocol method. for SMTP, i think that the best way to do this
> would be to factor the SMTPSession function out from the handler and
> create a new SMTPSession each time.
>
> opinions?
> objections?
>
> - robert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

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