I have a situation where I have several different configurations for my hibernate sessions, mainly revolving around different interceptors and filters. I also sometimes want the session to be event scoped and other times to be conversation scoped.
At the moment I have something similar to the ManagedHibernateSession which handles closing the session on the @Destroy of the component. This is all fine.
But now because I have all these different configuration options I don't really want to have to define an entry in component.xml for each property combination. I want to be able to do something like this in code...
Sessions.getSession( ScopeType.EVENT, enableInterceptors, enableFilters ... );