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 Miroslav Nachev <mi...@space-comm.com> on 2003/08/08 13:26:08 UTC

How to add some functionality to SMTPServer

   Hi,

   I would like to add some functionality to SMTPServer.java, but this
is very hard to do that because all variables like 'theHandlerFactory'
are private, and are used direct instead public get mothods like
'getHandlerFactory()'. In this case to modify some small part I have
to rewrite all the existing code or to write directly in the
SMTPServer.java class.
   Is there any easy and clever way to do that instead the above way.


   Regards,
   Miro.



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


Re: How to add some functionality to SMTPServer

Posted by Miroslav Nachev <mi...@space-comm.com>.
   Instead the hard coded I do the following in MySMTPServer.java:

   public class MySMTPServer
      extends SMTPServer
   {
       private ObjectFactory theHandlerFactory = getSMTPHandlerFactory();


       public static ObjectFactory getSMTPHandlerFactory()
       {
           return new ObjectFactory()
           {
              public Object newInstance()
              {
                 ...
              }
              ...
           }
       }
   }


   Regards,
   Miro.



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