geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [11/49] geode git commit: GEODE-2632: change dependencies on GemFireCacheImpl to InternalCache
Date Mon, 08 May 2017 23:05:47 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/8c2210db/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/8c2210db/geode-core/src/main/java/org/apache/geode/management/internal/beans/BeanUtilFuncs.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/BeanUtilFuncs.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/BeanUtilFuncs.java
index 6861a7d..499ef01 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/BeanUtilFuncs.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/BeanUtilFuncs.java
@@ -26,10 +26,10 @@ import java.util.Set;
 import java.util.zip.GZIPInputStream;
 import java.util.zip.GZIPOutputStream;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.GemFireProperties;
 import org.apache.geode.management.internal.cli.CliUtil;
 
@@ -41,9 +41,7 @@ public class BeanUtilFuncs {
   /**
    * returns the tail of the log file
    * 
-   * @param logFile
    * @return tail of the log file
-   * @throws IOException
    */
   public static String tailSystemLog(File logFile, final int numLines) throws IOException {
     if (logFile == null || logFile.equals(new File(""))) {
@@ -107,11 +105,8 @@ public class BeanUtilFuncs {
     return returnStr.toString();
   }
 
-
   /**
-   * @param sc
    * @return tail of log
-   * @throws IOException
    */
   public static String tailSystemLog(DistributionConfig sc, final int numLines) throws IOException {
     File logFile = sc.getLogFile();
@@ -128,7 +123,7 @@ public class BeanUtilFuncs {
     DistributedMember memberFound = null;
 
     if (memberNameOrId != null) {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = (InternalCache) CacheFactory.getAnyInstance();
       Set<DistributedMember> memberSet = CliUtil.getAllMembers(cache);
       for (DistributedMember member : memberSet) {
         if (memberNameOrId.equals(member.getId()) || memberNameOrId.equals(member.getName())) {
@@ -141,12 +136,8 @@ public class BeanUtilFuncs {
   }
 
   public static GemFireProperties initGemfireProperties(DistributionConfig config) {
-
-    // **TODO **/
     String memberGroups = "";
-    // **TODO **/
     String configFile = null;
-    // ** TODO **//
     String includeFile = null;
 
     GemFireProperties gemFirePropertyData = new GemFireProperties();
@@ -329,17 +320,14 @@ public class BeanUtilFuncs {
     gemFirePropertyData.setSSLDefaultAlias(config.getSSLDefaultAlias());
 
     return gemFirePropertyData;
-
   }
 
-
   /**
    * Compresses a given String. It is encoded using ISO-8859-1, So any decompression of the
    * compressed string should also use ISO-8859-1
    * 
    * @param str String to be compressed.
    * @return compressed bytes
-   * @throws IOException
    */
   public static byte[] compress(String str) throws IOException {
     if (str == null || str.length() == 0) {
@@ -356,7 +344,6 @@ public class BeanUtilFuncs {
   /**
    * @param bytes bytes to be decompressed
    * @return a decompressed String
-   * @throws IOException
    */
   public static String decompress(byte[] bytes) throws IOException {
     if (bytes == null || bytes.length == 0) {

http://git-wip-us.apache.org/repos/asf/geode/blob/8c2210db/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/8c2210db/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/8c2210db/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/8c2210db/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/8c2210db/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:


Mime
View raw message