Changeset 14633

Show
Ignore:
Timestamp:
08.10.2007 10:03:52 (12 years ago)
Author:
shaoqun
Message:

added synchronizing code

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java

    r14517 r14633  
    4848extends AbstractGS2Search { 
    4949     
    50 //    protected MGSearchWrapper mg_src = null; 
    51     protected MGSearchWrapper mg_src = null; 
     50    protected static MGSearchWrapper mg_src = null; 
    5251     
    5352    static Logger logger = Logger.getLogger (org.greenstone.gsdl3.service.GS2MGSearch.class.getName ()); 
     
    5655    /** constructor */ 
    5756    public GS2MGSearch () { 
    58 //        this.mg_src = new MGSearchWrapper (); 
    59         this.mg_src = new MGSearchWrapper (); 
    60          
     57    if(this.mg_src == null){ 
     58        this.mg_src = new MGSearchWrapper (); 
     59        } 
    6160    } 
    6261    public void cleanUp () { 
     
    8079    /** do the actual query */ 
    8180    protected Element processTextQuery (Element request) { 
    82          
     81        synchronized(this.mg_src){ 
    8382        // Create a new (empty) result message ('doc' is in ServiceRack.java) 
    8483        Element result = this.doc.createElement (GSXML.RESPONSE_ELEM); 
     
    211210        } 
    212211        return result; 
     212    }//end of synchronized 
    213213    } 
    214214