/** * Weld Application context is active from container start to its shutdown * This method merely clears out all ApplicationScoped beans BUT the context * will still be active which may result in immediate re-creation of some beans. */ private void stopApplicationScope() { // Welds ApplicationContext gets cleaned at shutdown. // Weld App context should be always active if (applicationContext.isActive()) { // destroys the bean instances, but the context stays active applicationContext.invalidate(); } }
/** * Weld Application context is active from container start to its shutdown * This method merely clears out all ApplicationScoped beans BUT the context * will still be active which may result in immediate re-creation of some beans. */ private void stopApplicationScope() { // Welds ApplicationContext gets cleaned at shutdown. // Weld App context should be always active if (applicationContext.isActive()) { // destroys the bean instances, but the context stays active applicationContext.invalidate(); } }
void stopApplicationScope() { if (applicationContext.isActive()) { if (applicationContext instanceof AbstractSharedContext) { ((AbstractSharedContext) applicationContext).getBeanStore().clear(); } } }