Object userThreadLifeCycleManager = lifeCycleManagerGetter.invoke(null, new Object[0]);
Method beginShutdown = lifeCycleManagerClass.getMethod("beginShutdown", long.class);
AppEngineWebXml appEngineWebXml = containerService.getAppEngineWebXmlConfig();
String moduleName = WebModule.getModuleName(appEngineWebXml);
ApiProxy.setEnvironmentForCurrentThread(new LocalInitializationEnvironment(
appEngineWebXml.getAppId(), moduleName, appEngineWebXml.getMajorVersionId(), instance,
containerService.getPort()));
try {
beginShutdown.invoke(userThreadLifeCycleManager, AH_REQUEST_DEFAULT_TIMEOUT);