-
1. Re: EJB - MBean communication
raja05 May 11, 2004 10:05 AM (in response to pbowker)One option that immediately comes to mind is calling the MBean method from ur EJB and the MBean emitting the notifications. You can look the MBean using the MBeanServer thats available all over the jboss vm.
This is one way
Properties p = new Properties();
p.put"java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
p.put("java.naming.provider.url", "localhost:1099");
InitialContext jndiContext = new InitialContext(p);
RMIAdaptor server = (RMIAdaptor) jndiContext.lookup("jmx/rmi/RMIAdaptor");
javax.management.ObjectName name = new javax.management.ObjectName("<your MBean object name>");
server.invoke(name, "ur operation", args, args);
Your MBean on receipt of this call can do the notifications. -
2. Re: EJB - MBean communication
pbowker May 12, 2004 11:42 AM (in response to pbowker)Thanks for the info Raja. In combination with some help I got from Sun's JMX forum I now have everything I need.
Cheers,
Phil -
3. Re: EJB - MBean communication
ant Jun 4, 2004 3:33 AM (in response to pbowker)Invoking MBean methods through the RMIAdaptor works fine for MBeans. But how can I communicate with an embedded class of a MBean? This situtation occurs using org.jboss.varia.scheduler.Scheduler. The Scheduler MBean needs to be configured with a class that implements the interface org.jboss.varia.scheduler.Schedulable.
I think the only way to communicate with this class is through JMS. Is there another way to accomplish this?
Using JMS works fine for my requirements. But there is one flaw to report: when shutting down JBoss, destroying the JMS destination throws an JMSException because it's already beeing used. How can I gracefully shutdown (closing queues and connections) all self-written components and services (such as the implementation class of Schedulabel) within JBoss?
Thanks in advance. -
4. Re: EJB - MBean communication
luispera Jan 5, 2005 2:00 PM (in response to pbowker)"pbowker" wrote:
Thanks for the info Raja. In combination with some help I got from Sun's JMX forum I now have everything I need.
Cheers,
Phil
Could you share the solution that you've got ?
Regards,
LP