geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java
@SuppressWarnings("serial")
  protected void checkProxyAsyncQueue(final VM vm, final DistributedMember senderMember,
      final boolean shouldExist) {
    SerializableRunnable checkProxyAsyncQueue =
        new SerializableRunnable("Check Proxy Async Queue") {
          public void run() {
            Cache cache = GemFireCacheImpl.getInstance();
            SystemManagementService service =
                (SystemManagementService) ManagementService.getManagementService(cache);
            final ObjectName queueMBeanName =
                service.getAsyncEventQueueMBeanName(senderMember, "pn");
            AsyncEventQueueMXBean bean = null;
            if (shouldExist) {
              // Verify the MBean proxy exists
              try {
                bean = MBeanUtil.getAsyncEventQueueMBeanProxy(senderMember, "pn");
              } catch (Exception e) {
                fail("Could not obtain Sender Proxy in desired time " + e);
              }
              assertNotNull(bean);

              try {
                MBeanUtil.printBeanDetails(queueMBeanName);
              } catch (Exception e) {
                fail("Error while Printing Bean Details " + e);
              }
            } else {
              // Verify the MBean proxy doesn't exist
              bean = service.getMBeanProxy(queueMBeanName, AsyncEventQueueMXBean.class);
              assertNull(bean);
            }
          }
        };
    vm.invoke(checkProxyAsyncQueue);
  }
/**
   * Checks Proxy Async Queue
   * 
   * @param vm reference to VM
   */
Checks Proxy Async Queue

@param vm reference to VM
Checks Proxy Async Queue @param vm reference to VM
@SuppressWarnings("serial")
  protected void checkProxyAsyncQueue(final VM vm, final DistributedMember senderMember,
      final boolean shouldExist) {
    SerializableRunnable checkProxyAsyncQueue =
        new SerializableRunnable("Check Proxy Async Queue") {
          public void run() {
            Cache cache = GemFireCacheImpl.getInstance();
            SystemManagementService service =
                (SystemManagementService) ManagementService.getManagementService(cache);
            final ObjectName queueMBeanName =
                service.getAsyncEventQueueMBeanName(senderMember, "pn");
            AsyncEventQueueMXBean bean = null;
            if (shouldExist) {
              try {
                bean = MBeanUtil.getAsyncEventQueueMBeanProxy(senderMember, "pn");
              } catch (Exception e) {
                fail("Could not obtain Sender Proxy in desired time " + e);
              }
              assertNotNull(bean);
              try {
                MBeanUtil.printBeanDetails(queueMBeanName);
              } catch (Exception e) {
                fail("Error while Printing Bean Details " + e);
              }
            } else {
              bean = service.getMBeanProxy(queueMBeanName, AsyncEventQueueMXBean.class);
              assertNull(bean);
            }
          }
        };
    vm.invoke(checkProxyAsyncQueue);
  }
@ SuppressWarnings ( "serial" ) protected void checkProxyAsyncQueue ( final VM vm , final DistributedMember senderMember , final boolean shouldExist ) { SerializableRunnable checkProxyAsyncQueue = new SerializableRunnable ( "Check Proxy Async Queue" ) { public void run ( ) { Cache cache = GemFireCacheImpl . getInstance ( ) ; SystemManagementService service = ( SystemManagementService ) ManagementService . getManagementService ( cache ) ; final ObjectName queueMBeanName = service . getAsyncEventQueueMBeanName ( senderMember , "pn" ) ; AsyncEventQueueMXBean bean = null ; if ( shouldExist ) { try { bean = MBeanUtil . getAsyncEventQueueMBeanProxy ( senderMember , "pn" ) ; } catch ( Exception e ) { fail ( "Could not obtain Sender Proxy in desired time " + e ) ; } assertNotNull ( bean ) ; try { MBeanUtil . printBeanDetails ( queueMBeanName ) ; } catch ( Exception e ) { fail ( "Error while Printing Bean Details " + e ) ; } } else { bean = service . getMBeanProxy ( queueMBeanName , AsyncEventQueueMXBean . class ) ; assertNull ( bean ) ; } } } ; vm . invoke ( checkProxyAsyncQueue ) ; }
Checks Proxy Async Queue
Checks Proxy Async Queue
// Verify the MBean proxy exists // Verify the MBean proxy doesn't exist