use of javax.enterprise.context.spi.AlterableContext in project core by weld.
the class SuicidalInterceptor method destroyInstance.
private void destroyInstance() throws Exception {
Context context = manager.getContext(bean.getScope());
if (!(context instanceof AlterableContext)) {
throw new IllegalStateException("Context does not support removal of instances");
}
AlterableContext alterableContext = AlterableContext.class.cast(context);
alterableContext.destroy(bean);
}
Aggregations