[jboss-user] [JBoss Seam] - @Service MBEan as Seam component
arondaniel
do-not-reply at jboss.com
Tue Nov 14 18:57:35 EST 2006
Hello,
Sorry for the newB-nature of this question, but I did do a fair amount of google/forum searching before posting.
What I'm wondering is if it is possible to use a @Service annotated JBoss MBean also as a @Name annotated seam component (with APPLICATION scope I guess) -- such that Seam makes calls on the singleton instance.
I tried something like this:
| @Service(objectName = "someapp:service=theManager")
| @Management(TheManager.class)
| @Name("theManager")
| @Scope(APPLICATION)
| @Interceptors(SeamInterceptor.class)
| public class TheManagerMBean implements TheManager {
| @PersistenceContext
| private EntityManager m_em;
| public Something getSomething() {
| return m_em.find(Something.class,"Something");
| }
|
Then in a jsp I try to call "#{theManager.something.foo}".
So what happens is it goes into getSomething just fine, but apparently Seam has created a new THeManagerMBEan instance for me, instead of using the MBEan singleton, because m_em is null.
Is this something that is just not supported? Can a MBean be accessed directly using seam? Do all Seam components have to be Entity/Stateful/Stateless/some other POJO?
Sorry if my question is facile, I'm new to all this JSP/JSF/Seam stuff.
-Aron
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985980#3985980
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985980
More information about the jboss-user
mailing list