1 Reply Latest reply on Sep 3, 2010 11:07 AM by Saravanan Muthusamy

    How to check the new singleton is fully started?

    Saravanan Muthusamy Newbie

      Hi, Please bare for the silly question

      In a cluster setup, when singleton server goes down, the new singleton will be brought up by jboss.

      My question is, is there way i can find whether all my singleton services are deployed on a new singleton server which is comming up?

        • 1. Re: How to check the new singleton is fully started?
          Saravanan Muthusamy Newbie

          Tthis will return true once all the services are deployed on a new singleton (Master App)server.

           

          private boolean isMasterAppSwitchoverCompleted(MainDeployerMBean deployer) {

                      Set<ControllerContext> contextSet = ((AbstractKernelController) deployer.getController().getStates()).getAllContexts();

                      Iterator<ControllerContext> contextIterator = contextSet.iterator();

                      while (contextIterator.hasNext()) {

                          ControllerContext contextController = contextIterator.next();

                          if (contextController instanceof ServiceControllerContext) {

                              ServiceContext serviceContext = ((ServiceControllerContext) contextController).getServiceContext();

                              if (ServiceContext.RUNNING != serviceContext.state && ServiceContext.FAILED != serviceContext.state &&

                                      ServiceContext.DESTROYED != serviceContext.state) {

                                 return false;

                              }

                          }

                      }

                 return true;

           

          }