Skip to content

Instantly share code, notes, and snippets.

@rmannibucau
Created April 16, 2013 15:08
Show Gist options
  • Save rmannibucau/5396703 to your computer and use it in GitHub Desktop.
Save rmannibucau/5396703 to your computer and use it in GitHub Desktop.
public void after() throws Exception {
final ContextsService contextsService = appContext.getWebBeansContext().getContextsService();
if (assembler != null) {
contextsService.endContext(SessionScoped.class, session);
contextsService.endContext(RequestScoped.class, null);
contextsService.endContext(ConversationScoped.class, null);
try {
assembler.destroyApplication(appInfo.path);
} catch (Exception e) {
// no-op
}
}
if (servletContext != null || session != null) {
try {
ScopeHelper.stopContexts(contextsService, servletContext, session);
} catch (Exception e) {
// no-op
}
}
if (serviceManager != null) {
try {
serviceManager.stop();
} catch (RuntimeException ignored) {
// no-op
}
}
OpenEJB.destroy();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment