private void disposeAuthorityFactories(Set<? extends AuthorityFactory> factories) throws FactoryException { for (AuthorityFactory af : factories) { if (af instanceof AbstractAuthorityFactory) { LOGGER.info("Disposing referencing factory " + af); ((AbstractAuthorityFactory) af).dispose(); } } } }
private void disposeAbstractAuthorityFactory(Object factory) throws FactoryException { if (factory instanceof AbstractAuthorityFactory) { ((AbstractAuthorityFactory) factory).dispose(); } } }
/** Dispose the factory. */ private void dispose() throws FactoryException { if (factory instanceof AbstractAuthorityFactory) { ((AbstractAuthorityFactory) factory).dispose(); } }
/** * Releases resources immediately instead of waiting for the garbage collector. * * @throws FactoryException if an error occured while disposing the factory. */ @Override public synchronized void dispose() throws FactoryException { if (backingStore != null) { backingStore.dispose(); backingStore = null; } pool.clear(); findPool.clear(); super.dispose(); }
public void dispose() throws FactoryException { delegate.dispose(); cache.clear(); cache = null; delegate = null; }
public void dispose() throws FactoryException { delegate.dispose(); cache.clear(); cache = null; delegate = null; }
/** * Disposes of the backing store * * @throws FactoryException */ protected synchronized void disposeBackingStore() { try { if (backingStore != null) { LOGGER.log(Level.INFO, "Disposing " + getClass() + " backing store"); backingStore.dispose(); backingStore = null; } } catch (FactoryException exception) { backingStore = null; final LogRecord record = Loggings.format(Level.WARNING, LoggingKeys.CANT_DISPOSE_BACKING_STORE); record.setSourceMethodName("run"); record.setSourceClassName(Disposer.class.getName()); record.setThrown(exception); record.setLoggerName(LOGGER.getName()); LOGGER.log(record); } }
@Override public void dispose() throws FactoryException { super.dispose(); disposeAbstractAuthorityFactory(datumFactory); disposeAbstractAuthorityFactory(csFactory); disposeAbstractAuthorityFactory(crsFactory); disposeAbstractAuthorityFactory(operationFactory); }
@Override public void destroy() { if (this.crsAuthority == null) { return; } if (this.crsAuthority instanceof DeferredAuthorityFactory) { DeferredAuthorityFactory.exit(); } if (this.crsAuthority instanceof AbstractAuthorityFactory) { try { ((AbstractAuthorityFactory) this.crsAuthority).dispose(); } catch (FactoryException fe) { LOGGER.error("Error while GeometryHandler clean up", fe); } } /* * close {@link WeakCollectionCleaner} * * Note: Not required if * se.jiderhamn.classloader.leak.prevention.ClassLoaderLeakPreventor is * defined in the web.xml */ // WeakCollectionCleaner.DEFAULT.exit(); }