1 Reply Latest reply on Apr 15, 2013 5:43 AM by ctomc

    How to read 'isMaster' method on MSC service decorated as SingletonService

    kristjan273

      Hi,

       

      I am trying to read the exposed 'isMaster' method on SingletonService which is decorating some MSC service (using as7 7.2.0.Final).

      Service is activated at startup (following JDF Quickstarts cluster-ha-singleton and also follow some idea in this thread https://community.jboss.org/message/748400 ).

       

      I have some ServiceAccessBean with

       

       

      ServiceController<String> realController = (ServiceController<String>) CurrentServiceContainer.getServiceContainer().getService(MyMSCService.SINGLETON_SERVICE_NAME);
      SingletonService<String> decoratedService = (SingletonService<String>)realController.getService();
      
      
      decoratedService.isMaster();
      

       

       

      This fails at runtime with:

       

      Caused by: javax.ejb.EJBTransactionRolledbackException: org.jboss.as.clustering.msc.AsynchronousService cannot be cast to org.jboss.as.clustering.singleton.SingletonService
      

       

      I am looking into SingletonService src, but seems that I am missing some hint how to get this working.

       

       

      Tnx for some idea in advance.