james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Fondermann (JIRA)" <server-...@james.apache.org>
Subject [jira] Assigned: (JAMES-494) Refactor the service methods to inject services via setters
Date Mon, 17 Jul 2006 08:51:15 GMT
     [ http://issues.apache.org/jira/browse/JAMES-494?page=all ]

Bernd Fondermann reassigned JAMES-494:
--------------------------------------

    Assignee:     (was: Bernd Fondermann)

The task is at least 50% completed. 

There are still discussions how mailets and matchers should receive references to needed services
and  whether or not this should happen through setter injection. This is the part where some
setters are missing, while others had been added before already.

> Refactor the service methods to inject services via setters
> -----------------------------------------------------------
>
>                 Key: JAMES-494
>                 URL: http://issues.apache.org/jira/browse/JAMES-494
>             Project: James
>          Issue Type: Sub-task
>    Affects Versions: 3.0
>            Reporter: Stefano Bagnara
>             Fix For: 3.0
>
>
> Nothing worth more than an example:
> Here is the current service method of the SMTPServer:
> public void service( final ServiceManager manager ) throws ServiceException {
> 	super.service( manager );
> 	serviceManager = manager;
> 	mailetcontext = (MailetContext) manager.lookup("org.apache.mailet.MailetContext");
> 	mailServer = (MailServer) manager.lookup(MailServer.ROLE);
> 	users = (UsersRepository) manager.lookup(UsersRepository.ROLE);
> 	dnsServer = (DNSServer) manager.lookup(DNSServer.ROLE); 
> }
> We could change it to
> public void service( final ServiceManager manager ) throws ServiceException {
> 	super.service( manager );
> 	serviceManager = manager;
> 	setMailetContext((MailetContext) manager.lookup("org.apache.mailet.MailetContext"));
> 	setMailServer((MailServer) manager.lookup(MailServer.ROLE));
> 	setUsersRepository((UsersRepository) manager.lookup(UsersRepository.ROLE));
> 	setDNSServer((DNSServer) manager.lookup(DNSServer.ROLE)); 
> }
> and add the above setters.
> This way we can fill dependencies of SMTPServer without using the Serviceable interface
and the ServiceManager component.
> Later we'll move the whole service method and Serviceable interface to the specific Avalon
extension of the "container-agnostic" SMTPServer.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message