james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From charl...@apache.org
Subject cvs commit: jakarta-james/src/org/apache/james/transport JamesSpoolManager.java LinearProcessor.java
Date Tue, 01 May 2001 11:52:07 GMT
charlesb    01/05/01 04:52:07

  Modified:    src/org/apache/james/core AvalonMailStore.java
               src/org/apache/james/mailrepository
                        AvalonMailRepository.java
                        AvalonSpoolRepository.java
               src/org/apache/james/transport JamesSpoolManager.java
                        LinearProcessor.java
  Log:
  Start to improve logging.
  
  Revision  Changes    Path
  1.11      +8 -3      jakarta-james/src/org/apache/james/core/AvalonMailStore.java
  
  Index: AvalonMailStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/core/AvalonMailStore.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- AvalonMailStore.java	2001/04/28 12:43:12	1.10
  +++ AvalonMailStore.java	2001/05/01 11:52:06	1.11
  @@ -19,6 +19,7 @@
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.avalon.framework.logger.Loggable;
   import org.apache.avalon.framework.logger.AbstractLoggable;
   import org.apache.james.services.MailRepository;
   import org.apache.james.services.MailStore;
  @@ -73,7 +74,7 @@
           {
               registerRepository((Configuration) registeredClasses[i]);
           }
  -        getLogger().info("James RepositoryManager ...init");
  +        getLogger().info("James MailStore ...init");
       }
   
       public synchronized void registerRepository(Configuration repConf)
  @@ -151,6 +152,9 @@
   
                   try {
                       reply = (MailRepository) Class.forName(repClass).newInstance();
  +                   if (reply instanceof Loggable) {
  +		       setupLogger(reply);
  +                    }
                       if (reply instanceof Configurable) {
                           ((Configurable) reply).configure(repConf);
                       }
  @@ -166,8 +170,9 @@
                       repositories.put(repID, reply);
                       models.put(repID, model);
                       getLogger().info("added repository: "+repID+"->"+repClass);
  -                    getLogger().info( "New instance of " + repClass +
  -                                      " created for " + destination );
  +		    /*                    getLogger().info( "New instance of " + repClass +
  +		     *		  " created for " + destination );
  +                     */
                       return (Component)reply;
                   } catch (Exception e) {
                       getLogger().warn( "Exception while creating repository:" +
  
  
  
  1.17      +6 -0      jakarta-james/src/org/apache/james/mailrepository/AvalonMailRepository.java
  
  Index: AvalonMailRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/mailrepository/AvalonMailRepository.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- AvalonMailRepository.java	2001/04/28 15:14:37	1.16
  +++ AvalonMailRepository.java	2001/05/01 11:52:06	1.17
  @@ -52,6 +52,7 @@
       private ObjectRepository or;
       private MailStore mailstore;
       private String destination;
  +    private static boolean DEEP_DEBUG = true;
   
       public void configure(Configuration conf) throws ConfigurationException {
           destination = conf.getAttribute("destinationURL");
  @@ -90,6 +91,7 @@
               sr = (StreamRepository) store.select(streamConfiguration);
               or = (ObjectRepository) store.select(objectConfiguration);
               lock = new Lock();
  +	    getLogger().debug(this.getClass().getName() + " created in " + destination);
           } catch (Exception e) {
               final String message = "Failed to retrieve Store component:" + e.getMessage();
               getLogger().error( message, e );
  @@ -122,20 +124,24 @@
               mc.writeMessageTo(out);
               out.close();
               or.put(key, mc);
  +	    if(DEEP_DEBUG) getLogger().debug("Mail " + key + " stored." );
               notifyAll();
           } catch (Exception e) {
  +	    getLogger().error("Exception storing mail: " + e);
               e.printStackTrace();
               throw new RuntimeException("Exception caught while storing Message Container:
" + e);
           }
       }
   
       public MailImpl retrieve(String key) {
  +	if(DEEP_DEBUG) getLogger().debug("Retrieving mail: " + key);
           MailImpl mc = (MailImpl) or.get(key);
           try {
               InputStream in = new FileMimeMessageInputStream(sr, key);
               mc.setMessage(in);
               in.close();
           } catch (Exception me) {
  +	    getLogger().error("Exception retrieving mail: " + me);
               throw new RuntimeException("Exception while retrieving mail: " + me.getMessage());
           }
           return mc;
  
  
  
  1.6       +1 -0      jakarta-james/src/org/apache/james/mailrepository/AvalonSpoolRepository.java
  
  Index: AvalonSpoolRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/mailrepository/AvalonSpoolRepository.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AvalonSpoolRepository.java	2001/04/08 00:30:28	1.5
  +++ AvalonSpoolRepository.java	2001/05/01 11:52:06	1.6
  @@ -39,6 +39,7 @@
                   
                   String s = it.next().toString();
                   if (lock.lock(s)) {
  +		    getLogger().debug("accept() has locked: " + s);
                       return s;
                   }
                   //  Object o = it.next();
  
  
  
  1.33      +1 -1      jakarta-james/src/org/apache/james/transport/JamesSpoolManager.java
  
  Index: JamesSpoolManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/JamesSpoolManager.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- JamesSpoolManager.java	2001/04/28 12:43:18	1.32
  +++ JamesSpoolManager.java	2001/05/01 11:52:06	1.33
  @@ -105,8 +105,8 @@
               String processorName = processorConf.getAttribute("name");
               try {
                   LinearProcessor processor = new LinearProcessor();
  +                setupLogger(processor, processorName);
                   processor.setSpool(spool);
  -                processor.setLogger( getLogger() );
                   processor.initialize();
                   processors.put(processorName, processor);
   
  
  
  
  1.19      +6 -7      jakarta-james/src/org/apache/james/transport/LinearProcessor.java
  
  Index: LinearProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/transport/LinearProcessor.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- LinearProcessor.java	2001/04/28 12:43:18	1.18
  +++ LinearProcessor.java	2001/05/01 11:52:06	1.19
  @@ -10,7 +10,7 @@
   import java.io.*;
   import java.util.*;
   import javax.mail.*;
  -import org.apache.avalon.framework.logger.Loggable;
  +import org.apache.avalon.framework.logger.AbstractLoggable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.james.*;
   import org.apache.james.core.*;
  @@ -35,9 +35,10 @@
    * Note that the 'onerror' attribute is not yet supported.
    */
   public class LinearProcessor 
  -    implements Loggable, Initializable {
  +    extends AbstractLoggable
  +    implements Initializable {
   
  -    private final static boolean DEBUG_PRINT_PIPE = false;
  +    private final static boolean DEEP_DEBUG = true;
   
       private List mailets;
       private List matchers;
  @@ -47,12 +48,9 @@
       private Logger logger;
       private SpoolRepository spool;
   
  -    public void setLogger(Logger logger) {
  -        this.logger = logger;
  -    }
  -
       public void setSpool(SpoolRepository spool) {
           this.spool = spool;
  +	if (DEEP_DEBUG) getLogger().debug("Using spool: " + spool);
       }
   
   
  @@ -74,6 +72,7 @@
   
   
       public synchronized void service(MailImpl mail) throws MessagingException {
  +	if (DEEP_DEBUG) getLogger().debug("Servicing mail: " + mail.getName());
           //make sure we have the array built
           if (unprocessed == null) {
               //Need to construct that object
  
  
  

---------------------------------------------------------------------
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