james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hb...@apache.org
Subject cvs commit: jakarta-james/src/org/apache/james James.java
Date Sat, 14 Apr 2001 21:41:14 GMT
hbedi       01/04/14 14:41:14

  Modified:    src/org/apache/james James.java
  Log:
  NNTP Server functionality
  
  Revision  Changes    Path
  1.30      +23 -1     jakarta-james/src/org/apache/james/James.java
  
  Index: James.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/James.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- James.java	2001/03/31 02:40:36	1.29
  +++ James.java	2001/04/14 21:41:14	1.30
  @@ -35,6 +35,7 @@
   import org.apache.james.imapserver.*;
   import org.apache.james.pop3server.*;
   import org.apache.james.remotemanager.*;
  +import org.apache.james.nntpserver.NNTPServer;
   import org.apache.james.services.*;
   import org.apache.james.smtpserver.*;
   import org.apache.james.transport.*;
  @@ -89,6 +90,7 @@
       private boolean provideSMTP = false;
       private boolean providePOP3 = false;
       private boolean provideIMAP = false;
  +    private boolean provideNNTP = false;
       private IMAPSystem imapSystem;
       private Host imapHost;
       protected BlockContext           blockContext;
  @@ -193,7 +195,11 @@
               provideIMAP = true;
               getLogger().info("Providing IMAP services");
           }
  -        if (! (provideSMTP | providePOP3 | provideIMAP)) {
  +        if (services.getAttribute("NNTP").equals("TRUE")) {
  +            provideNNTP = true;
  +            getLogger().info("Providing NNTP services");
  +        }
  +        if (! (provideSMTP | providePOP3 | provideIMAP | provideNNTP)) {
               throw new ConfigurationException ("Fatal configuration error: no services specified!");
           }
   
  @@ -330,6 +336,20 @@
               }
           }
   
  +        NNTPServer nntpServer = null;
  +        if (provideNNTP) {
  +            nntpServer = new NNTPServer();
  +            try {
  +                setupLogger( nntpServer, "NNTPServer" );
  +                nntpServer.configure(conf.getChild("nntpServer"));
  +                nntpServer.contextualize(context);
  +                nntpServer.compose(compMgr);
  +            } catch (Exception e) {
  +                getLogger().error("Exception in NNTPServer init: " + e.getMessage());
  +                throw e;
  +            }
  +        }
  +
           RemoteManager remoteAdmin = new RemoteManager();
           try {
               setupLogger( remoteAdmin, "RemoteManager" );
  @@ -369,12 +389,14 @@
               smtpServer.init();
               dnsServer.init();
           }
  +        if (provideNNTP) nntpServer.init();
           remoteAdmin.init();
   
           System.out.print(VERSION + " providing: ");
           if (provideSMTP) {System.out.print("SMTP ");}
           if (providePOP3) {System.out.print("POP3 ");}
           if (provideIMAP) {System.out.print("IMAP ");}
  +        if (provideNNTP) {System.out.print("NNTP ");}
           System.out.println("services.");
   
           getLogger().info("JAMES ...init end");
  
  
  

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


Mime
View raw message