Package org.geotools.data.directory

Source Code of org.geotools.data.directory.DataStoreSoftReference

package org.geotools.data.directory;

import java.lang.ref.SoftReference;

import org.geotools.data.DataStore;
import org.geotools.util.WeakCollectionCleaner;

/**
*
*
* @source $URL$
*/
public class DataStoreSoftReference extends SoftReference<DataStore> {

    public DataStoreSoftReference(DataStore referent) {
        super(referent, WeakCollectionCleaner.DEFAULT.getReferenceQueue());
    }
   
    @Override
    public void clear() {
        DataStore store = get();
        if(store != null)
            store.dispose();
        super.clear();
    }

}
TOP

Related Classes of org.geotools.data.directory.DataStoreSoftReference

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.