[ 
https://issues.apache.org/jira/browse/JAMES-494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved JAMES-494.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: Trunk)
                   3.0-M1
         Assignee: Norman Maurer

we use JSR250 in trunk

> Refactor the service methods to inject services via setters
> -----------------------------------------------------------
>
>                 Key: JAMES-494
>                 URL: https://issues.apache.org/jira/browse/JAMES-494
>             Project: JAMES Server
>          Issue Type: Sub-task
>    Affects Versions: 3.0
>            Reporter: Stefano Bagnara
>            Assignee: Norman Maurer
>             Fix For: 3.0-M1
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to