Search in sources :

Example 1 with ManagedContext

use of org.jboss.weld.context.ManagedContext in project core by weld.

the class ContextsImpl method destroyContext.

public void destroyContext(Context context) {
    context = ForwardingContext.unwrap(context);
    if (context instanceof ManagedContext) {
        ManagedContext managedContext = (ManagedContext) context;
        managedContext.invalidate();
        managedContext.deactivate();
        managedContext.activate();
    } else if (context instanceof ApplicationContext) {
        ((ApplicationContext) context).invalidate();
    } else {
        throw new UnsupportedOperationException();
    }
}
Also used : ApplicationContext(org.jboss.weld.context.ApplicationContext) ManagedContext(org.jboss.weld.context.ManagedContext)

Aggregations

ApplicationContext (org.jboss.weld.context.ApplicationContext)1 ManagedContext (org.jboss.weld.context.ManagedContext)1