I have some @SessionScoped CDI beans. Previously all of them were JSF managed beans (changed from JSF managed beans to CDI managed beans).
@SessionScoped
I was doing like
CDI 1.1 introduced an AlterableContext interface with a destroy(Bean) method.
AlterableContext
destroy(Bean)
Get the session context via beanManager.getContext(SessionScoped.class), downcast to AlterableContext and then invoke destroy() with the appropriate bean type.
beanManager.getContext(SessionScoped.class)
destroy()