Ignore:
Timestamp:
2005-05-05T15:55:27+12:00 (19 years ago)
Author:
kjdon
Message:

when a collection (using gdbm) is opened by tomcat, windows holds a lock on the gdbm file, so you can't rebuild it. modified ModuleInterface to have a cleanUp method, so all modules need to implement this. for mg/mgpp and gdbm modules, they now unload the index data or close the connection to the database. so cleanUp should be called whenever you deactivate a module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ant-install-branch/gsdl3/src/java/org/greenstone/gsdl3/core/MessageRouter.java

    r9798 r9824  
    9898    this.converter = new XMLConverter();
    9999    this.doc = this.converter.newDOM();
    100    
    101    
    102     }
    103 
     100    }
     101
     102    public void cleanUp() {
     103    if (this.module_map != null) {
     104        Iterator i = this.module_map.values().iterator();
     105        while (i.hasNext()) {
     106        ((ModuleInterface)i.next()).cleanUp();
     107        }
     108    }
     109    }
    104110    /** site_home must be set before configure called */
    105111    public void setSiteHome(String home) {
     
    807813
    808814        System.out.println("MessageRouter: deactivating "+name);
    809         this.module_map.remove(name);
    810 
     815        ModuleInterface m = (ModuleInterface)this.module_map.remove(name);
     816        m.cleanUp(); // clean up any open files/connections etc - can cause trouble on windows
    811817        // also remove the xml bit from description list
    812818        if (type.equals(GSXML.COLLECTION_ELEM)) {
Note: See TracChangeset for help on using the changeset viewer.