/** * Closes all children resources. */ @Override public synchronized void close() throws DataStoreException { final Collection<Resource> resources = components; if (resources != null) { components = null; // Clear first in case of failure. DataStoreException failure = null; for (final Resource r : resources) { if (r instanceof DataStore) try { ((DataStore) r).close(); } catch (DataStoreException ex) { if (failure == null) { failure = ex; } else { failure.addSuppressed(ex); } } } if (failure != null) { throw failure; } } } }
/** * Closes all children resources. */ @Override public synchronized void close() throws DataStoreException { final Collection<Resource> resources = components; if (resources != null) { components = null; // Clear first in case of failure. DataStoreException failure = null; for (final Resource r : resources) { if (r instanceof DataStore) try { ((DataStore) r).close(); } catch (DataStoreException ex) { if (failure == null) { failure = ex; } else { failure.addSuppressed(ex); } } } if (failure != null) { throw failure; } } } }
next.close(); next = existing; if (next instanceof Store) {
next.close(); next = existing; if (next instanceof Store) {