/** * Make a best effort at closing all the cached values. This method is *not* guaranteed to close * every cached value if there are concurrent users of the cache. As a result, this method * should only be relied upon if only a single thread is using this cache while {@code #close} is * called. * * @throws IOException if any entry throws an IOException while closing. An entry throwing an * IOException will prevent any further entries from being closed. */ @Override public void close() throws IOException { mCache.close(); }
/** * Close all cached ZooKeeper connections. * * <p> * This method closes all ZooKeeper connections that have been returned from * {@link #getZooKeeperClient}. Clients who continue to use these connections will receive * {@code IOExceptions}. This method should only be called when Fiji objects will no longer be * used in the JVM. * </p> * * @throws java.io.IOException on I/O Exception */ public static void closeAllZooKeeperConnections() throws IOException { ZK_CLIENT_CACHE.close(); }
/** * Close this InstanceMonitor. Should be called when this instance monitor is no longer needed. * All table monitor objects owned by this instance monitor will also be closed. * * @throws IOException on unrecoverable ZooKeeper exception. */ @Override public void close() throws IOException { mState.set(State.CLOSED); LOG.debug("Closing InstanceMonitor for instance {} with userID {}.", mInstanceURI, mUserID); if (mUserRegistration != null) { mUserRegistration.close(); } mTableLayoutMonitors.close(); }