Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0-M1
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              norman Norman Maurer
              Reporter:
              bago Stefano Bagnara
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: