@Override
	public void shutdown() throws Exception {
		synchronized (shutDownLock) {
			// This is problematic as the user code class loader is not
			// available at this point.
			for (Savepoint savepoint : savepoints.values()) {
				try {
					savepoint.dispose();
				} catch (Throwable t) {
					LOG.warn("Failed to dispose savepoint " + savepoint.getCheckpointId(), t);
				}
			}
			savepoints.clear();
			// Remove shutdown hook to prevent resource leaks, unless this is
			// invoked by the shutdown hook itself.
			if (shutdownHook != null && shutdownHook != Thread.currentThread()) {
				try {
					Runtime.getRuntime().removeShutdownHook(shutdownHook);
				} catch (IllegalStateException ignored) {
					// Race, JVM is in shutdown already, we can safely ignore this
				} catch (Throwable t) {
					LOG.warn("Failed to unregister shut down hook.");
				}
			}
			shutDown = true;
		}
	}
@Override
	public void shutdown() throws Exception {
		synchronized (shutDownLock) {
		
		
			for (Savepoint savepoint : savepoints.values()) {
				try {
					savepoint.dispose();
				} catch (Throwable t) {
					LOG.warn("Failed to dispose savepoint " + savepoint.getCheckpointId(), t);
				}
			}
			savepoints.clear();
		
		
			if (shutdownHook != null && shutdownHook != Thread.currentThread()) {
				try {
					Runtime.getRuntime().removeShutdownHook(shutdownHook);
				} catch (IllegalStateException ignored) {
				
				} catch (Throwable t) {
					LOG.warn("Failed to unregister shut down hook.");
				}
			}
			shutDown = true;
		}
	}
@override public void shutdown() throws exception { synchronized (shutdownlock) { for (savepoint savepoint : savepoints.values()) { try { savepoint.dispose(); } catch (throwable t) { log.warn("failed to dispose savepoint " + savepoint.getcheckpointid(), t); } } savepoints.clear(); if (shutdownhook != null && shutdownhook != thread.currentthread()) { try { runtime.getruntime().removeshutdownhook(shutdownhook); } catch (illegalstateexception ignored) { } catch (throwable t) { log.warn("failed to unregister shut down hook."); } } shutdown = true; } }