lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject cvs commit: jakarta-lucene-sandbox/contributions/webcrawler-LARM/src/de/lanlab/larm/util SimpleLoggerManager.java
Date Sun, 15 Sep 2002 00:26:21 GMT
otis        2002/09/14 17:26:21

  Modified:    contributions/webcrawler-LARM/src/de/lanlab/larm/util
                        SimpleLoggerManager.java
  Log:
  - Made this singleton thread-safe.
  
  Revision  Changes    Path
  1.3       +9 -8      jakarta-lucene-sandbox/contributions/webcrawler-LARM/src/de/lanlab/larm/util/SimpleLoggerManager.java
  
  Index: SimpleLoggerManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/webcrawler-LARM/src/de/lanlab/larm/util/SimpleLoggerManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SimpleLoggerManager.java	22 May 2002 23:09:19 -0000	1.2
  +++ SimpleLoggerManager.java	15 Sep 2002 00:26:21 -0000	1.3
  @@ -58,14 +58,15 @@
   import java.io.IOException;
   
   /**
  - * this singleton manages all loggers. It can be used to flush all SimpleLoggers
  - * at once
  + * This singleton manages all loggers. It can be used to flush all SimpleLoggers
  + * at once.
  + * @version $Id$
    */
   public class SimpleLoggerManager
   {
  -    static SimpleLoggerManager instance = null;
  +    private static SimpleLoggerManager instance = null;
   
  -    ArrayList logs;
  +    private ArrayList logs;
   
       private SimpleLoggerManager()
       {
  @@ -93,18 +94,18 @@
                  ex = e;
               }
           }
  -        if(ex != null)
  +        if (ex != null)
           {
               throw ex;
           }
       }
   
  -    public static SimpleLoggerManager getInstance()
  +    public synchronized static SimpleLoggerManager getInstance()
       {
  -        if(instance == null)
  +        if (instance == null)
           {
               instance = new SimpleLoggerManager();
           }
           return instance;
       }
  -}
  \ No newline at end of file
  +}
  
  
  

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message