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/java/org/apache/james/userrepository UsersFileRepository.java
Date Wed, 06 Jun 2001 13:18:37 GMT
charlesb    01/06/06 06:18:36

  Modified:    proposals/v1.3/java/org/apache/james James.java
               proposals/v1.3/java/org/apache/james/userrepository
                        UsersFileRepository.java
               src/java/org/apache/james James.java
               src/java/org/apache/james/imapserver
                        DefaultRecordRepository.java FileMailbox.java
                        JamesHost.java SimpleMessageAttributes.java
               src/java/org/apache/james/mailrepository
                        AvalonMailRepository.java
               src/java/org/apache/james/transport/mailets
                        RemoteDelivery.java ToRepository.java
               src/java/org/apache/james/userrepository
                        UsersFileRepository.java
  Log:
  Corrected most of the deprecated methods from Avalon 4.0b2 and Logkit 1.0b2
  
  Revision  Changes    Path
  1.4       +3 -3      jakarta-james/proposals/v1.3/java/org/apache/james/James.java
  
  Index: James.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/proposals/v1.3/java/org/apache/james/James.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- James.java	2001/05/22 12:03:05	1.3
  +++ James.java	2001/06/06 13:17:42	1.4
  @@ -370,9 +370,9 @@
               String destination = inboxRootURL + userName + File.separator;;
               DefaultConfiguration mboxConf
                   = new DefaultConfiguration("repository", "generated:AvalonFileRepository.compose()");
  -            mboxConf.addAttribute("destinationURL", destination);
  -            mboxConf.addAttribute("type", "MAIL");
  -            mboxConf.addAttribute("model", "SYNCHRONOUS");
  +            mboxConf.setAttribute("destinationURL", destination);
  +            mboxConf.setAttribute("type", "MAIL");
  +            mboxConf.setAttribute("model", "SYNCHRONOUS");
               try {
                   userInbox = (MailRepository) mailstore.select(mboxConf);
                   mailboxes.put(userName, userInbox);
  
  
  
  1.4       +5 -5      jakarta-james/proposals/v1.3/java/org/apache/james/userrepository/UsersFileRepository.java
  
  Index: UsersFileRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/proposals/v1.3/java/org/apache/james/userrepository/UsersFileRepository.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- UsersFileRepository.java	2001/06/06 10:50:18	1.3
  +++ UsersFileRepository.java	2001/06/06 13:17:48	1.4
  @@ -38,8 +38,8 @@
    * @author  Federico Barbieri <scoobie@pop.systemy.it>
    * @author  <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
    *
  - * Last changed by: $Author: charlesb $ on $Date: 2001/06/06 10:50:18 $
  - * $Revision: 1.3 $
  + * Last changed by: $Author: charlesb $ on $Date: 2001/06/06 13:17:48 $
  + * $Revision: 1.4 $
    */
   public class UsersFileRepository
       extends AbstractLoggable
  @@ -89,9 +89,9 @@
                   = new DefaultConfiguration( "repository",
                                               "generated:UsersFileRepository.compose()" );
   
  -            objectConfiguration.addAttribute( "destinationURL", destination );
  -            objectConfiguration.addAttribute( "type", "OBJECT" );
  -            objectConfiguration.addAttribute( "model", "SYNCHRONOUS" );
  +            objectConfiguration.setAttribute( "destinationURL", destination );
  +            objectConfiguration.setAttribute( "type", "OBJECT" );
  +            objectConfiguration.setAttribute( "model", "SYNCHRONOUS" );
   
               or = (ObjectRepository)store.select( objectConfiguration );
   	    getLogger().debug(this.getClass().getName() + " created in " + destination);
  
  
  
  1.2       +4 -3      jakarta-james/src/java/org/apache/james/James.java
  
  Index: James.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/James.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- James.java	2001/05/11 10:36:17	1.1
  +++ James.java	2001/06/06 13:17:54	1.2
  @@ -206,6 +206,7 @@
                   getLogger().info("Using SimpleSystem.");
                   imapHost = (Host) Class.forName(imapHostClass).newInstance();
                   //imapHost = new JamesHost();
  +		setupLogger(imapHost, "imaphost");
                   imapHost.configure(conf.getChild("imapHost"));
                   imapHost.contextualize(context);
                   imapHost.compose(compMgr);
  @@ -349,9 +350,9 @@
               String destination = inboxRootURL + userName + File.separator;;
               DefaultConfiguration mboxConf
                   = new DefaultConfiguration("repository", "generated:AvalonFileRepository.compose()");
  -            mboxConf.addAttribute("destinationURL", destination);
  -            mboxConf.addAttribute("type", "MAIL");
  -            mboxConf.addAttribute("model", "SYNCHRONOUS");
  +            mboxConf.setAttribute("destinationURL", destination);
  +            mboxConf.setAttribute("type", "MAIL");
  +            mboxConf.setAttribute("model", "SYNCHRONOUS");
               try {
                   userInbox = (MailRepository) mailstore.select(mboxConf);
                   mailboxes.put(userName, userInbox);
  
  
  
  1.2       +6 -5      jakarta-james/src/java/org/apache/james/imapserver/DefaultRecordRepository.java
  
  Index: DefaultRecordRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/imapserver/DefaultRecordRepository.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultRecordRepository.java	2001/05/11 11:01:10	1.1
  +++ DefaultRecordRepository.java	2001/06/06 13:18:00	1.2
  @@ -9,9 +9,9 @@
   
   import java.io.*;
   import java.util.*;
  -import org.apache.log.LogKit;
  -import org.apache.log.Logger;
  +import org.apache.avalon.framework.logger.AbstractLoggable;
   
  +
   /**
    * Implementation of a RecordRepository on a FileSystem.
    *
  @@ -19,11 +19,12 @@
    * @version 0.1 on 14 Dec 2000
    * @see RecordRepository
    */
  -public class DefaultRecordRepository implements RecordRepository   {
  +public class DefaultRecordRepository
  +    extends AbstractLoggable
  +    implements RecordRepository   {
    
       private String path;
       private File repository;
  -    private Logger logger =  LogKit.getLoggerFor("james.mailstore");
   
       public void setPath(final String rootPath) {
           if (path != null) {
  @@ -51,7 +52,7 @@
               out = new ObjectOutputStream( new FileOutputStream(key) );
               out.writeObject(fr);
               out.close();
  -            logger.info("Record stored for: " + fr.getAbsoluteName());
  +            getLogger().info("Record stored for: " + fr.getAbsoluteName());
               notifyAll();
           } catch (Exception e) {
               if (out != null) {
  
  
  
  1.3       +37 -38    jakarta-james/src/java/org/apache/james/imapserver/FileMailbox.java
  
  Index: FileMailbox.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/imapserver/FileMailbox.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileMailbox.java	2001/06/06 10:50:21	1.2
  +++ FileMailbox.java	2001/06/06 13:18:02	1.3
  @@ -16,13 +16,12 @@
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.context.Context;
  +import org.apache.avalon.framework.logger.AbstractLoggable;
   import org.apache.james.AccessControlException;
   import org.apache.james.AuthorizationException;
   import org.apache.james.Constants;
   import org.apache.james.core.EnhancedMimeMessage;
   import org.apache.james.services.UsersRepository;
  -import org.apache.log.LogKit;
  -import org.apache.log.Logger;
   import org.apache.mailet.Mail;
   
   /**
  @@ -87,6 +86,7 @@
    * @version 0.1 on 14 Dec 2000
    */
   public class FileMailbox
  +    extends AbstractLoggable
       implements ACLMailbox, Serializable {
   
       public static final String MAILBOX_FILE_NAME = "mailbox.mbr";
  @@ -121,7 +121,6 @@
       private transient Context context;
       private transient Configuration conf;
       private transient ComponentManager compMgr;
  -    private transient Logger logger = LogKit.getLoggerFor("james.MailRepository");
       private transient UsersRepository localUsers;
       private transient HashSet listeners;
   
  @@ -199,7 +198,7 @@
           sequence = new ArrayList();
           recentMessages = new HashSet();
           messagesForDeletion = new HashSet();
  -        logger.info("FileMailbox init for " + absoluteName);
  +        getLogger().info("FileMailbox init for " + absoluteName);
           localUsers = (UsersRepository)compMgr.lookup("org.apache.james.services.UsersRepository");
           String rootPath
               = conf.getChild("mailboxRepository").getValue();
  @@ -237,7 +236,7 @@
                   name = "";
               }
           } else {
  -            logger.error("FileMailbox init error: unknown namespace - "
  +            getLogger().error("FileMailbox init error: unknown namespace - "
                            + absoluteName);
               throw new RuntimeException("Unknown namespace for absoluteName"
                                          +" argument for a FileMailbox"
  @@ -253,7 +252,7 @@
               throw new RuntimeException("Error: Cannot write to directory at " + path);
           }
           writeMailbox();
  -        logger.info("FileMailbox init complete: " + absoluteName);
  +        getLogger().info("FileMailbox init complete: " + absoluteName);
       }
   
       /**
  @@ -263,8 +262,7 @@
        */
       public void reinitialize() throws Exception {
           listeners = new HashSet();
  -        logger = LogKit.getLoggerFor("james.MailRepository");
  -        logger.info("FileMailbox reInit for " + absoluteName);
  +        getLogger().info("FileMailbox reInit for " + absoluteName);
           localUsers = (UsersRepository)compMgr.lookup("org.apache.james.services.UsersRepository");
           String rootPath
               = conf.getChild("mailboxRepository").getValue();
  @@ -280,7 +278,7 @@
        */
       public void dispose() {
           writeMailbox();
  -        logger.info("FileMailbox object destroyed: " + absoluteName);
  +        getLogger().info("FileMailbox object destroyed: " + absoluteName);
       }
   
       /**
  @@ -294,7 +292,7 @@
        */
       public synchronized  boolean checkpoint() {
           writeMailbox();
  -        logger.info("FileMailbox: " + absoluteName + " checkpointed.");
  +        getLogger().info("FileMailbox: " + absoluteName + " checkpointed.");
           return true;
       }
   
  @@ -979,7 +977,7 @@
                  IllegalArgumentException {
   
           if (message == null || username == null) {
  -            logger.error("Null argument received in store.");
  +            getLogger().error("Null argument received in store.");
               throw new IllegalArgumentException("Null argument received in store.");
           }
           if (!hasInsertRights(username)) { //throws AccessControlException
  @@ -988,6 +986,7 @@
   
           SimpleMessageAttributes attrs = new SimpleMessageAttributes();
           try {
  +            setupLogger(attrs);
               attrs.setAttributesFor(message);
           } catch (javax.mail.MessagingException me) {
               throw new RuntimeException("Exception creating SimpleMessageAttributes: " + me);
  @@ -1018,11 +1017,11 @@
                  IllegalArgumentException {
   
           if (msgAttrs == null || message == null || username == null) {
  -            logger.error("Null argument received in store.");
  +            getLogger().error("Null argument received in store.");
               throw new IllegalArgumentException("Null argument received in store.");
           }
           if (! (msgAttrs instanceof SimpleMessageAttributes)) {
  -            logger.error("Wrong class for Attributes");
  +            getLogger().error("Wrong class for Attributes");
               throw new IllegalArgumentException("Wrong class for Attributes");
           }
           SimpleMessageAttributes attrs = (SimpleMessageAttributes)msgAttrs;
  @@ -1043,7 +1042,7 @@
               outAttrs.writeObject(attrs);
               outAttrs.close();
           } catch(Exception e) {
  -            logger.error("Error writing message to disc: " + e);
  +            getLogger().error("Error writing message to disc: " + e);
               e.printStackTrace();
               throw new
                   RuntimeException("Exception caught while storing Mail: "
  @@ -1053,7 +1052,7 @@
                   outMsg.close();
                   outAttrs.close();
               } catch (IOException ie) {
  -                logger.error("Error closing streams: " + ie);
  +                getLogger().error("Error closing streams: " + ie);
               }
           }
           marked = true;
  @@ -1074,7 +1073,7 @@
           }
           //}
           writeFlags(newUID, flags);
  -        logger.info("Mail " + newUID + " written in " + absoluteName);
  +        getLogger().info("Mail " + newUID + " written in " + absoluteName);
   
           return true;
       }
  @@ -1131,7 +1130,7 @@
                   response = new EnhancedMimeMessage(Session.getDefaultInstance(System.getProperties(), null),inMsg);
                   inMsg.close();
               } catch(Exception e) {
  -                logger.error("Error reading message from disc: " + e);
  +                getLogger().error("Error reading message from disc: " + e);
                   e.printStackTrace();
                   throw new
                       RuntimeException("Exception caught while retrieving Mail: "
  @@ -1140,10 +1139,10 @@
                   try {
                       inMsg.close();
                   } catch (IOException ie) {
  -                    logger.error("Error closing streams: " + ie);
  +                    getLogger().error("Error closing streams: " + ie);
                   }
               }
  -            logger.info("EnhancedMimeMessage " + uid + " read from " + absoluteName);
  +            getLogger().info("EnhancedMimeMessage " + uid + " read from " + absoluteName);
               return response;
           } else {
               return null;
  @@ -1243,9 +1242,9 @@
               try {
                   inAttrs = new ObjectInputStream( new FileInputStream(path + File.separator + uid + ATTRIBUTES_EXTENSION));
                   response = (SimpleMessageAttributes)inAttrs.readObject();
  -                response.reinitialize();
  +                setupLogger(response);
               } catch(Exception e) {
  -                logger.error("Error reading attributes from disc: " + e);
  +                getLogger().error("Error reading attributes from disc: " + e);
                   e.printStackTrace();
                   throw new
                       RuntimeException("Exception caught while retrieving Message attributes: "
  @@ -1254,10 +1253,10 @@
                   try {
                       inAttrs.close();
                   } catch (IOException ie) {
  -                    logger.error("Error closing streams: " + ie);
  +                    getLogger().error("Error closing streams: " + ie);
                   }
               }
  -            logger.info("MessageAttributes for " + uid + " read from " + absoluteName);
  +            getLogger().info("MessageAttributes for " + uid + " read from " + absoluteName);
               return response;
           } else {
               return null;
  @@ -1288,7 +1287,7 @@
                   outAttrs.writeObject(attrs);
                   outAttrs.close();
               } catch(Exception e) {
  -                logger.error("Error writing message to disc: " + e);
  +                getLogger().error("Error writing message to disc: " + e);
                   e.printStackTrace();
                   throw new
                       RuntimeException("Exception caught while storing Attributes: "
  @@ -1297,10 +1296,10 @@
                   try {
                       outAttrs.close();
                   } catch (IOException ie) {
  -                    logger.error("Error closing streams: " + ie);
  +                    getLogger().error("Error closing streams: " + ie);
                   }
               }
  -            logger.info("MessageAttributes for " + uid + " written in " + absoluteName);
  +            getLogger().info("MessageAttributes for " + uid + " written in " + absoluteName);
   
               return true;
           } else {
  @@ -1430,7 +1429,7 @@
                   }
   
                   writeFlags(uid, flags);
  -                logger.debug("Flags for message uid " + uid + " in " + absoluteName + " updated.");
  +                getLogger().debug("Flags for message uid " + uid + " in " + absoluteName + " updated.");
                   return true;
               } else {
                   return false;
  @@ -1465,7 +1464,7 @@
                   inFlags = new ObjectInputStream( new FileInputStream(path + File.separator + uid + FLAGS_EXTENSION));
                   response = (Flags)inFlags.readObject();
               } catch(Exception e) {
  -                logger.error("Error reading flags from disc: " + e);
  +                getLogger().error("Error reading flags from disc: " + e);
                   e.printStackTrace();
                   throw new
                       RuntimeException("Exception caught while retrieving Message flags: "
  @@ -1474,10 +1473,10 @@
                   try {
                       inFlags.close();
                   } catch (IOException ie) {
  -                    logger.error("Error closing streams: " + ie);
  +                    getLogger().error("Error closing streams: " + ie);
                   }
               }
  -            logger.info("Flags for " + uid + " read from " + absoluteName);
  +            getLogger().info("Flags for " + uid + " read from " + absoluteName);
           }
           return response;
       }
  @@ -1490,7 +1489,7 @@
                   outFlags.writeObject(flags);
                   outFlags.close();
               } catch(Exception e) {
  -                logger.error("Error writing message to disc: " + e);
  +                getLogger().error("Error writing message to disc: " + e);
                   e.printStackTrace();
                   throw new
                       RuntimeException("Exception caught while storing Flags: "
  @@ -1499,10 +1498,10 @@
                   try {
                       outFlags.close();
                   } catch (IOException ie) {
  -                    logger.error("Error closing streams: " + ie);
  +                    getLogger().error("Error closing streams: " + ie);
                   }
               }
  -            logger.info("Flags for " + uid + " written in " + absoluteName);
  +            getLogger().info("Flags for " + uid + " written in " + absoluteName);
               return true;
           } else {
               return false;
  @@ -1535,7 +1534,7 @@
                       final File attrFile = new File(path + File.separator + uid + ATTRIBUTES_EXTENSION );
                       attrFile.delete();
                       sequence.remove(uidObj);
  -                    logger.debug( "Removed message uid " + uid );
  +                    getLogger().debug( "Removed message uid " + uid );
                   } catch ( final Exception e )  {
                       throw new RuntimeException( "Exception caught while removing" +
                                                   " a message: " + e );
  @@ -1566,7 +1565,7 @@
               throw new
                   RuntimeException("Exception caught while storing Mailbox: " + e);
           }
  -        logger.info("FileMailbox written: " + absoluteName);
  +        getLogger().info("FileMailbox written: " + absoluteName);
       }
   
   
  @@ -1658,7 +1657,7 @@
                   response = new InternetHeaders(inMsg);
                   inMsg.close();
               } catch(Exception e) {
  -                logger.error("Error reading headers of message from disc: " + e);
  +                getLogger().error("Error reading headers of message from disc: " + e);
                   e.printStackTrace();
                   throw new
                       RuntimeException("Exception caughtt while retrieving InternetHeaders: "    + e);
  @@ -1666,10 +1665,10 @@
                   try {
                       inMsg.close();
                   } catch (IOException ie) {
  -                    logger.error("Error closing streams: " + ie);
  +                    getLogger().error("Error closing streams: " + ie);
                   }
               }
  -            logger.info("InternetHeaders for message " + uid + " read from "
  +            getLogger().info("InternetHeaders for message " + uid + " read from "
                           + absoluteName);
               return response;
           } else {
  
  
  
  1.2       +49 -46    jakarta-james/src/java/org/apache/james/imapserver/JamesHost.java
  
  Index: JamesHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/imapserver/JamesHost.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JamesHost.java	2001/05/11 11:01:11	1.1
  +++ JamesHost.java	2001/06/06 13:18:05	1.2
  @@ -18,12 +18,12 @@
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.avalon.framework.logger.AbstractLoggable;
   import org.apache.james.AccessControlException;
   import org.apache.james.AuthorizationException;
   import org.apache.james.services.*;
  -import org.apache.log.LogKit;
  -import org.apache.log.Logger;
   
  +
   /**
    * A single host that has an IMAP4rev1 messaging server.
    * There should be one instance of this class per instance of James.
  @@ -41,12 +41,12 @@
    * @see RecordRepository
    */
   public class JamesHost 
  +    extends AbstractLoggable
       implements Host, Component, Initializable {
   
       private Context context;
       private Configuration conf;
       private ComponentManager compMgr;
  -    private Logger logger  = LogKit.getLoggerFor("james.JamesHost");
       private String rootPath; // ends with File.seperator
       private File rootFolder;
       private IMAPSystem imapSystem;
  @@ -110,14 +110,15 @@
       
       public void initialize() throws Exception {
   
  -        logger.info("JamesHost init...");
  +        getLogger().info("JamesHost init...");
           imapSystem = (IMAPSystem) compMgr.lookup("org.apache.james.imapserver.IMAPSystem");
           localUsers = (UsersRepository)compMgr.lookup("org.apache.james.services.UsersRepository");
           String recordRepDest
               = conf.getChild("recordRepository").getValue();
           recordRep = new DefaultRecordRepository();
  +	setupLogger(recordRep, "recordRep");
           recordRep.setPath(recordRepDest);
  -        logger.info("AvalonRecordRepository opened at " + recordRepDest);
  +        getLogger().info("AvalonRecordRepository opened at " + recordRepDest);
           rootPath = conf.getChild("mailboxRepository").getValue();
           if (!rootPath.endsWith(File.separator)) {
               rootPath = rootPath + File.separator;
  @@ -130,7 +131,7 @@
           } else if (!rootFolder.canWrite()) {
               throw new RuntimeException("Error: Cannot write to directory for MailboxRepository");
           }
  -        logger.info("IMAP Mailbox Repository opened at " + rootPath);
  +        getLogger().info("IMAP Mailbox Repository opened at " + rootPath);
           Configuration namespaces = conf.getChild("namespaces");
           namespaceToken = namespaces.getAttribute("token");
           privateNamespace
  @@ -145,10 +146,10 @@
               = namespaces.getChild("sharedNamespace").getValue();
           sharedNamespaceSeparator
               = namespaces.getChild("sharedNamespace").getAttribute("separator");
  -        logger.info("Handling mail for namespaces: "+ privateNamespace + ", " + otherUsersNamespace + ", " + sharedNamespace);
  +        getLogger().info("Handling mail for namespaces: "+ privateNamespace + ", " + otherUsersNamespace + ", " + sharedNamespace);
           openMailboxes = new HashMap(31); // how big should this start?
           mailboxCounts = new HashMap(31);
  -        logger.info("JamesHost ...init end");
  +        getLogger().info("JamesHost ...init end");
       }
   
       /**
  @@ -192,17 +193,17 @@
       public synchronized ACLMailbox getMailbox(String user, String mailboxName)
           throws AccessControlException, MailboxException { 
           if (user == null || mailboxName == null) {
  -            logger.error("Null parameters received in getMailbox(). " );
  +            getLogger().error("Null parameters received in getMailbox(). " );
               throw new RuntimeException("Null parameters received.");
           } else if (user.equals("")
                      ||(!mailboxName.startsWith(namespaceToken))) {
  -            logger.error("Empty/ incorrect parameters received in getMailbox().");
  +            getLogger().error("Empty/ incorrect parameters received in getMailbox().");
               throw new RuntimeException("Empty/incorrect parameters received.");
           }
  -        logger.debug("Getting mailbox " + mailboxName + " for " + user);
  +        getLogger().debug("Getting mailbox " + mailboxName + " for " + user);
           String absoluteName = getAbsoluteName(user, mailboxName);
           if (absoluteName == null) {
  -            logger.error("Parameters in getMailbox() cannot be interpreted. ");
  +            getLogger().error("Parameters in getMailbox() cannot be interpreted. ");
               throw new RuntimeException("Parameters in getMailbox() cannot be interpreted.");
           }
           return getAbsoluteMailbox(user, absoluteName);
  @@ -229,7 +230,7 @@
                       Integer c = (Integer)mailboxCounts.get(absoluteName);
                       int count = c.intValue() + 1;
                       mailboxCounts.put(absoluteName, (new Integer(count)));
  -                    logger.info("Request no " + count + " for " + absoluteName);
  +                    getLogger().info("Request no " + count + " for " + absoluteName);
                       return mailbox;
                   }
               } else {
  @@ -239,6 +240,7 @@
                   try {
                       in        = new ObjectInputStream( new FileInputStream(key + File.separator + FileMailbox.MAILBOX_FILE_NAME) );
                       mailbox = (FileMailbox) in.readObject();
  +		    setupLogger(mailbox);
                       mailbox.configure(conf);
                       mailbox.contextualize(context);
                       mailbox.compose(compMgr);
  @@ -292,19 +294,19 @@
           throws AccessControlException, AuthorizationException,
           MailboxException {
           if (user == null || mailboxName == null) {
  -            logger.error("Null parameters received in createMailbox(). " );
  +            getLogger().error("Null parameters received in createMailbox(). " );
               throw new RuntimeException("Null parameters received.");
           } else if (user.equals("")
                      ||(!mailboxName.startsWith(namespaceToken))) {
  -            logger.error("Empty/ incorrect parameters received in createMailbox().");
  +            getLogger().error("Empty/ incorrect parameters received in createMailbox().");
               throw new RuntimeException("Empty/incorrect parameters received.");
           }
           String absoluteName = getAbsoluteName(user, mailboxName);
           if (absoluteName == null) {
  -            logger.error("Parameters in createMailbox() cannot be interpreted. ");
  +            getLogger().error("Parameters in createMailbox() cannot be interpreted. ");
               throw new RuntimeException("Parameters in createMailbox() cannot be interpreted.");
           }
  -        logger.debug("JamesHost createMailbox() for:  " + absoluteName);
  +        getLogger().debug("JamesHost createMailbox() for:  " + absoluteName);
   
           return createAbsoluteMailbox(user, absoluteName);
       }
  @@ -320,14 +322,14 @@
           if( recordRep.containsRecord(absoluteName)) {
               record = recordRep.retrieve(absoluteName);
               if (!record.isDeleted()) {
  -                logger.error("Attempt to create an existing Mailbox.");
  +                getLogger().error("Attempt to create an existing Mailbox.");
                   throw new MailboxException("Mailbox already exists", MailboxException.ALREADY_EXISTS_LOCALLY);
               }
           } else {
               String parent
                   = absoluteName.substring(0, absoluteName.lastIndexOf(privateNamespaceSeparator));
               if (!(parent.startsWith(privateNamespace + privateNamespaceSeparator) || parent.startsWith(sharedNamespace + sharedNamespaceSeparator))) {
  -                logger.warn("No such parent: " + parent);
  +                getLogger().warn("No such parent: " + parent);
                   throw new MailboxException("No such parent: " + parent);
               }
               //Recurse to a created and not deleted mailbox
  @@ -347,13 +349,14 @@
               } 
               try {
                   mailbox = new FileMailbox();
  +		setupLogger(mailbox);
                   mailbox.configure(conf);
                   mailbox.contextualize(context);
                   mailbox.compose(compMgr);
                   mailbox.prepareMailbox(user, absoluteName, user);
                   mailbox.initialize();
               } catch (Exception e) {
  -                logger.error("Exception creating mailbox: " + e);
  +                getLogger().error("Exception creating mailbox: " + e);
                   throw new MailboxException("Exception creating mailbox: " + e);
               }
               String mailboxName
  @@ -377,7 +380,7 @@
        */
       public void releaseMailbox(String user, ACLMailbox mailbox) {
           if (mailbox == null) {
  -            logger.debug("Attempt to release mailbox with null reference");
  +            getLogger().debug("Attempt to release mailbox with null reference");
               return;
           }
           if (user != MailServer.MDA) {
  @@ -403,13 +406,13 @@
                   recordRep.store(fr);
                   mailbox.dispose();
                   mailbox = null;
  -                logger.info("Mailbox object destroyed: " + absName);
  +                getLogger().info("Mailbox object destroyed: " + absName);
               } catch (Exception e) {
  -                logger.error("Exception destroying mailbox object: " + e);
  +                getLogger().error("Exception destroying mailbox object: " + e);
                   e.printStackTrace();
               }
           } else {
  -            logger.info("Mailbox " + absName + " now has " + count + "live references");
  +            getLogger().info("Mailbox " + absName + " now has " + count + "live references");
               mailboxCounts.put(absName, (new Integer(count)));
           }
       }
  @@ -433,19 +436,19 @@
       public boolean deleteMailbox(String user, String mailboxName)
           throws MailboxException, AuthorizationException {
           if (user == null || mailboxName == null) {
  -            logger.error("Null parameters received in deleteMailbox(). ");
  +            getLogger().error("Null parameters received in deleteMailbox(). ");
               throw new RuntimeException("Null parameters received.");
           } else if (user.equals("")
                      ||(!mailboxName.startsWith(namespaceToken))) {
  -            logger.error("Empty/ incorrect parameters received in deleteMailbox().");
  +            getLogger().error("Empty/ incorrect parameters received in deleteMailbox().");
               throw new RuntimeException("Empty/incorrect parameters received.");
           }
           String absoluteName = getAbsoluteName(user, mailboxName);
           if (absoluteName == null) {
  -            logger.error("Parameters in deleteMailbox() cannot be interpreted. ");
  +            getLogger().error("Parameters in deleteMailbox() cannot be interpreted. ");
               throw new RuntimeException("Parameters in deleteMailbox() cannot be interpreted.");
           }
  -        logger.debug("JamesHost deleteMailbox() called for:  " + absoluteName);
  +        getLogger().debug("JamesHost deleteMailbox() called for:  " + absoluteName);
           return false;
           //return deleteAbsoluteMailbox(user, absoluteName);
       }
  @@ -546,7 +549,7 @@
                                                    String mailboxName,
                                                    boolean subscribedOnly)
           throws MailboxException, AccessControlException {
  -        logger.debug("Listing for user: " + username + " ref " + referenceName + " mailbox " + mailboxName);
  +        getLogger().debug("Listing for user: " + username + " ref " + referenceName + " mailbox " + mailboxName);
           List responseList = new ArrayList();
           if (subscribedOnly == true ) {
               return null;
  @@ -564,7 +567,7 @@
                   response = "(\\Noselect) \"" + sharedNamespaceSeparator
                       + "\" " + sharedNamespace;
               } else {
  -                logger.error("Weird arguments for LIST? referenceName was: " + referenceName + " and mailbox names was " + mailboxName);
  +                getLogger().error("Weird arguments for LIST? referenceName was: " + referenceName + " and mailbox names was " + mailboxName);
                   return null;
               }
               responseList.add(response);
  @@ -597,7 +600,7 @@
               }
               
               //mailboxName = mailboxName.substring(0,mailboxName.length() -1);
  -            logger.debug("Refined mailboxName to: " + mailboxName);
  +            getLogger().debug("Refined mailboxName to: " + mailboxName);
               String userTarget;
               if (mailboxName.startsWith("#")) {
                   userTarget = mailboxName;
  @@ -609,49 +612,49 @@
                   }
               }
               String target = getAbsoluteName(username, userTarget);
  -            logger.info("Target is: " + target);
  +            getLogger().info("Target is: " + target);
               if (target == null) { return new HashSet();}
               int firstPercent = target.indexOf("%");
               int firstStar = target.indexOf("*");
  -            logger.info("First percent at index: " + firstPercent);
  -            logger.info("First star at index: " + firstStar);
  +            getLogger().info("First percent at index: " + firstPercent);
  +            getLogger().info("First star at index: " + firstStar);
               Iterator all = recordRep.getAbsoluteNames();
               Set matches = new HashSet();
   
               while (all.hasNext()) {
                   boolean match = false;
                   String test = (String)all.next();
  -                logger.info("Test is: " + test);
  +                getLogger().info("Test is: " + test);
                   if (firstPercent == -1 && firstStar == -1) {
                       // no wildcards so exact or nothing
                       match = test.equals(target);
  -                    logger.debug("match/ no match at test 1"); 
  +                    getLogger().debug("match/ no match at test 1"); 
                   } else if (firstStar == -1) {
                       // only % wildcards
                       if (!test.startsWith(target.substring(0, firstPercent))) {
                           match = false;
  -                        logger.debug("fail match at test 2");
  +                        getLogger().debug("fail match at test 2");
                       } else if (firstPercent == target.length() -1) {
                           // only one % and it is terminating char
                           target = target.substring(0, firstPercent);
  -                        logger.debug("Refined target to: " + target);
  +                        getLogger().debug("Refined target to: " + target);
                           if (test.equals(target)) {
                               match = true;
  -                            logger.debug("pass match at test 3");
  +                            getLogger().debug("pass match at test 3");
                           } else if ( (test.length() > target.length())
                                       &&  (test.indexOf('.', target.length())
                                            == -1)
                                       ) {
                               match = true;
  -                            logger.debug("pass match at test 4");
  +                            getLogger().debug("pass match at test 4");
                           } else {
                               match = false;
  -                            logger.debug("fail match at test 5");
  +                            getLogger().debug("fail match at test 5");
                           }
                       } else {
                           int secondPercent = target.indexOf("%", firstPercent + 1);
                           match = false; // unfinished
  -                        logger.debug("fail match at test 6");
  +                        getLogger().debug("fail match at test 6");
                       }
                   } else {
                       //at least one star
  @@ -674,7 +677,7 @@
                   }
                     
                   if (match)  {
  -                    logger.info("Processing match for : " + test);
  +                    getLogger().info("Processing match for : " + test);
                       FolderRecord record = recordRep.retrieve(test);
                       ACLMailbox mailbox = null;
                       StringBuffer buf = new StringBuffer();
  @@ -723,7 +726,7 @@
               }
               return matches;
           } catch (Exception e) {
  -            logger.error("Exception with list request for mailbox " + mailboxName);
  +            getLogger().error("Exception with list request for mailbox " + mailboxName);
               e.printStackTrace();
               return null;
           }
  @@ -957,7 +960,7 @@
               userInbox.initialize();
               userInbox.setRights(user, MailServer.MDA, "lrswi");
           } catch (Exception e) {
  -            logger.error("Exception creating new account: " + e);
  +            getLogger().error("Exception creating new account: " + e);
               return false;
           }
           userInboxRecord.initialize();
  @@ -978,7 +981,7 @@
           //      userRootFolder.destroy();
           //      userInbox.destroy();
           //} catch (Exception e) {
  -        //    logger.error("Exception closing new account mailbox: " + e);
  +        //    getLogger().error("Exception closing new account mailbox: " + e);
           //    return false;
           //} 
           userRootFolder = null;
  
  
  
  1.2       +74 -77    jakarta-james/src/java/org/apache/james/imapserver/SimpleMessageAttributes.java
  
  Index: SimpleMessageAttributes.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/imapserver/SimpleMessageAttributes.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleMessageAttributes.java	2001/05/11 11:01:11	1.1
  +++ SimpleMessageAttributes.java	2001/06/06 13:18:07	1.2
  @@ -14,9 +14,9 @@
   import javax.mail.MessagingException;
   import javax.mail.Session;
   import javax.mail.internet.*;
  +import org.apache.avalon.framework.logger.AbstractLoggable;
   import org.apache.james.core.EnhancedMimeMessage;
   import org.apache.james.util.RFC822DateFormat;
  -import org.apache.log.LogKit;
   import org.apache.log.Logger;
   import org.apache.mailet.*;
   
  @@ -32,6 +32,7 @@
    * @version 0.1 on 14 Dec 2000
    */
   public class SimpleMessageAttributes
  +    extends AbstractLoggable
       implements MessageAttributes, Serializable  {
   
       private final static String SP = " ";
  @@ -44,7 +45,7 @@
       private final static String MESSAGE = "MESSAGE";
   
       //Only available in first incarnation of object
  -    private transient Logger logger  = LogKit.getLoggerFor("james.JamesHost");
  +    private transient Logger logger;
   
       private int uid;
       private int messageSequenceNumber;
  @@ -80,33 +81,29 @@
       SimpleMessageAttributes() {
       }
   
  -    void reinitialize() {
  -        logger = LogKit.getLoggerFor("james.JamesHost");
  -    }
  -
       void setAttributesFor(MimeMessage msg) throws MessagingException {
           size = msg.getSize();
   
           try {
               internalDate = msg.getSentDate();
  -            if (DEBUG) logger.debug("setAttributes - getSentDate: " + internalDate);
  +            if (DEBUG) getLogger().debug("setAttributes - getSentDate: " + internalDate);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getSentDate: " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getSentDate: " + me);
               internalDate = new Date();
           }
   
           if (DEBUG) {
  -            logger.debug("HeaderLines recieved were: ");
  +            getLogger().debug("HeaderLines recieved were: ");
               Enumeration enum = msg.getAllHeaderLines();
               while(enum.hasMoreElements()) {
  -                logger.debug((String)enum.nextElement());
  +                getLogger().debug((String)enum.nextElement());
               }
  -            //  logger.debug("Header objects available are:");
  +            //  getLogger().debug("Header objects available are:");
               //   Enumeration e = msg.getAllHeaders();
               //   while(e.hasMoreElements()) {
               //Header h = (Header) e.nextElement();
  -            //logger.debug("Name: " + h.getName());
  -            //logger.debug("Value: " + h.getValue());
  +            //getLogger().debug("Name: " + h.getName());
  +            //getLogger().debug("Value: " + h.getValue());
               //  }
           }
           internalDateString = RFC822DateFormat.toString(internalDate); // not right format
  @@ -127,111 +124,111 @@
           if (part instanceof MimeMessage) {
               try {
                   subject = ((MimeMessage)part).getSubject();
  -                if (DEBUG) logger.debug("parseMessage - subject: " + subject);
  +                if (DEBUG) getLogger().debug("parseMessage - subject: " + subject);
               } catch (MessagingException me) {
  -                if (DEBUG) logger.debug("Messaging Exception for getSubject: " + me);
  +                if (DEBUG) getLogger().debug("Messaging Exception for getSubject: " + me);
               }
           }
           try {
               from = part.getHeader("From");
  -            if (DEBUG)  logger.debug("parseMessage - from: " + from);
  +            if (DEBUG)  getLogger().debug("parseMessage - from: " + from);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getHeader(From): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getHeader(From): " + me);
           }
           try {
               sender = part.getHeader("Sender");
  -            if (DEBUG) logger.debug("parseMessage - sender: " + sender);
  +            if (DEBUG) getLogger().debug("parseMessage - sender: " + sender);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getHeader(Sender): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getHeader(Sender): " + me);
           }
           try {
               replyTo = part.getHeader("Reply To");
  -            if (DEBUG) logger.debug("parseMessage - ReplyTo: " + replyTo);
  +            if (DEBUG) getLogger().debug("parseMessage - ReplyTo: " + replyTo);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getHeader(Reply To): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getHeader(Reply To): " + me);
           }
           try {
               to = part.getHeader("To");
  -            if (DEBUG) logger.debug("parseMessage - To: " + to);
  +            if (DEBUG) getLogger().debug("parseMessage - To: " + to);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getHeader(To): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getHeader(To): " + me);
           }
           try {
               cc = part.getHeader("Cc");
  -            if (DEBUG) logger.debug("parseMessage - cc: " + cc);
  +            if (DEBUG) getLogger().debug("parseMessage - cc: " + cc);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getHeader(To): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getHeader(To): " + me);
           }
           try {
               bcc = part.getHeader("Bcc");
  -            if (DEBUG) logger.debug("parseMessage - bcc: " + bcc);
  +            if (DEBUG) getLogger().debug("parseMessage - bcc: " + bcc);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getHeader(To): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getHeader(To): " + me);
           }
           try {
               inReplyTo = part.getHeader("In Reply To");
  -            if (DEBUG) logger.debug("parseMessage - In Reply To: " + inReplyTo);
  +            if (DEBUG) getLogger().debug("parseMessage - In Reply To: " + inReplyTo);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getHeader(In Reply To): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getHeader(In Reply To): " + me);
           }
           try {
               date = part.getHeader("Date");
  -            if (DEBUG) logger.debug("parseMessage - date: " + date);
  +            if (DEBUG) getLogger().debug("parseMessage - date: " + date);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getHeader(Date): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getHeader(Date): " + me);
           }
           try {
               messageID = part.getHeader("Message-ID");
  -            if (DEBUG) logger.debug("parseMessage - messageID: " + messageID);
  +            if (DEBUG) getLogger().debug("parseMessage - messageID: " + messageID);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getHeader(messageID): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getHeader(messageID): " + me);
           }
           String contentTypeLine = null;
           try {
               contentTypeLine = part.getContentType();
  -            if (DEBUG) logger.debug("parseMessage - contentType: " + contentTypeLine);
  +            if (DEBUG) getLogger().debug("parseMessage - contentType: " + contentTypeLine);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getContentType(): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getContentType(): " + me);
           }
           if (contentTypeLine !=null ) {
               decodeContentType(contentTypeLine);
           }
           try {
               contentID = part.getContentID();
  -            if (DEBUG) logger.debug("parseMessage - contentID: " + contentID);
  +            if (DEBUG) getLogger().debug("parseMessage - contentID: " + contentID);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getContentUD(): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getContentUD(): " + me);
           }
           try {
               contentDesc = part.getDescription();
  -            if (DEBUG) logger.debug("parseMessage - contentDesc: " + contentDesc);
  +            if (DEBUG) getLogger().debug("parseMessage - contentDesc: " + contentDesc);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getDescription(): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getDescription(): " + me);
           }
           try {
               contentEncoding = part.getEncoding();
  -            if (DEBUG) logger.debug("parseMessage - contentEncoding: " + contentEncoding);
  +            if (DEBUG) getLogger().debug("parseMessage - contentEncoding: " + contentEncoding);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getEncoding(): " + me);
  +            if (DEBUG) getLogger().debug("Messaging Exception for getEncoding(): " + me);
           }
           if (DEBUG) {
               try {
                   String contentDisposition = part.getDisposition();
  -                logger.debug("parseMessage - contentDisposition: " + contentEncoding);
  +                getLogger().debug("parseMessage - contentDisposition: " + contentEncoding);
               } catch (MessagingException me) {
  -                logger.debug("Messaging Exception for getEncoding(): " + me);
  +                getLogger().debug("Messaging Exception for getEncoding(): " + me);
               }
           }
   
           try {
               lineCount = part.getLineCount();
  -            if (DEBUG) logger.debug("parseMessage - Line Count: " + lineCount);
  +            if (DEBUG) getLogger().debug("parseMessage - Line Count: " + lineCount);
           } catch (MessagingException me) {
  -            if (DEBUG) logger.debug("Messaging Exception for getLineCount(): " + me);
  -            if (DEBUG) logger.debug(me.getMessage());
  +            if (DEBUG) getLogger().debug("Messaging Exception for getLineCount(): " + me);
  +            if (DEBUG) getLogger().debug(me.getMessage());
           } catch (Exception e) {
  -            if (DEBUG) logger.debug("Exception for getLineCount(): " + e);
  -            if (DEBUG) logger.debug("Exception message was: " +  e.getMessage());
  +            if (DEBUG) getLogger().debug("Exception for getLineCount(): " + e);
  +            if (DEBUG) getLogger().debug("Exception message was: " +  e.getMessage());
           }
   
           // Recurse through any embedded parts
  @@ -240,10 +237,10 @@
               try {
                   container =(MimeMultipart) part.getContent();
                   int count = container.getCount();
  -                logger.info("This part contains " + count + " parts.");
  +                getLogger().info("This part contains " + count + " parts.");
                   parts = new SimpleMessageAttributes[count];
                   for (int i = 0; i < count ; i ++) {
  -                    logger.info("Getting embedded part: " + i);
  +                    getLogger().info("Getting embedded part: " + i);
                       BodyPart nextPart = container.getBodyPart(i);
   
                       if (nextPart instanceof MimePart) {
  @@ -252,16 +249,16 @@
                           parts[i] = partAttrs;
   
                       } else {
  -                        logger.info("Found a non-Mime bodyPart");
  +                        getLogger().info("Found a non-Mime bodyPart");
                       }
  -                    logger.info("Finished with embedded part: " + i);
  +                    getLogger().info("Finished with embedded part: " + i);
                   }
               } catch (Exception e) {
  -                logger.debug("Messaging Exception for getContent(): " + e);
  +                getLogger().debug("Messaging Exception for getContent(): " + e);
               }
           } else if (primaryType.equalsIgnoreCase("message")) {
  -            logger.info("This part contains an embedded message of subtype: " + secondaryType);
  -            logger.info("Uses java class: " + part.getClass().getName());
  +            getLogger().info("This part contains an embedded message of subtype: " + secondaryType);
  +            getLogger().info("Uses java class: " + part.getClass().getName());
               if (secondaryType.equalsIgnoreCase("RFC822")) {
                   try {
   
  @@ -279,13 +276,13 @@
                       parts = new SimpleMessageAttributes[1];
                       parts[0] = msgAttrs;
                   } catch (Exception e) {
  -                    logger.error("Error interpreting a message/rfc822: " + e);
  +                    getLogger().error("Error interpreting a message/rfc822: " + e);
                       e.printStackTrace();
                   }
               } else {
  -                logger.info("Unknown subtype of message encountered.");
  +                getLogger().info("Unknown subtype of message encountered.");
               }
  -            logger.info("Finished with embedded message. " );
  +            getLogger().info("Finished with embedded message. " );
           }
       }
   
  @@ -311,7 +308,7 @@
           }
           response.add(SP);
           if (sender != null && sender.length >0) {
  -            if (DEBUG) logger.debug("parsingEnvelope - sender[0] is: " + sender[0]);
  +            if (DEBUG) getLogger().debug("parsingEnvelope - sender[0] is: " + sender[0]);
               //Check for Netscape feature - sender is local part only
               if (sender[0].indexOf("@") == -1) {
                   response.add(LB + (String)response.get(3) + RB); //first From address
  @@ -403,7 +400,7 @@
        * Parses a String email address to an IMAP address string.
        */
       String parseAddress(String address) {
  -        logger.info("Parsing address: " + address);
  +        getLogger().info("Parsing address: " + address);
           int comma = address.indexOf(",");
           StringBuffer buf = new StringBuffer();
           if (comma == -1) { //single address
  @@ -444,17 +441,17 @@
        * Decode a content Type header line into types and parameters pairs
        */
       void decodeContentType(String rawLine) {
  -        if (DEBUG) logger.debug("decoding: " + rawLine);
  +        if (DEBUG) getLogger().debug("decoding: " + rawLine);
           int slash = rawLine.indexOf("/");
           if( slash == -1){
  -            if (DEBUG) logger.debug("decoding ... no slash found");
  +            if (DEBUG) getLogger().debug("decoding ... no slash found");
               return;
           } else {
               primaryType = rawLine.substring(0, slash).trim();
           }
           int semicolon = rawLine.indexOf(";");
           if (semicolon == -1) {
  -            if (DEBUG) logger.debug("decoding ... no semicolon found");
  +            if (DEBUG) getLogger().debug("decoding ... no semicolon found");
               secondaryType = rawLine.substring(slash + 1).trim();
               return;
           }
  @@ -464,16 +461,16 @@
           int pos = semicolon;
           int nextsemi = rawLine.indexOf(";", pos+1);
           while (nextsemi != -1) {
  -            if (DEBUG) logger.debug("decoding ... found another semicolon");
  +            if (DEBUG) getLogger().debug("decoding ... found another semicolon");
               String param = rawLine.substring(pos + 1, nextsemi);
               int esign = param.indexOf("=") ;
               if (esign == -1) {
  -                if (DEBUG) logger.debug("Whacky parameter found: " + param);
  +                if (DEBUG) getLogger().debug("Whacky parameter found: " + param);
               } else {
                   String name = param.substring(0, esign).trim();
                   String value = param.substring(esign + 1).trim();
                   parameters.add(name + SP + value);
  -                if (DEBUG) logger.debug("Found parameter: " + name + SP + value);
  +                if (DEBUG) getLogger().debug("Found parameter: " + name + SP + value);
               }
               pos = nextsemi;
               nextsemi = rawLine.indexOf(";", pos +1);
  @@ -481,17 +478,17 @@
           String lastParam = rawLine.substring(pos + 1);
           int esign = lastParam.indexOf("=") ;
           if (esign == -1) {
  -            if (DEBUG) logger.debug("Whacky parameter found: " + lastParam);
  +            if (DEBUG) getLogger().debug("Whacky parameter found: " + lastParam);
           } else {
               String name = lastParam.substring(0, esign).trim();
               String value = lastParam.substring(esign + 1).trim();
               parameters.add(Q + name + Q + SP + Q + value + Q);
  -            if (DEBUG) logger.debug("Found parameter: " + name + SP + value);
  +            if (DEBUG) getLogger().debug("Found parameter: " + name + SP + value);
           }
       }
   
       String parseBodyFields() {
  -        logger.debug("Parsing body fields");
  +        getLogger().debug("Parsing body fields");
           StringBuffer buf = new StringBuffer();
           if (parameters == null || parameters.isEmpty()) {
               buf.append(NIL);
  @@ -530,28 +527,28 @@
        * Produce the IMAP formatted String for the BodyStructure of a pre-parsed MimeMessage
        */
       String parseBodyStructure() {
  -        logger.debug("Parsing bodyStructure.");
  +        getLogger().debug("Parsing bodyStructure.");
           try {
               String fields = parseBodyFields();
               StringBuffer buf = new StringBuffer();
               buf.append(LB);
               if (primaryType.equalsIgnoreCase("Text")) {
  -                logger.debug("Assembling bodystrucuture for type TEXT.");
  +                getLogger().debug("Assembling bodystrucuture for type TEXT.");
                   buf.append("\"Text\" \"" + secondaryType + "\" ");
                   buf.append(fields + " " + lineCount);
               } else if  (primaryType.equalsIgnoreCase(MESSAGE) && secondaryType.equalsIgnoreCase("rfc822")) {
  -                logger.debug("Assembling bodyStructure for type MESSAGE/FRC822");
  +                getLogger().debug("Assembling bodyStructure for type MESSAGE/FRC822");
                   buf.append("\"MESSAGE\" \"RFC822\" ");
                   buf.append(fields + SP);
  -                ((SimpleMessageAttributes)parts[0]).reinitialize(); // reset transient logger
  +                setupLogger(parts[0]); // reset transient logger
                   buf.append(parts[0].getEnvelope() + SP);
                   buf.append(parts[0].getBodyStructure() + SP);
                   buf.append(lineCount);
               } else if (primaryType.equalsIgnoreCase(MULTIPART)) {
  -                logger.debug("Assembling bodystructure for type MULTIPART");
  +                getLogger().debug("Assembling bodystructure for type MULTIPART");
                   for (int i=0; i<parts.length; i++) {
  -                    logger.debug("Parsing part: " + i);
  -                    ((SimpleMessageAttributes)parts[i]).reinitialize(); // reset transient logger
  +                    getLogger().debug("Parsing part: " + i);
  +                    setupLogger(parts[i]); // reset transient getLogger()
                       buf.append(parts[i].getBodyStructure());
                   }
                   buf.append(SP + secondaryType);
  @@ -559,7 +556,7 @@
               buf.append(RB);
               return buf.toString();
           } catch (Exception e) {
  -            logger.error("Exception while parsing BodyStrucuture: " + e);
  +            getLogger().error("Exception while parsing BodyStrucuture: " + e);
               e.printStackTrace();
               throw new RuntimeException("Exception in parseBodyStructure");
           }
  
  
  
  1.2       +6 -6      jakarta-james/src/java/org/apache/james/mailrepository/AvalonMailRepository.java
  
  Index: AvalonMailRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/AvalonMailRepository.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AvalonMailRepository.java	2001/05/11 09:25:59	1.1
  +++ AvalonMailRepository.java	2001/06/06 13:18:18	1.2
  @@ -77,17 +77,17 @@
                   = new DefaultConfiguration( "repository",
                                               "generated:AvalonFileRepository.compose()" );
   
  -            objectConfiguration.addAttribute("destinationURL", destination);
  -            objectConfiguration.addAttribute("type", "OBJECT");
  -            objectConfiguration.addAttribute("model", "SYNCHRONOUS");
  +            objectConfiguration.setAttribute("destinationURL", destination);
  +            objectConfiguration.setAttribute("type", "OBJECT");
  +            objectConfiguration.setAttribute("model", "SYNCHRONOUS");
   
               DefaultConfiguration streamConfiguration
                   = new DefaultConfiguration( "repository",
                                               "generated:AvalonFileRepository.compose()" );
   
  -            streamConfiguration.addAttribute( "destinationURL", destination );
  -            streamConfiguration.addAttribute( "type", "STREAM" );
  -            streamConfiguration.addAttribute( "model", "SYNCHRONOUS" );
  +            streamConfiguration.setAttribute( "destinationURL", destination );
  +            streamConfiguration.setAttribute( "type", "STREAM" );
  +            streamConfiguration.setAttribute( "model", "SYNCHRONOUS" );
   
               sr = (StreamRepository) store.select(streamConfiguration);
               or = (ObjectRepository) store.select(objectConfiguration);
  
  
  
  1.2       +3 -3      jakarta-james/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
  
  Index: RemoteDelivery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/RemoteDelivery.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RemoteDelivery.java	2001/05/11 10:01:03	1.1
  +++ RemoteDelivery.java	2001/06/06 13:18:24	1.2
  @@ -67,9 +67,9 @@
   
               DefaultConfiguration spoolConf
                   = new DefaultConfiguration("repository", "generated:RemoteDelivery.java");
  -            spoolConf.addAttribute("destinationURL", outgoingPath);
  -            spoolConf.addAttribute("type", "SPOOL");
  -            spoolConf.addAttribute("model", "SYNCHRONOUS");
  +            spoolConf.setAttribute("destinationURL", outgoingPath);
  +            spoolConf.setAttribute("type", "SPOOL");
  +            spoolConf.setAttribute("model", "SYNCHRONOUS");
   
               outgoing = (SpoolRepository) mailstore.select(spoolConf);
           } catch (ComponentException cnfe) {
  
  
  
  1.2       +3 -3      jakarta-james/src/java/org/apache/james/transport/mailets/ToRepository.java
  
  Index: ToRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/ToRepository.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ToRepository.java	2001/05/11 10:01:03	1.1
  +++ ToRepository.java	2001/06/06 13:18:26	1.2
  @@ -44,9 +44,9 @@
               MailStore mailstore = (MailStore) compMgr.lookup("org.apache.james.services.MailStore");
               DefaultConfiguration mailConf
                   = new DefaultConfiguration("repository", "generated:ToRepository");
  -            mailConf.addAttribute("destinationURL", repositoryPath);
  -            mailConf.addAttribute("type", "MAIL");
  -            mailConf.addAttribute("model", "SYNCHRONOUS");
  +            mailConf.setAttribute("destinationURL", repositoryPath);
  +            mailConf.setAttribute("type", "MAIL");
  +            mailConf.setAttribute("model", "SYNCHRONOUS");
   
               repository = (MailRepository) mailstore.select(mailConf);
           } catch (ComponentException cnfe) {
  
  
  
  1.2       +3 -3      jakarta-james/src/java/org/apache/james/userrepository/UsersFileRepository.java
  
  Index: UsersFileRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/userrepository/UsersFileRepository.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UsersFileRepository.java	2001/05/11 09:52:29	1.1
  +++ UsersFileRepository.java	2001/06/06 13:18:32	1.2
  @@ -74,9 +74,9 @@
                   = new DefaultConfiguration( "repository",
                                               "generated:UsersFileRepository.compose()" );
   
  -            objectConfiguration.addAttribute( "destinationURL", destination );
  -            objectConfiguration.addAttribute( "type", "OBJECT" );
  -            objectConfiguration.addAttribute( "model", "SYNCHRONOUS" );
  +            objectConfiguration.setAttribute( "destinationURL", destination );
  +            objectConfiguration.setAttribute( "type", "OBJECT" );
  +            objectConfiguration.setAttribute( "model", "SYNCHRONOUS" );
   
               or = (ObjectRepository)store.select( objectConfiguration );
   
  
  
  

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