geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [4/7] geode git commit: Change GemFireCacheImpl to InternalCache
Date Fri, 05 May 2017 17:32:31 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java b/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
index fe0f59f..c674e48 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
@@ -25,14 +25,13 @@ import javax.management.ObjectName;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.CancelException;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.DistributedSystemDisconnectedException;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ResourceEvent;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.management.AlreadyRunningException;
@@ -66,13 +65,11 @@ public final class SystemManagementService extends BaseManagementService {
   /**
    * The concrete implementation of DistributedSystem that provides internal-only functionality.
    */
-
   private InternalDistributedSystem system;
 
   /**
    * core component for distribution
    */
-
   private LocalManager localManager;
 
   /**
@@ -84,7 +81,6 @@ public final class SystemManagementService extends BaseManagementService {
   /**
    * Local Filter chain for local MBean filters
    */
-
   private LocalFilterChain localFilterChain;
 
   /**
@@ -103,8 +99,7 @@ public final class SystemManagementService extends BaseManagementService {
    */
   private MBeanJMXAdapter jmxAdapter;
 
-
-  private Cache cache;
+  private InternalCache cache;
 
   private FederatingManager federatingManager;
 
@@ -118,7 +113,6 @@ public final class SystemManagementService extends BaseManagementService {
    */
   private ManagementMembershipListener listener;
 
-
   /**
    * Proxy aggregator to create aggregate MBeans e.g. DistributedSystem and DistributedRegion
    * GemFire comes with a default aggregator.
@@ -127,11 +121,11 @@ public final class SystemManagementService extends BaseManagementService {
 
   private UniversalListenerContainer universalListenerContainer = new UniversalListenerContainer();
 
-  public static BaseManagementService newSystemManagementService(Cache cache) {
+  public static BaseManagementService newSystemManagementService(InternalCache cache) {
     return new SystemManagementService(cache).init();
   }
 
-  protected SystemManagementService(Cache cache) {
+  protected SystemManagementService(InternalCache cache) {
     this.cache = cache;
     this.system = (InternalDistributedSystem) cache.getDistributedSystem();
     // This is a safe check to ensure Management service does not start for a
@@ -166,7 +160,6 @@ public final class SystemManagementService extends BaseManagementService {
    * ManagementFunction
    */
   private SystemManagementService init() {
-
     try {
       this.localManager = new LocalManager(repo, system, this, cache);
       this.localManager.startManager();
@@ -182,7 +175,6 @@ public final class SystemManagementService extends BaseManagementService {
       logger.error(e.getMessage(), e);
       throw new ManagementException(e);
     }
-
   }
 
   /**
@@ -265,12 +257,11 @@ public final class SystemManagementService extends BaseManagementService {
         this.agent.stopAgent();
       }
 
-      getGemFireCacheImpl().getJmxManagerAdvisor().broadcastChange();
+      getInternalCache().getJmxManagerAdvisor().broadcastChange();
       instances.remove(cache);
       localManager = null;
       closed = true;
     }
-
   }
 
   @Override
@@ -305,7 +296,6 @@ public final class SystemManagementService extends BaseManagementService {
     if (isManager()) {
       afterCreateProxy(objectName, interfaceClass, object, fedComp);
     }
-
   }
 
   @Override
@@ -349,7 +339,6 @@ public final class SystemManagementService extends BaseManagementService {
     return bean;
   }
 
-
   public <T> T getMBeanProxy(ObjectName objectName, Class<T> interfaceClass) { // TODO: this is too
                                                                                // generic
     if (!isStartedAndOpen()) {
@@ -372,7 +361,6 @@ public final class SystemManagementService extends BaseManagementService {
 
   @Override
   public Set<ObjectName> queryMBeanNames(DistributedMember member) {
-
     if (!isStartedAndOpen()) {
       return Collections.emptySet();
     }
@@ -387,7 +375,6 @@ public final class SystemManagementService extends BaseManagementService {
       }
       return federatingManager.findAllProxies(member);
     }
-
   }
 
   @Override
@@ -441,7 +428,7 @@ public final class SystemManagementService extends BaseManagementService {
 
   @Override
   public void startManager() {
-    if (!getGemFireCacheImpl().getSystem().getConfig().getJmxManager()) {
+    if (!getInternalCache().getInternalDistributedSystem().getConfig().getJmxManager()) {
       // fix for 45900
       throw new ManagementException(
           "Could not start the manager because the gemfire property \"jmx-manager\" is false.");
@@ -466,9 +453,9 @@ public final class SystemManagementService extends BaseManagementService {
           system.handleResourceEvent(ResourceEvent.MANAGER_START, null);
           federatingManager.startManager();
           if (this.agent != null) {
-            this.agent.startAgent(getGemFireCacheImpl());
+            this.agent.startAgent(getInternalCache());
           }
-          getGemFireCacheImpl().getJmxManagerAdvisor().broadcastChange();
+          getInternalCache().getJmxManagerAdvisor().broadcastChange();
           started = true;
         } catch (RuntimeException e) {
           logger.error("Jmx manager could not be started because {}", e.getMessage(), e);
@@ -488,13 +475,12 @@ public final class SystemManagementService extends BaseManagementService {
     }
   }
 
-  private GemFireCacheImpl getGemFireCacheImpl() {
-    return (GemFireCacheImpl) this.cache;
+  private InternalCache getInternalCache() {
+    return this.cache;
   }
 
   /**
    * Creates a Manager instance in stopped state.
-   * 
    */
   public boolean createManager() {
     synchronized (instances) {
@@ -504,7 +490,7 @@ public final class SystemManagementService extends BaseManagementService {
       system.handleResourceEvent(ResourceEvent.MANAGER_CREATE, null);
       // An initialised copy of federating manager
       federatingManager = new FederatingManager(jmxAdapter, repo, system, this, cache);
-      getGemFireCacheImpl().getJmxManagerAdvisor().broadcastChange();
+      getInternalCache().getJmxManagerAdvisor().broadcastChange();
       return true;
     }
   }
@@ -519,7 +505,7 @@ public final class SystemManagementService extends BaseManagementService {
       if (federatingManager != null) {
         federatingManager.stopManager();
         system.handleResourceEvent(ResourceEvent.MANAGER_STOP, null);
-        getGemFireCacheImpl().getJmxManagerAdvisor().broadcastChange();
+        getInternalCache().getJmxManagerAdvisor().broadcastChange();
         if (this.agent != null && (this.agent.isRunning() || this.agent.isHttpServiceRunning())) {
           this.agent.stopAgent();
         }
@@ -657,7 +643,6 @@ public final class SystemManagementService extends BaseManagementService {
     return true;
   }
 
-
   public boolean afterPseudoCreateProxy(ObjectName objectName, Class interfaceClass,
       Object proxyObject, FederationComponent newVal) {
     for (ProxyListener listener : proxyListeners) {
@@ -688,8 +673,6 @@ public final class SystemManagementService extends BaseManagementService {
     }
   }
 
-
-
   @Override
   public <T> T getMBeanInstance(ObjectName objectName, Class<T> interfaceClass) {
     if (jmxAdapter.isLocalMBean(objectName)) {
@@ -705,7 +688,6 @@ public final class SystemManagementService extends BaseManagementService {
     }
   }
 
-
   public void memberJoined(InternalDistributedMember id) {
     for (ProxyListener listener : proxyListeners) {
       listener.memberJoined(id);
@@ -725,7 +707,6 @@ public final class SystemManagementService extends BaseManagementService {
     }
   }
 
-
   public void quorumLost(Set<InternalDistributedMember> failures,
       List<InternalDistributedMember> remaining) {
     for (ProxyListener listener : proxyListeners) {
@@ -733,9 +714,7 @@ public final class SystemManagementService extends BaseManagementService {
     }
   }
 
-
-
-  public class UniversalListenerContainer {
+  public static class UniversalListenerContainer {
 
     private List<MembershipListener> membershipListeners =
         new CopyOnWriteArrayList<MembershipListener>();
@@ -749,7 +728,6 @@ public final class SystemManagementService extends BaseManagementService {
           logger.error("Could not invoke listener event memberJoined for listener[{}] due to ",
               listener.getClass(), e.getMessage(), e);
         }
-
       }
     }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/beans/CacheServerBridge.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/CacheServerBridge.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/CacheServerBridge.java
index 54ac0c5..728402c 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/CacheServerBridge.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/CacheServerBridge.java
@@ -28,11 +28,8 @@ import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.query.CqClosedException;
 import org.apache.geode.cache.query.CqException;
-import org.apache.geode.cache.query.CqQuery;
-import org.apache.geode.cache.query.CqState;
 import org.apache.geode.cache.query.Index;
 import org.apache.geode.cache.query.QueryService;
-import org.apache.geode.cache.query.RegionNotFoundException;
 import org.apache.geode.cache.query.internal.CqStateImpl;
 import org.apache.geode.cache.query.internal.cq.CqService;
 import org.apache.geode.cache.query.internal.cq.InternalCqQuery;
@@ -45,7 +42,7 @@ import org.apache.geode.internal.Version;
 import org.apache.geode.internal.admin.ClientHealthMonitoringRegion;
 import org.apache.geode.internal.admin.remote.ClientHealthStats;
 import org.apache.geode.internal.cache.CacheServerImpl;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.ha.HARegionQueue;
 import org.apache.geode.internal.cache.tier.InternalClientMembership;
 import org.apache.geode.internal.cache.tier.sockets.AcceptorImpl;
@@ -70,8 +67,6 @@ import org.apache.geode.management.membership.ClientMembershipListener;
 /**
  * Represents the GemFire CacheServer . Provides data and notifications about server,
  * subscriptions,durable queues and indices
- * 
- * 
  */
 public class CacheServerBridge extends ServerBridge {
 
@@ -79,7 +74,7 @@ public class CacheServerBridge extends ServerBridge {
 
   private CacheServer cacheServer;
 
-  private GemFireCacheImpl cache;
+  private InternalCache cache;
 
   private QueryService qs;
 
@@ -106,7 +101,7 @@ public class CacheServerBridge extends ServerBridge {
     }
   }
 
-  public CacheServerBridge(CacheServer cacheServer, GemFireCacheImpl cache) {
+  public CacheServerBridge(CacheServer cacheServer, InternalCache cache) {
     super(cacheServer);
     this.cacheServer = cacheServer;
     this.cache = cache;
@@ -306,7 +301,6 @@ public class CacheServerBridge extends ServerBridge {
   }
 
   /**
-   * 
    * @return a list of client Ids connected to this particular server instance
    */
   public String[] listClientIds() throws Exception {
@@ -323,10 +317,8 @@ public class CacheServerBridge extends ServerBridge {
     } else {
       return new String[0];
     }
-
   }
 
-
   private Map<String, ClientConnInfo> getUniqueClientIds() {
     Map<String, ClientConnInfo> uniqueIds = null;
 
@@ -401,7 +393,7 @@ public class CacheServerBridge extends ServerBridge {
   }
 
   public Version getClientVersion(ClientConnInfo connInfo) {
-    GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+    InternalCache cache = (InternalCache) CacheFactory.getAnyInstance();
 
     if (cache.getCacheServers().size() == 0) {
       return null;
@@ -496,8 +488,7 @@ public class CacheServerBridge extends ServerBridge {
 
     ClientHealthStatus status = new ClientHealthStatus();
 
-    Region clientHealthMonitoringRegion =
-        ClientHealthMonitoringRegion.getInstance((GemFireCacheImpl) cache);
+    Region clientHealthMonitoringRegion = ClientHealthMonitoringRegion.getInstance(this.cache);
     String clientName = proxyId.getDSMembership();
     status.setClientId(connInfo.toString());
     status.setName(clientName);
@@ -530,7 +521,6 @@ public class CacheServerBridge extends ServerBridge {
     return status;
   }
 
-
   /**
    * closes a continuous query and releases all the resources associated with it.
    * 
@@ -550,7 +540,6 @@ public class CacheServerBridge extends ServerBridge {
           } catch (CqException e) {
             throw new Exception(e.getMessage());
           }
-
         }
       }
     }
@@ -576,7 +565,6 @@ public class CacheServerBridge extends ServerBridge {
         }
       }
     }
-
   }
 
   /**
@@ -627,12 +615,10 @@ public class CacheServerBridge extends ServerBridge {
     }
   }
 
-
   public int getIndexCount() {
     return qs.getIndexes().size();
   }
 
-
   public int getNumClientNotificationRequests() {
     return getStatistic(StatsKey.NUM_CLIENT_NOTIFICATION_REQUEST).intValue();
   }
@@ -641,7 +627,6 @@ public class CacheServerBridge extends ServerBridge {
     return clientNotificatioAvgLatency.getAverageLatency();
   }
 
-
   public float getClientNotificationRate() {
     return clientNotificationRate.getRate();
   }
@@ -654,7 +639,6 @@ public class CacheServerBridge extends ServerBridge {
     return memberMBeanBridge.getTotalIndexMaintenanceTime();
   }
 
-
   public long getActiveCQCount() {
     CqService cqService = cache.getCqService();
     if (cqService != null && cqService.isRunning()) {
@@ -710,9 +694,7 @@ public class CacheServerBridge extends ServerBridge {
     }
   }
 
-
   private ClientQueueDetail getClientQueueDetail(CacheClientProxy p) {
-
     ClientQueueDetail queueDetail = new ClientQueueDetail();
     ClientProxyMembershipID proxyID = p.getProxyID();
 
@@ -737,13 +719,7 @@ public class CacheServerBridge extends ServerBridge {
     return queueDetail;
   }
 
-  /**
-   * 
-   * @param clientId
-   * @return stats for a given client ID
-   */
   public ClientQueueDetail getClientQueueDetail(String clientId) throws Exception {
-
     try {
       if (acceptor != null && acceptor.getCacheClientNotifier() != null) {
         Collection<CacheClientProxy> clientProxies =
@@ -755,7 +731,6 @@ public class CacheServerBridge extends ServerBridge {
             return queueDetail;
           }
         }
-
       }
     } catch (Exception e) {
       throw new Exception(e.getMessage());

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
index 5b8c115..ef643ac 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
@@ -55,6 +55,7 @@ import org.apache.geode.internal.admin.remote.PrepareRevokePersistentIDRequest;
 import org.apache.geode.internal.admin.remote.RevokePersistentIDRequest;
 import org.apache.geode.internal.admin.remote.ShutdownAllRequest;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.persistence.PersistentMemberPattern;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
@@ -97,10 +98,6 @@ import org.apache.geode.management.internal.cli.json.TypedJson;
  *
  * Operation strategy is not fixed. Some of the operations operate on local proxies. Some uses admin
  * messaging for distributed message.
- *
- *
- *
- *
  */
 public class DistributedSystemBridge {
 
@@ -154,7 +151,7 @@ public class DistributedSystemBridge {
   /**
    * Cache instance
    */
-  private GemFireCacheImpl cache;
+  private InternalCache cache;
 
   /**
    * private instance of SystemManagementService
@@ -193,15 +190,12 @@ public class DistributedSystemBridge {
 
   private GatewayReceiverClusterStatsMonitor receiverMonitor;
 
-
   /**
    * Distributed System level listener to listen on all the member level notifications It will then
    * send the notification up the JMX layer in the name of DistributedSystemMBean.
    */
   private DistributedSystemNotifListener distListener;
 
-
-
   /**
    * Static reference to the platform mbean server
    */
@@ -223,7 +217,6 @@ public class DistributedSystemBridge {
    */
   private int queryCollectionsDepth = TypedJson.DEFAULT_COLLECTION_ELEMENT_LIMIT;
 
-
   /**
    * Helper method to get a member bean reference given a member name or id
    *
@@ -237,7 +230,6 @@ public class DistributedSystemBridge {
     } catch (ManagementException mx) {
       return null;
     }
-
   }
 
   /**
@@ -254,7 +246,7 @@ public class DistributedSystemBridge {
     this.mapOfGatewaySenders = new ConcurrentHashMap<ObjectName, GatewaySenderMXBean>();
     this.service = service;
     this.cache = GemFireCacheImpl.getInstance();
-    this.system = (InternalDistributedSystem) cache.getDistributedSystem();
+    this.system = cache.getInternalDistributedSystem();
     this.dm = system.getDistributionManager();
     this.alertLevel = ManagementConstants.DEFAULT_ALERT_LEVEL;
     this.thisMemberName = MBeanJMXAdapter.getMemberMBeanName(system.getDistributedMember());
@@ -264,7 +256,6 @@ public class DistributedSystemBridge {
     initClusterMonitors();
   }
 
-
   private void initClusterMonitors() {
     this.memberMBeanMonitor = new MemberClusterStatsMonitor();
     this.serverMBeanMonitor = new ServerClusterStatsMonitor();
@@ -305,9 +296,7 @@ public class DistributedSystemBridge {
       }
 
       logger.info(LocalizedMessage.create(ManagementStrings.INSTANCE_NOT_FOUND, objectName));
-
     }
-
   }
 
   public void updateMember(ObjectName objectName, FederationComponent newState,
@@ -330,7 +319,6 @@ public class DistributedSystemBridge {
     receiverMonitor.aggregate(newState, oldState);
   }
 
-
   /**
    * Removed the proxy from the map.
    *
@@ -353,7 +341,6 @@ public class DistributedSystemBridge {
       if (mapOfMembers.values().size() == 0) {
         memberSetSize = 0;
         return true;
-
       }
     }
     updateMember(objectName, null, oldState);
@@ -406,7 +393,6 @@ public class DistributedSystemBridge {
       if (mapOfServers.values().size() == 0) {
         serverSetSize = 0;
         return true;
-
       }
     }
     updateCacheServer(objectName, null, oldState);
@@ -444,7 +430,6 @@ public class DistributedSystemBridge {
       if (mapOfGatewaySenders.values().size() == 0) {
         gatewaySenderSetSize = 0;
         return true;
-
       }
     }
     updateGatewaySender(objectName, null, oldState);
@@ -482,7 +467,6 @@ public class DistributedSystemBridge {
       if (mapOfGatewayReceivers.values().size() == 0) {
         gatewayReceiverSetSize = 0;
         return true;
-
       }
     }
     updateGatewayReceiver(objectName, null, oldState);
@@ -513,7 +497,6 @@ public class DistributedSystemBridge {
           baselineDir = new File(baselineDirPath);
         }
 
-
         DM dm = cache.getDistributionManager();
         Set<PersistentID> missingMembers = MissingPersistentIDsRequest.send(dm);
         Set recipients = dm.getOtherDistributionManagerIds();
@@ -558,7 +541,6 @@ public class DistributedSystemBridge {
               setOfMissingDiskStr[j] = id.getDirectory();
               j++;
             }
-
           }
         }
 
@@ -576,7 +558,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return Minimum level for alerts to be delivered to listeners. Should be one of: WARNING,
    *         ERROR, SEVERE, OFF. It is not case-sensitive.
    */
@@ -616,7 +597,6 @@ public class DistributedSystemBridge {
       throw new Exception("Unknown log-level \"" + alertLevel
           + "\". Valid levels are: WARNING, ERROR, SEVERE, NONE");
     }
-
   }
 
   /**
@@ -637,7 +617,6 @@ public class DistributedSystemBridge {
       return listOfServer.toArray(members);
     }
     return ManagementConstants.NO_DATA_STRING;
-
   }
 
   /**
@@ -676,7 +655,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return a list of Gateway Senders
    */
   public String[] listGatwaySenders() {
@@ -711,7 +689,6 @@ public class DistributedSystemBridge {
     if (bean != null) {
       return bean;
     } else {
-
       throw new Exception(ManagementStrings.INVALID_MEMBER_NAME_OR_ID.toLocalizedString(member));
     }
   }
@@ -727,7 +704,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return the list of all locators present in the system
    */
   public String[] listLocators() {
@@ -750,7 +726,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @param member name or id of the member
    * @return GemFire configuration data
    */
@@ -774,7 +749,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return Lists all the members disk stores
    */
   public Map<String, String[]> getMemberDiskstoreMap() {
@@ -785,7 +759,6 @@ public class DistributedSystemBridge {
       while (memberIterator.hasNext()) {
         MemberMXBean bean = memberIterator.next();
         mapOfDisks.put(bean.getMember(), bean.getDiskStores());
-
       }
 
       return mapOfDisks;
@@ -794,19 +767,15 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @param member name or id of the member
    * @return for how long the member is up.
    */
   public long getMemberUpTime(String member) throws Exception {
     MemberMXBean bean = validateMember(member);
     return bean.getMemberUpTime();
-
   }
 
-
   /**
-   *
    * @return list of members visible to the Managing node and which can be manageable.
    */
   public String[] getMembers() {
@@ -876,7 +845,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return list of groups visible to the Manager node
    */
   public String[] getGroups() {
@@ -909,7 +877,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @param member name or id of the member
    * @return basic Opertaing metrics for a given member.
    */
@@ -919,7 +886,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return a list of region names hosted on the system
    */
   public String[] listAllRegions() {
@@ -938,7 +904,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return a list of region names hosted on the system
    */
   public String[] listAllRegionPaths() {
@@ -959,10 +924,8 @@ public class DistributedSystemBridge {
 
 
   /**
-   *
    * @return the set of members successfully shutdown
    */
-
   @SuppressWarnings("unchecked")
   public String[] shutDownAllMembers() throws Exception {
     try {
@@ -1069,7 +1032,6 @@ public class DistributedSystemBridge {
   }
 
   public ObjectName fetchDistributedRegionObjectName(String regionPath) throws Exception {
-
     ObjectName distributedRegionMBeanName =
         MBeanJMXAdapter.getDistributedRegionMbeanName(regionPath);
 
@@ -1078,11 +1040,9 @@ public class DistributedSystemBridge {
     } else {
       throw new Exception(ManagementStrings.DISTRIBUTED_REGION_MBEAN_NOT_FOUND_IN_DS.toString());
     }
-
   }
 
   public ObjectName fetchRegionObjectName(String member, String regionPath) throws Exception {
-
     validateMember(member);
 
     ObjectName distributedRegionMBeanName =
@@ -1120,7 +1080,6 @@ public class DistributedSystemBridge {
   }
 
   public ObjectName[] listDistributedRegionObjectNames() {
-
     List<ObjectName> list = new ArrayList<ObjectName>();
     Iterator<ObjectName> it = distrRegionMap.keySet().iterator();
     while (it.hasNext()) {
@@ -1131,7 +1090,6 @@ public class DistributedSystemBridge {
   }
 
   public ObjectName fetchCacheServerObjectName(String member, int port) throws Exception {
-
     validateMember(member);
     ObjectName serverName = MBeanJMXAdapter.getClientServiceMBeanName(port, member);
 
@@ -1145,12 +1103,10 @@ public class DistributedSystemBridge {
       } else {
         throw new Exception(ManagementStrings.CACHE_SERVER_MBEAN_NOT_FOUND_IN_DS.toString());
       }
-
     }
   }
 
   public ObjectName fetchDiskStoreObjectName(String member, String diskStore) throws Exception {
-
     validateMember(member);
     ObjectName diskStoreName = MBeanJMXAdapter.getDiskStoreMBeanName(member, diskStore);
 
@@ -1166,7 +1122,6 @@ public class DistributedSystemBridge {
     } else {
       throw new Exception(ManagementStrings.DISK_STORE_MBEAN_NOT_FOUND_IN_DS.toString());
     }
-
   }
 
   public ObjectName fetchDistributedLockServiceObjectName(String lockServiceName) throws Exception {
@@ -1181,7 +1136,6 @@ public class DistributedSystemBridge {
   }
 
   public ObjectName fetchGatewayReceiverObjectName(String member) throws Exception {
-
     validateMember(member);
     ObjectName receiverName = MBeanJMXAdapter.getGatewayReceiverMBeanName(member);
     GatewayReceiverMXBean bean =
@@ -1198,11 +1152,9 @@ public class DistributedSystemBridge {
             ManagementStrings.GATEWAY_RECEIVER_MBEAN_NOT_FOUND_IN_SYSTEM.toString());
       }
     }
-
   }
 
   public ObjectName fetchGatewaySenderObjectName(String member, String senderId) throws Exception {
-
     validateMember(member);
 
     ObjectName senderName = MBeanJMXAdapter.getGatewaySenderMBeanName(member, senderId);
@@ -1219,11 +1171,9 @@ public class DistributedSystemBridge {
         throw new Exception(ManagementStrings.GATEWAY_SENDER_MBEAN_NOT_FOUND_IN_SYSTEM.toString());
       }
     }
-
   }
 
   public ObjectName fetchLockServiceObjectName(String member, String lockService) throws Exception {
-
     validateMember(member);
 
     ObjectName lockServiceName = MBeanJMXAdapter.getLockServiceMBeanName(member, lockService);
@@ -1257,14 +1207,11 @@ public class DistributedSystemBridge {
   }
 
   public ObjectName[] listGatewaySenderObjectNames(String member) throws Exception {
-
     validateMember(member);
     DistributedMember distributedMember = BeanUtilFuncs.getDistributedMemberByNameOrId(member);
 
-
     List<ObjectName> listName = null;
 
-
     ObjectName pattern = new ObjectName(ManagementConstants.GATEWAY_SENDER_PATTERN);
 
     Set<ObjectName> mbeanSet = service.queryMBeanNames(distributedMember);
@@ -1285,8 +1232,6 @@ public class DistributedSystemBridge {
     return ManagementConstants.NO_DATA_OBJECTNAME;
   }
 
-  /** Statistics Attributes **/
-
   /**
    * We have to iterate through the Cache servers to get Unique Client list across system. Stats
    * will give duplicate client numbers;
@@ -1294,7 +1239,6 @@ public class DistributedSystemBridge {
    * @return total number of client vm connected to the system
    */
   public int getNumClients() {
-
     if (mapOfServers.keySet().size() > 0) {
       Set<String> uniqueClientSet = new HashSet<String>();
       Iterator<CacheServerMXBean> it = mapOfServers.values().iterator();
@@ -1312,7 +1256,6 @@ public class DistributedSystemBridge {
             uniqueClientSet.add(client);
           }
         }
-
       }
       return uniqueClientSet.size();
     }
@@ -1320,7 +1263,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return total number of query running
    */
   public long getActiveCQCount() {
@@ -1328,7 +1270,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return average query request rate
    */
   public float getQueryRequestRate() {
@@ -1336,7 +1277,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return rate of disk reads
    */
   public float getDiskReadsRate() {
@@ -1344,7 +1284,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return rate of disk writes
    */
   public float getDiskWritesRate() {
@@ -1352,7 +1291,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return disk flush avg latency
    */
   public long getDiskFlushAvgLatency() {
@@ -1372,7 +1310,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return average events received rate across system
    */
   public float getGatewayReceiverEventsReceivedRate() {
@@ -1380,26 +1317,21 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return Average number of batches of events removed from the event queue and sent per second
    */
   public long getGatewaySenderAverageDistributionTimePerBatch() {
     return MetricsCalculator.getAverage(
         senderMonitor.getGatewaySenderAverageDistributionTimePerBatch(), gatewaySenderSetSize);
-
   }
 
   /**
-   *
    * @return average gateway sender batch dispatch rate
    */
   public float getGatewaySenderBatchesDispatchedRate() {
     return senderMonitor.getGatewaySenderBatchesDispatchedRate();
-
   }
 
   /**
-   *
    * @return event queue size
    */
   public int getGatewaySenderEventQueueSize() {
@@ -1407,7 +1339,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return events queued rate
    */
   public float getGatewaySenderEventsQueuedRate() {
@@ -1415,7 +1346,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return total batches redistributed
    */
   public int getGatewaySenderTotalBatchesRedistributed() {
@@ -1423,16 +1353,13 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return total number of events conflated
    */
   public int getGatewaySenderTotalEventsConflated() {
     return senderMonitor.getGatewaySenderTotalEventsConflated();
   }
 
-
   /**
-   *
    * @return the total count of disk stores present in the system
    */
   public int getSystemDiskStoreCount() {
@@ -1440,7 +1367,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return total number of disk back up going on across system
    */
   public int getTotalBackupInProgress() {
@@ -1448,19 +1374,16 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return total heap size occupied by the DS
    */
   public long getTotalHeapSize() {
     return memberMBeanMonitor.getTotalHeapSize();
   }
 
-
   public long getOffHeapFreeSize() {
     return memberMBeanMonitor.getOffHeapFreeMemory();
   }
 
-
   public long getOffHeapUsedSize() {
     return memberMBeanMonitor.getOffHeapUsedMemory();
   }
@@ -1474,7 +1397,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return total hit count across DS
    */
   public int getTotalHitCount() {
@@ -1482,7 +1404,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return total miss count across the system
    */
   public int getTotalMissCount() {
@@ -1490,7 +1411,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return number of regions
    */
   public int getTotalRegionCount() {
@@ -1498,7 +1418,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return total number of region entries
    */
   public long getTotalRegionEntryCount() {
@@ -1514,7 +1433,6 @@ public class DistributedSystemBridge {
   }
 
   /**
-   *
    * @return Number of Initial image operations that are in progress across system
    */
   public int getNumInitialImagesInProgress() {
@@ -1535,7 +1453,6 @@ public class DistributedSystemBridge {
 
   public float getAverageReads() {
     return memberMBeanMonitor.getAverageReads();
-
   }
 
   public float getAverageWrites() {
@@ -1576,12 +1493,10 @@ public class DistributedSystemBridge {
     return Collections.emptyMap();
   }
 
-
   public String queryData(String query, String members, int limit) throws Exception {
     Object result = QueryDataFunction.queryData(query, members, limit, false, queryResultSetLimit,
         queryCollectionsDepth);
     return (String) result;
-
   }
 
   public byte[] queryDataForCompressedResult(String query, String members, int limit)
@@ -1589,10 +1504,8 @@ public class DistributedSystemBridge {
     Object result = QueryDataFunction.queryData(query, members, limit, true, queryResultSetLimit,
         queryCollectionsDepth);
     return (byte[]) result;
-
   }
 
-
   public int getQueryResultSetLimit() {
     return queryResultSetLimit;
   }
@@ -1609,20 +1522,15 @@ public class DistributedSystemBridge {
     this.queryCollectionsDepth = queryCollectionsDepth;
   }
 
-
   /**
    * User defined notification handler
-   *
-   *
    */
   private class DistributedSystemNotifListener implements NotificationListener {
 
     @Override
     public void handleNotification(Notification notification, Object handback) {
-
       notification.setSequenceNumber(SequenceNumber.next());
       systemLevelNotifEmitter.sendNotification(notification);
-
     }
   }
 
@@ -1737,7 +1645,6 @@ public class DistributedSystemBridge {
         return;
       }
     }
-
   }
 
   public void updateLockService(ObjectName proxyName, FederationComponent oldValue,
@@ -1748,31 +1655,25 @@ public class DistributedSystemBridge {
   }
 
   public void memberDeparted(InternalDistributedMember id, boolean crashed) {
-
     Notification notification = new Notification(JMXNotificationType.CACHE_MEMBER_DEPARTED,
         MBeanJMXAdapter.getMemberNameOrId(id), SequenceNumber.next(), System.currentTimeMillis(),
         ManagementConstants.CACHE_MEMBER_DEPARTED_PREFIX + MBeanJMXAdapter.getMemberNameOrId(id)
             + " has crashed = " + crashed);
     systemLevelNotifEmitter.sendNotification(notification);
-
   }
 
   public void memberJoined(InternalDistributedMember id) {
-
     Notification notification = new Notification(JMXNotificationType.CACHE_MEMBER_JOINED,
         MBeanJMXAdapter.getMemberNameOrId(id), SequenceNumber.next(), System.currentTimeMillis(),
         ManagementConstants.CACHE_MEMBER_JOINED_PREFIX + MBeanJMXAdapter.getMemberNameOrId(id));
     systemLevelNotifEmitter.sendNotification(notification);
-
   }
 
   public void memberSuspect(InternalDistributedMember id, InternalDistributedMember whoSuspected) {
-
     Notification notification = new Notification(JMXNotificationType.CACHE_MEMBER_SUSPECT,
         MBeanJMXAdapter.getMemberNameOrId(id), SequenceNumber.next(), System.currentTimeMillis(),
         ManagementConstants.CACHE_MEMBER_SUSPECT_PREFIX + MBeanJMXAdapter.getMemberNameOrId(id)
             + " By : " + whoSuspected.getName());
     systemLevelNotifEmitter.sendNotification(notification);
-
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/beans/LocatorMBeanBridge.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/LocatorMBeanBridge.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/LocatorMBeanBridge.java
index 33b3175..1597f9f 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/LocatorMBeanBridge.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/LocatorMBeanBridge.java
@@ -23,6 +23,7 @@ import org.apache.logging.log4j.Logger;
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
@@ -30,23 +31,15 @@ import org.apache.geode.management.internal.JmxManagerAdvisor.JmxManagerProfile;
 import org.apache.geode.management.internal.ManagementConstants;
 import org.apache.geode.management.internal.ManagementStrings;
 
-
-/**
- * 
- *
- */
 public class LocatorMBeanBridge {
   private static final Logger logger = LogService.getLogger();
 
   private Locator loc;
 
-  private InternalDistributedSystem system;
-
-  private GemFireCacheImpl cache;
+  private InternalCache cache;
 
   public LocatorMBeanBridge(Locator loc) {
     this.loc = loc;
-    this.system = (InternalDistributedSystem) loc.getDistributedSystem();
     this.cache = GemFireCacheImpl.getInstance();
   }
 
@@ -54,27 +47,22 @@ public class LocatorMBeanBridge {
     return loc.getBindAddress().getCanonicalHostName();
   }
 
-
   public String getHostnameForClients() {
     return loc.getHostnameForClients();
   }
 
-
   public String viewLog() {
     return fetchLog(loc.getLogFile(), ManagementConstants.DEFAULT_SHOW_LOG_LINES);
   }
 
-
   public int getPort() {
     return loc.getPort();
   }
 
-
   public boolean isPeerLocator() {
     return true;
   }
 
-
   public boolean isServerLocator() {
     return true;
   }
@@ -114,11 +102,9 @@ public class LocatorMBeanBridge {
   }
 
   /**
-   * 
    * @return log of the locator.
    */
   private String fetchLog(File logFile, int numLines) {
-
     if (numLines > ManagementConstants.MAX_SHOW_LOG_LINES) {
       numLines = ManagementConstants.MAX_SHOW_LOG_LINES;
     }
@@ -127,7 +113,6 @@ public class LocatorMBeanBridge {
     }
     String mainTail = null;
     try {
-      InternalDistributedSystem sys = system;
       mainTail = BeanUtilFuncs.tailSystemLog(logFile, numLines);
       if (mainTail == null) {
         mainTail =

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementAdapter.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementAdapter.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementAdapter.java
index 1dc90dc..7dce602 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementAdapter.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementAdapter.java
@@ -47,7 +47,7 @@ import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.distributed.internal.locks.DLockService;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.ClassLoadUtil;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.PartitionedRegionHelper;
 import org.apache.geode.internal.logging.LogService;
@@ -82,9 +82,6 @@ import org.apache.geode.pdx.internal.PeerTypeRegistration;
  * 
  * Even though this class have a lot of utility functions it interacts with the state of the system
  * and contains some state itself.
- * 
- * 
- * 
  */
 public class ManagementAdapter {
 
@@ -94,7 +91,7 @@ public class ManagementAdapter {
   private SystemManagementService service;
 
   /** GemFire Cache impl **/
-  private GemFireCacheImpl cacheImpl;
+  private InternalCache internalCache;
 
   /** Member Name **/
   private String memberSource;
@@ -104,26 +101,20 @@ public class ManagementAdapter {
    **/
   private NotificationBroadcasterSupport memberLevelNotifEmitter;
 
-
   /** The <code>MBeanServer</code> for this application */
   public static final MBeanServer mbeanServer = MBeanJMXAdapter.mbeanServer;
 
-
   /** MemberMBean instance **/
   private MemberMBean memberBean;
 
-
-
   private volatile boolean serviceInitialised = false;
 
   private MBeanAggregator aggregator;
 
   public static final List<Class> refreshOnInit = new ArrayList<Class>();
 
-
   public static final List<String> internalLocks = new ArrayList<String>();
 
-
   static {
     refreshOnInit.add(RegionMXBean.class);
     refreshOnInit.add(MemberMXBean.class);
@@ -132,37 +123,33 @@ public class ManagementAdapter {
     internalLocks.add(DLockService.LTLS); // From reserved lock service name
     internalLocks.add(PartitionedRegionHelper.PARTITION_LOCK_SERVICE_NAME);
     internalLocks.add(PeerTypeRegistration.LOCK_SERVICE_NAME);
-
   }
 
   protected MemberMBeanBridge memberMBeanBridge;
 
   private final Object regionOpLock = new Object();
 
-
-
   /**
    * Adapter life cycle is tied with the Cache . So its better to make all cache level artifacts as
    * instance variable
-   * 
+   *
    * @param cache gemfire cache
    */
-  public void handleCacheCreation(GemFireCacheImpl cache) throws ManagementException {
+  public void handleCacheCreation(InternalCache cache) throws ManagementException {
     try {
-      this.cacheImpl = (GemFireCacheImpl) cache;
-      this.service = (SystemManagementService) ManagementService.getManagementService(cacheImpl);
+      this.internalCache = cache;
+      this.service =
+          (SystemManagementService) ManagementService.getManagementService(internalCache);
 
-      this.memberMBeanBridge = new MemberMBeanBridge(cacheImpl, service).init();
+      this.memberMBeanBridge = new MemberMBeanBridge(internalCache, service).init();
       this.memberBean = new MemberMBean(memberMBeanBridge);
       this.memberLevelNotifEmitter = memberBean;
 
       ObjectName memberMBeanName = MBeanJMXAdapter.getMemberMBeanName(
           InternalDistributedSystem.getConnectedInstance().getDistributedMember());
 
-
       memberSource = MBeanJMXAdapter
-          .getMemberNameOrId(cacheImpl.getDistributedSystem().getDistributedMember());
-
+          .getMemberNameOrId(internalCache.getDistributedSystem().getDistributedMember());
 
       // Type casting to MemberMXBean to expose only those methods described in
       // the interface;
@@ -170,21 +157,17 @@ public class ManagementAdapter {
           service.registerInternalMBean((MemberMXBean) memberBean, memberMBeanName);
       service.federate(changedMBeanName, MemberMXBean.class, true);
 
-
-
       this.serviceInitialised = true;
 
       // Service initialised is only for ManagementService and not necessarily
       // Manager service.
 
-
-      /** For situations where locator is created before any cache is created **/
+      // For situations where locator is created before any cache is created
       if (InternalLocator.hasLocator()) {
         Locator loc = InternalLocator.getLocator();
         handleLocatorStart(loc);
       }
 
-
       if (cache.getInternalDistributedSystem().getConfig().getJmxManager()) {
         this.service.createManager();
         if (cache.getInternalDistributedSystem().getConfig().getJmxManagerStart()) {
@@ -206,7 +189,6 @@ public class ManagementAdapter {
 
       }
     }
-
   }
 
   /**
@@ -224,7 +206,7 @@ public class ManagementAdapter {
     // register the aggregator for Federation framework to use
     service.addProxyListener(aggregator);
 
-    /**
+    /*
      * get the local member mbean as it need to be provided to aggregator first
      */
 
@@ -269,10 +251,7 @@ public class ManagementAdapter {
         }
         throw new ManagementException(e);
       }
-
     }
-
-
   }
 
   /**
@@ -336,7 +315,6 @@ public class ManagementAdapter {
         logger.warn("Failed to invoke aggregator for {} with exception {}", objectName,
             e.getMessage(), e);
       }
-
     }
     service.removeProxyListener(this.aggregator);
     this.aggregator = null;
@@ -344,7 +322,6 @@ public class ManagementAdapter {
 
   /**
    * Assumption is always cache and MemberMbean has been will be created first
-   * 
    */
   public void handleManagerCreation() throws ManagementException {
     if (!isServiceInitialised("handleManagerCreation")) {
@@ -358,7 +335,6 @@ public class ManagementAdapter {
     ManagerMXBean bean = new ManagerMBean(bridge);
 
     service.registerInternalMBean(bean, managerMBeanName);
-
   }
 
   /**
@@ -380,12 +356,12 @@ public class ManagementAdapter {
       if (localRegion.isDestroyed()) {
         return;
       }
-      /** Bridge is responsible for extracting data from GemFire Layer **/
+      // Bridge is responsible for extracting data from GemFire Layer
       RegionMBeanBridge<K, V> bridge = RegionMBeanBridge.getInstance(region);
 
       RegionMXBean regionMBean = new RegionMBean<K, V>(bridge);
       ObjectName regionMBeanName = MBeanJMXAdapter.getRegionMBeanName(
-          cacheImpl.getDistributedSystem().getDistributedMember(), region.getFullPath());
+          internalCache.getDistributedSystem().getDistributedMember(), region.getFullPath());
       ObjectName changedMBeanName = service.registerInternalMBean(regionMBean, regionMBeanName);
       service.federate(changedMBeanName, RegionMXBean.class, true);
 
@@ -394,11 +370,7 @@ public class ManagementAdapter {
           ManagementConstants.REGION_CREATED_PREFIX + region.getFullPath());
       memberLevelNotifEmitter.sendNotification(notification);
       memberMBeanBridge.addRegion(region);
-
-
     }
-
-
   }
 
   /**
@@ -413,7 +385,7 @@ public class ManagementAdapter {
     DiskStoreMBeanBridge bridge = new DiskStoreMBeanBridge(disk);
     DiskStoreMXBean diskStoreMBean = new DiskStoreMBean(bridge);
     ObjectName diskStoreMBeanName = MBeanJMXAdapter.getDiskStoreMBeanName(
-        cacheImpl.getDistributedSystem().getDistributedMember(), disk.getName());
+        internalCache.getDistributedSystem().getDistributedMember(), disk.getName());
     ObjectName changedMBeanName = service.registerInternalMBean(diskStoreMBean, diskStoreMBeanName);
 
     service.federate(changedMBeanName, DiskStoreMXBean.class, true);
@@ -425,7 +397,6 @@ public class ManagementAdapter {
     memberMBeanBridge.addDiskStore(disk);
   }
 
-
   /**
    * Handles LockService Creation
    * 
@@ -435,7 +406,7 @@ public class ManagementAdapter {
     if (!isServiceInitialised("handleLockServiceCreation")) {
       return;
     }
-    /** Internal Locks Should not be exposed to client for monitoring **/
+    // Internal Locks Should not be exposed to client for monitoring
     if (internalLocks.contains(lockService.getName())) {
       return;
     }
@@ -443,7 +414,7 @@ public class ManagementAdapter {
     LockServiceMXBean lockServiceMBean = new LockServiceMBean(bridge);
 
     ObjectName lockServiceMBeanName = MBeanJMXAdapter.getLockServiceMBeanName(
-        cacheImpl.getDistributedSystem().getDistributedMember(), lockService.getName());
+        internalCache.getDistributedSystem().getDistributedMember(), lockService.getName());
 
     ObjectName changedMBeanName =
         service.registerInternalMBean(lockServiceMBean, lockServiceMBeanName);
@@ -472,7 +443,7 @@ public class ManagementAdapter {
 
     GatewaySenderMXBean senderMBean = new GatewaySenderMBean(bridge);
     ObjectName senderObjectName = MBeanJMXAdapter.getGatewaySenderMBeanName(
-        cacheImpl.getDistributedSystem().getDistributedMember(), sender.getId());
+        internalCache.getDistributedSystem().getDistributedMember(), sender.getId());
 
     ObjectName changedMBeanName = service.registerInternalMBean(senderMBean, senderObjectName);
 
@@ -482,7 +453,6 @@ public class ManagementAdapter {
         memberSource, SequenceNumber.next(), System.currentTimeMillis(),
         ManagementConstants.GATEWAY_SENDER_CREATED_PREFIX);
     memberLevelNotifEmitter.sendNotification(notification);
-
   }
 
   /**
@@ -500,7 +470,6 @@ public class ManagementAdapter {
     }
 
     createGatewayReceiverMBean(recv);
-
   }
 
   private void createGatewayReceiverMBean(GatewayReceiver recv) {
@@ -508,7 +477,7 @@ public class ManagementAdapter {
 
     GatewayReceiverMXBean receiverMBean = new GatewayReceiverMBean(bridge);
     ObjectName recvObjectName = MBeanJMXAdapter
-        .getGatewayReceiverMBeanName(cacheImpl.getDistributedSystem().getDistributedMember());
+        .getGatewayReceiverMBeanName(internalCache.getDistributedSystem().getDistributedMember());
 
     ObjectName changedMBeanName = service.registerInternalMBean(receiverMBean, recvObjectName);
 
@@ -518,10 +487,8 @@ public class ManagementAdapter {
         memberSource, SequenceNumber.next(), System.currentTimeMillis(),
         ManagementConstants.GATEWAY_RECEIVER_CREATED_PREFIX);
     memberLevelNotifEmitter.sendNotification(notification);
-
   }
 
-
   /**
    * Handles Gateway receiver creation
    * 
@@ -546,10 +513,8 @@ public class ManagementAdapter {
         memberSource, SequenceNumber.next(), System.currentTimeMillis(),
         ManagementConstants.GATEWAY_RECEIVER_STARTED_PREFIX);
     memberLevelNotifEmitter.sendNotification(notification);
-
   }
 
-
   /**
    * Handles Gateway receiver creation
    * 
@@ -569,7 +534,6 @@ public class ManagementAdapter {
         memberSource, SequenceNumber.next(), System.currentTimeMillis(),
         ManagementConstants.GATEWAY_RECEIVER_STOPPED_PREFIX);
     memberLevelNotifEmitter.sendNotification(notification);
-
   }
 
   public void handleAsyncEventQueueCreation(AsyncEventQueue queue) throws ManagementException {
@@ -579,7 +543,7 @@ public class ManagementAdapter {
     AsyncEventQueueMBeanBridge bridge = new AsyncEventQueueMBeanBridge(queue);
     AsyncEventQueueMXBean queueMBean = new AsyncEventQueueMBean(bridge);
     ObjectName senderObjectName = MBeanJMXAdapter.getAsycnEventQueueMBeanName(
-        cacheImpl.getDistributedSystem().getDistributedMember(), queue.getId());
+        internalCache.getDistributedSystem().getDistributedMember(), queue.getId());
 
     ObjectName changedMBeanName = service.registerInternalMBean(queueMBean, senderObjectName);
 
@@ -602,7 +566,7 @@ public class ManagementAdapter {
     }
 
     ObjectName asycnEventQueueMBeanName = MBeanJMXAdapter.getAsycnEventQueueMBeanName(
-        cacheImpl.getDistributedSystem().getDistributedMember(), queue.getId());
+        internalCache.getDistributedSystem().getDistributedMember(), queue.getId());
     AsyncEventQueueMBean bean = null;
     try {
       bean = (AsyncEventQueueMBean) service.getLocalAsyncEventQueueMXBean(queue.getId());
@@ -649,7 +613,6 @@ public class ManagementAdapter {
       notification.setUserData(userData);
       service.handleNotification(notification);
     }
-
   }
 
   private Map<String, String> prepareUserData(AlertDetails details) {
@@ -657,13 +620,11 @@ public class ManagementAdapter {
     userData.put(JMXNotificationUserData.ALERT_LEVEL,
         AlertDetails.getAlertLevelAsString(details.getAlertLevel()));
 
-
     String source = details.getSource();
     userData.put(JMXNotificationUserData.THREAD, source);
 
     InternalDistributedMember sender = details.getSender();
-    String nameOrId = memberSource; // TODO Rishi/Abhishek - what if sender is
-    // null?
+    String nameOrId = memberSource; // TODO: what if sender is null?
     if (sender != null) {
       nameOrId = sender.getName();
       nameOrId = nameOrId != null && !nameOrId.trim().isEmpty() ? nameOrId : sender.getId();
@@ -684,13 +645,13 @@ public class ManagementAdapter {
       return;
     }
 
-    CacheServerBridge cacheServerBridge = new CacheServerBridge(cacheServer, cacheImpl);
+    CacheServerBridge cacheServerBridge = new CacheServerBridge(cacheServer, internalCache);
     cacheServerBridge.setMemberMBeanBridge(memberMBeanBridge);
 
     CacheServerMBean cacheServerMBean = new CacheServerMBean(cacheServerBridge);
 
     ObjectName cacheServerMBeanName = MBeanJMXAdapter.getClientServiceMBeanName(
-        cacheServer.getPort(), cacheImpl.getDistributedSystem().getDistributedMember());
+        cacheServer.getPort(), internalCache.getDistributedSystem().getDistributedMember());
 
     ObjectName changedMBeanName =
         service.registerInternalMBean((CacheServerMXBean) cacheServerMBean, cacheServerMBeanName);
@@ -710,7 +671,6 @@ public class ManagementAdapter {
     memberLevelNotifEmitter.sendNotification(notification);
 
     memberMBeanBridge.setCacheServer(true);
-
   }
 
   /**
@@ -731,11 +691,10 @@ public class ManagementAdapter {
       ClientMembership.unregisterClientMembershipListener(listener);
     }
 
-
     mbean.stopMonitor();
 
     ObjectName cacheServerMBeanName = MBeanJMXAdapter.getClientServiceMBeanName(server.getPort(),
-        cacheImpl.getDistributedSystem().getDistributedMember());
+        internalCache.getDistributedSystem().getDistributedMember());
     service.unregisterMBean(cacheServerMBeanName);
 
     Notification notification = new Notification(JMXNotificationType.CACHE_SERVER_STOPPED,
@@ -745,7 +704,6 @@ public class ManagementAdapter {
     memberLevelNotifEmitter.sendNotification(notification);
 
     memberMBeanBridge.setCacheServer(false);
-
   }
 
   /**
@@ -757,6 +715,7 @@ public class ManagementAdapter {
     if (!isServiceInitialised("handleCacheRemoval")) {
       return;
     }
+
     this.serviceInitialised = false;
     try {
       cleanUpMonitors();
@@ -765,32 +724,28 @@ public class ManagementAdapter {
       if (logger.isDebugEnabled()) {
         logger.debug(e.getMessage(), e);
       }
-
     }
+
     try {
       service.close();
-
     } catch (Exception e) {
       logger.warn(e.getMessage(), e);
     } finally {
-      this.cacheImpl = null;
+      this.internalCache = null;
       this.service = null;
       this.memberMBeanBridge = null;
       this.memberBean = null;
       this.memberLevelNotifEmitter = null;
-
-
     }
   }
 
   private void cleanUpMonitors() {
-
     MemberMBean bean = (MemberMBean) service.getMemberMXBean();
     if (bean != null) {
       bean.stopMonitor();
     }
 
-    Set<GatewaySender> senders = cacheImpl.getGatewaySenders();
+    Set<GatewaySender> senders = internalCache.getGatewaySenders();
 
     if (senders != null && senders.size() > 0) {
       for (GatewaySender sender : senders) {
@@ -808,9 +763,8 @@ public class ManagementAdapter {
     }
   }
 
-
   private void cleanBridgeResources() {
-    List<CacheServer> servers = cacheImpl.getCacheServers();
+    List<CacheServer> servers = internalCache.getCacheServers();
 
     if (servers != null && servers.size() > 0) {
       for (CacheServer server : servers) {
@@ -824,7 +778,6 @@ public class ManagementAdapter {
             ClientMembership.unregisterClientMembershipListener(listener);
           }
         }
-
       }
     }
   }
@@ -838,15 +791,14 @@ public class ManagementAdapter {
     if (!isServiceInitialised("handleRegionRemoval")) {
       return;
     }
-    /**
+    /*
      * Moved region remove operation to a guarded block. If a region is getting created it wont
      * allow it to destroy any region.
      */
 
     synchronized (regionOpLock) {
-
       ObjectName regionMBeanName = MBeanJMXAdapter.getRegionMBeanName(
-          cacheImpl.getDistributedSystem().getDistributedMember(), region.getFullPath());
+          internalCache.getDistributedSystem().getDistributedMember(), region.getFullPath());
       RegionMBean bean = null;
       try {
         bean = (RegionMBean) service.getLocalRegionMBean(region.getFullPath());
@@ -871,7 +823,6 @@ public class ManagementAdapter {
       memberLevelNotifEmitter.sendNotification(notification);
       memberMBeanBridge.removeRegion(region);
     }
-
   }
 
   /**
@@ -880,13 +831,12 @@ public class ManagementAdapter {
    * @param disk
    */
   public void handleDiskRemoval(DiskStore disk) throws ManagementException {
-
     if (!isServiceInitialised("handleDiskRemoval")) {
       return;
     }
 
     ObjectName diskStoreMBeanName = MBeanJMXAdapter.getDiskStoreMBeanName(
-        cacheImpl.getDistributedSystem().getDistributedMember(), disk.getName());
+        internalCache.getDistributedSystem().getDistributedMember(), disk.getName());
 
     DiskStoreMBean bean = null;
     try {
@@ -913,20 +863,18 @@ public class ManagementAdapter {
     memberMBeanBridge.removeDiskStore(disk);
   }
 
-
   /**
    * Handles Lock Service Removal
    * 
    * @param lockService lock service instance
    */
   public void handleLockServiceRemoval(DLockService lockService) throws ManagementException {
-
     if (!isServiceInitialised("handleLockServiceRemoval")) {
       return;
     }
 
     ObjectName lockServiceMBeanName = MBeanJMXAdapter.getLockServiceMBeanName(
-        cacheImpl.getDistributedSystem().getDistributedMember(), lockService.getName());
+        internalCache.getDistributedSystem().getDistributedMember(), lockService.getName());
 
     LockServiceMXBean bean = service.getLocalLockServiceMBean(lockService.getName());
 
@@ -954,7 +902,7 @@ public class ManagementAdapter {
     }
 
     ObjectName locatorMBeanName = MBeanJMXAdapter
-        .getLocatorMBeanName(cacheImpl.getDistributedSystem().getDistributedMember());
+        .getLocatorMBeanName(internalCache.getDistributedSystem().getDistributedMember());
 
     LocatorMBeanBridge bridge = new LocatorMBeanBridge(locator);
     LocatorMBean locatorMBean = new LocatorMBean(bridge);
@@ -989,7 +937,6 @@ public class ManagementAdapter {
         ManagementConstants.GATEWAY_SENDER_STARTED_PREFIX + sender.getId());
 
     memberLevelNotifEmitter.sendNotification(notification);
-
   }
 
   public void handleGatewaySenderStop(GatewaySender sender) throws ManagementException {
@@ -1002,7 +949,6 @@ public class ManagementAdapter {
         ManagementConstants.GATEWAY_SENDER_STOPPED_PREFIX + sender.getId());
 
     memberLevelNotifEmitter.sendNotification(notification);
-
   }
 
   public void handleGatewaySenderPaused(GatewaySender sender) throws ManagementException {
@@ -1015,7 +961,6 @@ public class ManagementAdapter {
         ManagementConstants.GATEWAY_SENDER_PAUSED_PREFIX + sender.getId());
 
     memberLevelNotifEmitter.sendNotification(notification);
-
   }
 
   public void handleGatewaySenderResumed(GatewaySender sender) throws ManagementException {
@@ -1028,7 +973,6 @@ public class ManagementAdapter {
         ManagementConstants.GATEWAY_SENDER_RESUMED_PREFIX + sender.getId());
 
     memberLevelNotifEmitter.sendNotification(notification);
-
   }
 
   public void handleCacheServiceCreation(CacheService cacheService) throws ManagementException {
@@ -1037,7 +981,7 @@ public class ManagementAdapter {
     }
     // Don't register the CacheServices in the Locator
     InternalDistributedMember member =
-        cacheImpl.getInternalDistributedSystem().getDistributedMember();
+        internalCache.getInternalDistributedSystem().getDistributedMember();
     if (member.getVmKind() == DistributionManager.LOCATOR_DM_TYPE) {
       return;
     }
@@ -1061,7 +1005,6 @@ public class ManagementAdapter {
    * Private class which acts as a ClientMembershipListener to propagate client joined/left
    * notifications
    */
-
   private static class CacheServerMembershipListenerAdapter
       extends ClientMembershipListenerAdapter {
 
@@ -1088,7 +1031,6 @@ public class ManagementAdapter {
           ManagementConstants.CLIENT_JOINED_PREFIX + event.getMemberId());
       serverLevelNotifEmitter.sendNotification(notification);
       memberLevelNotifEmitter.sendNotification(notification);
-
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementListener.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementListener.java
index d841122..fa93f6c 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementListener.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementListener.java
@@ -29,14 +29,12 @@ import org.apache.geode.distributed.internal.locks.DLockService;
 import org.apache.geode.i18n.LogWriterI18n;
 import org.apache.geode.internal.cache.CacheService;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.management.ManagementException;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.internal.AlertDetails;
 
 /**
  * This Listener listens on various resource creation in GemFire and create/destroys GemFire
  * specific MBeans accordingly
- * 
- * 
  */
 public class ManagementListener implements ResourceEventsListener {
 
@@ -51,10 +49,8 @@ public class ManagementListener implements ResourceEventsListener {
    * Constructor
    */
   public ManagementListener() {
-
     this.adapter = new ManagementAdapter();
     this.logger = InternalDistributedSystem.getLoggerI18n();
-
   }
 
   /**
@@ -82,7 +78,7 @@ public class ManagementListener implements ResourceEventsListener {
       return false;
     }
 
-    GemFireCacheImpl currentCache = GemFireCacheImpl.getInstance();
+    InternalCache currentCache = GemFireCacheImpl.getInstance();
     if (currentCache == null) {
       return false;
     }
@@ -92,14 +88,11 @@ public class ManagementListener implements ResourceEventsListener {
     return true;
   }
 
-
-
   /**
    * Handles various GFE resource life-cycle methods vis-a-vis Management and Monitoring
    * 
    * It checks for race conditions cases by calling shouldProceed();
-   * 
-   * 
+   *
    * @param event Management event for which invocation has happened
    * @param resource the GFE resource type
    */
@@ -109,11 +102,11 @@ public class ManagementListener implements ResourceEventsListener {
     }
     switch (event) {
       case CACHE_CREATE:
-        GemFireCacheImpl createdCache = (GemFireCacheImpl) resource;
+        InternalCache createdCache = (InternalCache) resource;
         adapter.handleCacheCreation(createdCache);
         break;
       case CACHE_REMOVE:
-        GemFireCacheImpl removedCache = (GemFireCacheImpl) resource;
+        InternalCache removedCache = (InternalCache) resource;
         adapter.handleCacheRemoval(removedCache);
         break;
       case REGION_CREATE:

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBeanBridge.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBeanBridge.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBeanBridge.java
index f6450f7..516b97d 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBeanBridge.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBeanBridge.java
@@ -14,7 +14,33 @@
  */
 package org.apache.geode.management.internal.beans;
 
-import static org.apache.geode.internal.lang.SystemUtils.getLineSeparator;
+import static org.apache.geode.internal.lang.SystemUtils.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryMXBean;
+import java.lang.management.MemoryUsage;
+import java.lang.management.OperatingSystemMXBean;
+import java.lang.management.RuntimeMXBean;
+import java.lang.management.ThreadInfo;
+import java.lang.management.ThreadMXBean;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import javax.management.JMRuntimeException;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.Statistics;
 import org.apache.geode.StatisticsType;
@@ -28,11 +54,26 @@ import org.apache.geode.cache.wan.GatewaySender;
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.distributed.LocatorLauncher;
 import org.apache.geode.distributed.ServerLauncher;
-import org.apache.geode.distributed.internal.*;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.distributed.internal.DistributionStats;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.locks.DLockService;
 import org.apache.geode.distributed.internal.locks.DLockStats;
-import org.apache.geode.internal.*;
-import org.apache.geode.internal.cache.*;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.GemFireVersion;
+import org.apache.geode.internal.PureJavaMode;
+import org.apache.geode.internal.cache.CachePerfStats;
+import org.apache.geode.internal.cache.DirectoryHolder;
+import org.apache.geode.internal.cache.DiskDirectoryStats;
+import org.apache.geode.internal.cache.DiskRegion;
+import org.apache.geode.internal.cache.DiskStoreImpl;
+import org.apache.geode.internal.cache.DiskStoreStats;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.cache.LocalRegion;
+import org.apache.geode.internal.cache.PartitionedRegion;
+import org.apache.geode.internal.cache.PartitionedRegionStats;
 import org.apache.geode.internal.cache.control.ResourceManagerStats;
 import org.apache.geode.internal.cache.execute.FunctionServiceStats;
 import org.apache.geode.internal.cache.lru.LRUStatistics;
@@ -50,46 +91,45 @@ import org.apache.geode.internal.process.PidUnavailableException;
 import org.apache.geode.internal.process.ProcessUtils;
 import org.apache.geode.internal.statistics.GemFireStatSampler;
 import org.apache.geode.internal.statistics.HostStatHelper;
+import org.apache.geode.internal.statistics.StatSamplerStats;
+import org.apache.geode.internal.statistics.VMStatsContract;
 import org.apache.geode.internal.statistics.platform.LinuxSystemStats;
 import org.apache.geode.internal.statistics.platform.ProcessStats;
 import org.apache.geode.internal.statistics.platform.SolarisSystemStats;
-import org.apache.geode.internal.statistics.StatSamplerStats;
-import org.apache.geode.internal.statistics.VMStatsContract;
 import org.apache.geode.internal.statistics.platform.WindowsSystemStats;
 import org.apache.geode.internal.stats50.VMStats50;
 import org.apache.geode.internal.tcp.ConnectionTable;
-import org.apache.geode.management.*;
+import org.apache.geode.management.DependenciesNotFoundException;
+import org.apache.geode.management.DiskBackupResult;
+import org.apache.geode.management.GemFireProperties;
+import org.apache.geode.management.JVMMetrics;
+import org.apache.geode.management.ManagementException;
+import org.apache.geode.management.OSMetrics;
 import org.apache.geode.management.cli.CommandService;
 import org.apache.geode.management.cli.CommandServiceException;
 import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.ManagementConstants;
 import org.apache.geode.management.internal.ManagementStrings;
 import org.apache.geode.management.internal.SystemManagementService;
-import org.apache.geode.management.internal.beans.stats.*;
+import org.apache.geode.management.internal.beans.stats.AggregateRegionStatsMonitor;
+import org.apache.geode.management.internal.beans.stats.GCStatsMonitor;
+import org.apache.geode.management.internal.beans.stats.MBeanStatsMonitor;
+import org.apache.geode.management.internal.beans.stats.MemberLevelDiskMonitor;
+import org.apache.geode.management.internal.beans.stats.StatType;
+import org.apache.geode.management.internal.beans.stats.StatsAverageLatency;
+import org.apache.geode.management.internal.beans.stats.StatsKey;
+import org.apache.geode.management.internal.beans.stats.StatsLatency;
+import org.apache.geode.management.internal.beans.stats.StatsRate;
+import org.apache.geode.management.internal.beans.stats.VMStatsMonitor;
 import org.apache.geode.management.internal.cli.CommandResponseBuilder;
 import org.apache.geode.management.internal.cli.remote.CommandExecutionContext;
 import org.apache.geode.management.internal.cli.remote.MemberCommandService;
 import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.result.ResultBuilder;
 import org.apache.geode.management.internal.cli.shell.Gfsh;
-import org.apache.logging.log4j.Logger;
-
-import javax.management.JMRuntimeException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import java.io.File;
-import java.io.IOException;
-import java.lang.management.*;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
 
 /**
  * This class acts as an Bridge between MemberMBean and GemFire Cache and Distributed System
- * 
- * 
  */
 public class MemberMBeanBridge {
 
@@ -108,7 +148,7 @@ public class MemberMBeanBridge {
   private static TimeUnit nanoSeconds = TimeUnit.NANOSECONDS;
 
   /** Cache Instance **/
-  private GemFireCacheImpl cache;
+  private InternalCache cache;
 
   /** Distribution Config **/
   private DistributionConfig config;
@@ -130,6 +170,7 @@ public class MemberMBeanBridge {
    * Command Service
    */
   private CommandService commandService;
+
   private String commandServiceInitError;
 
   /**
@@ -150,10 +191,8 @@ public class MemberMBeanBridge {
   /**
    * Reference to JDK bean OperatingSystemMXBean
    */
-
   private OperatingSystemMXBean osBean;
 
-
   /**
    * Host name of the member
    */
@@ -189,7 +228,6 @@ public class MemberMBeanBridge {
 
   private AggregateRegionStatsMonitor regionMonitor;
 
-
   private StatsRate createsRate;
 
   private StatsRate bytesReceivedRate;
@@ -268,8 +306,6 @@ public class MemberMBeanBridge {
 
   private MBeanStatsMonitor systemStatsMonitor;
 
-
-
   private float instCreatesRate = 0;
 
   private float instGetsRate = 0;
@@ -291,7 +327,7 @@ public class MemberMBeanBridge {
 
   private ResourceManagerStats resourceManagerStats;
 
-  public MemberMBeanBridge(GemFireCacheImpl cache, SystemManagementService service) {
+  public MemberMBeanBridge(InternalCache cache, SystemManagementService service) {
     this.cache = cache;
     this.service = service;
 
@@ -305,7 +341,6 @@ public class MemberMBeanBridge {
           .getRedundancyZone(cache.getInternalDistributedSystem().getDistributedMember());
     }
 
-
     this.sampler = system.getStatSampler();
 
     this.config = system.getConfig();
@@ -354,7 +389,6 @@ public class MemberMBeanBridge {
     this.runtimeMXBean = ManagementFactory.getRuntimeMXBean();
     this.osBean = ManagementFactory.getOperatingSystemMXBean();
 
-
     // Initialize all the Stats Monitors
     this.monitor =
         new MBeanStatsMonitor(ManagementStrings.MEMBER_CACHE_MONITOR.toLocalizedString());
@@ -382,14 +416,12 @@ public class MemberMBeanBridge {
       }
     }
 
-
     QueryDataFunction qDataFunction = new QueryDataFunction();
     FunctionService.registerFunction(qDataFunction);
 
     this.resourceManagerStats = cache.getInternalResourceManager().getStats();
   }
 
-
   public MemberMBeanBridge() {
     this.monitor =
         new MBeanStatsMonitor(ManagementStrings.MEMBER_CACHE_MONITOR.toLocalizedString());
@@ -407,7 +439,7 @@ public class MemberMBeanBridge {
   }
 
   public MemberMBeanBridge init() {
-    CachePerfStats cachePerfStats = ((GemFireCacheImpl) cache).getCachePerfStats();
+    CachePerfStats cachePerfStats = this.cache.getCachePerfStats();
     addCacheStats(cachePerfStats);
     addFunctionStats(system.getFunctionServiceStats());
 
@@ -435,7 +467,7 @@ public class MemberMBeanBridge {
       }
     }
 
-    MemoryAllocator allocator = ((GemFireCacheImpl) cache).getOffHeapStore();
+    MemoryAllocator allocator = this.cache.getOffHeapStore();
     if ((null != allocator)) {
       OffHeapMemoryStats offHeapStats = allocator.getStats();
 
@@ -541,7 +573,6 @@ public class MemberMBeanBridge {
         removeDirectoryStats(dh.getDiskDirectoryStats());
       }
     }
-
   }
 
   public void removePartionRegionStats(PartitionedRegionStats parStats) {
@@ -556,14 +587,12 @@ public class MemberMBeanBridge {
     regionMonitor.removeDirectoryStatistics(diskDirStats.getStats());
   }
 
-
   public void addLockServiceStats(DLockService lock) {
     if (!lockStatsAdded) {
       DLockStats stats = (DLockStats) lock.getStats();
       addLockServiceStats(stats);
       lockStatsAdded = true;
     }
-
   }
 
   public void addLockServiceStats(DLockStats stats) {
@@ -573,7 +602,6 @@ public class MemberMBeanBridge {
   public void addSystemStats() {
     GemFireStatSampler sampler = system.getStatSampler();
 
-
     ProcessStats processStats = sampler.getProcessStats();
 
     StatSamplerStats samplerStats = sampler.getStatSamplerStats();
@@ -600,8 +628,6 @@ public class MemberMBeanBridge {
         vmStatsMonitor.addStatisticsToMonitor(vmHeapStats);
       }
 
-      // vmStatsMonitor.addStatisticsToMonitor(vm50.getVMNonHeapStats());
-
       StatisticsType gcType = VMStats50.getGCType();
       if (gcType != null) {
         Statistics[] gcStats = system.findStatisticsByType(gcType);
@@ -641,7 +667,6 @@ public class MemberMBeanBridge {
   }
 
   private void initializeStats() {
-
     createsRate = new StatsRate(StatsKey.CREATES, StatType.INT_TYPE, monitor);
     bytesReceivedRate = new StatsRate(StatsKey.RECEIVED_BYTES, StatType.LONG_TYPE, monitor);
     bytesSentRate = new StatsRate(StatsKey.SENT_BYTES, StatType.LONG_TYPE, monitor);
@@ -684,7 +709,6 @@ public class MemberMBeanBridge {
     netLoadsAverageLatency = new StatsAverageLatency(StatsKey.NET_LOADS_COMPLETED,
         StatType.INT_TYPE, StatsKey.NET_LOADS_TIME, monitor);
 
-
     netSearchAverageLatency = new StatsAverageLatency(StatsKey.NET_SEARCH_COMPLETED,
         StatType.INT_TYPE, StatsKey.NET_SEARCH_TIME, monitor);
 
@@ -716,7 +740,6 @@ public class MemberMBeanBridge {
     pdxDeserializationRate =
         new StatsRate(StatsKey.PDX_INSTANCE_DESERIALIZATIONS, StatType.INT_TYPE, monitor);
 
-
     lruDestroyRate = new StatsRate(StatsKey.LRU_DESTROYS, StatType.LONG_TYPE, regionMonitor);
 
     lruEvictionRate = new StatsRate(StatsKey.LRU_EVICTIONS, StatType.LONG_TYPE, regionMonitor);
@@ -726,15 +749,12 @@ public class MemberMBeanBridge {
     if (gemFirePropertyData == null) {
       this.gemFirePropertyData = BeanUtilFuncs.initGemfireProperties(config);
     }
-
   }
 
-
   /**
    * @return Some basic JVM metrics at the particular instance
    */
   public JVMMetrics fetchJVMMetrics() {
-
     long gcCount = getGCStatistic(StatsKey.VM_GC_STATS_COLLECTIONS).longValue();
     long gcTimeMillis = getGCStatistic(StatsKey.VM_GC_STATS_COLLECTION_TIME).longValue();
 
@@ -775,7 +795,6 @@ public class MemberMBeanBridge {
       int availableProcessors = osBean.getAvailableProcessors();
       double systemLoadAverage = osBean.getSystemLoadAverage();
 
-
       openFileDescriptorCount = getVMStatistic(StatsKey.VM_STATS_OPEN_FDS).longValue();
       processCpuTime = getVMStatistic(StatsKey.VM_PROCESS_CPU_TIME).longValue();
 
@@ -792,7 +811,6 @@ public class MemberMBeanBridge {
         committedVirtualMemorySize = -1;
       }
 
-
       // If Linux System type exists
       if (PureJavaMode.osStatsAreAvailable() && HostStatHelper.isLinux() && systemStat != null) {
 
@@ -835,14 +853,11 @@ public class MemberMBeanBridge {
       if (logger.isTraceEnabled()) {
         logger.trace(ex.getMessage(), ex);
       }
-
     }
     return metrics;
-
   }
 
   /**
-   * 
    * @return GemFire Properties
    */
   public GemFireProperties getGemFireProperty() {
@@ -867,15 +882,12 @@ public class MemberMBeanBridge {
    * @return a list of compacted Disk stores
    */
   public String[] compactAllDiskStores() {
-
-    GemFireCacheImpl cacheImpl = (GemFireCacheImpl) cache;
     List<String> compactedStores = new ArrayList<String>();
 
     if (cache != null && !cache.isClosed()) {
-      for (DiskStore store : cacheImpl.listDiskStoresIncludingRegionOwned()) {
+      for (DiskStore store : this.cache.listDiskStoresIncludingRegionOwned()) {
         if (store.forceCompaction()) {
           compactedStores.add(((DiskStoreImpl) store).getPersistentID().getDirectory());
-
         }
       }
     }
@@ -890,13 +902,12 @@ public class MemberMBeanBridge {
    * @return list all the disk Stores name at cache level
    */
   public String[] listDiskStores(boolean includeRegionOwned) {
-    GemFireCacheImpl cacheImpl = (GemFireCacheImpl) cache;
     String[] retStr = null;
     Collection<DiskStore> diskCollection = null;
     if (includeRegionOwned) {
-      diskCollection = cacheImpl.listDiskStoresIncludingRegionOwned();
+      diskCollection = this.cache.listDiskStoresIncludingRegionOwned();
     } else {
-      diskCollection = cacheImpl.listDiskStores();
+      diskCollection = this.cache.listDiskStores();
     }
     if (diskCollection != null && diskCollection.size() > 0) {
       retStr = new String[diskCollection.size()];
@@ -905,15 +916,12 @@ public class MemberMBeanBridge {
       while (it.hasNext()) {
         retStr[i] = it.next().getName();
         i++;
-
       }
     }
     return retStr;
-
   }
 
   /**
-   * 
    * @return list of disk stores which defaults includeRegionOwned = true;
    */
   public String[] getDiskStores() {
@@ -921,11 +929,9 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return log of the member.
    */
   public String fetchLog(int numLines) {
-
     if (numLines > ManagementConstants.MAX_SHOW_LOG_LINES) {
       numLines = ManagementConstants.MAX_SHOW_LOG_LINES;
     }
@@ -981,7 +987,6 @@ public class MemberMBeanBridge {
    * before deciding to shut itself down
    */
   public void shutDownMember() {
-
     final InternalDistributedSystem ids = dm.getSystem();
     if (ids.isConnected()) {
       Thread t = new Thread(new Runnable() {
@@ -1000,22 +1005,17 @@ public class MemberMBeanBridge {
       t.setDaemon(false);
       t.start();
     }
-
   }
 
   /**
    * backs up all the disk to the targeted directory
    * 
    * @param targetDirPath path of the directory where back up is to be taken
-   * @return array of DiskBackup results which might get aggregated at Managing node
-   * 
-   *         Check the validity of this mbean call. When does it make sense to backup a single
-   *         member of a gemfire system in isolation of the other members?
+   * @return array of DiskBackup results which might get aggregated at Managing node Check the
+   *         validity of this mbean call. When does it make sense to backup a single member of a
+   *         gemfire system in isolation of the other members?
    */
   public DiskBackupResult[] backupMember(String targetDirPath) {
-
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-
     if (cache != null) {
       Collection<DiskStore> diskStores = cache.listDiskStoresIncludingRegionOwned();
       for (DiskStore store : diskStores) {
@@ -1027,11 +1027,9 @@ public class MemberMBeanBridge {
     File targetDir = new File(targetDirPath);
 
     if (cache == null) {
-
       return null;
 
     } else {
-
       try {
         BackupManager manager =
             cache.startBackup(cache.getInternalDistributedSystem().getDistributedMember());
@@ -1064,7 +1062,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return The name for this member.
    */
   public String getName() {
@@ -1072,7 +1069,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return The ID for this member.
    */
   public String getId() {
@@ -1080,7 +1076,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return The name of the member if it's been set, otherwise the ID of the member
    */
   public String getMember() {
@@ -1098,7 +1093,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return classPath of the VM
    */
   public String getClassPath() {
@@ -1106,7 +1100,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return Connected gateway receivers
    */
   public String[] listConnectedGatewayReceivers() {
@@ -1124,7 +1117,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return Connected gateway senders
    */
   public String[] listConnectedGatewaySenders() {
@@ -1142,7 +1134,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return approximate usage of CPUs
    */
   public float getCpuUsage() {
@@ -1150,7 +1141,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return current time of the system
    */
   public long getCurrentTime() {
@@ -1171,19 +1161,15 @@ public class MemberMBeanBridge {
   /**
    * Gets a String describing the GemFire member's status. A GemFire member includes, but is not
    * limited to: Locators, Managers, Cache Servers and so on.
-   * </p>
-   * 
+   *
    * @return String description of the GemFire member's status.
    * @see #isLocator()
    * @see #isServer()
    */
   public String status() {
-    // if (isLocator()) {
     if (LocatorLauncher.getInstance() != null) {
       return LocatorLauncher.getLocatorState().toJson();
-    }
-    // else if (isServer()) {
-    else if (ServerLauncher.getInstance() != null) {
+    } else if (ServerLauncher.getInstance() != null) {
       return ServerLauncher.getServerState().toJson();
     }
 
@@ -1192,7 +1178,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return total heap usage in bytes
    */
   public long getTotalBytesInUse() {
@@ -1201,7 +1186,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return Number of availabe CPUs
    */
   public int getAvailableCpus() {
@@ -1210,7 +1194,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return JVM thread list
    */
   public String[] fetchJvmThreads() {
@@ -1230,7 +1213,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return list of regions
    */
   public String[] getListOfRegions() {
@@ -1248,7 +1230,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return configuration data lock lease
    */
   public long getLockLease() {
@@ -1256,14 +1237,12 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return configuration data lock time out
    */
   public long getLockTimeout() {
     return cache.getLockTimeout();
   }
 
-
   /**
    * @return the duration for which the member is up
    */
@@ -1296,7 +1275,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return true if this members has a gateway receiver
    */
   public boolean hasGatewayReceiver() {
@@ -1304,7 +1282,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return true if member has Gateway senders
    */
   public boolean hasGatewaySender() {
@@ -1312,7 +1289,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return true if member contains one locator. From 7.0 only locator can be hosted in a JVM
    */
   public boolean isLocator() {
@@ -1320,12 +1296,10 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return true if the Federating Manager Thread is running
    */
   public boolean isManager() {
-    GemFireCacheImpl existingCache = GemFireCacheImpl.getInstance();
-    if (existingCache == null || existingCache.isClosed()) {
+    if (this.cache == null || this.cache.isClosed()) {
       return false;
     }
     try {
@@ -1342,8 +1316,7 @@ public class MemberMBeanBridge {
    * @return true if the manager has been created.
    */
   public boolean isManagerCreated() {
-    GemFireCacheImpl existingCache = GemFireCacheImpl.getInstance();
-    if (existingCache == null || existingCache.isClosed()) {
+    if (this.cache == null || this.cache.isClosed()) {
       return false;
     }
     try {
@@ -1486,7 +1459,6 @@ public class MemberMBeanBridge {
 
   public int getTotalHitCount() {
     return getMemberLevelStatistic(StatsKey.GETS).intValue() - getTotalMissCount();
-
   }
 
   public float getLruDestroyRate() {
@@ -1552,7 +1524,6 @@ public class MemberMBeanBridge {
   public int getTotalTransactionsCount() {
     return getMemberLevelStatistic(StatsKey.TRANSACTION_COMMITS).intValue()
         + getMemberLevelStatistic(StatsKey.TRANSACTION_ROLLBACKS).intValue();
-
   }
 
   public long getTransactionCommitsAvgLatency() {
@@ -1650,7 +1621,6 @@ public class MemberMBeanBridge {
     return regionMonitor.getDiskSpace();
   }
 
-
   public float getAverageReads() {
     return instGetsRate;
   }
@@ -1680,7 +1650,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return max limit of FD ..Ulimit
    */
   public long getFileDescriptorLimit() {
@@ -1698,7 +1667,6 @@ public class MemberMBeanBridge {
   }
 
   /**
-   * 
    * @return count of currently opened FDs
    */
   public long getTotalFileDescriptorOpen() {
@@ -1806,7 +1774,6 @@ public class MemberMBeanBridge {
   }
 
   public int getHostCpuUsage() {
-
     if (systemStat != null) {
       return systemStat.get(StatsKey.SYSTEM_CPU_ACTIVE).intValue();
     } else {
@@ -1814,12 +1781,10 @@ public class MemberMBeanBridge {
     }
   }
 
-
   public boolean isCacheServer() {
     return cacheServer;
   }
 
-
   public void setCacheServer(boolean cacheServer) {
     this.cacheServer = cacheServer;
   }
@@ -1832,22 +1797,18 @@ public class MemberMBeanBridge {
     return resourceManagerStats.getRebalancesInProgress();
   }
 
-
   public int getReplyWaitsInProgress() {
     return getMemberLevelStatistic(StatsKey.REPLY_WAITS_IN_PROGRESS).intValue();
   }
 
-
   public int getReplyWaitsCompleted() {
     return getMemberLevelStatistic(StatsKey.REPLY_WAITS_COMPLETED).intValue();
   }
 
-
   public int getVisibleNodes() {
     return getMemberLevelStatistic(StatsKey.NODES).intValue();
   }
 
-
   public long getMaxMemory() {
     Runtime rt = Runtime.getRuntime();
     return rt.maxMemory() / MBFactor;


Mime
View raw message