1 Reply Latest reply on Oct 28, 2010 11:40 PM by akhil achuthan

    Looking up an HASingletonSupport from EJB Session Bean

    akhil achuthan Newbie

      I have a class that extends HASingletonSupport. I use the startSingleton() to initiate some services as part of my application. But I am in need of calling some other apis within my HASingletonSupport class on the run from my session bean classes. How do i lookup for my HASingleton...

       

      My bean class just extends HASingletonSupport. I havnt implelement any interface.

       

      My HASingleton class is named InitBean and it has a method myMBeanMethod() with no arguments and no return value, that has to be invoked from my session bean.

      I actually tied the following piece of code, but did not succeed...

       


      ObjectName mBeanObject = new ObjectName("InitBean:class=com.test.akhil.init.ejb.InitBean");
      Object[] valObj = {};
      String[] typeObj = {};
      MBeanServer server = MBeanServerLocator.locateJBoss();
      server.invoke(mBeanObject, "myMBeanMethod", valObj, typeObj);

       

       

      even tried

       

      ObjectName mBeanObject = new           ObjectName("jboss.management.local:J2EEServer=Local,j2eeType=ServiceModule,name=system.sar,class=com.test.akhil.init.ejb.InitBean");

       

      but no use..

       

       

      Any help.

       

      Thanks