/** * Returns {@code true} if the backing store can be disposed now. This method is invoked * automatically after the amount of time specified by {@link #setTimeout} if the factory were * not used during that time. * * @param backingStore The backing store in process of being disposed. */ @Override protected boolean canDisposeBackingStore(final AbstractAuthorityFactory backingStore) { if (backingStore instanceof DirectEpsgFactory) { return ((DirectEpsgFactory) backingStore).canDispose(); } return super.canDisposeBackingStore(backingStore); }
public void run() { synchronized (DeferredAuthorityFactory.this) { if (used || !canDisposeBackingStore(backingStore)) { used = false; return; } if (cancel()) { disposer = null; if (backingStore != null) { disposeBackingStore(); } // Needed in order to lets GC do its job. hints.remove(Hints.DATUM_AUTHORITY_FACTORY); hints.remove(Hints.CS_AUTHORITY_FACTORY); hints.remove(Hints.CRS_AUTHORITY_FACTORY); hints.remove(Hints.COORDINATE_OPERATION_AUTHORITY_FACTORY); } } } }