if (plan == null) {
throw new IllegalArgumentException("The plan may not be null.");
}
ContextChecker checker = new ContextChecker();
checker.check(plan);
synchronized (this.lock) {
// check if we start a session dedicated for this execution
final boolean shutDownAtEnd;