public static DCRContextImplementation create(Logger logger) {
		final Instrumentation instrumentation = ExposeInstrumentation.getInstrumentation();

		try {
			final Method m = Instrumentation.class.getMethod("isRetransformClassesSupported");

			if (!(Boolean) m.invoke(instrumentation)) {
				logger.info("Java VM does not support class retransformation, DCR unavailable");
				return null;
			}
		} catch (Exception e1) {
			// Also catches case where instrumentation == null.
			logger.info("Java VM does not support instrumentation, DCR unavailable");
			return null;
		}

		return new DCRContextImplementation(instrumentation,
			RecorderLocator.class,
			RecorderLocator.getRecorderRegistry());
	}
Attempt to create a context.

@param logger A logger to complain to if problems are found.
@return The context, or {@code null} if one could not be created.
ngrinder-runtime/src/main/java/net/grinder/engine/process/dcr/DCRContextImplementation.java