}
BeanFactory<SessionContext> factory
= beanManager.createBeanFactory(SessionContext.class);
AbstractContext context = getSessionContext();
context.setDeclaredRoles(_declaredRoles);
beanManager.addBean(factory.singleton(context));
} finally {
thread.setContextClassLoader(oldLoader);
}