framework/application/engine/api/src/main/java/org/ldp4j/application/engine/ApplicationEngine.java
public static void setEngine(final ApplicationEngine delegate) {
		final SecurityManager security = System.getSecurityManager();
		if (security != null) {
			security.checkPermission(SUPPRESS_ACCESS_CHECKS_PERMISSION);
		}
		synchronized(ApplicationEngine.CACHED_DELEGATE) {
			final ApplicationEngine current=ApplicationEngine.CACHED_DELEGATE.get();
			if(current!=null) {
				try {
					current.shutdown();
				} catch (final ApplicationEngineLifecycleException e) {
					LOGGER.error("Shutdown of previous engine failed. Full stacktrace follows:",e);
				}
			}
			ApplicationEngine.CACHED_DELEGATE.set(delegate);
			if(delegate!=null) {
				delegate.setState(ApplicationEngineState.AVAILABLE);
			}
		}
	}
public static void setEngine(final ApplicationEngine delegate) {
		final SecurityManager security = System.getSecurityManager();
		if (security != null) {
			security.checkPermission(SUPPRESS_ACCESS_CHECKS_PERMISSION);
		}
		synchronized(ApplicationEngine.CACHED_DELEGATE) {
			final ApplicationEngine current=ApplicationEngine.CACHED_DELEGATE.get();
			if(current!=null) {
				try {
					current.shutdown();
				} catch (final ApplicationEngineLifecycleException e) {
					LOGGER.error("Shutdown of previous engine failed. Full stacktrace follows:",e);
				}
			}
			ApplicationEngine.CACHED_DELEGATE.set(delegate);
			if(delegate!=null) {
				delegate.setState(ApplicationEngineState.AVAILABLE);
			}
		}
	}
Set the application engine that will be used by clients. If this method
is not called prior to {@link ApplicationEngine#engine()} then an
implementation will be sought as described in
{@link ApplicationEngine#engine()}.

@param delegate
the {@code ApplicationEngine} runtime delegate instance.
@throws SecurityException
if there is a security manager and the permission
ReflectPermission("suppressAccessChecks") has not been
granted.