geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [12/50] [abbrv] geode git commit: GEODE-2632: change dependencies on GemFireCacheImpl to InternalCache
Date Thu, 11 May 2017 21:23:18 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/ClientCacheCreation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/ClientCacheCreation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/ClientCacheCreation.java
index fbb82e8..667ae0c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/ClientCacheCreation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/ClientCacheCreation.java
@@ -14,6 +14,13 @@
  */
 package org.apache.geode.internal.cache.xmlcache;
 
+import java.io.File;
+import java.net.InetSocketAddress;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
 import org.apache.geode.cache.AttributesFactory;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheWriterException;
@@ -22,6 +29,7 @@ import org.apache.geode.cache.DiskStoreFactory;
 import org.apache.geode.cache.DynamicRegionFactory;
 import org.apache.geode.cache.GatewayException;
 import org.apache.geode.cache.InterestPolicy;
+import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.cache.RegionExistsException;
 import org.apache.geode.cache.RegionService;
@@ -33,36 +41,25 @@ import org.apache.geode.cache.client.ClientRegionFactory;
 import org.apache.geode.cache.client.ClientRegionShortcut;
 import org.apache.geode.cache.client.Pool;
 import org.apache.geode.cache.client.PoolManager;
-import org.apache.geode.cache.client.internal.PoolImpl;
+import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PoolFactoryImpl;
 import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.pdx.internal.TypeRegistry;
-
-import java.io.File;
-import java.net.InetSocketAddress;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
 
 /**
  * Represents a {@link ClientCache} that is created declaratively. Notice that it implements the
  * {@link ClientCache} interface so that this class must be updated when {@link ClientCache} is
  * modified. This class is public for testing purposes.
  *
- *
  * @since GemFire 6.5
  */
 @SuppressWarnings("deprecation")
 public class ClientCacheCreation extends CacheCreation implements ClientCache {
 
-  //////////////////////// Constructors ////////////////////////
-
   /**
-   * Creates a new <code>ClientCacheCreation</code> with no root regions
+   * Creates a new {@code ClientCacheCreation} with no root regions
    */
   public ClientCacheCreation() {
     this(false);
@@ -73,19 +70,18 @@ public class ClientCacheCreation extends CacheCreation implements ClientCache {
    *        for generating xml.
    * @since GemFire 5.7
    */
-  public ClientCacheCreation(boolean forParsing) {
+  ClientCacheCreation(boolean forParsing) {
     super(forParsing);
   }
 
-  ////////////////////// Instance Methods //////////////////////
+  private static final RegionAttributes clientDefaults = createClientDefaults();
 
-  static final private RegionAttributes clientDefaults;
-  static {
+  private static RegionAttributes createClientDefaults() {
     AttributesFactory af = new AttributesFactory();
     af.setScope(Scope.LOCAL);
     // af.setIgnoreJTA(true); In 6.6 and later releases client regions support JTA
     af.setSubscriptionAttributes(new SubscriptionAttributes(InterestPolicy.ALL));
-    clientDefaults = af.create();
+    return af.create();
   }
 
   @Override
@@ -98,17 +94,25 @@ public class ClientCacheCreation extends CacheCreation implements ClientCache {
     GemFireCacheImpl.initializeClientRegionShortcuts(this);
   }
 
-  public org.apache.geode.cache.query.QueryService getQueryService(String poolName) {
+  @Override
+  public QueryService getQueryService(String poolName) {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  @Override
+  public QueryService getLocalQueryService() {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
 
-  public org.apache.geode.cache.query.QueryService getLocalQueryService() {
+  @Override
+  public void determineDefaultPool() {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
 
   /**
    * @since GemFire 6.5
    */
+  @Override
   public <K, V> ClientRegionFactory<K, V> createClientRegionFactory(ClientRegionShortcut atts) {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
@@ -116,14 +120,17 @@ public class ClientCacheCreation extends CacheCreation implements ClientCache {
   /**
    * @since GemFire 6.5
    */
+  @Override
   public <K, V> ClientRegionFactory<K, V> createClientRegionFactory(String regionAttributesId) {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
 
-  public RegionService createAuthenticatedView(Properties properties, String poolName) {
+  @Override
+  public RegionService createAuthenticatedView(Properties userSecurityProperties, String poolName) {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
 
+  @Override
   public RegionService createAuthenticatedView(Properties userSecurityProperties) {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
@@ -165,32 +172,22 @@ public class ClientCacheCreation extends CacheCreation implements ClientCache {
 
   /**
    * Fills in the contents of a {@link Cache} based on this creation object's state.
-   *
-   * @throws TimeoutException
-   * @throws CacheWriterException
-   * @throws RegionExistsException
-   * @throws GatewayException
    */
   @Override
-  void create(GemFireCacheImpl cache)
+  void create(InternalCache cache)
       throws TimeoutException, CacheWriterException, GatewayException, RegionExistsException {
     cache.setDeclarativeCacheConfig(this.getCacheConfig());
     if (!cache.isClient()) {
       throw new IllegalStateException(
           "You must use ClientCacheFactory when the cache.xml uses client-cache.");
     }
-    { // create connection pools
-      Map m = getPools();
-      if (!m.isEmpty()) {
-        boolean setDefault = m.size() == 1;
-        Iterator it = m.values().iterator();
-        while (it.hasNext()) {
-          Pool cp = (Pool) it.next();
-          PoolFactoryImpl f;
-          f = (PoolFactoryImpl) PoolManager.createFactory();
-          f.init(cp);
-          PoolImpl p = (PoolImpl) f.create(cp.getName());
-        }
+    // create connection pools
+    Map<String, Pool> pools = getPools();
+    if (!pools.isEmpty()) {
+      for (final Pool cp : pools.values()) {
+        PoolFactoryImpl poolFactory = (PoolFactoryImpl) PoolManager.createFactory();
+        poolFactory.init(cp);
+        poolFactory.create(cp.getName());
       }
     }
 
@@ -205,20 +202,18 @@ public class ClientCacheCreation extends CacheCreation implements ClientCache {
 
     cache.initializePdxRegistry();
 
-    for (Iterator iter = listDiskStores().iterator(); iter.hasNext();) {
-      DiskStoreAttributesCreation creation = (DiskStoreAttributesCreation) iter.next();
+    for (DiskStore diskStore : listDiskStores()) {
+      DiskStoreAttributesCreation creation = (DiskStoreAttributesCreation) diskStore;
       if (creation != pdxRegDSC) {
         createDiskStore(creation, cache);
       }
     }
-    for (Iterator iter = listDiskStores().iterator(); iter.hasNext();) {
-      DiskStoreAttributesCreation creation = (DiskStoreAttributesCreation) iter.next();
+    for (DiskStore diskStore : listDiskStores()) {
+      DiskStoreAttributesCreation creation = (DiskStoreAttributesCreation) diskStore;
 
-      // It's GemFireCache
-      GemFireCacheImpl gfc = (GemFireCacheImpl) cache;
       // Don't let the DiskStoreAttributesCreation escape to the user
-      DiskStoreFactory factory = gfc.createDiskStoreFactory(creation);
-      DiskStore ds = factory.create(creation.getName());
+      DiskStoreFactory factory = cache.createDiskStoreFactory(creation);
+      factory.create(creation.getName());
     }
 
     if (hasDynamicRegionFactory()) {
@@ -241,23 +236,20 @@ public class ClientCacheCreation extends CacheCreation implements ClientCache {
 
     cache.initializePdxRegistry();
 
-    for (Iterator iter = this.regionAttributesNames.iterator(); iter.hasNext();) {
-      String id = (String) iter.next();
+    for (String id : this.regionAttributesNames) {
       RegionAttributesCreation creation = (RegionAttributesCreation) getRegionAttributes(id);
       creation.inheritAttributes(cache, false);
 
-      RegionAttributes attrs;
       // Don't let the RegionAttributesCreation escape to the user
       AttributesFactory factory = new AttributesFactory(creation);
-      attrs = factory.createRegionAttributes();
+      RegionAttributes attrs = factory.createRegionAttributes();
 
       cache.setRegionAttributes(id, attrs);
     }
 
-    Iterator it = this.roots.values().iterator();
-    while (it.hasNext()) {
-      RegionCreation r = (RegionCreation) it.next();
-      r.createRoot(cache);
+    for (final Region<?, ?> region : this.roots.values()) {
+      RegionCreation regionCreation = (RegionCreation) region;
+      regionCreation.createRoot(cache);
     }
 
     cache.readyDynamicRegionFactory();
@@ -266,39 +258,29 @@ public class ClientCacheCreation extends CacheCreation implements ClientCache {
 
   public String getDefaultPoolName() {
     String result = null;
-    Map m = getPools();
-    if (m.size() == 1) {
-      Pool p = (Pool) m.values().iterator().next();
-      result = p.getName();
-    } else if (m.isEmpty()) {
+    Map<String, Pool> pools = getPools();
+    if (pools.size() == 1) {
+      Pool pool = pools.values().iterator().next();
+      result = pool.getName();
+    } else if (pools.isEmpty()) {
       result = "DEFAULT";
     }
     return result;
   }
 
+  @Override
   public Pool getDefaultPool() {
-    return (Pool) getPools().get(getDefaultPoolName());
+    return getPools().get(getDefaultPoolName());
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.cache.client.CacheCreation#getPdxReadSerialized()
-   */
   @Override
   public boolean getPdxReadSerialized() {
     return false;
   }
 
-
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.cache.client.ClientCache#getCurrentServers()
-   */
+  @Override
   public Set<InetSocketAddress> getCurrentServers() {
-    return Collections.EMPTY_SET;
+    return Collections.emptySet();
   }
 
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/DiskStoreAttributesCreation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/DiskStoreAttributesCreation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/DiskStoreAttributesCreation.java
index 3425c89..2316666 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/DiskStoreAttributesCreation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/DiskStoreAttributesCreation.java
@@ -33,7 +33,7 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
  * @since GemFire prPersistSprint2
  */
 public class DiskStoreAttributesCreation extends UserSpecifiedDiskStoreAttributes
-    implements Serializable {
+    implements Serializable, DiskStore {
 
   /**
    * An <code>AttributesFactory</code> for creating default <code>RegionAttribute</code>s

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionAttributesCreation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionAttributesCreation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionAttributesCreation.java
index 30b6237..cf8c4c9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionAttributesCreation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionAttributesCreation.java
@@ -41,6 +41,7 @@ import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.cache.Scope;
 import org.apache.geode.cache.SubscriptionAttributes;
+import org.apache.geode.cache.client.internal.InternalClientCache;
 import org.apache.geode.compression.Compressor;
 import org.apache.geode.internal.cache.EvictionAttributesImpl;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
@@ -62,8 +63,6 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
 
   private static final RegionAttributes defaultAttributes = new AttributesFactory().create();
 
-  /////////////////////// Instance Fields ///////////////////////
-
   /** The attributes' cache listener */
   private ArrayList cacheListeners;
   /** The attributes' gateway senders */
@@ -288,8 +287,6 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
     }
   }
 
-  ////////////////////// Instance Methods //////////////////////
-
   /**
    * Returns whether or not two objects are {@linkplain Object#equals equals} taking
    * <code>null</code> into account.
@@ -386,14 +383,6 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
    * <code>RegionAttributes</code>.
    */
   public boolean sameAs(RegionAttributes other) {
-    // if (!equal(this.cacheListeners, Arrays.asList(other.getCacheListeners()))) {
-    // throw new RuntimeException("cacheListeners not equal "
-    // + this.cacheListeners
-    // + " and "
-    // + Arrays.asList(other.getCacheListeners())
-    // + " this=" + this
-    // + " other=" + other);
-    // }
     if (!equal(this.cacheListeners, Arrays.asList(other.getCacheListeners()))) {
       throw new RuntimeException(
           LocalizedStrings.RegionAttributesCreation_CACHELISTENERS_ARE_NOT_THE_SAME
@@ -895,7 +884,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
     setHasMulticastEnabled(true);
   }
 
-  /*
+  /**
    * @deprecated as of prPersistSprint1
    */
   @Deprecated
@@ -903,13 +892,12 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
     return this.publisher;
   }
 
-  /*
+  /**
    * @deprecated as of prPersistSprint1
    */
   @Deprecated
   public void setPublisher(boolean v) {
-    // this.publisher = v;
-    // setHasPublisher(true);
+    // nothing
   }
 
   public boolean getEnableConflation() { // deprecated in 5.0
@@ -958,11 +946,10 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated as of prPersistSprint2
    */
+  @Deprecated
   public void setDiskWriteAttributes(DiskWriteAttributes attrs) {
     // not throw exception for mixed API, since it's internal
     this.diskWriteAttributes = attrs;
-    // Asif: Take the value of isSynchronous from it;
-    // Asif : Is this correct?
     this.isDiskSynchronous = attrs.isSynchronous();
     setHasDiskWriteAttributes(true);
   }
@@ -970,6 +957,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated as of prPersistSprint2
    */
+  @Deprecated
   public File[] getDiskDirs() {
     // not throw exception for mixed API, since it's internal
     return this.diskDirs;
@@ -978,6 +966,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated as of prPersistSprint2
    */
+  @Deprecated
   public int[] getDiskDirSizes() {
     // not throw exception for mixed API, since it's internal
     return this.diskSizes;
@@ -986,6 +975,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated as of prPersistSprint2
    */
+  @Deprecated
   public void setDiskDirs(File[] diskDirs) {
     // not throw exception for mixed API, since it's internal
     checkIfDirectoriesExist(diskDirs);
@@ -1008,12 +998,8 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
 
   public boolean isDiskSynchronous() {
     return this.isDiskSynchronous;
-    // Asif: If DiskWriteAttributes is set, the flag needs to be checked from DiskWriteAttribs
+    // If DiskWriteAttributes is set, the flag needs to be checked from DiskWriteAttribs
     // TODO: Should we set the correct value in the flag isDiskSynchronous
-    /*
-     * if(hasDiskWriteAttributes()) { return this.diskWriteAttributes.isSynchronous(); }else {
-     * return this.isDiskSynchronous; }
-     */
   }
 
   public void setDiskSynchronous(boolean isDiskSynchronous) {
@@ -1036,10 +1022,10 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
     }
   }
 
-
   /**
    * @deprecated as of prPersistSprint2
    */
+  @Deprecated
   public void setDiskDirsAndSize(File[] diskDirs, int[] sizes) {
     // not throw exception for mixed API, since it's internal
     checkIfDirectoriesExist(diskDirs);
@@ -1055,7 +1041,6 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
     this.setHasDiskDirs(true);
   }
 
-
   private void verifyNonNegativeDirSize(int[] sizes) {
     for (int i = 0; i < sizes.length; i++) {
       if (sizes[i] < 0) {
@@ -1126,7 +1111,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
       if (setDefaultPool && this.requiresPoolName && !hasPoolName()) {
         String defaultPoolName = null;
         if (cache instanceof GemFireCacheImpl) {
-          GemFireCacheImpl gfc = (GemFireCacheImpl) cache;
+          InternalClientCache gfc = (InternalClientCache) cache;
           if (gfc.getDefaultPool() != null) {
             defaultPoolName = gfc.getDefaultPool().getName();
           }
@@ -1162,7 +1147,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
         if (!hasPoolName()) {
           String defaultPoolName = null;
           if (cache instanceof GemFireCacheImpl) {
-            GemFireCacheImpl gfc = (GemFireCacheImpl) cache;
+            InternalClientCache gfc = (InternalClientCache) cache;
             if (gfc.getDefaultPool() != null) {
               defaultPoolName = gfc.getDefaultPool().getName();
             }
@@ -1547,7 +1532,6 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
         setMulticastEnabled(parent.getMulticastEnabled());
       }
     }
-
   }
 
   public PartitionAttributes getPartitionAttributes() {
@@ -1569,6 +1553,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated this API is scheduled to be removed
    */
+  @Deprecated
   public MembershipAttributes getMembershipAttributes() {
     return this.membershipAttributes;
   }
@@ -1576,6 +1561,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated this API is scheduled to be removed
    */
+  @Deprecated
   public void setMembershipAttributes(MembershipAttributes pa) {
     this.membershipAttributes = pa;
     setHasMembershipAttributes(true);
@@ -1656,7 +1642,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
           && (getRegionTimeToLive().getTimeout() != 0 || getRegionIdleTimeout().getTimeout() != 0
               || getEntryTimeToLive().getTimeout() != 0 || getEntryIdleTimeout().getTimeout() != 0
               || getCustomEntryIdleTimeout() != null || getCustomEntryTimeToLive() != null)) {
-        // @todo we could do some more implementation work so that we would
+        // TODO: we could do some more implementation work so that we would
         // not need to enable stats unless entryIdleTimeout is enabled.
         // We need the stats in that case because we need a new type of RegionEntry
         // so we know that last time it was accessed. But for all the others we

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionCreation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionCreation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionCreation.java
index 712bbfb..a107fb3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionCreation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionCreation.java
@@ -46,7 +46,7 @@ import org.apache.geode.cache.TimeoutException;
 import org.apache.geode.cache.query.SelectResults;
 import org.apache.geode.cache.query.internal.index.IndexCreationData;
 import org.apache.geode.cache.snapshot.RegionSnapshotService;
-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.extension.Extensible;
 import org.apache.geode.internal.cache.extension.ExtensionPoint;
@@ -58,18 +58,10 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
  * {@link Region} interface so that this class must be updated when {@link Region} is modified. This
  * class is public for testing purposes.
  *
- *
  * @since GemFire 3.0
  */
 public class RegionCreation implements Region, Extensible<Region<?, ?>> {
 
-  // /** An <code>AttributesFactory</code> for creating default
-  // * <code>RegionAttribute</code>s */
-  // private static final AttributesFactory defaultFactory =
-  // new AttributesFactory();
-
-  /////////////////////// Instance Fields ///////////////////////
-
   /** The name of this region */
   private final String name;
 
@@ -115,8 +107,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
   private final SimpleExtensionPoint<Region<?, ?>> extensionPoint =
       new SimpleExtensionPoint<Region<?, ?>>(this, this);
 
-  /////////////////////// Constructors ///////////////////////
-
   /**
    * Creates a new <code>RegionCreation</code> with the given name and with the default
    * <code>RegionAttributes</code>.
@@ -146,8 +136,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
     this(cache, null, name, null);
   }
 
-  ////////////////////// Instance Methods //////////////////////
-
   public Object put(Object key, Object value) throws TimeoutException, CacheWriterException {
     return this.values.put(key, value);
   }
@@ -252,7 +240,7 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
     extensionPoint.beforeCreate(cache);
 
     try {
-      root = ((GemFireCacheImpl) cache).basicCreateRegion(this.name,
+      root = ((InternalCache) cache).basicCreateRegion(this.name,
           new AttributesFactory(this.attrs).create());
     } catch (RegionExistsException ex) {
       root = ex.getRegion();
@@ -635,8 +623,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
     return this.fullPath;
   }
 
-  ////////// Inherited methods that don't do anything //////////
-
   public Region getParentRegion() {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
@@ -665,7 +651,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
 
-
   public void destroyRegion() throws CacheWriterException, TimeoutException {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
@@ -736,7 +721,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
 
-
   public Object destroy(Object key)
       throws TimeoutException, EntryNotFoundException, CacheWriterException {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
@@ -753,7 +737,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
 
   public void localDestroy(Object key, Object callbackArgument) throws EntryNotFoundException {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-
   }
 
   public Set keys() {
@@ -831,7 +814,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
 
   public void clear() {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-
   }
 
   public boolean isEmpty() {
@@ -899,39 +881,18 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
     throw new UnsupportedOperationException("Shouldn't be invoked");
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see java.util.concurrent.ConcurrentMap#putIfAbsent(java.lang.Object, java.lang.Object)
-   */
   public Object putIfAbsent(Object key, Object value) {
     throw new UnsupportedOperationException();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see java.util.concurrent.ConcurrentMap#remove(java.lang.Object, java.lang.Object)
-   */
   public boolean remove(Object key, Object value) {
     throw new UnsupportedOperationException();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see java.util.concurrent.ConcurrentMap#replace(java.lang.Object, java.lang.Object)
-   */
   public Object replace(Object key, Object value) {
     throw new UnsupportedOperationException();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see java.util.concurrent.ConcurrentMap#replace(java.lang.Object, java.lang.Object,
-   * java.lang.Object)
-   */
   public boolean replace(Object key, Object oldValue, Object newValue) {
     throw new UnsupportedOperationException();
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/internal/lang/SystemUtils.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/lang/SystemUtils.java b/geode-core/src/main/java/org/apache/geode/internal/lang/SystemUtils.java
index 28f37ef..3485ede 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/lang/SystemUtils.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/lang/SystemUtils.java
@@ -12,7 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.internal.lang;
 
 import java.io.File;
@@ -49,6 +48,8 @@ public class SystemUtils {
   public static final String WINDOWS_OS_NAME = "Windows";
   public static final String SOLARIS_OS_NAME = "SunOS";
 
+  private static final String LINE_SEPARATOR = System.getProperty("line.separator");
+
   /**
    * Utility method to determine whether the installed Java Runtime Environment (JRE) is minimally
    * at the specified, expected version. Typically, Java versions are of the form "1.6.0_31"... In
@@ -83,7 +84,7 @@ public class SystemUtils {
         '0', actualVersionDigits.length());
 
     try {
-      return (Long.parseLong(actualVersionDigits) >= Long.parseLong(expectedVersionDigits));
+      return Long.parseLong(actualVersionDigits) >= Long.parseLong(expectedVersionDigits);
     } catch (NumberFormatException ignore) {
       return false;
     }
@@ -126,7 +127,7 @@ public class SystemUtils {
   // @see java.lang.System#getProperty(String) with 'java.vm.vendor'.
   private static boolean isJvmVendor(final String expectedJvmVendorName) {
     String jvmVendor = System.getProperty("java.vm.vendor");
-    return (jvmVendor != null && jvmVendor.contains(expectedJvmVendorName));
+    return jvmVendor != null && jvmVendor.contains(expectedJvmVendorName);
   }
 
   /**
@@ -164,10 +165,12 @@ public class SystemUtils {
     return isJVM(ORACLE_JROCKIT_JVM_NAME);
   }
 
-  // @see java.lang.System#getProperty(String) with "java.vm.name".
+  /**
+   * Returns true if the expectedJvmName matches {@code System.getProperty("java.vm.name")}.
+   */
   private static boolean isJVM(final String expectedJvmName) {
     String jvmName = System.getProperty("java.vm.name");
-    return (jvmName != null && jvmName.contains(expectedJvmName));
+    return jvmName != null && jvmName.contains(expectedJvmName);
   }
 
   /**
@@ -220,11 +223,10 @@ public class SystemUtils {
   /**
    * Returns true if the specified location is in the JVM classpath. This may ignore additions to
    * the classpath that are not reflected by the value in
-   * <code>System.getProperty("java.class.path")</code>.
+   * {@code System.getProperty("java.class.path")}.
    * 
    * @param location the directory or jar name to test for
    * @return true if location is in the JVM classpath
-   * @throws MalformedURLException
    */
   public static boolean isInClassPath(String location) throws MalformedURLException {
     return isInClassPath(new File(location).toURI().toURL());
@@ -233,11 +235,10 @@ public class SystemUtils {
   /**
    * Returns true if the specified location is in the JVM classpath. This may ignore additions to
    * the classpath that are not reflected by the value in
-   * <code>System.getProperty("java.class.path")</code>.
+   * {@code System.getProperty("java.class.path")}.
    * 
    * @param location the directory or jar URL to test for
    * @return true if location is in the JVM classpath
-   * @throws MalformedURLException
    */
   public static boolean isInClassPath(URL location) throws MalformedURLException {
     String classPath = getClassPath();
@@ -252,44 +253,52 @@ public class SystemUtils {
   }
 
   /**
-   * Returns the value of {code System.getProperty("os.name")}.
+   * Returns the value of {@code System.getProperty("os.name")}.
    */
   public static String getOsName() {
     return System.getProperty("os.name");
   }
 
   /**
-   * Returns the value of {code System.getProperty("os.version")}.
+   * Returns the value of {@code System.getProperty("os.version")}.
    */
   public static String getOsVersion() {
     return System.getProperty("os.version");
   }
 
   /**
-   * Returns the value of {code System.getProperty("os.arch")}.
+   * Returns the value of {@code System.getProperty("os.arch")}.
    */
   public static String getOsArchitecture() {
     return System.getProperty("os.arch");
   }
 
   /**
-   * Returns the value of {code System.getProperty("java.class.path")}.
+   * Returns the value of {@code System.getProperty("java.class.path")}.
    */
   public static String getClassPath() {
     return System.getProperty("java.class.path");
   }
 
   /**
-   * Returns the value of {code System.getProperty("sun.boot.class.path")}.
+   * Returns the value of {@code System.getProperty("sun.boot.class.path")}.
    */
   public static String getBootClassPath() {
     return System.getProperty("sun.boot.class.path");
   }
 
-  // @see java.lang.System#getProperty(String) with "os.name".
+  /**
+   * Returns true if expectedOsName matches {@code System.getProperty("os.name")}.
+   */
   private static boolean isOS(final String expectedOsName) {
     String osName = getOsName();
-    return (osName != null && osName.contains(expectedOsName));
+    return osName != null && osName.contains(expectedOsName);
   }
 
+  /**
+   * Returns the value of {@code System.getProperty("line.separator")}.
+   */
+  public static String getLineSeparator() {
+    return LINE_SEPARATOR;
+  }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/internal/offheap/DataType.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/offheap/DataType.java b/geode-core/src/main/java/org/apache/geode/internal/offheap/DataType.java
index 08ee355..3c9dd72 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/offheap/DataType.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/offheap/DataType.java
@@ -27,6 +27,7 @@ import org.apache.geode.internal.DSFIDFactory;
 import org.apache.geode.internal.InternalDataSerializer;
 import org.apache.geode.internal.InternalInstantiator;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.pdx.internal.EnumInfo;
 import org.apache.geode.pdx.internal.PdxType;
 
@@ -200,7 +201,7 @@ public class DataType implements DSCODE {
         case PDX: {
           int typeId = in.readInt();
           try {
-            GemFireCacheImpl gfc = GemFireCacheImpl
+            InternalCache gfc = GemFireCacheImpl
                 .getForPdx("PDX registry is unavailable because the Cache has been closed.");
             PdxType pdxType = gfc.getPdxRegistry().getType(typeId);
             if (pdxType == null) { // fix 52164
@@ -216,7 +217,7 @@ public class DataType implements DSCODE {
           int tmp = InternalDataSerializer.readArrayLength(in);
           int enumId = (dsId << 24) | (tmp & 0xFFFFFF);
           try {
-            GemFireCacheImpl gfc = GemFireCacheImpl
+            InternalCache gfc = GemFireCacheImpl
                 .getForPdx("PDX registry is unavailable because the Cache has been closed.");
             EnumInfo enumInfo = gfc.getPdxRegistry().getEnumInfoById(enumId);
             return "PdxRegistry/java.lang.Enum:" + enumInfo.getClassName();
@@ -244,10 +245,8 @@ public class DataType implements DSCODE {
       }
       return "Unknown header byte: " + header;
     } catch (IOException e) {
-      // return "IOException for header byte: " + header;
       throw new Error(e);
     } catch (ClassNotFoundException e) {
-      // return "IOException for header byte: " + header;
       throw new Error(e);
     }
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java b/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java
index 4dd152e..f057369 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java
@@ -14,18 +14,31 @@
  */
 package org.apache.geode.internal.offheap;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.logging.log4j.Logger;
+
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionService;
 import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.cache.*;
+import org.apache.geode.internal.cache.BucketRegion;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.LocalRegion;
+import org.apache.geode.internal.cache.PartitionedRegion;
+import org.apache.geode.internal.cache.PartitionedRegionDataStore;
+import org.apache.geode.internal.cache.RegionEntry;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.offheap.annotations.OffHeapIdentifier;
 import org.apache.geode.internal.offheap.annotations.Unretained;
-import org.apache.logging.log4j.Logger;
-
-import java.util.*;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * This allocator is somewhat like an Arena allocator. We start out with an array of multiple large

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/management/ManagementService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/ManagementService.java b/geode-core/src/main/java/org/apache/geode/management/ManagementService.java
index f09665a..faada65 100755
--- a/geode-core/src/main/java/org/apache/geode/management/ManagementService.java
+++ b/geode-core/src/main/java/org/apache/geode/management/ManagementService.java
@@ -21,11 +21,10 @@ import javax.management.ObjectName;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.internal.BaseManagementService;
 import org.apache.geode.management.membership.MembershipListener;
 
-
-
 /**
  * Interface to the GemFire management service for a single Cache.
  * 
@@ -33,14 +32,13 @@ import org.apache.geode.management.membership.MembershipListener;
  */
 public abstract class ManagementService {
 
-
   /**
    * Returns a newly created or the existing instance of the management service for a cache.
    * 
    * @param cache Cache for which to get the management service.
    */
   public static ManagementService getManagementService(Cache cache) {
-    return BaseManagementService.getManagementService(cache);
+    return BaseManagementService.getManagementService((InternalCache) cache);
   }
 
   /**
@@ -50,7 +48,7 @@ public abstract class ManagementService {
    * @return The existing management service if one exists, null otherwise.
    */
   public static ManagementService getExistingManagementService(Cache cache) {
-    return BaseManagementService.getExistingManagementService(cache);
+    return BaseManagementService.getExistingManagementService((InternalCache) cache);
   }
 
   /**
@@ -300,7 +298,6 @@ public abstract class ManagementService {
   public abstract ObjectName getGatewaySenderMBeanName(DistributedMember member,
       String gatwaySenderId);
 
-
   /**
    * Returns the object name of the AsyncEventQueueMBean representing a asynchronous queue. This is
    * a utility method for generating an object name and it does not register an MBean.

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/management/internal/BaseManagementService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/BaseManagementService.java b/geode-core/src/main/java/org/apache/geode/management/internal/BaseManagementService.java
index 34bb6c0..bc317bc 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/BaseManagementService.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/BaseManagementService.java
@@ -21,9 +21,9 @@ import java.util.Map;
 
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.DistributedSystemDisconnectedException;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.management.ManagementService;
 
@@ -50,32 +50,28 @@ public abstract class BaseManagementService extends ManagementService {
   protected BaseManagementService() {}
 
   // Static block to initialize the ConnectListener on the System
-
   static {
     initInternalDistributedSystem();
-
   }
 
   /**
    * This method will close the service. Any operation on the service instance will throw exception
    */
-
   protected abstract void close();
 
   /**
    * This method will close the service. Any operation on the service instance will throw exception
    */
-
   protected abstract boolean isClosed();
 
   /**
    * Returns a ManagementService to use for the specified Cache.
-   * 
+   *
    * @param cache defines the scope of resources to be managed
    */
-  public static ManagementService getManagementService(Cache cache) {
+  public static ManagementService getManagementService(InternalCache cache) {
     synchronized (instances) {
-      BaseManagementService service = (BaseManagementService) instances.get(cache);
+      BaseManagementService service = instances.get(cache);
       if (service == null) {
         service = SystemManagementService.newSystemManagementService(cache);
         instances.put(cache, service);
@@ -85,14 +81,13 @@ public abstract class BaseManagementService extends ManagementService {
     }
   }
 
-  public static ManagementService getExistingManagementService(Cache cache) {
+  public static ManagementService getExistingManagementService(InternalCache cache) {
     synchronized (instances) {
       BaseManagementService service = (BaseManagementService) instances.get(cache);
       return service;
     }
   }
 
-
   /**
    * Initialises the distributed system listener
    */
@@ -125,8 +120,6 @@ public abstract class BaseManagementService extends ManagementService {
 
   /**
    * Add an Distributed System and adds a Discon Listener
-   * 
-   * @param sys
    */
   private static void addInternalDistributedSystem(InternalDistributedSystem sys) {
     synchronized (instances) {
@@ -147,8 +140,6 @@ public abstract class BaseManagementService extends ManagementService {
   /**
    * Remove a Distributed System from the system lists. If list is empty it closes down all the
    * services if not closed
-   * 
-   * @param sys
    */
   private static void removeInternalDistributedSystem(InternalDistributedSystem sys) {
     synchronized (instances) {
@@ -172,7 +163,6 @@ public abstract class BaseManagementService extends ManagementService {
         }
         instances.clear();
       }
-
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java b/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
index da92f69..b6ffa41 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
@@ -25,6 +25,7 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
+import java.util.concurrent.RejectedExecutionException;
 
 import javax.management.Notification;
 import javax.management.ObjectName;
@@ -32,7 +33,6 @@ import javax.management.ObjectName;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.AttributesFactory;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.DataPolicy;
 import org.apache.geode.cache.EvictionAction;
 import org.apache.geode.cache.EvictionAttributes;
@@ -40,11 +40,13 @@ import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.cache.RegionExistsException;
 import org.apache.geode.cache.Scope;
+import org.apache.geode.cache.TimeoutException;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.cache.CachePerfStats;
 import org.apache.geode.internal.cache.HasCachePerfStats;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.InternalRegionArguments;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.management.ManagementException;
@@ -60,48 +62,38 @@ import org.apache.geode.management.ManagementException;
 public class FederatingManager extends Manager {
   public static final Logger logger = LogService.getLogger();
 
-
   /**
-   * 
    * This Executor uses a pool of thread to execute the member addition /removal tasks, This will
    * utilize the processing powers available. Going with unbounded queue because tasks wont be
    * unbounded in practical situation as number of members will be a finite set at any given point
    * of time
    */
-
   private ExecutorService pooledMembershipExecutor;
 
-
   /**
    * Proxy factory is used to create , remove proxies
    */
   protected MBeanProxyFactory proxyFactory;
 
-
   /**
    * Remote Filter chain for local MBean filters
    */
-
   private RemoteFilterChain remoteFilterChain;
 
   private MBeanJMXAdapter jmxAdapter;
 
   private MemberMessenger messenger;
 
-
   private SystemManagementService service;
 
-
   /**
-   * Public Constructor
-   * 
    * @param jmxAdapter JMX Adpater
    * @param repo Management resource repo
    * @param system Internal Distributed System
    * @param service SystemManagement Service
    */
   public FederatingManager(MBeanJMXAdapter jmxAdapter, ManagementResourceRepo repo,
-      InternalDistributedSystem system, SystemManagementService service, Cache cache) {
+      InternalDistributedSystem system, SystemManagementService service, InternalCache cache) {
     super(repo, system, cache);
     this.remoteFilterChain = new RemoteFilterChain();
     this.service = service;
@@ -110,14 +102,12 @@ public class FederatingManager extends Manager {
     this.messenger = new MemberMessenger(jmxAdapter, repo, system);
   }
 
-
   /**
    * This method will be invoked whenever a member wants to be a managing node. The exception
    * Management exception has to be handled by the caller.
    */
   @Override
   public synchronized void startManager() {
-
     try {
       if (logger.isDebugEnabled()) {
         logger.debug("Starting the Federating Manager.... ");
@@ -138,7 +128,6 @@ public class FederatingManager extends Manager {
       running = false;
       throw new ManagementException(e);
     }
-
   }
 
   public synchronized void stopManager() {
@@ -151,18 +140,13 @@ public class FederatingManager extends Manager {
       logger.debug("Stopping the Federating Manager.... ");
     }
     stopManagingActivity();
-
   }
 
   /**
    * This method will be invoked whenever a member stops being a managing node. The exception
    * Management exception has to be handled by the caller. *
-   * 
-   * @throws ManagementException
-   * 
    */
   private void stopManagingActivity() {
-
     try {
       this.pooledMembershipExecutor.shutdownNow();
       Iterator<DistributedMember> it = repo.getMonitoringRegionMap().keySet().iterator();
@@ -173,10 +157,7 @@ public class FederatingManager extends Manager {
 
     } catch (Exception e) {
       throw new ManagementException(e);
-    } finally {
-      // For future use
     }
-
   }
 
   @Override
@@ -190,8 +171,6 @@ public class FederatingManager extends Manager {
    * 
    * This method will delegate task to another thread and exit, so that it wont block the membership
    * listener
-   * 
-   * @param member
    */
   public void addMember(DistributedMember member) {
     GIITask giiTask = new GIITask(member);
@@ -203,33 +182,22 @@ public class FederatingManager extends Manager {
     });
   }
 
-
   /**
    * This method will be invoked from MembershipListener which is registered when the member becomes
    * a Management node.
    * 
    * This method will delegate task to another thread and exit, so that it wont block the membership
    * listener
-   * 
-   * @param member
    */
   public void removeMember(DistributedMember member, boolean crashed) {
     RemoveMemberTask removeTask = new RemoveMemberTask(member, crashed);
     executeTask(removeTask);
   }
 
-  private void submitTask(Callable<DistributedMember> task) {
-    try {
-      pooledMembershipExecutor.submit(task);
-    } catch (java.util.concurrent.RejectedExecutionException ex) {
-      // Ignore, we are getting shutdown
-    }
-  }
-
   private void executeTask(Runnable task) {
     try {
       pooledMembershipExecutor.execute(task);
-    } catch (java.util.concurrent.RejectedExecutionException ex) {
+    } catch (RejectedExecutionException ex) {
       // Ignore, we are getting shutdown
     }
   }
@@ -278,22 +246,16 @@ public class FederatingManager extends Manager {
    * 
    * this method will delegate task to another thread and exit, so that it wont block the membership
    * listener
-   * 
-   * @param member
-   * @param reason TODO
    */
   public void suspectMember(DistributedMember member, InternalDistributedMember whoSuspected,
       String reason) {
     service.memberSuspect((InternalDistributedMember) member, whoSuspected, reason);
-
   }
 
   /**
    * This method will be invoked when a node transitions from managed node to managing node This
    * method will block for all GIIs to be completed But each GII is given a specific time frame.
    * After that the task will be marked as cancelled.
-   * 
-   * @throws InterruptedException
    */
   public void startManagingActivity() throws Exception {
     final boolean isDebugEnabled = logger.isDebugEnabled();
@@ -304,7 +266,6 @@ public class FederatingManager extends Manager {
     Iterator<DistributedMember> it = members.iterator();
     DistributedMember member;
 
-
     final List<Callable<DistributedMember>> giiTaskList = new ArrayList<>();
 
     List<Future<DistributedMember>> futureTaskList;
@@ -354,9 +315,7 @@ public class FederatingManager extends Manager {
             logger.debug("InterruptedException while creating Monitoring resource with error : {}",
                 mgEx.getMessage(), mgEx);
           }
-
         }
-
       }
     } catch (InterruptedException e) {
       if (isDebugEnabled) {
@@ -370,20 +329,14 @@ public class FederatingManager extends Manager {
         logger.debug("Management Resource creation completed");
       }
     }
-
   }
 
-
-
   /**
    * Actual task of doing the GII
    * 
    * It will perform the GII request which might originate from TranstionListener or Membership
    * Listener.
-   * 
-   * 
-   * 
-   * 
+   *
    * Managing Node side resources are created per member which is visible to this node
    * 
    * 1)Management Region : its a Replicated NO_ACK region 2)Notification Region : its a Replicated
@@ -394,10 +347,7 @@ public class FederatingManager extends Manager {
    * 
    * This task can be cancelled from the calling thread if a timeout happens. In that case we have
    * to handle the thread interrupt
-   * 
-   * 
    */
-
   private class GIITask implements Callable<DistributedMember> {
 
     private DistributedMember member;
@@ -438,7 +388,6 @@ public class FederatingManager extends Manager {
           ManagementCacheListener mgmtCacheListener = new ManagementCacheListener(proxyFactory);
           monitorAttrFactory.addCacheListener(mgmtCacheListener);
 
-
           RegionAttributes<String, Object> monitoringRegionAttrs = monitorAttrFactory.create();
 
           // Notification region for member is created
@@ -472,8 +421,7 @@ public class FederatingManager extends Manager {
                     monitoringRegionAttrs, internalArgs);
             proxyMonitoringRegionCreated = true;
 
-
-          } catch (org.apache.geode.cache.TimeoutException e) {
+          } catch (TimeoutException e) {
             if (logger.isDebugEnabled()) {
               logger.debug("Error During Internal Region creation {}", e.getMessage(), e);
             }
@@ -504,7 +452,7 @@ public class FederatingManager extends Manager {
                 cache.createVMRegion(ManagementConstants.NOTIFICATION_REGION + "_" + appender,
                     notifRegionAttrs, internalArgs);
             proxyNotifRegionCreated = true;
-          } catch (org.apache.geode.cache.TimeoutException e) {
+          } catch (TimeoutException e) {
             if (logger.isDebugEnabled()) {
               logger.debug("Error During Internal Region creation {}", e.getMessage(), e);
             }
@@ -530,7 +478,6 @@ public class FederatingManager extends Manager {
               // region is not created
               proxyMonitoringRegion.localDestroyRegion();
             }
-
           }
 
           if (logger.isDebugEnabled()) {
@@ -560,25 +507,20 @@ public class FederatingManager extends Manager {
 
             throw new ManagementException(e);
           }
-
         }
 
       } catch (Exception e) {
         throw new ManagementException(e);
       }
 
-
       // Before completing task intimate all listening ProxyListener which might send notifications.
       service.memberJoined((InternalDistributedMember) member);
 
       // Send manager info to the added member
       messenger.sendManagerInfo(member);
 
-
       return member;
-
     }
-
   }
 
   /**
@@ -622,10 +564,8 @@ public class FederatingManager extends Manager {
     return proxyFactory.findAllProxies(member);
   }
 
-
   public MemberMessenger getMessenger() {
     return messenger;
   }
 
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisee.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisee.java b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisee.java
index 5952c4c..7d02d38 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisee.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisee.java
@@ -14,6 +14,8 @@
  */
 package org.apache.geode.management.internal;
 
+import java.net.UnknownHostException;
+
 import org.apache.geode.CancelCriterion;
 import org.apache.geode.distributed.internal.DM;
 import org.apache.geode.distributed.internal.DistributionAdvisee;
@@ -22,26 +24,23 @@ import org.apache.geode.distributed.internal.DistributionAdvisor.Profile;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.admin.SSLConfig;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.net.SSLConfigurationFactory;
 import org.apache.geode.internal.net.SocketCreator;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.internal.JmxManagerAdvisor.JmxManagerProfile;
 
-import java.net.UnknownHostException;
-
 /**
- * 
  * @since GemFire 7.0
  */
 public class JmxManagerAdvisee implements DistributionAdvisee {
 
   private final int serialNumber;
-  private final GemFireCacheImpl cache;
+  private final InternalCache cache;
   private JmxManagerProfile myMostRecentProfile;
 
-  public JmxManagerAdvisee(GemFireCacheImpl cache) {
+  public JmxManagerAdvisee(InternalCache cache) {
     this.serialNumber = DistributionAdvisor.createSerialNumber();
     this.cache = cache;
   }
@@ -73,7 +72,7 @@ public class JmxManagerAdvisee implements DistributionAdvisee {
 
   @Override
   public InternalDistributedSystem getSystem() {
-    return this.cache.getSystem();
+    return this.cache.getInternalDistributedSystem();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisor.java b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisor.java
index a0f63ce..c8858f4 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisor.java
@@ -35,12 +35,12 @@ import org.apache.geode.distributed.internal.HighPriorityDistributionMessage;
 import org.apache.geode.distributed.internal.ReplyException;
 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.internal.logging.log4j.LocalizedMessage;
 
 /**
- * 
  * @since GemFire 7.0
  */
 public class JmxManagerAdvisor extends DistributionAdvisor {
@@ -104,10 +104,10 @@ public class JmxManagerAdvisor extends DistributionAdvisor {
     return new JmxManagerProfile(memberId, version);
   }
 
-  @Override
   /**
    * Overridden to also include our profile. If our profile is included it will always be first.
    */
+  @Override
   protected List/* <Profile> */ fetchProfiles(Filter f) {
     initializationGate();
     List result = null;
@@ -169,18 +169,12 @@ public class JmxManagerAdvisor extends DistributionAdvisor {
       this.profile = p;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.geode.distributed.internal.DistributionMessage#process(org.apache.geode.
-     * distributed.internal.DistributionManager)
-     */
     @Override
     protected void process(DistributionManager dm) {
       Throwable thr = null;
       JmxManagerProfile p = null;
       try {
-        final GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+        final InternalCache cache = GemFireCacheImpl.getInstance();
         if (cache != null && !cache.isClosed()) {
           final JmxManagerAdvisor adv = cache.getJmxManagerAdvisor();
           p = this.profile;
@@ -194,7 +188,7 @@ public class JmxManagerAdvisor extends DistributionAdvisor {
         }
       } catch (CancelException e) {
         if (logger.isDebugEnabled()) {
-          logger.debug("Cache closed, ", this);
+          logger.debug("Cache closed, {}", this);
         }
       } catch (VirtualMachineError err) {
         SystemFailure.initiateFailure(err);
@@ -219,11 +213,6 @@ public class JmxManagerAdvisor extends DistributionAdvisor {
       }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.geode.internal.DataSerializableFixedID#getDSFID()
-     */
     public int getDSFID() {
       return JMX_MANAGER_PROFILE_MESSAGE;
     }
@@ -338,7 +327,7 @@ public class JmxManagerAdvisor extends DistributionAdvisor {
     @Override
     public void processIncoming(DistributionManager dm, String adviseePath, boolean removeProfile,
         boolean exchangeProfiles, final List<Profile> replyProfiles) {
-      final GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+      final InternalCache cache = GemFireCacheImpl.getInstance();
       if (cache != null && !cache.isClosed()) {
         handleDistributionAdvisee(cache.getJmxManagerAdvisor().getAdvisee(), removeProfile,
             exchangeProfiles, replyProfiles);

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerLocator.java b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerLocator.java
index 6417d57..1a5b531 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerLocator.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerLocator.java
@@ -15,10 +15,8 @@
 package org.apache.geode.management.internal;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.geode.distributed.internal.ClusterConfigurationService;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.CancelException;
@@ -30,11 +28,12 @@ import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.distributed.internal.ClusterConfigurationService;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.distributed.internal.tcpserver.TcpHandler;
 import org.apache.geode.distributed.internal.tcpserver.TcpServer;
 import org.apache.geode.internal.InternalEntity;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.management.AlreadyRunningException;
 import org.apache.geode.management.ManagementService;
@@ -43,10 +42,10 @@ import org.apache.geode.management.internal.JmxManagerAdvisor.JmxManagerProfile;
 public class JmxManagerLocator implements TcpHandler {
   private static final Logger logger = LogService.getLogger();
 
-  private GemFireCacheImpl cache;
+  private InternalCache cache;
 
-  public JmxManagerLocator(GemFireCacheImpl gfc) {
-    this.cache = gfc;
+  public JmxManagerLocator(InternalCache internalCache) {
+    this.cache = internalCache;
   }
 
   @Override
@@ -70,9 +69,10 @@ public class JmxManagerLocator implements TcpHandler {
     // nothing needed
   }
 
+  @Override
   public void restarting(DistributedSystem ds, GemFireCache cache,
       ClusterConfigurationService sharedConfig) {
-    this.cache = (GemFireCacheImpl) cache;
+    this.cache = (InternalCache) cache;
   }
 
   @Override
@@ -81,7 +81,6 @@ public class JmxManagerLocator implements TcpHandler {
   }
 
   private JmxManagerLocatorResponse findJmxManager(JmxManagerLocatorRequest request) {
-    JmxManagerLocatorResponse result = null;
     if (logger.isDebugEnabled()) {
       logger.debug("Locator requested to find or start jmx manager");
     }
@@ -132,8 +131,9 @@ public class JmxManagerLocator implements TcpHandler {
                         .contains(p.getDistributedMember())) {
                   sleepCount++;
                   try {
+                    // TODO: call to sleep while synchronized
                     Thread.sleep(100);
-                  } catch (InterruptedException e) {
+                  } catch (InterruptedException ignored) {
                     Thread.currentThread().interrupt();
                   }
                   alreadyManaging = this.cache.getJmxManagerAdvisor().adviseAlreadyManaging();
@@ -147,6 +147,7 @@ public class JmxManagerLocator implements TcpHandler {
         } // sync
       }
     }
+    JmxManagerLocatorResponse result = null;
     if (!alreadyManaging.isEmpty()) {
       JmxManagerProfile p = alreadyManaging.get(0);
       result = new JmxManagerLocatorResponse(p.getHost(), p.getPort(), p.getSsl(), null);
@@ -173,11 +174,11 @@ public class JmxManagerLocator implements TcpHandler {
 
   private boolean sendStartJmxManager(InternalDistributedMember distributedMember) {
     try {
-      ArrayList<Object> resultContainer = (ArrayList<Object>) FunctionService
-          .onMember(distributedMember).execute(new StartJmxManagerFunction()).getResult();
+      List<Object> resultContainer = (List<Object>) FunctionService.onMember(distributedMember)
+          .execute(new StartJmxManagerFunction()).getResult();
       Object result = resultContainer.get(0);
       if (result instanceof Boolean) {
-        return ((Boolean) result).booleanValue();
+        return (Boolean) result;
       } else {
         logger.info("Could not start jmx manager on {} because {}", distributedMember, result);
         return false;
@@ -197,11 +198,11 @@ public class JmxManagerLocator implements TcpHandler {
 
   public static class StartJmxManagerFunction implements Function, InternalEntity {
     private static final long serialVersionUID = -2860286061903069789L;
+
     public static final String ID = StartJmxManagerFunction.class.getName();
 
     @Override
     public void execute(FunctionContext context) {
-
       try {
         Cache cache = CacheFactory.getAnyInstance();
         if (cache != null) {
@@ -214,7 +215,7 @@ public class JmxManagerLocator implements TcpHandler {
           }
         }
         context.getResultSender().lastResult(Boolean.FALSE);
-      } catch (AlreadyRunningException ok) {
+      } catch (AlreadyRunningException ignored) {
         context.getResultSender().lastResult(Boolean.TRUE);
       } catch (Exception e) {
         context.getResultSender().lastResult("Exception in StartJmxManager =" + e.getMessage());

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/management/internal/LocalManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/LocalManager.java b/geode-core/src/main/java/org/apache/geode/management/internal/LocalManager.java
index 3adbce0..b5b97ca 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/LocalManager.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/LocalManager.java
@@ -17,7 +17,6 @@ package org.apache.geode.management.internal;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
@@ -36,14 +35,15 @@ import org.apache.geode.CancelException;
 import org.apache.geode.GemFireException;
 import org.apache.geode.SystemFailure;
 import org.apache.geode.cache.AttributesFactory;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.DataPolicy;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.cache.RegionExistsException;
 import org.apache.geode.cache.Scope;
+import org.apache.geode.cache.TimeoutException;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.cache.CachePerfStats;
 import org.apache.geode.internal.cache.HasCachePerfStats;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.InternalRegionArguments;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.LoggingThreadGroup;
@@ -55,11 +55,7 @@ import org.apache.geode.management.ManagementException;
  * a) Handles proxy creation when Management node comes up b) Handles proxy creation when a member
  * joins c) Remove proxies when a member leaves or node stops being management node. d) Takes care
  * to create resources like hidden regions for MBean and notification federation.
- * 
- * 
- * 
  */
-
 public class LocalManager extends Manager {
   private static final Logger logger = LogService.getLogger();
 
@@ -74,27 +70,22 @@ public class LocalManager extends Manager {
    */
   protected ScheduledExecutorService singleThreadFederationScheduler;
 
-
   /**
    * This map holds all the components which are eligible for federation. Although filters might
    * prevent any of the component from getting federated.
    */
-
   private Map<ObjectName, FederationComponent> federatedComponentMap;
 
-
   private Object lock = new Object();
 
   private SystemManagementService service;
 
   /**
-   * Public constructor
-   * 
    * @param repo management resource repo
    * @param system internal distributed system
    */
   public LocalManager(ManagementResourceRepo repo, InternalDistributedSystem system,
-      SystemManagementService service, Cache cache) {
+      SystemManagementService service, InternalCache cache) {
     super(repo, system, cache);
     this.service = service;
     this.federatedComponentMap = new ConcurrentHashMap<ObjectName, FederationComponent>();
@@ -105,7 +96,6 @@ public class LocalManager extends Manager {
    * 
    * Management Region : its a Replicated NO_ACK region Notification Region : its a Replicated Proxy
    * NO_ACK region
-   * 
    */
   private void startLocalManagement(Map<ObjectName, FederationComponent> federatedComponentMap) {
 
@@ -137,9 +127,9 @@ public class LocalManager extends Manager {
           logger.debug("Creating  Management Region :");
         }
 
-        /**
+        /*
          * Sharing the same Internal Argument for both notification region and monitoring region
-         **/
+         */
         InternalRegionArguments internalArgs = new InternalRegionArguments();
         internalArgs.setIsUsedForMetaRegion(true);
 
@@ -184,7 +174,7 @@ public class LocalManager extends Manager {
                   monitoringRegionAttrs, internalArgs));
           monitoringRegionCreated = true;
 
-        } catch (org.apache.geode.cache.TimeoutException e) {
+        } catch (TimeoutException e) {
           throw new ManagementException(e);
         } catch (RegionExistsException e) {
           throw new ManagementException(e);
@@ -199,7 +189,7 @@ public class LocalManager extends Manager {
               cache.createVMRegion(ManagementConstants.NOTIFICATION_REGION + "_" + appender,
                   notifRegionAttrs, internalArgs));
           notifRegionCreated = true;
-        } catch (org.apache.geode.cache.TimeoutException e) {
+        } catch (TimeoutException e) {
           throw new ManagementException(e);
         } catch (RegionExistsException e) {
           throw new ManagementException(e);
@@ -212,7 +202,6 @@ public class LocalManager extends Manager {
             repo.getLocalMonitoringRegion().localDestroyRegion();
 
           }
-
         }
 
         managementTask = new ManagementTask(federatedComponentMap);
@@ -230,11 +219,8 @@ public class LocalManager extends Manager {
           logger.debug("Notification Region created with Name : {}",
               repo.getLocalNotificationRegion().getName());
         }
-
       }
-
     }
-
   }
 
   public void markForFederation(ObjectName objName, FederationComponent fedComp) {
@@ -251,23 +237,18 @@ public class LocalManager extends Manager {
         // To delete an entry from the region
         repo.getLocalMonitoringRegion().remove(objName.toString());
       }
-
     }
-
   }
 
   /**
    * This method will shutdown various tasks running for management
    */
   private void shutdownTasks() {
-
     // No need of pooledGIIExecutor as this node wont do GII again
     // so better to release resources
     if (this.singleThreadFederationScheduler != null) {
-      List<Runnable> l = this.singleThreadFederationScheduler.shutdownNow();
-
+      this.singleThreadFederationScheduler.shutdownNow();
     }
-
   }
 
   /**
@@ -294,7 +275,6 @@ public class LocalManager extends Manager {
               logger.debug("Unable to clean MBean: {} due to {}", objName, e.getMessage(), e);
             }
           }
-
         }
         repo.destroyLocalMonitoringRegion();
       }
@@ -330,11 +310,7 @@ public class LocalManager extends Manager {
    * guaranteed to execute sequentially, and no more than one task will be active at any given time.
    * Unlike the otherwise equivalent <tt>newScheduledThreadPool(1)</tt> the returned executor is
    * guaranteed not to be reconfigurable to use additional threads.
-   * 
-   * 
-   * 
    */
-
   private class ManagementTask implements Runnable {
 
     private Map<String, FederationComponent> replicaMap;
@@ -346,12 +322,10 @@ public class LocalManager extends Manager {
 
     @Override
     public void run() {
-
       if (logger.isTraceEnabled()) {
         logger.trace("Federation started at managed node : ");
       }
 
-
       try {
         synchronized (lock) {
           replicaMap.clear();
@@ -380,7 +354,6 @@ public class LocalManager extends Manager {
                   replicaMap.put(key, fedCompInstance);
                 }
               }
-
             }
           }
 
@@ -434,13 +407,11 @@ public class LocalManager extends Manager {
 
   @Override
   public void stopManager() {
-    // Shutting down the GII executor as this node wont require
-    // it anymore
+    // Shutting down the GII executor as this node wont require it anymore
     shutdownTasks();
     // Clean up management Resources
     cleanUpResources();
     running = false;
-
   }
 
   public void stopCacheOps() {

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
index 9394efb..62310e8 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
@@ -14,32 +14,6 @@
  */
 package org.apache.geode.management.internal;
 
-import org.apache.geode.GemFireConfigException;
-import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.internal.GemFireVersion;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.lang.StringUtils;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.net.SSLConfigurationFactory;
-import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.internal.net.SocketCreatorFactory;
-import org.apache.geode.internal.security.SecurableCommunicationChannel;
-import org.apache.geode.internal.security.SecurityService;
-import org.apache.geode.internal.security.shiro.JMXShiroAuthenticator;
-import org.apache.geode.internal.tcp.TCPConduit;
-import org.apache.geode.management.ManagementException;
-import org.apache.geode.management.ManagementService;
-import org.apache.geode.management.ManagerMXBean;
-import org.apache.geode.management.internal.security.AccessControlMBean;
-import org.apache.geode.management.internal.security.MBeanServerWrapper;
-import org.apache.geode.management.internal.security.ResourceConstants;
-import org.apache.geode.management.internal.unsafe.ReadOpFileAccessController;
-import org.apache.logging.log4j.Logger;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ServerConnector;
-
 import java.io.IOException;
 import java.io.Serializable;
 import java.lang.management.ManagementFactory;
@@ -55,6 +29,7 @@ import java.rmi.server.RMIServerSocketFactory;
 import java.rmi.server.UnicastRemoteObject;
 import java.util.HashMap;
 import java.util.Set;
+
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.MBeanRegistrationException;
 import javax.management.MBeanServer;
@@ -68,6 +43,33 @@ import javax.management.remote.rmi.RMIJRMPServerImpl;
 import javax.management.remote.rmi.RMIServerImpl;
 import javax.rmi.ssl.SslRMIClientSocketFactory;
 
+import org.apache.logging.log4j.Logger;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
+
+import org.apache.geode.GemFireConfigException;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.internal.GemFireVersion;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.lang.StringUtils;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.net.SSLConfigurationFactory;
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.internal.net.SocketCreatorFactory;
+import org.apache.geode.internal.security.SecurableCommunicationChannel;
+import org.apache.geode.internal.security.SecurityService;
+import org.apache.geode.internal.security.shiro.JMXShiroAuthenticator;
+import org.apache.geode.internal.tcp.TCPConduit;
+import org.apache.geode.management.ManagementException;
+import org.apache.geode.management.ManagementService;
+import org.apache.geode.management.ManagerMXBean;
+import org.apache.geode.management.internal.security.AccessControlMBean;
+import org.apache.geode.management.internal.security.MBeanServerWrapper;
+import org.apache.geode.management.internal.security.ResourceConstants;
+import org.apache.geode.management.internal.unsafe.ReadOpFileAccessController;
+
 /**
  * Agent implementation that controls the JMX server end points for JMX clients to connect, such as
  * an RMI server.
@@ -118,11 +120,11 @@ public class ManagementAgent {
     this.isHttpServiceRunning = isHttpServiceRunning;
   }
 
-  private boolean isAPIRestServiceRunning(GemFireCacheImpl cache) {
+  private boolean isAPIRestServiceRunning(InternalCache cache) {
     return (cache != null && cache.getRestAgent() != null && cache.getRestAgent().isRunning());
   }
 
-  private boolean isServerNode(GemFireCacheImpl cache) {
+  private boolean isServerNode(InternalCache cache) {
     return (cache.getInternalDistributedSystem().getDistributedMember()
         .getVmKind() != DistributionManager.LOCATOR_DM_TYPE
         && cache.getInternalDistributedSystem().getDistributedMember()
@@ -130,7 +132,7 @@ public class ManagementAgent {
         && !cache.isClient());
   }
 
-  public synchronized void startAgent(GemFireCacheImpl cache) {
+  public synchronized void startAgent(InternalCache cache) {
     // Do not start Management REST service if developer REST service is already
     // started.
 
@@ -285,7 +287,7 @@ public class ManagementAgent {
 
           // set cache property for developer REST service running
           if (isRestWebAppAdded) {
-            GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+            InternalCache cache = (InternalCache) CacheFactory.getAnyInstance();
             cache.setRESTServiceRunning(true);
 
             // create region to hold query information (queryId, queryString).
@@ -354,12 +356,9 @@ public class ManagementAgent {
    * https://blogs.oracle.com/jmxetc/entry/java_5_premain_rmi_connectors
    * https://blogs.oracle.com/jmxetc/entry/building_a_remotely_stoppable_connector
    * https://blogs.oracle.com/jmxetc/entry/jmx_connecting_through_firewalls_using
+   * https://blogs.oracle.com/jmxetc/entry/java_5_premain_rmi_connectors
    */
   private void configureAndStart() throws IOException {
-    // KIRK: I copied this from
-    // https://blogs.oracle.com/jmxetc/entry/java_5_premain_rmi_connectors
-    // we'll need to change this significantly but it's a starting point
-
     // get the port for RMI Registry and RMI Connector Server
     final int port = this.config.getJmxManagerPort();
     final String hostname;
@@ -387,7 +386,6 @@ public class ManagementAgent {
           (bindAddr != null ? (" bound to " + bindAddr) : "") + (ssl ? " using SSL" : ""));
     }
     RMIClientSocketFactory rmiClientSocketFactory = ssl ? new SslRMIClientSocketFactory() : null;// RMISocketFactory.getDefaultSocketFactory();
-    // new GemFireRMIClientSocketFactory(sc, getLogger());
     RMIServerSocketFactory rmiServerSocketFactory =
         new GemFireRMIServerSocketFactory(socketCreator, bindAddr);
 
@@ -399,14 +397,14 @@ public class ManagementAgent {
     // everywhere, or nowhere. Since we want to use them in the JMX
     // RMI Connector server, we must also use them in the RMI Registry.
     // Otherwise, we wouldn't be able to use a single port.
-    //
+
     // Start an RMI registry on port <port>.
     registry = LocateRegistry.createRegistry(port, rmiClientSocketFactory, rmiServerSocketFactory);
 
     // Retrieve the PlatformMBeanServer.
     MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
 
-    // Environment map. KIRK: why is this declared as HashMap?
+    // Environment map. why is this declared as HashMap?
     final HashMap<String, Object> env = new HashMap<String, Object>();
 
     // Manually creates and binds a JMX RMI Connector Server stub with the
@@ -441,7 +439,7 @@ public class ManagementAgent {
 
     // Create an RMI connector server with the JMXServiceURL
     //
-    // KIRK: JDK 1.5 cannot use JMXConnectorServerFactory because of
+    // JDK 1.5 cannot use JMXConnectorServerFactory because of
     // http://bugs.sun.com/view_bug.do?bug_id=5107423
     // but we're using JDK 1.6
     jmxConnectorServer =
@@ -538,8 +536,6 @@ public class ManagementAgent {
     }
   }
 
-  ;
-
   private static class GemFireRMIServerSocketFactory
       implements RMIServerSocketFactory, Serializable {
 
@@ -557,6 +553,4 @@ public class ManagementAgent {
       return this.sc.createServerSocket(port, TCPConduit.getBackLog(), this.bindAddr);
     }
   }
-
-  ;
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/management/internal/ManagementFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementFunction.java
index 26f4d38..097b161 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementFunction.java
@@ -29,6 +29,7 @@ import org.apache.geode.cache.execute.FunctionAdapter;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.internal.InternalEntity;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 
 /**
@@ -40,17 +41,11 @@ import org.apache.geode.internal.logging.LogService;
  * 
  * 1) All setter methods 2) All operations 3) addNotificationListener 4) removeNotificationListener
  * 5) getNotificationInfo
- * 
- * 
  */
-
 public class ManagementFunction extends FunctionAdapter implements InternalEntity {
 
   private static final Logger logger = LogService.getLogger();
 
-  /**
-   * 
-   */
   private static final long serialVersionUID = 1L;
 
   /**
@@ -81,8 +76,7 @@ public class ManagementFunction extends FunctionAdapter implements InternalEntit
 
     boolean executedSuccessfully = false;
 
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-
+    InternalCache cache = GemFireCacheImpl.getInstance();
 
     Object[] functionArguments = (Object[]) fc.getArguments();
 
@@ -145,10 +139,8 @@ public class ManagementFunction extends FunctionAdapter implements InternalEntit
           sendException(e, fc);
           return; // member is closing or invalid member
         }
-
       }
     }
-
   }
 
   public String getId() {

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/management/internal/Manager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/Manager.java b/geode-core/src/main/java/org/apache/geode/management/internal/Manager.java
index 3c80969..916cbd7 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/Manager.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/Manager.java
@@ -14,10 +14,8 @@
  */
 package org.apache.geode.management.internal;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.logging.InternalLogWriter;
+import org.apache.geode.internal.cache.InternalCache;
 
 /**
  * The Manager is a 7.0 JMX Agent which is hosted within a GemFire process. Only one instance is
@@ -28,44 +26,32 @@ import org.apache.geode.internal.logging.InternalLogWriter;
  */
 public abstract class Manager {
 
-
-  /**
-   * GemFire Cache implementation
-   */
-
-  protected GemFireCacheImpl cache;
-
+  protected InternalCache cache;
 
   /**
    * depicts whether this node is a Managing node or not
    */
   protected volatile boolean running = false;
 
-
   /**
    * depicts whether this node is a Managing node or not
    */
   protected volatile boolean stopCacheOps = false;
 
-
-
   /**
    * This is a single window to manipulate region resources for management
    */
   protected ManagementResourceRepo repo;
 
-
   /**
    * The concrete implementation of DistributedSystem that provides internal-only functionality.
    */
-
   protected InternalDistributedSystem system;
 
-
-
-  public Manager(ManagementResourceRepo repo, InternalDistributedSystem system, Cache cache) {
+  public Manager(ManagementResourceRepo repo, InternalDistributedSystem system,
+      InternalCache cache) {
     this.repo = repo;
-    this.cache = (GemFireCacheImpl) cache;
+    this.cache = cache;
     this.system = system;
   }
 
@@ -77,12 +63,8 @@ public abstract class Manager {
 
   /**
    * For internal use only
-   * 
    */
-
   public ManagementResourceRepo getManagementResourceRepo() {
     return repo;
   }
-
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/153db276/geode-core/src/main/java/org/apache/geode/management/internal/RestAgent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/RestAgent.java b/geode-core/src/main/java/org/apache/geode/management/internal/RestAgent.java
index 07e6e25..837e815 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/RestAgent.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/RestAgent.java
@@ -12,7 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.management.internal;
 
 import java.net.UnknownHostException;
@@ -29,9 +28,9 @@ import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.cache.Scope;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.internal.GemFireVersion;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.net.SSLConfigurationFactory;
 import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.InternalRegionArguments;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
@@ -60,15 +59,14 @@ public class RestAgent {
     return this.running;
   }
 
-  private boolean isManagementRestServiceRunning(GemFireCacheImpl cache) {
+  private boolean isManagementRestServiceRunning(InternalCache cache) {
     final SystemManagementService managementService =
         (SystemManagementService) ManagementService.getManagementService(cache);
     return (managementService.getManagementAgent() != null
         && managementService.getManagementAgent().isHttpServiceRunning());
-
   }
 
-  public synchronized void start(GemFireCacheImpl cache) {
+  public synchronized void start(InternalCache cache) {
     if (!this.running && this.config.getHttpServicePort() != 0
         && !isManagementRestServiceRunning(cache)) {
       try {
@@ -84,7 +82,6 @@ public class RestAgent {
         logger.debug(e.getMessage(), e);
       }
     }
-
   }
 
   public synchronized void stop() {
@@ -141,7 +138,7 @@ public class RestAgent {
         this.httpServer = JettyHelper.addWebApplication(httpServer, "/geode", gemfireAPIWar);
 
         if (logger.isDebugEnabled()) {
-          logger.info("Starting HTTP embedded server on port ({}) at bind-address ({})...",
+          logger.debug("Starting HTTP embedded server on port ({}) at bind-address ({})...",
               ((ServerConnector) this.httpServer.getConnectors()[0]).getPort(),
               httpServiceBindAddress);
         }
@@ -212,9 +209,8 @@ public class RestAgent {
       if (logger.isDebugEnabled()) {
         logger.debug("Starting creation of  __ParameterizedQueries__ region");
       }
-      GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+      InternalCache cache = (InternalCache) CacheFactory.getAnyInstance();
       if (cache != null) {
-        // cache.getCacheConfig().setPdxReadSerialized(true);
         final InternalRegionArguments regionArguments = new InternalRegionArguments();
         regionArguments.setIsUsedForMetaRegion(true);
         final AttributesFactory<String, String> attributesFactory =


Mime
View raw message