shuber      2004/08/04 17:01:34 CEST

  Modified files:
    core/src/java/org/jahia/services/search 
                                            JahiaSearchBaseService.java 
  Log:
  Improved startup and shutdown of search service.
  
  Revision  Changes    Path
  1.3       +7 -1      
jahia/core/src/java/org/jahia/services/search/JahiaSearchBaseService.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/services/search/JahiaSearchBaseService.java.diff?r1=1.2&r2=1.3&f=h
  
  
  
  Index: JahiaSearchBaseService.java
  ===================================================================
  RCS file: 
/cvs/jahia/core/src/java/org/jahia/services/search/JahiaSearchBaseService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JahiaSearchBaseService.java       21 May 2004 15:35:28 -0000      1.2
  +++ JahiaSearchBaseService.java       4 Aug 2004 15:01:34 -0000       1.3
  @@ -83,6 +83,8 @@
   
       // list of all removed/added fields to add/remove from the index in background
       private Vector indexOrders; // les ordres de add/remove
  +
  +    private Thread backgroundIndexingThread;
       private boolean indexingThreadActivated = true;
   
       /**
  @@ -107,7 +109,6 @@
       public static synchronized JahiaSearchBaseService getInstance () {
           if (theObject == null) {
               theObject = new JahiaSearchBaseService ();
  -            new Thread (theObject).start (); // start background thread
           }
           return theObject;
       }
  @@ -121,6 +122,10 @@
       public void init (SettingsBean jSettings)
               throws JahiaInitializationException {
   
  +        backgroundIndexingThread = new Thread(theObject,
  +                                              "Background content indexing");
  +        backgroundIndexingThread.start(); // start background thread
  +
           searchIndexesDiskPath = jSettings.getJahiaVarDiskPath ()
                   + File.separator
                   + searchIndexesDir;
  @@ -139,6 +144,7 @@
   
       public synchronized void shutdown() throws JahiaException {
           indexingThreadActivated = false;
  +        notifyAll();
           // give it a change to finish right now if it's not processing anything.
           Thread.yield();
           mIsServiceInitialized = false;
  

Reply via email to