-
1. Re: Another way to write clustered singletons
oglueck Jun 29, 2006 5:34 AM (in response to dimitris)In http://jboss.org/jbossBlog/blog/dimitris/?permalink=Clustered_Singletons_simplified.txt you state this works for MDBs only as of 4.0.4. I don't see why this should not work with 4.0.3 (but I have not tried). Could you explain?
-
2. Re: Another way to write clustered singletons
brian.stansberry Jun 29, 2006 4:02 PM (in response to dimitris)Haven't checked, but I would assume because the HASingletonDeployer notifications mentioned in JBAS-2626 were only added in 4.0.4.
-
3. Re: Another way to write clustered singletons
batter Jan 11, 2007 3:52 PM (in response to dimitris)Is there a list of jmx notifications emitted by services? At one blog I read something like org.jboss.system.server.stopped that will tell you that the jboss kernel stopped; what are the jmx message emitted f.e. by mq and other services ?
-
4. Re: Another way to write clustered singletons
oglueck Jan 12, 2007 3:02 AM (in response to dimitris)Not only such a list would be interesting. You also must filter them for instance with the DeploymentInfoNotificationFilterFactory. So one must know the possible filter cirteria.
-
5. Re: Another way to write clustered singletons
dimitris Jan 12, 2007 3:41 AM (in response to dimitris)I had made a start to document this list here:
http://wiki.jboss.org/wiki/Wiki.jsp?page=NotificationsEmittedByJBossMBeans
Obviously we need everyone to contribute to this page.
Another possibility is just configure a NotificationListener to listen for all notifications in the system, boot jboss, take the log and record what you see :) -
6. Re: Another way to write clustered singletons
dimitris Jan 12, 2007 3:46 AM (in response to dimitris)And while here, I made this addition to the BarrierController:
http://jira.jboss.com/jira/browse/JBAS-3469
It could be used to control HASingletons that are fully destroyed/created when a node becomes master, rather than just started/stopped. -
7. Re: Another way to write clustered singletons
oglueck Jan 12, 2007 5:42 AM (in response to dimitris)By the way, Dimitris, do you know how the deployment of a WAR file is notified? I must create a barrier so I can depend an MBean on it that uses a servlet deployed in that WAR file.
-
8. Re: Another way to write clustered singletons
batter Jan 12, 2007 12:11 PM (in response to dimitris)"oglueck" wrote:
Not only such a list would be interesting. You also must filter them for instance with the DeploymentInfoNotificationFilterFactory. So one must know the possible filter cirteria.
Definitely; I am trying to add a dependency on the MQ service being started so I know f.e. that my queues and topics are deployed. Finally ran into this barrier discussion and am now playing with using that and then filtering on 'some' mq notification. For the time being I wrote my own bean and playing with it; if people leave me alone today I might do that NotificationListener thingy Dimitris suggested :-) -
9. Re: Another way to write clustered singletons
oglueck Jan 12, 2007 12:17 PM (in response to dimitris)You can also try and filter with MBeanServerNotificationFilterFactory for MBean registration notifications. See
http://docs.jboss.org/jbossas/javadoc/4.0.5/system/org/jboss/system/filterfactory/MBeanServerNotificationFilterFactory.html
I am trying to figure out with that one when Axis has registered its JMX bean. -
10. Re: Another way to write clustered singletons
sebastianlacuesta Mar 7, 2008 1:43 PM (in response to dimitris)Excellent. I want to call a method of a singleton service. I tried using an RMIAdaptor this way:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); String numero = request.getParameter("numero"); String mensaje = request.getParameter("mensaje"); try { Context context = new InitialContext(); RMIAdaptor rmiAdaptor = (RMIAdaptor)context.lookup("jmx/rmi/RMIAdaptor"); if ((rmiAdaptor != null) && (rmiAdaptor.isRegistered(new ObjectName("poksmedia.mbean:service=MBloxService")))) { rmiAdaptor.invoke(new ObjectName("poksmedia.mbean:service=MBloxService"), "sendMessage", new Object[]{numero, mensaje}, new String[]{"java.lang.String", "java.lang.String"}); out.print("El mensaje se envió correctamente (creo)."); } } catch (NamingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (MalformedObjectNameException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (NullPointerException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstanceNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (MBeanException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ReflectionException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
This works awesome in the same node where the service is running. But not in the others. It throws a javax.management.RuntimeMBeanException
.
Any ideas?