[jboss-user] [JBoss Seam] - Component with custom scope and configuration
do-not-reply at jboss.com
Tue Mar 13 16:24:41 EDT 2007
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 ... );
And have the a Session returned that will be created on demand with the correct configuration AND stored in the relevant Seam context so it is cleaned up in the right place.
Almost like wanting to add arbitrary objects to the Seam contexts and have them cleaned up like normal Seam components.
I can't see anyway of doing this right now as the Seam stuff all revolves around the Component entry being in place. Is there any way of making this a bit more dynamic. I thought about having a Seam component per scope that stores a list of objects and does the relevant lifecycle stuff do them (calling a destory method for example).
Has anyone else tried to do something like this or have a better way within Seam of doing this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027680#4027680
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027680
More information about the jboss-user