public static LockServiceMXBean getLockServiceMbeanProxy(DistributedMember member,
      String lockServiceName) {
    LockServiceMXBean bean = null;
    final SystemManagementService service =
        (SystemManagementService) ManagementTestBase.getManagementService();
    final ObjectName lockServiceMBeanName =
        service.getLockServiceMBeanName(member, lockServiceName);

    Wait.waitForCriterion(new WaitCriterion() {
      LockServiceMXBean bean = null;

      @Override
      public String description() {
        return "Waiting for the proxy to get reflected at managing node";
      }

      @Override
      public boolean done() {
        GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
        GemFireCacheImpl cacheImpl = cache;
        bean = service.getMBeanProxy(lockServiceMBeanName, LockServiceMXBean.class);
        boolean done = bean != null;
        return done;
      }

    }, MAX_WAIT, 500, true);

    try {
      bean = service.getMBeanProxy(lockServiceMBeanName, LockServiceMXBean.class);
    } catch (ManagementException mgz) {
      if (bean == null) {
        InternalDistributedSystem.getLogger()
            .fine("Undesired Result :LockService Proxy Should Not be Empty for : "
                + lockServiceMBeanName.getCanonicalName());
      }
    }

    return bean;
  }
Utility Method to obtain LockServiceMXBean proxy reference for a particular lock service on a
Member

@param member the member
@param lockServiceName the name of the lock service
@return a reference to LockServiceMXBean
geode-dunit/src/main/java/org/apache/geode/management/MBeanUtil.java