geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [1/7] geode git commit: Change GemFireCacheImpl to InternalCache
Date Fri, 05 May 2017 17:32:28 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2632-12 0c36d5f8e -> bccdb56e2


http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxReaderImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxReaderImpl.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxReaderImpl.java
index 822fc99..801157e 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxReaderImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxReaderImpl.java
@@ -24,6 +24,7 @@ import org.apache.geode.InternalGemFireException;
 import org.apache.geode.internal.DSCODE;
 import org.apache.geode.internal.InternalDataSerializer;
 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.tcp.ByteBufferInputStream;
 import org.apache.geode.internal.tcp.ByteBufferInputStream.ByteSource;
@@ -560,7 +561,6 @@ public class PdxReaderImpl implements InternalPdxReader, java.io.Serializable {
   }
 
   /**
-   * 
    * @param idx of the variable length field
    * @return the offset to the variable length field
    */
@@ -697,10 +697,10 @@ public class PdxReaderImpl implements InternalPdxReader, java.io.Serializable {
     // only create a tracking one if we might need it
     UnreadPdxType unreadLocalPdxType = null;
     boolean needToTrackReads = TESTHOOK_TRACKREADS;
-    GemFireCacheImpl gfc = GemFireCacheImpl
+    InternalCache cache = GemFireCacheImpl
         .getForPdx("PDX registry is unavailable because the Cache has been closed.");
-    TypeRegistry tr = gfc.getPdxRegistry();
-    if (!gfc.getPdxIgnoreUnreadFields()) {
+    TypeRegistry tr = cache.getPdxRegistry();
+    if (!cache.getPdxIgnoreUnreadFields()) {
       PdxType localPdxType = tr.getExistingTypeForClass(pdxClass);
       if (localPdxType != null) {
         if (getPdxType().getTypeId() != localPdxType.getTypeId()
@@ -736,7 +736,7 @@ public class PdxReaderImpl implements InternalPdxReader, java.io.Serializable {
       }
       ((PdxSerializable) result).fromData(pdxReader);
     } else {
-      PdxSerializer pdxSerializer = gfc.getPdxSerializer();
+      PdxSerializer pdxSerializer = cache.getPdxSerializer();
       if (pdxSerializer != null) {
         result = pdxSerializer.fromData(pdxClass, pdxReader);
         if (result == null) {
@@ -843,8 +843,6 @@ public class PdxReaderImpl implements InternalPdxReader, java.io.Serializable {
   public void orderedDeserialize(Object obj, AutoClassInfo ci) {
     PdxReaderImpl reader = prepForOrderedReading();
     for (PdxFieldWrapper f : ci.getFields()) {
-      // System.out.println("DEBUG reading field=" + f.getField().getName() + " offset=" +
-      // reader.dis.position());
       f.orderedDeserialize(reader, obj);
     }
   }
@@ -866,8 +864,6 @@ public class PdxReaderImpl implements InternalPdxReader, java.io.Serializable {
   }
 
   /**
-   * 
-   * @param field
    * @return PdxString if field is a String otherwise invokes {@link #readField(String)}
    */
   public Object readRawField(String field) {
@@ -888,9 +884,6 @@ public class PdxReaderImpl implements InternalPdxReader, java.io.Serializable {
   /**
    * This method checks whether Object field is String type. If its String then it returns PdxString
    * otherwise null.
-   * 
-   * @param ft
-   * @return
    */
   private PdxString getPdxStringFromObjectField(PdxField ft) {
     if (ft.getFieldType() == FieldType.OBJECT) {
@@ -912,8 +905,6 @@ public class PdxReaderImpl implements InternalPdxReader, java.io.Serializable {
   }
 
   /**
-   * 
-   * @param ft
    * @return returns {@link PdxString}
    */
   public PdxString readPdxString(PdxField ft) {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxUnreadData.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxUnreadData.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxUnreadData.java
index 82883b1..d2621b5 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxUnreadData.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxUnreadData.java
@@ -14,15 +14,13 @@
  */
 package org.apache.geode.pdx.internal;
 
-import java.nio.ByteBuffer;
-
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.tcp.ByteBufferInputStream.ByteSource;
 import org.apache.geode.pdx.PdxFieldAlreadyExistsException;
 import org.apache.geode.pdx.PdxUnreadFields;
 
 /**
- * 
  * @since GemFire 6.6
  */
 public class PdxUnreadData implements PdxUnreadFields {
@@ -31,6 +29,7 @@ public class PdxUnreadData implements PdxUnreadFields {
    * This is the original type of the blob that we deserialized and did not read some of its fields.
    */
   private UnreadPdxType unreadType;
+
   private byte[][] unreadData;
 
   public PdxUnreadData() {
@@ -104,10 +103,10 @@ public class PdxUnreadData implements PdxUnreadFields {
     // This method is only called by CopyHelper which is public and does not require that a Cache
     // exists.
     // So we need to call getInstance instead of getExisting.
-    GemFireCacheImpl gfc = GemFireCacheImpl.getInstance();
-    if (gfc == null)
+    InternalCache cache = GemFireCacheImpl.getInstance();
+    if (cache == null)
       return;
-    TypeRegistry tr = gfc.getPdxRegistry();
+    TypeRegistry tr = cache.getPdxRegistry();
     PdxUnreadData ud = tr.getUnreadData(o);
     if (ud != null && !ud.isEmpty()) {
       tr.putUnreadData(copy, ud);

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxWriterImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxWriterImpl.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxWriterImpl.java
index 2aee53c..61be1ad 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxWriterImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxWriterImpl.java
@@ -14,6 +14,11 @@
  */
 package org.apache.geode.pdx.internal;
 
+import java.io.DataOutput;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.Date;
+
 import org.apache.geode.InternalGemFireException;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.internal.DSCODE;
@@ -21,14 +26,16 @@ import org.apache.geode.internal.HeapDataOutputStream;
 import org.apache.geode.internal.InternalDataSerializer;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.tcp.ByteBufferInputStream.ByteSource;
-import org.apache.geode.pdx.*;
+import org.apache.geode.pdx.FieldType;
+import org.apache.geode.pdx.PdxFieldAlreadyExistsException;
+import org.apache.geode.pdx.PdxFieldDoesNotExistException;
+import org.apache.geode.pdx.PdxInstance;
+import org.apache.geode.pdx.PdxSerializable;
+import org.apache.geode.pdx.PdxSerializationException;
+import org.apache.geode.pdx.PdxUnreadFields;
+import org.apache.geode.pdx.PdxWriter;
 import org.apache.geode.pdx.internal.AutoSerializableManager.AutoClassInfo;
 
-import java.io.DataOutput;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.Date;
-
 /**
  * A new instance of this class is created for each (nested) instance of {@link PdxSerializable}.
  * But it may share the underlying instance of {@link HeapDataOutputStream} with other instances of
@@ -47,6 +54,7 @@ public class PdxWriterImpl implements PdxWriter {
    * tr is no longer final because it is initialized late when using a PdxSerializer.
    */
   private TypeRegistry tr;
+
   private final Object pdx;
   private final PdxOutputStream os;
   private final AutoClassInfo aci;
@@ -55,16 +63,20 @@ public class PdxWriterImpl implements PdxWriter {
    * Offsets to the variable length fields.
    */
   private int[] vlfOffsets;
+
   /**
    * The number of variable length fields that need an offset. The first VLF does not need an
    * offset.
    */
   private int vlfCount = 0;
+
   private boolean hasSeenFirstVlf = false;
+
   /**
    * The offset into the hdos to the header.
    */
   protected final int headerOffset;
+
   private PdxUnreadData unreadData;
 
   private PdxType existingType;
@@ -80,6 +92,7 @@ public class PdxWriterImpl implements PdxWriter {
    */
   private static final boolean sysPropDoExtraPdxValidation =
       Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "validatePdxWriters");
+
   private boolean doExtraValidation = sysPropDoExtraPdxValidation;
 
   public PdxWriterImpl(TypeRegistry tr, Object pdx, PdxOutputStream out) {
@@ -543,7 +556,6 @@ public class PdxWriterImpl implements PdxWriter {
   }
 
   /**
-   * 
    * @return the offset to the byte of the first field
    */
   private int getBaseOffset() {
@@ -561,11 +573,7 @@ public class PdxWriterImpl implements PdxWriter {
     int fieldDataSize = getCurrentOffset();
     // Take the list of offsets and append it in reverse order.
     byte sizeOfOffset = getSizeOfOffset(this.vlfCount, fieldDataSize);
-    // System.out.println("Size of each offset: " + sizeOfOffset +
-    // " byte(s), curPos: " + this.curPos + ", numOfOffsets: " +
-    // this.offsetIndex);
     for (int i = (this.vlfCount - 1); i >= 0; i--) {
-      // System.out.println("offset[" + i + "]: " + this.offsets[i]);
       switch (sizeOfOffset) {
         case 1:
           this.os.write((byte) this.vlfOffsets[i]);
@@ -612,7 +620,6 @@ public class PdxWriterImpl implements PdxWriter {
     return this.os.toByteArray();
   }
 
-
   private void markVariableField() {
     if (!this.hasSeenFirstVlf) {
       this.hasSeenFirstVlf = true;
@@ -829,7 +836,6 @@ public class PdxWriterImpl implements PdxWriter {
     }
   }
 
-
   private HeapDataOutputStream.LongUpdater lu;
 
   private void writeHeader() {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
index 6b22aac..065255b 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
@@ -28,7 +28,6 @@ import org.apache.logging.log4j.Logger;
 import org.apache.geode.InternalGemFireError;
 import org.apache.geode.InternalGemFireException;
 import org.apache.geode.cache.AttributesFactory;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheWriterException;
 import org.apache.geode.cache.DataPolicy;
 import org.apache.geode.cache.DiskStore;
@@ -99,8 +98,10 @@ public class PeerTypeRegistration implements TypeRegistration {
    */
   private Map<PdxType, Integer> typeToId =
       Collections.synchronizedMap(new HashMap<PdxType, Integer>());
+
   private Map<EnumInfo, EnumId> enumToId =
       Collections.synchronizedMap(new HashMap<EnumInfo, EnumId>());
+
   private final Map<String, Set<PdxType>> classToType =
       new CopyOnWriteHashMap<String, Set<PdxType>>();
 
@@ -404,11 +405,11 @@ public class PeerTypeRegistration implements TypeRegistration {
 
   private void updateRegion(Object k, Object v) {
     Region<Object, Object> r = getIdToType();
-    Cache c = (Cache) r.getRegionService();
+    InternalCache cache = (InternalCache) r.getRegionService();
 
     checkDistributedTypeRegistryState();
 
-    TXManagerImpl txManager = (TXManagerImpl) c.getCacheTransactionManager();
+    TXManagerImpl txManager = (TXManagerImpl) cache.getCacheTransactionManager();
     TXStateProxy currentState = suspendTX();
     boolean state = useUDPMessagingIfNecessary();
     try {
@@ -452,7 +453,6 @@ public class PeerTypeRegistration implements TypeRegistration {
     } finally {
       resumeTX(currentState);
     }
-
   }
 
   public void addRemoteType(int typeId, PdxType type) {
@@ -626,8 +626,8 @@ public class PeerTypeRegistration implements TypeRegistration {
   }
 
   private TXStateProxy suspendTX() {
-    Cache c = (Cache) getIdToType().getRegionService();
-    TXManagerImpl txManager = (TXManagerImpl) c.getCacheTransactionManager();
+    InternalCache cache = (InternalCache) getIdToType().getRegionService();
+    TXManagerImpl txManager = (TXManagerImpl) cache.getCacheTransactionManager();
     return txManager.internalSuspend();
   }
 
@@ -748,7 +748,6 @@ public class PeerTypeRegistration implements TypeRegistration {
     return enums;
   }
 
-
   /**
    * adds a PdxType for a field to a {@code className => Set<PdxType>} map
    */
@@ -780,14 +779,14 @@ public class PeerTypeRegistration implements TypeRegistration {
     return null;
   }
 
-  /*
+  /**
    * For testing purpose
    */
   public Map<String, Set<PdxType>> getClassToType() {
     return classToType;
   }
 
-  /*
+  /**
    * test hook
    */
   @Override
@@ -813,7 +812,7 @@ public class PeerTypeRegistration implements TypeRegistration {
   }
 
   public static int getPdxRegistrySize() {
-    GemFireCacheImpl cache = GemFireCacheImpl.getExisting();
+    InternalCache cache = GemFireCacheImpl.getExisting();
     if (cache == null) {
       return 0;
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/pdx/internal/WritablePdxInstanceImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/WritablePdxInstanceImpl.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/WritablePdxInstanceImpl.java
index cb080b6..1006d96 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/WritablePdxInstanceImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/WritablePdxInstanceImpl.java
@@ -19,6 +19,7 @@ import java.util.Date;
 
 import org.apache.geode.InternalGemFireException;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.pdx.PdxFieldDoesNotExistException;
 import org.apache.geode.pdx.PdxFieldTypeMismatchException;
 import org.apache.geode.pdx.WritablePdxInstance;
@@ -80,9 +81,9 @@ public class WritablePdxInstanceImpl extends PdxInstanceImpl implements Writable
       if (getPdxType().getHasDeletedField()) {
         // Need a new type that does not have the deleted field
         PdxType pt = new PdxType(getPdxType().getClassName(), !getPdxType().getNoDomainClass());
-        GemFireCacheImpl gfc = GemFireCacheImpl
+        InternalCache cache = GemFireCacheImpl
             .getForPdx("PDX registry is unavailable because the Cache has been closed.");
-        TypeRegistry tr = gfc.getPdxRegistry();
+        TypeRegistry tr = cache.getPdxRegistry();
         writer = new PdxWriterImpl(pt, tr, os);
       } else {
         writer = new PdxWriterImpl(getPdxType(), os);

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxInstanceHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxInstanceHelper.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxInstanceHelper.java
index 39d16a5..fc21bf0 100755
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxInstanceHelper.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxInstanceHelper.java
@@ -20,13 +20,13 @@ import java.math.BigInteger;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.CacheFactory;
-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.pdx.JSONFormatter;
 import org.apache.geode.pdx.PdxInstance;
 import org.apache.geode.pdx.internal.PdxInstanceFactoryImpl;
 
-/*
+/**
  * This class is intermediate class to create PdxInstance.
  */
 public class PdxInstanceHelper implements JSONToPdxMapper {
@@ -37,15 +37,19 @@ public class PdxInstanceHelper implements JSONToPdxMapper {
   PdxInstance m_pdxInstance;
   String m_PdxName;// when pdx is member, else null if part of lists
 
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
   public PdxInstanceHelper(String className, JSONToPdxMapper parent) {
-    GemFireCacheImpl gci = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+    InternalCache cache = getCache();
     if (logger.isTraceEnabled()) {
       logger.trace("ClassName {}", className);
     }
     m_PdxName = className;
     m_parent = parent;
-    m_pdxInstanceFactory =
-        (PdxInstanceFactoryImpl) gci.createPdxInstanceFactory(JSONFormatter.JSON_CLASSNAME, false);
+    m_pdxInstanceFactory = (PdxInstanceFactoryImpl) cache
+        .createPdxInstanceFactory(JSONFormatter.JSON_CLASSNAME, false);
   }
 
   public JSONToPdxMapper getParent() {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxInstanceSortedHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxInstanceSortedHelper.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxInstanceSortedHelper.java
index 7f510da..24e596a 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxInstanceSortedHelper.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxInstanceSortedHelper.java
@@ -16,28 +16,20 @@ package org.apache.geode.pdx.internal.json;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.util.Collection;
 import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedList;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.SortedMap;
-import java.util.concurrent.ConcurrentSkipListMap;
 
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.CacheFactory;
-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.pdx.FieldType;
 import org.apache.geode.pdx.JSONFormatter;
 import org.apache.geode.pdx.PdxInstance;
 import org.apache.geode.pdx.PdxInstanceFactory;
-import org.apache.geode.pdx.internal.PdxInstanceFactoryImpl;
 
-/*
+/**
  * This class is intermediate class to create PdxInstance.
  */
 public class PdxInstanceSortedHelper implements JSONToPdxMapper {
@@ -48,8 +40,11 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
   PdxInstance m_pdxInstance;
   String m_PdxName;// when pdx is member, else null if part of lists
 
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
   public PdxInstanceSortedHelper(String className, JSONToPdxMapper parent) {
-    GemFireCacheImpl gci = (GemFireCacheImpl) CacheFactory.getAnyInstance();
     if (logger.isTraceEnabled()) {
       logger.trace("ClassName {}", className);
     }
@@ -57,21 +52,11 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     m_parent = parent;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#getParent()
-   */
   @Override
   public JSONToPdxMapper getParent() {
     return m_parent;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#setPdxFieldName(java.lang.String)
-   */
   @Override
   public void setPdxFieldName(String name) {
     if (logger.isTraceEnabled()) {
@@ -104,12 +89,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     }
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addStringField(java.lang.String,
-   * java.lang.String)
-   */
   @Override
   public void addStringField(String fieldName, String value) {
     if (logger.isTraceEnabled()) {
@@ -118,11 +97,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, value, FieldType.STRING));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addByteField(java.lang.String, byte)
-   */
   @Override
   public void addByteField(String fieldName, byte value) {
     if (logger.isTraceEnabled()) {
@@ -131,11 +105,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, value, FieldType.BYTE));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addShortField(java.lang.String, short)
-   */
   @Override
   public void addShortField(String fieldName, short value) {
     if (logger.isTraceEnabled()) {
@@ -144,11 +113,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, value, FieldType.SHORT));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addIntField(java.lang.String, int)
-   */
   @Override
   public void addIntField(String fieldName, int value) {
     if (logger.isTraceEnabled()) {
@@ -157,11 +121,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, value, FieldType.INT));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addLongField(java.lang.String, long)
-   */
   @Override
   public void addLongField(String fieldName, long value) {
     if (logger.isTraceEnabled()) {
@@ -170,12 +129,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, value, FieldType.LONG));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addBigDecimalField(java.lang.String,
-   * java.math.BigDecimal)
-   */
   @Override
   public void addBigDecimalField(String fieldName, BigDecimal value) {
     if (logger.isTraceEnabled()) {
@@ -184,12 +137,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, value, FieldType.OBJECT));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addBigIntegerField(java.lang.String,
-   * java.math.BigInteger)
-   */
   @Override
   public void addBigIntegerField(String fieldName, BigInteger value) {
     if (logger.isTraceEnabled()) {
@@ -198,12 +145,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, value, FieldType.OBJECT));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addBooleanField(java.lang.String,
-   * boolean)
-   */
   @Override
   public void addBooleanField(String fieldName, boolean value) {
     if (logger.isTraceEnabled()) {
@@ -212,11 +153,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, value, FieldType.BOOLEAN));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addFloatField(java.lang.String, float)
-   */
   @Override
   public void addFloatField(String fieldName, float value) {
     if (logger.isTraceEnabled()) {
@@ -225,12 +161,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, value, FieldType.FLOAT));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addDoubleField(java.lang.String,
-   * double)
-   */
   @Override
   public void addDoubleField(String fieldName, double value) {
     if (logger.isTraceEnabled()) {
@@ -239,11 +169,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, value, FieldType.DOUBLE));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addNullField(java.lang.String)
-   */
   @Override
   public void addNullField(String fieldName) {
     if (logger.isTraceEnabled()) {
@@ -252,12 +177,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, null, FieldType.OBJECT));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addListField(java.lang.String,
-   * org.apache.geode.pdx.internal.json.PdxListHelper)
-   */
   @Override
   public void addListField(String fieldName, PdxListHelper list) {
     if (logger.isTraceEnabled()) {
@@ -267,11 +186,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, list.getList(), FieldType.OBJECT));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#endListField(java.lang.String)
-   */
   @Override
   public void endListField(String fieldName) {
     if (logger.isTraceEnabled()) {
@@ -279,12 +193,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     }
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#addObjectField(java.lang.String,
-   * org.apache.geode.pdx.PdxInstance)
-   */
   @Override
   public void addObjectField(String fieldName, Object member) {
     if (logger.isTraceEnabled()) {
@@ -296,11 +204,6 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     fieldList.add(new JSONFieldHolder(fieldName, member, FieldType.OBJECT));
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#endObjectField(java.lang.String)
-   */
   @Override
   public void endObjectField(String fieldName) {
     if (logger.isTraceEnabled()) {
@@ -352,30 +255,18 @@ public class PdxInstanceSortedHelper implements JSONToPdxMapper {
     }
   }
 
-
-  static PdxInstanceFactory createPdxInstanceFactory() {
-    GemFireCacheImpl gci = (GemFireCacheImpl) CacheFactory.getAnyInstance();
-    return gci.createPdxInstanceFactory(JSONFormatter.JSON_CLASSNAME, false);
+  private PdxInstanceFactory createPdxInstanceFactory() {
+    InternalCache cache = getCache();
+    return cache.createPdxInstanceFactory(JSONFormatter.JSON_CLASSNAME, false);
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#getPdxInstance()
-   */
   @Override
   public PdxInstance getPdxInstance() {
     return m_pdxInstance;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.geode.pdx.internal.json.JSONToPdxMapper#getPdxFieldName()
-   */
   @Override
   public String getPdxFieldName() {
-    // return m_fieldName != null ? m_fieldName : "emptyclassname"; //when object is just like { }
     return m_PdxName;
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxListHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxListHelper.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxListHelper.java
index 417e56a..f73a129 100755
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxListHelper.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/json/PdxListHelper.java
@@ -22,8 +22,7 @@ import java.util.List;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.i18n.LogWriterI18n;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 
 /*
@@ -36,8 +35,12 @@ public class PdxListHelper {
   PdxListHelper m_parent;
   List list = new LinkedList();
 
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
   public PdxListHelper(PdxListHelper parent, String name) {
-    GemFireCacheImpl gci = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+    InternalCache cache = getCache();
     m_name = name;
     if (logger.isTraceEnabled()) {
       logger.trace("PdxListHelper name: {}", name);
@@ -155,7 +158,6 @@ public class PdxListHelper {
     if (logger.isTraceEnabled()) {
       logger.trace("addObjectField fieldName: {}", fieldName);
     }
-    // dpi.setPdxFieldName(fieldName);
     list.add(dpi.getPdxInstance());
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/redis/GeodeRedisServer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/redis/GeodeRedisServer.java b/geode-core/src/main/java/org/apache/geode/redis/GeodeRedisServer.java
index 32a40dd..9ffc075 100644
--- a/geode-core/src/main/java/org/apache/geode/redis/GeodeRedisServer.java
+++ b/geode-core/src/main/java/org/apache/geode/redis/GeodeRedisServer.java
@@ -45,24 +45,33 @@ import io.netty.channel.socket.SocketChannel;
 import io.netty.channel.socket.nio.NioServerSocketChannel;
 import io.netty.channel.socket.oio.OioServerSocketChannel;
 import io.netty.util.concurrent.Future;
-import org.apache.geode.annotations.Experimental;
-import org.apache.geode.cache.*;
-import org.apache.geode.redis.internal.ByteArrayWrapper;
-import org.apache.geode.redis.internal.ByteToCommandDecoder;
-import org.apache.geode.redis.internal.Coder;
-import org.apache.geode.redis.internal.ExecutionHandlerContext;
-import org.apache.geode.redis.internal.RedisDataType;
-import org.apache.geode.redis.internal.RegionProvider;
 
 import org.apache.geode.InternalGemFireError;
 import org.apache.geode.LogWriter;
+import org.apache.geode.annotations.Experimental;
+import org.apache.geode.cache.AttributesFactory;
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.DataPolicy;
+import org.apache.geode.cache.EntryEvent;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionDestroyedException;
+import org.apache.geode.cache.RegionFactory;
+import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.cache.util.CacheListenerAdapter;
 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.cache.InternalRegionArguments;
 import org.apache.geode.internal.hll.HyperLogLogPlus;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.redis.internal.ByteArrayWrapper;
+import org.apache.geode.redis.internal.ByteToCommandDecoder;
+import org.apache.geode.redis.internal.Coder;
+import org.apache.geode.redis.internal.ExecutionHandlerContext;
+import org.apache.geode.redis.internal.RedisDataType;
+import org.apache.geode.redis.internal.RegionProvider;
 
 /**
  * The GeodeRedisServer is a server that understands the Redis protocol. As commands are sent to the
@@ -142,7 +151,7 @@ public class GeodeRedisServer {
   private static Thread mainThread = null;
 
   /**
-   * The default Redis port as specified by their protocol, {@value #DEFAULT_REDIS_SERVER_PORT}
+   * The default Redis port as specified by their protocol, {@code DEFAULT_REDIS_SERVER_PORT}
    */
   public static final int DEFAULT_REDIS_SERVER_PORT = 6379;
 
@@ -213,25 +222,25 @@ public class GeodeRedisServer {
 
   /**
    * The field that defines the name of the {@link Region} which holds all of the strings. The
-   * current value of this field is {@value #STRING_REGION}.
+   * current value of this field is {@code STRING_REGION}.
    */
   public static final String STRING_REGION = "ReDiS_StRiNgS";
 
   /**
    * The field that defines the name of the {@link Region} which holds all of the HyperLogLogs. The
-   * current value of this field is {@value #HLL_REGION}.
+   * current value of this field is {@code HLL_REGION}.
    */
   public static final String HLL_REGION = "ReDiS_HlL";
 
   /**
    * The field that defines the name of the {@link Region} which holds all of the Redis meta data.
-   * The current value of this field is {@value #REDIS_META_DATA_REGION}.
+   * The current value of this field is {@code REDIS_META_DATA_REGION}.
    */
   public static final String REDIS_META_DATA_REGION = "__ReDiS_MeTa_DaTa";
 
   /**
    * The system property name used to set the default {@link Region} creation type. The property
-   * name is {@value #DEFAULT_REGION_SYS_PROP_NAME} and the acceptable values are types defined by
+   * name is {@code DEFAULT_REGION_SYS_PROP_NAME} and the acceptable values are types defined by
    * {@link RegionShortcut}, i.e. "PARTITION" would be used for {@link RegionShortcut#PARTITION}.
    */
   public static final String DEFAULT_REGION_SYS_PROP_NAME = "gemfireredis.regiontype";
@@ -290,7 +299,7 @@ public class GeodeRedisServer {
   }
 
   /**
-   * Constructor for {@link GeodeRedisServer} that will start the server on the given port and bind
+   * Constructor for {@code GeodeRedisServer} that will start the server on the given port and bind
    * to the first non-loopback address
    * 
    * @param port The port the server will bind to, will use {@value #DEFAULT_REDIS_SERVER_PORT} by
@@ -301,7 +310,7 @@ public class GeodeRedisServer {
   }
 
   /**
-   * Constructor for {@link GeodeRedisServer} that will start the server and bind to the given
+   * Constructor for {@code GeodeRedisServer} that will start the server and bind to the given
    * address and port
    * 
    * @param bindAddress The address to which the server will attempt to bind to
@@ -312,9 +321,8 @@ public class GeodeRedisServer {
     this(bindAddress, port, null);
   }
 
-
   /**
-   * Constructor for {@link GeodeRedisServer} that will start the server and bind to the given
+   * Constructor for {@code GeodeRedisServer} that will start the server and bind to the given
    * address and port. Keep in mind that the log level configuration will only be set if a
    * {@link Cache} does not already exist, if one already exists then setting that property will
    * have no effect.
@@ -367,7 +375,7 @@ public class GeodeRedisServer {
   }
 
   /**
-   * This is function to call on a {@link GeodeRedisServer} instance to start it running
+   * This is function to call on a {@code GeodeRedisServer} instance to start it running
    */
   public synchronized void start() {
     if (!started) {
@@ -386,24 +394,24 @@ public class GeodeRedisServer {
 
   /**
    * Initializes the {@link Cache}, and creates Redis necessities Region and protects declares that
-   * {@link Region} to be protected. Also, every {@link GeodeRedisServer} will check for entries
+   * {@link Region} to be protected. Also, every {@code GeodeRedisServer} will check for entries
    * already in the meta data Region.
    */
   private void startGemFire() {
-    Cache c = GemFireCacheImpl.getInstance();
-    if (c == null) {
+    Cache cache = GemFireCacheImpl.getInstance();
+    if (cache == null) {
       synchronized (GeodeRedisServer.class) {
-        c = GemFireCacheImpl.getInstance();
-        if (c == null) {
+        cache = GemFireCacheImpl.getInstance();
+        if (cache == null) {
           CacheFactory cacheFactory = new CacheFactory();
           if (logLevel != null)
             cacheFactory.set(LOG_LEVEL, logLevel);
-          c = cacheFactory.create();
+          cache = cacheFactory.create();
         }
       }
     }
-    this.cache = c;
-    this.logger = c.getLogger();
+    this.cache = cache;
+    this.logger = cache.getLogger();
   }
 
   private void initializeRedis() {
@@ -412,7 +420,7 @@ public class GeodeRedisServer {
 
       Region<ByteArrayWrapper, HyperLogLogPlus> hLLRegion;
       Region<String, RedisDataType> redisMetaData;
-      GemFireCacheImpl gemFireCache = (GemFireCacheImpl) cache;
+      InternalCache gemFireCache = (InternalCache) cache;
       try {
         if ((stringsRegion = cache.getRegion(STRING_REGION)) == null) {
           RegionFactory<ByteArrayWrapper, ByteArrayWrapper> regionFactory =
@@ -611,7 +619,7 @@ public class GeodeRedisServer {
   }
 
   /**
-   * Shutdown method for {@link GeodeRedisServer}. This closes the {@link Cache}, interrupts all
+   * Shutdown method for {@code GeodeRedisServer}. This closes the {@link Cache}, interrupts all
    * execution and forcefully closes all connections.
    */
   public synchronized void shutdown() {
@@ -637,7 +645,7 @@ public class GeodeRedisServer {
   }
 
   /**
-   * Static main method that allows the {@link GeodeRedisServer} to be started from the command
+   * Static main method that allows the {@code GeodeRedisServer} to be started from the command
    * line. The supported command line arguments are
    * <p>
    * -port= <br>

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/redis/internal/RegionProvider.java b/geode-core/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
index 5994d7d..1de73a0 100644
--- a/geode-core/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
+++ b/geode-core/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
@@ -54,8 +54,6 @@ import org.apache.geode.redis.GeodeRedisServer;
  * because some keys for Redis represented as a {@link Region} in {@link GeodeRedisServer} come with
  * additional state. Therefore getting, creating, or destroying a {@link Region} needs to be
  * synchronized, which is done away with and abstracted by this class.
- * 
- *
  */
 public class RegionProvider implements Closeable {
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/redis/internal/executor/list/ListExecutor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/redis/internal/executor/list/ListExecutor.java b/geode-core/src/main/java/org/apache/geode/redis/internal/executor/list/ListExecutor.java
index ab80a36..fd518b9 100755
--- a/geode-core/src/main/java/org/apache/geode/redis/internal/executor/list/ListExecutor.java
+++ b/geode-core/src/main/java/org/apache/geode/redis/internal/executor/list/ListExecutor.java
@@ -24,12 +24,11 @@ import org.apache.geode.redis.internal.ExecutionHandlerContext;
 import org.apache.geode.redis.internal.RedisDataType;
 import org.apache.geode.redis.internal.executor.AbstractExecutor;
 
-
 public abstract class ListExecutor extends AbstractExecutor {
 
   protected static final int LIST_EMPTY_SIZE = 2;
 
-  protected static enum ListDirection {
+  protected enum ListDirection {
     LEFT, RIGHT
   };
 
@@ -76,7 +75,7 @@ public abstract class ListExecutor extends AbstractExecutor {
       index += pushType == ListDirection.LEFT ? -1 : 1; // Subtract index if left push, add if right
                                                         // push
 
-    /**
+    /*
      * Multi push command
      * 
      * For every element that needs to be added
@@ -86,7 +85,7 @@ public abstract class ListExecutor extends AbstractExecutor {
       byte[] value = commandElems.get(i);
       ByteArrayWrapper wrapper = new ByteArrayWrapper(value);
 
-      /**
+      /*
        * 
        * First, use the start index to attempt to insert the value into the Region
        * 
@@ -101,7 +100,7 @@ public abstract class ListExecutor extends AbstractExecutor {
         }
       } while (oldValue != null);
 
-      /**
+      /*
        * 
        * Next, update the index in the meta data region. Keep trying to replace the existing index
        * unless the index is further out than previously inserted, that's ok. Example below:

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/security/AuthInitialize.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/security/AuthInitialize.java b/geode-core/src/main/java/org/apache/geode/security/AuthInitialize.java
index 05ba515..6b0675a 100644
--- a/geode-core/src/main/java/org/apache/geode/security/AuthInitialize.java
+++ b/geode-core/src/main/java/org/apache/geode/security/AuthInitialize.java
@@ -22,6 +22,7 @@ import org.apache.geode.cache.CacheCallback;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 
 // TODO Add example usage of this interface and configuration details
 /**
@@ -30,7 +31,7 @@ import org.apache.geode.internal.cache.GemFireCacheImpl;
  * server/locator side respectively. Implementations should register name of the static creation
  * function (that returns an object of the class) as the <i>security-peer-auth-init</i> system
  * property on peers and as the <i>security-client-auth-init</i> system property on clients.
- * 
+ *
  * @since GemFire 5.5
  */
 public interface AuthInitialize extends CacheCallback {
@@ -46,6 +47,7 @@ public interface AuthInitialize extends CacheCallback {
    *
    * @deprecated since Geode 1.0, use init()
    */
+  @Deprecated
   public void init(LogWriter systemLogger, LogWriter securityLogger)
       throws AuthenticationFailedException;
 
@@ -53,8 +55,8 @@ public interface AuthInitialize extends CacheCallback {
    * @since Geode 1.0. implement this method instead of init with logwriters. Implementation should
    *        use log4j instead of these loggers.
    */
-  default public void init() {
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+  public default void init() {
+    InternalCache cache = GemFireCacheImpl.getInstance();
     init(cache.getLogger(), cache.getSecurityLogger());
   }
 
@@ -83,6 +85,7 @@ public interface AuthInitialize extends CacheCallback {
    * @deprecated since Geode 1.0, use getCredentials(Properties). When using Integrated security,
    *             all members, peer/client will use the same credentials.
    */
+  @Deprecated
   public Properties getCredentials(Properties securityProps, DistributedMember server,
       boolean isPeer) throws AuthenticationFailedException;
 
@@ -93,7 +96,7 @@ public interface AuthInitialize extends CacheCallback {
    * @return the credentials to be used. It needs to contain "security-username" and
    *         "security-password"
    */
-  default public Properties getCredentials(Properties securityProps) {
+  default Properties getCredentials(Properties securityProps) {
     return getCredentials(securityProps, null, true);
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PartitionMessageTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PartitionMessageTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PartitionMessageTest.java
index f842470..b3bb02b 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PartitionMessageTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PartitionMessageTest.java
@@ -59,7 +59,7 @@ public class PartitionMessageTest {
     when(msg.checkCacheClosing(dm)).thenReturn(false);
     when(msg.checkDSClosing(dm)).thenReturn(false);
     when(msg.getPartitionedRegion()).thenReturn(pr);
-    when(msg.getGemFireCacheImpl()).thenReturn(cache);
+    when(msg.getInternalCache()).thenReturn(cache);
     when(msg.getStartPartitionMessageProcessingTime(pr)).thenReturn(startTime);
     when(msg.getTXManagerImpl(cache)).thenReturn(txMgr);
 
@@ -100,7 +100,7 @@ public class PartitionMessageTest {
       DataLocationException, InterruptedException, IOException {
     txMgr = new TXManagerImpl(null, cache);
     when(msg.getPartitionedRegion()).thenReturn(pr);
-    when(msg.getGemFireCacheImpl()).thenReturn(cache);
+    when(msg.getInternalCache()).thenReturn(cache);
     when(msg.getStartPartitionMessageProcessingTime(pr)).thenReturn(startTime);
     when(msg.getTXManagerImpl(cache)).thenReturn(txMgr);
     when(msg.canParticipateInTransaction()).thenReturn(true);

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java
index e0dfc6c..6291142 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java
@@ -37,6 +37,7 @@ import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.FunctionInvocationTargetException;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.execute.AbstractExecution;
 import org.apache.geode.internal.util.CollectionUtils;
 import org.apache.geode.management.internal.cli.domain.DiskStoreDetails;
@@ -425,7 +426,7 @@ public class DiskStoreCommandsJUnitTest {
     }
 
     @Override
-    protected Set<DistributedMember> getMembers(final Cache cache) {
+    protected Set<DistributedMember> getMembers(final InternalCache cache) {
       assertSame(getCache(), cache);
       return Collections.singleton(this.distributedMember);
     }
@@ -437,7 +438,7 @@ public class DiskStoreCommandsJUnitTest {
     }
 
     @Override
-    protected Set<DistributedMember> getNormalMembers(final Cache cache) {
+    protected Set<DistributedMember> getNormalMembers(final InternalCache cache) {
       assertSame(getCache(), cache);
       return Collections.singleton(this.distributedMember);
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsJUnitTest.java
index bdb84a9..f2e168a 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/IndexCommandsJUnitTest.java
@@ -37,6 +37,7 @@ import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.FunctionInvocationTargetException;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.execute.AbstractExecution;
 import org.apache.geode.internal.util.CollectionUtils;
 import org.apache.geode.management.internal.cli.domain.IndexDetails;
@@ -207,7 +208,7 @@ public class IndexCommandsJUnitTest {
     }
 
     @Override
-    protected Set<DistributedMember> getMembers(final Cache cache) {
+    protected Set<DistributedMember> getMembers(final InternalCache cache) {
       assertSame(getCache(), cache);
       return Collections.emptySet();
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQImpl.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQImpl.java b/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQImpl.java
index c484105..2f13fac 100644
--- a/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQImpl.java
+++ b/geode-cq/src/main/java/org/apache/geode/cache/query/internal/cq/ServerCQImpl.java
@@ -44,7 +44,7 @@ import org.apache.geode.cache.query.internal.CompiledSelect;
 import org.apache.geode.cache.query.internal.CqStateImpl;
 import org.apache.geode.cache.query.internal.DefaultQuery;
 import org.apache.geode.i18n.StringId;
-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.Token;
 import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier;
@@ -216,7 +216,6 @@ public class ServerCQImpl extends CqQueryImpl implements DataSerializable, Serve
       }
     }
 
-    // this.cqService.addToCqEventKeysMap(this);
     this.updateCqCreateStats();
 
     // Initialize the state of CQ.
@@ -283,7 +282,7 @@ public class ServerCQImpl extends CqQueryImpl implements DataSerializable, Serve
    * @return String modified query.
    */
   private Query constructServerSideQuery() throws QueryException {
-    GemFireCacheImpl cache = (GemFireCacheImpl) cqService.getCache();
+    InternalCache cache = cqService.getInternalCache();
     DefaultQuery locQuery = (DefaultQuery) cache.getLocalQueryService().newQuery(this.queryString);
     CompiledSelect select = locQuery.getSimpleSelect();
     CompiledIteratorDef from = (CompiledIteratorDef) select.getIterators().get(0);
@@ -371,8 +370,6 @@ public class ServerCQImpl extends CqQueryImpl implements DataSerializable, Serve
     if (!CqServiceProvider.MAINTAIN_KEYS) {
       return;
     }
-    // this.logger.fine("Marking key in Results Cache For CQ :" +
-    // this.cqName + " key :" + key);
 
     if (this.cqResultKeys != null) {
       synchronized (this.cqResultKeys) {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/DestroyLuceneIndexMessage.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/DestroyLuceneIndexMessage.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/DestroyLuceneIndexMessage.java
index 8bdef9b..9eada5b 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/DestroyLuceneIndexMessage.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/DestroyLuceneIndexMessage.java
@@ -14,32 +14,39 @@
  */
 package org.apache.geode.cache.lucene.internal;
 
-import org.apache.geode.DataSerializer;
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.lucene.LuceneServiceProvider;
-import org.apache.geode.distributed.internal.*;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.logging.log4j.Logger;
-
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.util.Collection;
 
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.DataSerializer;
+import org.apache.geode.cache.lucene.LuceneServiceProvider;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.distributed.internal.MessageWithReply;
+import org.apache.geode.distributed.internal.PooledDistributionMessage;
+import org.apache.geode.distributed.internal.ReplyException;
+import org.apache.geode.distributed.internal.ReplyMessage;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.logging.LogService;
+
 public class DestroyLuceneIndexMessage extends PooledDistributionMessage
     implements MessageWithReply {
 
+  private static final Logger logger = LogService.getLogger();
+
   private int processorId;
 
   private String regionPath;
 
   private String indexName;
 
-  private static final Logger logger = LogService.getLogger();
-
   /* For serialization */
-  public DestroyLuceneIndexMessage() {}
+  public DestroyLuceneIndexMessage() {
+    // nothing
+  }
 
   protected DestroyLuceneIndexMessage(Collection recipients, int processorId, String regionPath,
       String indexName) {
@@ -59,7 +66,7 @@ public class DestroyLuceneIndexMessage extends PooledDistributionMessage
             + "; indexName=" + this.indexName);
       }
       try {
-        Cache cache = GemFireCacheImpl.getInstance();
+        InternalCache cache = GemFireCacheImpl.getInstance();
         LuceneServiceImpl impl = (LuceneServiceImpl) LuceneServiceProvider.get(cache);
         impl.destroyIndex(this.indexName, this.regionPath, false);
         if (logger.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
index e4b4b4f..fa45927 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
@@ -29,6 +29,8 @@ import java.util.Set;
 
 import junitparams.JUnitParamsRunner;
 import junitparams.Parameters;
+
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.core.KeywordAnalyzer;
@@ -650,7 +652,7 @@ public class LuceneIndexCommandsJUnitTest {
     }
 
     @Override
-    protected Set<DistributedMember> getMembers(final Cache cache) {
+    protected Set<DistributedMember> getMembers(final InternalCache cache) {
       assertSame(getCache(), cache);
       return Collections.emptySet();
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
----------------------------------------------------------------------
diff --git a/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java b/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
index ab8b5b0..0f1a995 100644
--- a/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
+++ b/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
@@ -443,6 +443,7 @@ public class AutoBalancer implements Declarable {
     }
 
     InternalCache getCache() {
+      // TODO: delete this double-checking
       if (cache == null) {
         synchronized (this) {
           if (cache == null) {
@@ -461,6 +462,7 @@ public class AutoBalancer implements Declarable {
 
     @Override
     public boolean acquireAutoBalanceLock() {
+      // TODO: delete this double-checking
       if (!isLockAcquired.get()) {
         synchronized (isLockAcquired) {
           if (!isLockAcquired.get()) {
@@ -501,7 +503,7 @@ public class AutoBalancer implements Declarable {
     }
   }
 
-  private class SystemClockTimeProvider implements TimeProvider {
+  private static class SystemClockTimeProvider implements TimeProvider {
     @Override
     public long currentTimeMillis() {
       return System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverFactoryImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverFactoryImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverFactoryImpl.java
index eb46258..a5c09d3 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverFactoryImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverFactoryImpl.java
@@ -18,19 +18,18 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.wan.GatewayReceiver;
 import org.apache.geode.cache.wan.GatewayReceiverFactory;
 import org.apache.geode.cache.wan.GatewayTransportFilter;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ResourceEvent;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.xmlcache.CacheCreation;
 import org.apache.geode.internal.cache.xmlcache.GatewayReceiverCreation;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
 /**
- * 
  * @since GemFire 7.0
  */
 public class GatewayReceiverFactoryImpl implements GatewayReceiverFactory {
@@ -51,13 +50,13 @@ public class GatewayReceiverFactoryImpl implements GatewayReceiverFactory {
 
   private List<GatewayTransportFilter> filters = new ArrayList<GatewayTransportFilter>();
 
-  private Cache cache;
+  private InternalCache cache;
 
   public GatewayReceiverFactoryImpl() {
-
+    // nothing
   }
 
-  public GatewayReceiverFactoryImpl(Cache cache) {
+  public GatewayReceiverFactoryImpl(InternalCache cache) {
     this.cache = cache;
   }
 
@@ -116,7 +115,7 @@ public class GatewayReceiverFactoryImpl implements GatewayReceiverFactory {
       recv = new GatewayReceiverImpl(this.cache, this.startPort, this.endPort, this.timeBetPings,
           this.socketBuffSize, this.bindAdd, this.filters, this.hostnameForSenders,
           this.manualStart);
-      ((GemFireCacheImpl) cache).addGatewayReceiver(recv);
+      this.cache.addGatewayReceiver(recv);
       InternalDistributedSystem system =
           (InternalDistributedSystem) this.cache.getDistributedSystem();
       system.handleResourceEvent(ResourceEvent.GATEWAYRECEIVER_CREATE, recv);
@@ -134,7 +133,7 @@ public class GatewayReceiverFactoryImpl implements GatewayReceiverFactory {
       recv = new GatewayReceiverCreation(this.cache, this.startPort, this.endPort,
           this.timeBetPings, this.socketBuffSize, this.bindAdd, this.filters,
           this.hostnameForSenders, this.manualStart);
-      ((CacheCreation) cache).addGatewayReceiver(recv);
+      this.cache.addGatewayReceiver(recv);
     }
     return recv;
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
index d953d7f..5e26a46 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
@@ -23,16 +23,15 @@ import java.util.List;
 
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.cache.wan.GatewayReceiver;
 import org.apache.geode.cache.wan.GatewayTransportFilter;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ResourceEvent;
 import org.apache.geode.internal.AvailablePort;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.net.SocketCreator;
 import org.apache.geode.internal.cache.CacheServerImpl;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
@@ -65,12 +64,12 @@ public class GatewayReceiverImpl implements GatewayReceiver {
 
   private CacheServer receiver;
 
-  private final GemFireCacheImpl cache;
+  private final InternalCache cache;
 
-  public GatewayReceiverImpl(Cache cache, int startPort, int endPort, int timeBetPings,
+  public GatewayReceiverImpl(InternalCache cache, int startPort, int endPort, int timeBetPings,
       int buffSize, String bindAdd, List<GatewayTransportFilter> filters, String hostnameForSenders,
       boolean manualStart) {
-    this.cache = (GemFireCacheImpl) cache;
+    this.cache = cache;
 
     /*
      * If user has set hostNameForSenders then it should take precedence over bindAddress. If user
@@ -151,17 +150,17 @@ public class GatewayReceiverImpl implements GatewayReceiver {
       receiver.setMaximumTimeBetweenPings(timeBetPings);
       receiver.setHostnameForClients(host);
       receiver.setBindAddress(bindAdd);
-      receiver.setGroups(new String[] {GatewayReceiverImpl.RECEIVER_GROUP});
+      receiver.setGroups(new String[] {GatewayReceiver.RECEIVER_GROUP});
       ((CacheServerImpl) receiver).setGatewayTransportFilter(this.filters);
       try {
-        ((CacheServerImpl) receiver).start();
+        receiver.start();
         started = true;
       } catch (BindException be) {
         if (be.getCause() != null
             && be.getCause().getMessage().contains("assign requested address")) {
           throw new GatewayReceiverException(
               LocalizedStrings.SocketCreator_FAILED_TO_CREATE_SERVER_SOCKET_ON_0_1
-                  .toLocalizedString(new Object[] {bindAdd, Integer.valueOf(this.port)}));
+                  .toLocalizedString(new Object[] {bindAdd, this.port}));
         }
         // ignore as this port might have been used by other threads.
         logger.warn(LocalizedMessage.create(LocalizedStrings.GatewayReceiver_Address_Already_In_Use,
@@ -208,11 +207,6 @@ public class GatewayReceiverImpl implements GatewayReceiver {
           LocalizedStrings.GatewayReceiver_IS_NOT_RUNNING.toLocalizedString());
     }
     receiver.stop();
-
-    // InternalDistributedSystem system = ((GemFireCacheImpl) this.cache)
-    // .getDistributedSystem();
-    // system.handleResourceEvent(ResourceEvent.GATEWAYRECEIVER_STOP, this);
-
   }
 
   public String getHost() {
@@ -237,7 +231,7 @@ public class GatewayReceiverImpl implements GatewayReceiver {
         .append("; maximumTimeBetweenPings=").append(getMaximumTimeBetweenPings())
         .append("; socketBufferSize=").append(getSocketBufferSize()).append("; isManualStart=")
         .append(isManualStart()).append("; group=")
-        .append(Arrays.toString(new String[] {GatewayReceiverImpl.RECEIVER_GROUP})).append("]")
+        .append(Arrays.toString(new String[] {GatewayReceiver.RECEIVER_GROUP})).append("]")
         .toString();
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java
index 8da5613..3eec101 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java
@@ -14,38 +14,35 @@
  */
 package org.apache.geode.internal.cache.wan;
 
-
 import java.io.IOException;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-import org.apache.geode.GemFireIOException;
-import org.apache.geode.internal.cache.tier.sockets.MessageTooLargeException;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.CancelException;
-import org.apache.geode.cache.Cache;
+import org.apache.geode.GemFireIOException;
 import org.apache.geode.cache.RegionDestroyedException;
 import org.apache.geode.cache.client.ServerConnectivityException;
 import org.apache.geode.cache.client.ServerOperationException;
 import org.apache.geode.cache.client.internal.Connection;
+import org.apache.geode.cache.client.internal.SenderProxy;
 import org.apache.geode.cache.client.internal.pooling.ConnectionDestroyedException;
 import org.apache.geode.cache.wan.GatewaySender;
 import org.apache.geode.distributed.internal.ServerLocation;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.UpdateAttributesProcessor;
+import org.apache.geode.internal.cache.tier.sockets.MessageTooLargeException;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
 import org.apache.geode.pdx.PdxRegistryMismatchException;
 import org.apache.geode.security.GemFireSecurityException;
-import org.apache.geode.cache.client.internal.SenderProxy;
 
 /**
  * @since GemFire 7.0
- *
  */
 public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDispatcher {
 
@@ -326,7 +323,7 @@ public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDis
 
     // Here we might wait on a connection to another server if I was secondary
     // so don't start waiting until I am primary
-    Cache cache = this.sender.getCache();
+    InternalCache cache = this.sender.getCache();
     if (cache != null && !cache.isClosed()) {
       if (this.sender.isPrimary() && (this.connection != null)) {
         if (this.ackReaderThread == null || !this.ackReaderThread.isRunning()) {
@@ -551,7 +548,7 @@ public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDis
      */
     private volatile boolean shutdown = false;
 
-    private final GemFireCacheImpl cache;
+    private final InternalCache cache;
 
     private volatile boolean ackReaderThreadRunning = false;
 
@@ -562,7 +559,7 @@ public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDis
     public AckReaderThread(GatewaySender sender, String name) {
       super("AckReaderThread for : " + name);
       this.setDaemon(true);
-      this.cache = (GemFireCacheImpl) ((AbstractGatewaySender) sender).getCache();
+      this.cache = ((AbstractGatewaySender) sender).getCache();
     }
 
     public void waitForRunningAckReaderThreadRunningState() {
@@ -671,13 +668,8 @@ public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDis
         }
         ackReaderThreadRunning = false;
       }
-
     }
 
-    /**
-     * @param exception
-     * 
-     */
     protected void logBatchExceptions(BatchException70 exception) {
       try {
         for (BatchException70 be : exception.getExceptions()) {
@@ -785,7 +777,6 @@ public class GatewaySenderEventRemoteDispatcher implements GatewaySenderEventDis
       } catch (ConnectionDestroyedException e) {
         logger.info("AckReader shutting down and connection already destroyed");
       }
-
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
index 2c7925b..467c622 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
@@ -221,11 +221,6 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
     }
 
     if (this.attrs.isParallel()) {
-      // if(this.attrs.getDispatcherThreads() != 1){
-      // throw new GatewaySenderException(
-      // LocalizedStrings.GatewaySenderImpl_PARALLEL_GATEWAY_SENDER_0_CANNOT_BE_CREATED_WITH_DISPATCHER_THREADS_OTHER_THAN_1
-      // .toLocalizedString(id));
-      // }
       if ((this.attrs.getOrderPolicy() != null)
           && this.attrs.getOrderPolicy().equals(OrderPolicy.THREAD)) {
         throw new GatewaySenderException(
@@ -234,14 +229,14 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
       }
       if (this.cache instanceof GemFireCacheImpl) {
         sender = new ParallelGatewaySenderImpl(this.cache, this.attrs);
-        ((GemFireCacheImpl) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
 
         if (!this.attrs.isManualStart()) {
           sender.start();
         }
       } else if (this.cache instanceof CacheCreation) {
         sender = new ParallelGatewaySenderCreation(this.cache, this.attrs);
-        ((CacheCreation) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
       }
     } else {
       if (this.attrs.getAsyncEventListeners().size() > 0) {
@@ -254,14 +249,14 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
       }
       if (this.cache instanceof GemFireCacheImpl) {
         sender = new SerialGatewaySenderImpl(this.cache, this.attrs);
-        ((GemFireCacheImpl) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
 
         if (!this.attrs.isManualStart()) {
           sender.start();
         }
       } else if (this.cache instanceof CacheCreation) {
         sender = new SerialGatewaySenderCreation(this.cache, this.attrs);
-        ((CacheCreation) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
       }
     }
     return sender;
@@ -287,13 +282,13 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
 
       if (this.cache instanceof GemFireCacheImpl) {
         sender = new ParallelGatewaySenderImpl(this.cache, this.attrs);
-        ((GemFireCacheImpl) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
         if (!this.attrs.isManualStart()) {
           sender.start();
         }
       } else if (this.cache instanceof CacheCreation) {
         sender = new ParallelGatewaySenderCreation(this.cache, this.attrs);
-        ((CacheCreation) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
       }
     } else {
       if (this.attrs.getOrderPolicy() == null && this.attrs.getDispatcherThreads() > 1) {
@@ -301,13 +296,13 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
       }
       if (this.cache instanceof GemFireCacheImpl) {
         sender = new SerialGatewaySenderImpl(this.cache, this.attrs);
-        ((GemFireCacheImpl) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
         if (!this.attrs.isManualStart()) {
           sender.start();
         }
       } else if (this.cache instanceof CacheCreation) {
         sender = new SerialGatewaySenderCreation(this.cache, this.attrs);
-        ((CacheCreation) this.cache).addGatewaySender(sender);
+        this.cache.addGatewaySender(sender);
       }
     }
     return sender;

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
index c2d4673..daeeb6f 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
@@ -18,6 +18,7 @@ import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.EntryOperation;
 import org.apache.geode.cache.asyncqueue.AsyncEventListener;
+import org.apache.geode.cache.wan.GatewayEventFilter;
 import org.apache.geode.cache.wan.GatewayTransportFilter;
 import org.apache.geode.distributed.internal.DistributionAdvisor.Profile;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
@@ -25,7 +26,6 @@ import org.apache.geode.distributed.internal.ResourceEvent;
 import org.apache.geode.internal.cache.DistributedRegion;
 import org.apache.geode.internal.cache.EntryEventImpl;
 import org.apache.geode.internal.cache.EventID;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PartitionedRegionHelper;
 import org.apache.geode.internal.cache.UpdateAttributesProcessor;
@@ -79,7 +79,7 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
 
       // Only notify the type registry if this is a WAN gateway queue
       if (!isAsyncEventQueue()) {
-        ((GemFireCacheImpl) getCache()).getPdxRegistry().gatewaySenderStarted(this);
+        getCache().getPdxRegistry().gatewaySenderStarted(this);
       }
       new UpdateAttributesProcessor(this).distribute(false);
 
@@ -135,11 +135,11 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
 
   @Override
   public String toString() {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     sb.append("ParallelGatewaySender{");
-    sb.append("id=" + getId());
-    sb.append(",remoteDsId=" + getRemoteDSId());
-    sb.append(",isRunning =" + isRunning());
+    sb.append("id=").append(getId());
+    sb.append(",remoteDsId=").append(getRemoteDSId());
+    sb.append(",isRunning =").append(isRunning());
     sb.append("}");
     return sb.toString();
   }
@@ -158,7 +158,7 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
     pf.manualStart = isManualStart();
     pf.dispatcherThreads = getDispatcherThreads();
     pf.orderPolicy = getOrderPolicy();
-    for (org.apache.geode.cache.wan.GatewayEventFilter filter : getGatewayEventFilters()) {
+    for (GatewayEventFilter filter : getGatewayEventFilters()) {
       pf.eventFiltersClassNames.add(filter.getClass().getName());
     }
     for (GatewayTransportFilter filter : getGatewayTransportFilters()) {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
index b300460..fe83d60 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
@@ -26,7 +26,6 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ResourceEvent;
 import org.apache.geode.internal.cache.EntryEventImpl;
 import org.apache.geode.internal.cache.EventID;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.RegionQueue;
 import org.apache.geode.internal.cache.UpdateAttributesProcessor;
@@ -93,7 +92,7 @@ public class SerialGatewaySenderImpl extends AbstractRemoteGatewaySender {
 
       // Only notify the type registry if this is a WAN gateway queue
       if (!isAsyncEventQueue()) {
-        ((GemFireCacheImpl) getCache()).getPdxRegistry().gatewaySenderStarted(this);
+        getCache().getPdxRegistry().gatewaySenderStarted(this);
       }
       new UpdateAttributesProcessor(this).distribute(false);
 
@@ -178,12 +177,12 @@ public class SerialGatewaySenderImpl extends AbstractRemoteGatewaySender {
 
   @Override
   public String toString() {
-    StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     sb.append("SerialGatewaySender{");
-    sb.append("id=" + getId());
-    sb.append(",remoteDsId=" + getRemoteDSId());
-    sb.append(",isRunning =" + isRunning());
-    sb.append(",isPrimary =" + isPrimary());
+    sb.append("id=").append(getId());
+    sb.append(",remoteDsId=").append(getRemoteDSId());
+    sb.append(",isRunning =").append(isRunning());
+    sb.append(",isPrimary =").append(isPrimary());
     sb.append("}");
     return sb.toString();
   }


Mime
View raw message