1 Reply Latest reply on Aug 24, 2004 3:34 PM by genman

    Using ObjectName

    neva

      Hello,

      I am kind of new to this so I was hoping that you guys could help me out..
      I want to flush the cached data of all entity beans in my application when a specific event occures..
      I have only been able to get to the following code which only flushes data of one entity bean:

      MBeanServer server = MBeanServerLocator.locateJBoss();
      ObjectName container = new ObjectName("jboss.j2ee:service=EJB,jndiName=myBean");
      server.invoke(container, "flushCache", null, null);

      How can I create an ObjectName to flush all data that has to do with my application (all beans in my .ear)? What will the string given to the constructor look like?

      Thanks..

        • 1. Re: Using ObjectName
          genman


          When using invoke, the ObjectName needs to be unique, meaning you can't create this: ObjectName("domain:service=*") and expect MBeanServer.invoke to invoke for all those MBeans.

          You'll have to figure out how to get the names of all EJB in your ear. Should be someplace.