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

    How to check the new singleton is fully started?

    tosaravananm

      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?
          tosaravananm

          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;

           

          }