[jboss-user] [EJB 3.0] - Get MBean reference

hoeft do-not-reply at jboss.com
Mon Sep 11 06:28:02 EDT 2006


Hi!

One of my stateless session beans must call a method on a MBean.
Is it possible to inject a reference to that MBean into my stateless session bean?

I tried this, but it doesn't work :-(:


  | public class My implements MyMBean {
  |     public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception
  | 	{ 
  | 		return new ObjectName(test:service=MyMBean); 
  | 	} 
  | 
  | }
  | 



  | @Stateless
  | public class MyStatelessSessionBean implements ... {
  |     @Resource(mappedName="test:service=MyMBean")
  |     private MyMBean myMBean;
  | 
  |     ....
  |     public void myMethod() {
  |         myMBean.op();
  |     }
  | 
  | }
  | 

Thanks for your help
M. Schwartau


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970700#3970700

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970700



More information about the jboss-user mailing list