geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [08/49] geode git commit: GEODE-2632: change dependencies on GemFireCacheImpl to InternalCache
Date Tue, 09 May 2017 18:17:39 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/WanCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/WanCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/WanCommands.java
index cd8f6eb..feeb353 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/WanCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/WanCommands.java
@@ -14,10 +14,30 @@
  */
 package org.apache.geode.management.internal.cli.commands;
 
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.CacheFactory;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.management.ObjectName;
+
+import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.DistributedSystemMXBean;
 import org.apache.geode.management.GatewayReceiverMXBean;
 import org.apache.geode.management.GatewaySenderMXBean;
@@ -45,27 +65,9 @@ import org.apache.geode.management.internal.configuration.domain.XmlEntity;
 import org.apache.geode.management.internal.security.ResourceOperation;
 import org.apache.geode.security.ResourcePermission.Operation;
 import org.apache.geode.security.ResourcePermission.Resource;
-import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
-import org.springframework.shell.core.annotation.CliCommand;
-import org.springframework.shell.core.annotation.CliOption;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
-import javax.management.ObjectName;
 
 public class WanCommands extends AbstractCommandsSupport {
+
   @CliCommand(value = CliStrings.CREATE_GATEWAYSENDER, help = CliStrings.CREATE_GATEWAYSENDER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
   @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
@@ -198,7 +200,7 @@ public class WanCommands extends AbstractCommandsSupport {
     final String id = senderId.trim();
 
     try {
-      final Cache cache = CacheFactory.getAnyInstance();
+      final InternalCache cache = getCache();
       final SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
@@ -317,24 +319,17 @@ public class WanCommands extends AbstractCommandsSupport {
           help = CliStrings.PAUSE_GATEWAYSENDER__MEMBER__HELP) String onMember) {
 
     Result result = null;
-    if (senderId != null)
+    if (senderId != null) {
       senderId = senderId.trim();
-    // if (memberNameOrId != null)
-    // memberNameOrId = memberNameOrId.trim();
-    //
-    // if (memberNameOrId != null && onGroup != null) {
-    // return ResultBuilder
-    // .createUserErrorResult(CliStrings.GATEWAY__MSG__OPTIONS);
-    // }
+    }
 
     try {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
       GatewaySenderMXBean bean = null;
 
-
       TabularResultData resultData = ResultBuilder.createTabularResultData();
       Set<DistributedMember> dsMembers = null;
 
@@ -394,79 +389,20 @@ public class WanCommands extends AbstractCommandsSupport {
           help = CliStrings.RESUME_GATEWAYSENDER__MEMBER__HELP) String onMember) {
 
     Result result = null;
-    if (senderId != null)
+    if (senderId != null) {
       senderId = senderId.trim();
-    // if (memberNameOrId != null)
-    // memberNameOrId = memberNameOrId.trim();
-    //
-    // if (memberNameOrId != null && onGroup != null) {
-    // return ResultBuilder
-    // .createUserErrorResult(CliStrings.GATEWAY__MSG__OPTIONS);
-    // }
+    }
 
     try {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-
       GatewaySenderMXBean bean = null;
-      //
-      // if (memberNameOrId != null && memberNameOrId.length() > 0) {
-      // InfoResultData resultData = ResultBuilder.createInfoResultData();
-      // DistributedMember memberToBeInvoked = CliUtil
-      // .getDistributedMemberByNameOrId(memberNameOrId);
-      //
-      // if (memberToBeInvoked != null) {
-      // String memberId = memberToBeInvoked.getId();
-      // if (cache.getDistributedSystem().getDistributedMember().getId()
-      // .equals(memberId)) {
-      // bean = service.getLocalGatewaySenderMXBean(senderId);
-      // } else {
-      // ObjectName objectName = service.getGatewaySenderMBeanName(memberToBeInvoked,
-      // senderId);
-      // bean = service.getMBeanProxy(objectName, GatewaySenderMXBean.class);
-      // }
-      // if (bean != null) {
-      // if (bean.isRunning()) {
-      // if (bean.isPaused()) {
-      // bean.resume();
-      // resultData.addLine(CliStrings.format(
-      // CliStrings.GATEWAY_SENDER_0_IS_RESUMED_ON_MEMBER_1,
-      // new Object[] { senderId, memberId }));
-      // return ResultBuilder.buildResult(resultData);
-      // }
-      // resultData.addLine(CliStrings.format(
-      // CliStrings.GATEWAY_SENDER_0_IS_NOT_PAUSED_ON_MEMBER_1,
-      // new Object[] { senderId, memberId }));
-      // return ResultBuilder.buildResult(resultData);
-      // }
-      // resultData.addLine(CliStrings.format(
-      // CliStrings.GATEWAY_SENDER_0_IS_NOT_RUNNING_ON_MEMBER_1,
-      // new Object[] { senderId, memberId }));
-      // return ResultBuilder.buildResult(resultData);
-      // }
-      // return ResultBuilder.createBadConfigurationErrorResult(CliStrings
-      // .format(CliStrings.GATEWAY_SENDER_0_IS_NOT_AVAILABLE_ON_MEMBER_1,
-      // new Object[] { senderId, memberId }));
-      // }
-      // return ResultBuilder.createUserErrorResult(CliStrings.format(
-      // CliStrings.GATEWAY_MSG_MEMBER_0_NOT_FOUND,
-      // new Object[] { memberNameOrId }));
-      // }
 
       TabularResultData resultData = ResultBuilder.createTabularResultData();
-      Set<DistributedMember> dsMembers = null;
-      // if (onGroup != null && onGroup.length > 0) {
-      // dsMembers = CliUtil.getDistributedMembersByGroup(cache, onGroup);
-      // } else {
-      // dsMembers = CliUtil.getAllNormalMembers(cache);
-      // }
-      // if (dsMembers.isEmpty()) {
-      // return ResultBuilder
-      // .createUserErrorResult(CliStrings.GATEWAY_MSG_MEMBERS_NOT_FOUND);
-      // }
-      dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
+
+      Set<DistributedMember> dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
       for (DistributedMember member : dsMembers) {
         if (cache.getDistributedSystem().getDistributedMember().getId().equals(member.getId())) {
           bean = service.getLocalGatewaySenderMXBean(senderId);
@@ -527,14 +463,12 @@ public class WanCommands extends AbstractCommandsSupport {
       senderId = senderId.trim();
 
     try {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-
       GatewaySenderMXBean bean = null;
 
-
       TabularResultData resultData = ResultBuilder.createTabularResultData();
       Set<DistributedMember> dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
 
@@ -668,7 +602,7 @@ public class WanCommands extends AbstractCommandsSupport {
     }
 
     try {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
       TabularResultData resultData = ResultBuilder.createTabularResultData();
@@ -726,9 +660,8 @@ public class WanCommands extends AbstractCommandsSupport {
           help = CliStrings.START_GATEWAYRECEIVER__MEMBER__HELP) String onMember) {
     Result result = null;
 
-
     try {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
@@ -791,14 +724,12 @@ public class WanCommands extends AbstractCommandsSupport {
     Result result = null;
 
     try {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-
       GatewayReceiverMXBean receieverBean = null;
 
-
       TabularResultData resultData = ResultBuilder.createTabularResultData();
       Set<DistributedMember> dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
 
@@ -850,22 +781,12 @@ public class WanCommands extends AbstractCommandsSupport {
           help = CliStrings.LIST_GATEWAY__GROUP__HELP) String onGroup) {
 
     Result result = null;
-    Cache cache = CacheFactory.getAnyInstance();
+    InternalCache cache = getCache();
     try {
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-      Set<DistributedMember> dsMembers = null;
-      // if (onGroup != null && onGroup.length > 0) {
-      // dsMembers = CliUtil.getDistributedMembersByGroup(cache, onGroup);
-      // } else {
-      // dsMembers = CliUtil.getAllNormalMembers(cache);
-      // }
-      // if (dsMembers.isEmpty()) {
-      // return ResultBuilder
-      // .createUserErrorResult(CliStrings.GATEWAY_MSG_MEMBERS_NOT_FOUND);
-      // }
-      dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
+      Set<DistributedMember> dsMembers = CliUtil.findMembersOrThrow(onGroup, onMember);
 
       Map<String, Map<String, GatewaySenderMXBean>> gatewaySenderBeans =
           new TreeMap<String, Map<String, GatewaySenderMXBean>>();
@@ -945,13 +866,12 @@ public class WanCommands extends AbstractCommandsSupport {
     if (senderId != null)
       senderId = senderId.trim();
     try {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
       GatewaySenderMXBean bean = null;
 
-
       CompositeResultData crd = ResultBuilder.createCompositeResultData();
       TabularResultData availableSenderData =
           crd.addSection(CliStrings.SECTION_GATEWAY_SENDER_AVAILABLE)
@@ -1001,11 +921,10 @@ public class WanCommands extends AbstractCommandsSupport {
     Result result = null;
 
     try {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
       SystemManagementService service =
           (SystemManagementService) ManagementService.getExistingManagementService(cache);
 
-
       CompositeResultData crd = ResultBuilder.createCompositeResultData();
       TabularResultData availableReceiverData =
           crd.addSection(CliStrings.SECTION_GATEWAY_RECEIVER_AVAILABLE)
@@ -1039,7 +958,6 @@ public class WanCommands extends AbstractCommandsSupport {
     return result;
   }
 
-
   @CliCommand(value = CliStrings.DESTROY_GATEWAYSENDER,
       help = CliStrings.DESTROY_GATEWAYSENDER__HELP)
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_WAN)
@@ -1128,18 +1046,6 @@ public class WanCommands extends AbstractCommandsSupport {
     return resultData;
   }
 
-  // CliStrings.format(
-  // CliStrings.GATEWAY_SENDER_0_IS_STARTED_ON_MEMBER_1,
-  // new Object[] {senderId, memberId });
-  //
-  // CliStrings.format(
-  // CliStrings.GATEWAY_SENDER_0_IS_ALREADY_STARTED_ON_MEMBER_1,
-  // new Object[] {senderId, memberId });
-  //
-  // CliStrings.format(
-  // CliStrings.GATEWAY_SENDER_0_IS_NOT_AVAILABLE_ON_MEMBER_1,
-  // new Object[] {senderId, memberId });
-
   private void accumulateListGatewayResult(CompositeResultData crd,
       Map<String, Map<String, GatewaySenderMXBean>> gatewaySenderBeans,
       Map<String, GatewayReceiverMXBean> gatewayReceiverBeans) {
@@ -1179,7 +1085,6 @@ public class WanCommands extends AbstractCommandsSupport {
             entry.getValue().getConnectedGatewaySenders());
       }
     }
-
   }
 
   private void accumulateStartResult(TabularResultData resultData, String member, String Status,

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/AlterRuntimeConfigFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/AlterRuntimeConfigFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/AlterRuntimeConfigFunction.java
index 62b3226..1d3e5f5 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/AlterRuntimeConfigFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/AlterRuntimeConfigFunction.java
@@ -14,7 +14,10 @@
  */
 package org.apache.geode.management.internal.cli.functions;
 
-import org.apache.geode.cache.Cache;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.execute.FunctionAdapter;
@@ -22,31 +25,26 @@ import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.internal.ConfigSource;
 import org.apache.geode.internal.InternalEntity;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.internal.cli.CliUtil;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
 
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-/****
- * 
- *
- */
 public class AlterRuntimeConfigFunction extends FunctionAdapter implements InternalEntity {
 
   private static final long serialVersionUID = 1L;
 
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
   @Override
   public void execute(FunctionContext context) {
     String memberId = "";
 
     try {
       Object arg = context.getArguments();
-      Cache trueCache = null;
-      GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
-      DistributionConfig config = cache.getSystem().getConfig();
+      InternalCache cache = getCache();
+      DistributionConfig config = cache.getInternalDistributedSystem().getConfig();
       memberId = cache.getDistributedSystem().getDistributedMember().getId();
 
       Map<String, String> runtimeAttributes = (Map<String, String>) arg;

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContunuousQueryFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContunuousQueryFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContunuousQueryFunction.java
index 816f76a..8cd67a0 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContunuousQueryFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ContunuousQueryFunction.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.cli.functions;
 
 import java.io.Serializable;
@@ -23,29 +22,32 @@ import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.internal.InternalEntity;
 import org.apache.geode.internal.cache.CacheServerImpl;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.tier.sockets.AcceptorImpl;
 import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier;
 import org.apache.geode.internal.cache.tier.sockets.CacheClientProxy;
 import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
 import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
 
-
-
 /**
+ * TODO: rename ContunuousQueryFunction
  * 
  * @since GemFire 8.0
  */
-
 public class ContunuousQueryFunction implements Function, InternalEntity {
-  public static final String ID = ContunuousQueryFunction.class.getName();
   private static final long serialVersionUID = 1L;
 
+  public static final String ID = ContunuousQueryFunction.class.getName();
+
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
   @Override
   public void execute(FunctionContext context) {
     try {
       String clientID = (String) context.getArguments();
-      GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
       if (cache.getCacheServers().size() > 0) {
         CacheServerImpl server = (CacheServerImpl) cache.getCacheServers().iterator().next();
         if (server != null) {
@@ -105,13 +107,11 @@ public class ContunuousQueryFunction implements Function, InternalEntity {
           .lastResult("Exception in ContunuousQueryFunction =" + e.getMessage());
     }
     context.getResultSender().lastResult(null);
-
   }
 
   @Override
   public String getId() {
     return ContunuousQueryFunction.ID;
-
   }
 
   @Override
@@ -129,14 +129,12 @@ public class ContunuousQueryFunction implements Function, InternalEntity {
     return false;
   }
 
-  public class ClientInfo implements Serializable {
+  public static class ClientInfo implements Serializable {
     private static final long serialVersionUID = 1L;
     public String isDurable;
     public String primaryServer;
     public String secondaryServer;
 
-
-
     public ClientInfo(String IsClientDurable, String primaryServerId, String secondaryServerId) {
       isDurable = IsClientDurable;
       primaryServer = primaryServerId;
@@ -148,8 +146,5 @@ public class ContunuousQueryFunction implements Function, InternalEntity {
       return "ClientInfo [isDurable=" + isDurable + ", primaryServer=" + primaryServer
           + ", secondaryServer=" + secondaryServer + "]";
     }
-
-
   }
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateAsyncEventQueueFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateAsyncEventQueueFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateAsyncEventQueueFunction.java
index 8bd603b..aab19be 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateAsyncEventQueueFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateAsyncEventQueueFunction.java
@@ -14,16 +14,11 @@
  */
 package org.apache.geode.management.internal.cli.functions;
 
-/**
- * Function used by the 'create async-event-queue' gfsh command to create an asynchronous event
- * queue on a member.
- * 
- * @since GemFire 8.0
- */
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
+import joptsimple.internal.Strings;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.SystemFailure;
@@ -34,25 +29,34 @@ import org.apache.geode.cache.asyncqueue.AsyncEventListener;
 import org.apache.geode.cache.asyncqueue.AsyncEventQueueFactory;
 import org.apache.geode.cache.execute.FunctionAdapter;
 import org.apache.geode.cache.execute.FunctionContext;
-import org.apache.geode.cache.wan.GatewaySender.OrderPolicy;
 import org.apache.geode.cache.wan.GatewayEventFilter;
 import org.apache.geode.cache.wan.GatewayEventSubstitutionFilter;
+import org.apache.geode.cache.wan.GatewaySender.OrderPolicy;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.ClassPathLoader;
 import org.apache.geode.internal.InternalDataSerializer;
 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.cache.xmlcache.CacheXml;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.management.internal.configuration.domain.XmlEntity;
-import joptsimple.internal.Strings;
 
+/**
+ * Function used by the 'create async-event-queue' gfsh command to create an asynchronous event
+ * queue on a member.
+ *
+ * @since GemFire 8.0
+ */
 public class CreateAsyncEventQueueFunction extends FunctionAdapter implements InternalEntity {
   private static final Logger logger = LogService.getLogger();
 
   private static final long serialVersionUID = 1L;
 
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
   @SuppressWarnings("deprecation")
   @Override
   public void execute(FunctionContext context) {
@@ -62,7 +66,7 @@ public class CreateAsyncEventQueueFunction extends FunctionAdapter implements In
     try {
       AsyncEventQueueFunctionArgs aeqArgs = (AsyncEventQueueFunctionArgs) context.getArguments();
 
-      GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
 
       DistributedMember member = cache.getDistributedSystem().getDistributedMember();
 

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateDiskStoreFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateDiskStoreFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateDiskStoreFunction.java
index 944044b..3b4679c 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateDiskStoreFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/CreateDiskStoreFunction.java
@@ -19,9 +19,9 @@ package org.apache.geode.management.internal.cli.functions;
  * 
  * @since GemFire 8.0
  */
+
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.LogWriter;
 import org.apache.geode.SystemFailure;
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.CacheFactory;
@@ -31,7 +31,7 @@ import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.InternalEntity;
 import org.apache.geode.internal.cache.DiskStoreAttributes;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.xmlcache.CacheXml;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.management.internal.configuration.domain.XmlEntity;
@@ -41,6 +41,10 @@ public class CreateDiskStoreFunction extends FunctionAdapter implements Internal
 
   private static final long serialVersionUID = 1L;
 
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
   @Override
   public void execute(FunctionContext context) {
     // Declared here so that it's available when returning a Throwable
@@ -50,7 +54,7 @@ public class CreateDiskStoreFunction extends FunctionAdapter implements Internal
       final String diskStoreName = (String) args[0];
       final DiskStoreAttributes diskStoreAttrs = (DiskStoreAttributes) args[01];
 
-      GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
 
       DistributedMember member = cache.getDistributedSystem().getDistributedMember();
 

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DataCommandFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DataCommandFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DataCommandFunction.java
index bb77466..1ad5eeb 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DataCommandFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DataCommandFunction.java
@@ -30,7 +30,6 @@ import org.apache.logging.log4j.Logger;
 import org.apache.shiro.subject.Subject;
 import org.json.JSONArray;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.DataPolicy;
@@ -59,6 +58,7 @@ import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.ClassPathLoader;
 import org.apache.geode.internal.InternalEntity;
 import org.apache.geode.internal.NanoTimer;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.security.SecurityService;
@@ -88,6 +88,7 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
   private static final Logger logger = LogService.getLogger();
 
   private static final long serialVersionUID = 1L;
+
   private boolean optimizeForWrite = false;
 
   protected static final String SELECT_STEP_DISPLAY = "SELECT_DISPLAY";
@@ -105,7 +106,6 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
   }
 
   @Override
-
   public boolean hasResult() {
     return true;
   }
@@ -116,15 +116,14 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
     return false;
   }
 
-  @Override
   /**
    * Read only function
    */
+  @Override
   public boolean optimizeForWrite() {
     return optimizeForWrite;
   }
 
-
   public void setOptimizeForWrite(boolean optimizeForWrite) {
     this.optimizeForWrite = optimizeForWrite;
   }
@@ -132,7 +131,7 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
   @Override
   public void execute(FunctionContext functionContext) {
     try {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
       DataCommandRequest request = (DataCommandRequest) functionContext.getArguments();
       if (logger.isDebugEnabled()) {
         logger.debug("Executing function : \n{}\n on member {}", request,
@@ -162,7 +161,9 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
     }
   }
 
-
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
 
   public DataCommandResult remove(DataCommandRequest request) {
     String key = request.getKey();
@@ -190,7 +191,6 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
     return locateEntry(key, keyClass, valueClass, regionName, recursive);
   }
 
-
   public DataCommandResult put(DataCommandRequest request) {
     String key = request.getKey();
     String value = request.getValue();
@@ -223,8 +223,7 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
 
   @SuppressWarnings("rawtypes")
   private DataCommandResult select(Object principal, String queryString) {
-
-    Cache cache = CacheFactory.getAnyInstance();
+    InternalCache cache = getCache();
     AtomicInteger nestedObjectCount = new AtomicInteger(0);
     if (queryString != null && !queryString.isEmpty()) {
       QueryService qs = cache.getQueryService();
@@ -362,7 +361,6 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
         if (JsonUtil.isPrimitiveOrWrapper(value.getClass())) {
           jsonObject.put(fields[i], value);
         } else {
-          // jsonObject.put(fields[i], value.getClass().getCanonicalName());
           jsonObject.put(fields[i], toJson(value));
         }
       } else {
@@ -376,7 +374,7 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
   public DataCommandResult remove(String key, String keyClass, String regionName,
       String removeAllKeys) {
 
-    Cache cache = CacheFactory.getAnyInstance();
+    InternalCache cache = getCache();
 
     if (regionName == null || regionName.isEmpty()) {
       return DataCommandResult.createRemoveResult(key, null, null,
@@ -441,7 +439,7 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
   public DataCommandResult get(Object principal, String key, String keyClass, String valueClass,
       String regionName, Boolean loadOnCacheMiss) {
 
-    Cache cache = CacheFactory.getAnyInstance();
+    InternalCache cache = getCache();
 
     if (regionName == null || regionName.isEmpty()) {
       return DataCommandResult.createGetResult(key, null, null,
@@ -474,8 +472,6 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
 
       // TODO determine whether the following conditional logic (assigned to 'doGet') is safer or
       // necessary
-      // boolean doGet = (Boolean.TRUE.equals(loadOnCacheMiss) &&
-      // region.getAttributes().getCacheLoader() != null);
       boolean doGet = Boolean.TRUE.equals(loadOnCacheMiss);
 
       if (doGet || region.containsKey(keyObject)) {
@@ -512,7 +508,7 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
   public DataCommandResult locateEntry(String key, String keyClass, String valueClass,
       String regionPath, boolean recursive) {
 
-    Cache cache = CacheFactory.getAnyInstance();
+    InternalCache cache = getCache();
 
     if (regionPath == null || regionPath.isEmpty()) {
       return DataCommandResult.createLocateEntryResult(key, null, null,
@@ -617,7 +613,6 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
       return DataCommandResult.createLocateEntryInfoResult(key, null, null,
           CliStrings.LOCATE_ENTRY__MSG__KEY_NOT_FOUND_REGION, false);
     }
-
   }
 
   @SuppressWarnings({"rawtypes"})
@@ -639,7 +634,7 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
           false);
     }
 
-    Cache cache = CacheFactory.getAnyInstance();
+    InternalCache cache = getCache();
     Region region = cache.getRegion(regionName);
     if (region == null) {
       return DataCommandResult.createPutResult(key, null, null,
@@ -812,8 +807,6 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
     return v;
   }
 
-
-  // Copied from RegionUtil of old Gfsh
   /**
    * Returns a sorted list of all region full paths found in the specified cache.
    * 
@@ -822,7 +815,7 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
    * @return Returns a sorted list of all region paths defined in the distributed system.
    */
   @SuppressWarnings({"rawtypes", "unchecked"})
-  public static List getAllRegionPaths(Cache cache, boolean recursive) {
+  public static List getAllRegionPaths(InternalCache cache, boolean recursive) {
     ArrayList list = new ArrayList();
     if (cache == null) {
       return list;
@@ -908,7 +901,6 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
     }
   }
 
-
   public static class SelectMoveStep extends CLIMultiStepHelper.RemoteStep {
 
     private static final long serialVersionUID = 1L;
@@ -932,8 +924,11 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
 
     private static SecurityService securityService = SecurityService.getSecurityService();
 
-    public SelectExecStep(Object[] arguments) {
+    private final InternalCache cache;
+
+    public SelectExecStep(Object[] arguments, final InternalCache cache) {
       super(SELECT_STEP_EXEC, arguments);
+      this.cache = cache;
     }
 
     @Override
@@ -956,13 +951,8 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
             SELECT_STEP_END);
     }
 
-    /*
-     * private int getLimit(CompiledValue compiledQuery) { return compiledQuery instanceof
-     * CompiledSelect ? ((CompiledSelect)compiledQuery).getLimitValue(): -1; }
-     */
-
     public DataCommandResult _select(String query) {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = (InternalCache) CacheFactory.getAnyInstance();
       DataCommandResult dataResult = null;
 
       if (query == null || query.isEmpty()) {
@@ -971,7 +961,6 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
         return dataResult;
       }
 
-      // String query = querySB.toString().trim();
       Object array[] = DataCommands.replaceGfshEnvVar(query, CommandExecutionContext.getShellEnv());
       query = (String) array[1];
       query = addLimit(query);
@@ -1080,7 +1069,6 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
     return CommandExecutionContext.getShellFetchSize();
   }
 
-
   public static String getLogMessage(QueryObserver observer, long startTime, String query) {
     String usedIndexesString = null;
     String rowCountString = null;
@@ -1114,13 +1102,9 @@ public class DataCommandFunction extends FunctionAdapter implements InternalEnti
           + observer.getClass().getName() + ")";
     }
 
-    /*
-     * if (resultSize != -1){ rowCountString = " rowCount = " + resultSize + ";"; }
-     */
     return "Query Executed" + (startTime > 0L ? " in " + time + " ms;" : ";")
         + (rowCountString != null ? rowCountString : "")
-        + (usedIndexesString != null ? usedIndexesString : "")
-    /* + " \"" + query + "\"" */;
+        + (usedIndexesString != null ? usedIndexesString : "");
   }
 
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DeployFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DeployFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DeployFunction.java
index 421f9d7..f1b1cd6 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DeployFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DeployFunction.java
@@ -15,23 +15,21 @@
 package org.apache.geode.management.internal.cli.functions;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
 
-import org.apache.geode.internal.ClassPathLoader;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.SystemFailure;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.InternalEntity;
+import org.apache.geode.internal.ClassPathLoader;
 import org.apache.geode.internal.DeployedJar;
+import org.apache.geode.internal.InternalEntity;
 import org.apache.geode.internal.JarDeployer;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 
 public class DeployFunction implements Function, InternalEntity {
@@ -41,6 +39,10 @@ public class DeployFunction implements Function, InternalEntity {
 
   private static final long serialVersionUID = 1L;
 
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
   @Override
   public void execute(FunctionContext context) {
     // Declared here so that it's available when returning a Throwable
@@ -50,10 +52,10 @@ public class DeployFunction implements Function, InternalEntity {
       final Object[] args = (Object[]) context.getArguments();
       final String[] jarFilenames = (String[]) args[0];
       final byte[][] jarBytes = (byte[][]) args[1];
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
 
-      final JarDeployer jarDeployer = new JarDeployer(((GemFireCacheImpl) cache)
-          .getInternalDistributedSystem().getConfig().getDeployWorkingDir());
+      final JarDeployer jarDeployer =
+          new JarDeployer(cache.getInternalDistributedSystem().getConfig().getDeployWorkingDir());
 
       DistributedMember member = cache.getDistributedSystem().getDistributedMember();
 

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DestroyDiskStoreFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DestroyDiskStoreFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DestroyDiskStoreFunction.java
index 84dde7f..c25a534 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DestroyDiskStoreFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DestroyDiskStoreFunction.java
@@ -24,7 +24,7 @@ import org.apache.geode.cache.execute.FunctionAdapter;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.distributed.DistributedMember;
 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.cache.xmlcache.CacheXml;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.management.internal.configuration.domain.XmlEntity;
@@ -34,12 +34,15 @@ import org.apache.geode.management.internal.configuration.domain.XmlEntity;
  * 
  * @since GemFire 8.0
  */
-
 public class DestroyDiskStoreFunction extends FunctionAdapter implements InternalEntity {
   private static final Logger logger = LogService.getLogger();
 
   private static final long serialVersionUID = 1L;
 
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
   @Override
   public void execute(FunctionContext context) {
     // Declared here so that it's available when returning a Throwable
@@ -49,7 +52,7 @@ public class DestroyDiskStoreFunction extends FunctionAdapter implements Interna
       final Object[] args = (Object[]) context.getArguments();
       final String diskStoreName = (String) args[0];
 
-      GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
 
       DistributedMember member = cache.getDistributedSystem().getDistributedMember();
 

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunction.java
index fd5d6a4..663a08e 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunction.java
@@ -15,7 +15,21 @@
  */
 package org.apache.geode.management.internal.cli.functions;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.Serializable;
+import java.nio.file.Path;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.Arrays;
+
 import org.apache.commons.lang.StringUtils;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Logger;
+
 import org.apache.geode.cache.AttributesFactory;
 import org.apache.geode.cache.DataPolicy;
 import org.apache.geode.cache.Region;
@@ -25,27 +39,15 @@ import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.distributed.internal.DistributionConfig;
 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.cache.InternalRegionArguments;
 import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LogLevel;
 import org.apache.geode.management.internal.cli.commands.ExportLogsCommand;
 import org.apache.geode.management.internal.cli.util.ExportLogsCacheWriter;
 import org.apache.geode.management.internal.cli.util.LogExporter;
 import org.apache.geode.management.internal.cli.util.LogFilter;
-import org.apache.geode.internal.logging.log4j.LogLevel;
 import org.apache.geode.management.internal.configuration.domain.Configuration;
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.Serializable;
-import java.nio.file.Path;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
-import java.util.Arrays;
 
 /**
  * this function extracts the logs using a LogExporter which creates a zip file, and then writes the
@@ -55,21 +57,21 @@ import java.util.Arrays;
  * The function only extracts .log and .gfs files under server's working directory
  */
 public class ExportLogsFunction implements Function, InternalEntity {
+  private static final Logger logger = LogService.getLogger();
 
   public static final String EXPORT_LOGS_REGION = "__exportLogsRegion";
 
-  private static final Logger LOGGER = LogService.getLogger();
   private static final long serialVersionUID = 1L;
   private static final int BUFFER_SIZE = 1024;
 
   @Override
   public void execute(final FunctionContext context) {
     try {
-      GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+      InternalCache cache = GemFireCacheImpl.getInstance();
       DistributionConfig config = cache.getInternalDistributedSystem().getConfig();
 
       String memberId = cache.getDistributedSystem().getMemberId();
-      LOGGER.info("ExportLogsFunction started for member {}", memberId);
+      logger.info("ExportLogsFunction started for member {}", memberId);
 
       Region exportLogsRegion = createOrGetExistingExportLogsRegion(false, cache);
 
@@ -95,7 +97,7 @@ public class ExportLogsFunction implements Function, InternalEntity {
         return;
       }
 
-      LOGGER.info("Streaming zipped file: " + exportedZipFile.toString());
+      logger.info("Streaming zipped file: " + exportedZipFile.toString());
       try (FileInputStream inputStream = new FileInputStream(exportedZipFile.toFile())) {
         byte[] buffer = new byte[BUFFER_SIZE];
 
@@ -113,13 +115,13 @@ public class ExportLogsFunction implements Function, InternalEntity {
 
     } catch (Exception e) {
       e.printStackTrace();
-      LOGGER.error(e);
+      logger.error(e);
       context.getResultSender().sendException(e);
     }
   }
 
   public static Region createOrGetExistingExportLogsRegion(boolean isInitiatingMember,
-      GemFireCacheImpl cache) throws IOException, ClassNotFoundException {
+      InternalCache cache) throws IOException, ClassNotFoundException {
 
     Region exportLogsRegion = cache.getRegion(EXPORT_LOGS_REGION);
     if (exportLogsRegion == null) {
@@ -140,8 +142,7 @@ public class ExportLogsFunction implements Function, InternalEntity {
     return exportLogsRegion;
   }
 
-  public static void destroyExportLogsRegion(GemFireCacheImpl cache) {
-
+  public static void destroyExportLogsRegion(InternalCache cache) {
     Region exportLogsRegion = cache.getRegion(EXPORT_LOGS_REGION);
     if (exportLogsRegion == null) {
       return;

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/FetchSharedConfigurationStatusFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/FetchSharedConfigurationStatusFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/FetchSharedConfigurationStatusFunction.java
index ff65471..57d209b 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/FetchSharedConfigurationStatusFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/FetchSharedConfigurationStatusFunction.java
@@ -20,6 +20,7 @@ import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.internal.InternalLocator;
 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.lang.StringUtils;
 import org.apache.geode.management.internal.configuration.domain.SharedConfigurationStatus;
 
@@ -31,7 +32,7 @@ public class FetchSharedConfigurationStatusFunction extends FunctionAdapter
   @Override
   public void execute(FunctionContext context) {
     InternalLocator locator = InternalLocator.getLocator();
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+    InternalCache cache = GemFireCacheImpl.getInstance();
     DistributedMember member = cache.getDistributedSystem().getDistributedMember();
     SharedConfigurationStatus status = locator.getSharedConfigurationStatus().getStatus();
 

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ListDeployedFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ListDeployedFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ListDeployedFunction.java
index 3d6a321..88a77be 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ListDeployedFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ListDeployedFunction.java
@@ -21,7 +21,6 @@ import org.apache.geode.internal.DeployedJar;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.SystemFailure;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.execute.Function;
@@ -29,7 +28,7 @@ import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.InternalEntity;
 import org.apache.geode.internal.JarDeployer;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 
 public class ListDeployedFunction implements Function, InternalEntity {
@@ -39,13 +38,17 @@ public class ListDeployedFunction implements Function, InternalEntity {
 
   private static final long serialVersionUID = 1L;
 
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
   @Override
   public void execute(FunctionContext context) {
     // Declared here so that it's available when returning a Throwable
     String memberId = "";
 
     try {
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
       final JarDeployer jarDeployer = ClassPathLoader.getLatest().getJarDeployer();
 
       DistributedMember member = cache.getDistributedSystem().getDistributedMember();

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ShowMissingDiskStoresFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ShowMissingDiskStoresFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ShowMissingDiskStoresFunction.java
index 441486e..ca66b6a 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ShowMissingDiskStoresFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ShowMissingDiskStoresFunction.java
@@ -19,8 +19,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.execute.FunctionAdapter;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.distributed.DistributedMember;
@@ -62,7 +60,7 @@ public class ShowMissingDiskStoresFunction extends FunctionAdapter implements In
           }
         }
         // Missing colocated regions
-        Set<PartitionedRegion> prs = ((GemFireCacheImpl) cache).getPartitionedRegions();
+        Set<PartitionedRegion> prs = cache.getPartitionedRegions();
         for (PartitionedRegion pr : prs) {
           List<String> missingChildRegions = pr.getMissingColocatedChildren();
           for (String child : missingChildRegions) {
@@ -96,4 +94,3 @@ public class ShowMissingDiskStoresFunction extends FunctionAdapter implements In
     return getClass().getName();
   }
 }
-

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/SizeExportLogsFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/SizeExportLogsFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/SizeExportLogsFunction.java
index 06af662..8d20dc0 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/SizeExportLogsFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/SizeExportLogsFunction.java
@@ -14,36 +14,32 @@
  */
 package org.apache.geode.management.internal.cli.functions;
 
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.CacheFactory;
+import java.io.File;
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.Arrays;
+
+import org.apache.logging.log4j.Logger;
+
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.internal.DistributionConfig;
 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.internal.cli.util.LogFilter;
 import org.apache.geode.management.internal.cli.util.LogSizer;
-import org.apache.logging.log4j.Logger;
-
-import java.io.File;
-import java.io.IOException;
-import java.text.ParseException;
-import java.util.Arrays;
 
 public class SizeExportLogsFunction extends ExportLogsFunction implements Function, InternalEntity {
   private static final Logger LOGGER = LogService.getLogger();
   private static final long serialVersionUID = 1L;
 
-  protected Cache getCache() {
-    return CacheFactory.getAnyInstance();
-  }
-
   @Override
   public void execute(final FunctionContext context) {
     try {
-      GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+      InternalCache cache = GemFireCacheImpl.getInstance();
       DistributionConfig config = cache.getInternalDistributedSystem().getConfig();
       Args args = (Args) context.getArguments();
       long diskAvailable = config.getLogFile().getUsableSpace();

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UndeployFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UndeployFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UndeployFunction.java
index 14d875e..64ed367 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UndeployFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UndeployFunction.java
@@ -22,7 +22,6 @@ import org.apache.geode.internal.ClassPathLoader;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.SystemFailure;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.execute.Function;
@@ -31,7 +30,7 @@ import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.InternalEntity;
 import org.apache.geode.internal.DeployedJar;
 import org.apache.geode.internal.JarDeployer;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 
 public class UndeployFunction implements Function, InternalEntity {
@@ -41,6 +40,10 @@ public class UndeployFunction implements Function, InternalEntity {
 
   private static final long serialVersionUID = 1L;
 
+  private InternalCache getCache() {
+    return (InternalCache) CacheFactory.getAnyInstance();
+  }
+
   @Override
   public void execute(FunctionContext context) {
     // Declared here so that it's available when returning a Throwable
@@ -49,7 +52,7 @@ public class UndeployFunction implements Function, InternalEntity {
     try {
       final Object[] args = (Object[]) context.getArguments();
       final String jarFilenameList = (String) args[0]; // Comma separated
-      Cache cache = CacheFactory.getAnyInstance();
+      InternalCache cache = getCache();
 
       final JarDeployer jarDeployer = ClassPathLoader.getLatest().getJarDeployer();
 

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/configuration/domain/SharedConfigurationStatus.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/domain/SharedConfigurationStatus.java b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/domain/SharedConfigurationStatus.java
index fb687c8..3f93b6c 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/domain/SharedConfigurationStatus.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/domain/SharedConfigurationStatus.java
@@ -14,10 +14,6 @@
  */
 package org.apache.geode.management.internal.configuration.domain;
 
-/***
- * 
- *
- */
 public enum SharedConfigurationStatus {
   NOT_STARTED, STARTED, RUNNING, STOPPED, WAITING, UNDETERMINED
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/configuration/functions/GetRegionNamesFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/functions/GetRegionNamesFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/functions/GetRegionNamesFunction.java
index 0fd8876..bd942c7 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/functions/GetRegionNamesFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/functions/GetRegionNamesFunction.java
@@ -20,6 +20,7 @@ import org.apache.geode.cache.execute.Function;
 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.cache.LocalRegion;
 
 import java.util.Set;
@@ -27,7 +28,7 @@ import java.util.Set;
 public class GetRegionNamesFunction implements Function, InternalEntity {
   @Override
   public void execute(FunctionContext context) {
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+    InternalCache cache = GemFireCacheImpl.getInstance();
 
     Set<String> regions =
         cache.getApplicationRegions().stream().map(LocalRegion::getName).collect(toSet());

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/configuration/functions/RecreateCacheFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/functions/RecreateCacheFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/functions/RecreateCacheFunction.java
index 464a651..a00a79e 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/functions/RecreateCacheFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/functions/RecreateCacheFunction.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.configuration.functions;
 
 import org.apache.geode.cache.execute.Function;
@@ -21,13 +20,14 @@ import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.InternalEntity;
 import org.apache.geode.internal.cache.CacheConfig;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
 
 public class RecreateCacheFunction implements Function, InternalEntity {
   @Override
   public void execute(FunctionContext context) {
     CliFunctionResult result = null;
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+    InternalCache cache = GemFireCacheImpl.getInstance();
     DistributedSystem ds = cache.getDistributedSystem();
     CacheConfig cacheConfig = cache.getCacheConfig();
     try {

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/configuration/handlers/ConfigurationRequestHandler.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/handlers/ConfigurationRequestHandler.java b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/handlers/ConfigurationRequestHandler.java
index 6495d09..201bcd6 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/handlers/ConfigurationRequestHandler.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/handlers/ConfigurationRequestHandler.java
@@ -48,7 +48,7 @@ public class ConfigurationRequestHandler implements TcpHandler {
     try {
       logger.info("Received request for configuration  : {}", request);
       ConfigurationRequest configRequest = (ConfigurationRequest) request;
-      return sharedConfig.createConfigurationReponse(configRequest);
+      return sharedConfig.createConfigurationResponse(configRequest);
     } catch (Exception e) {
       logger.info(e.getMessage(), e);
       return null;

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/messages/CompactRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/messages/CompactRequest.java b/geode-core/src/main/java/org/apache/geode/management/internal/messages/CompactRequest.java
index dfd5d88..2b22d27 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/messages/CompactRequest.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/messages/CompactRequest.java
@@ -33,27 +33,27 @@ import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.internal.DM;
 import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.distributed.internal.DistributionMessage;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ReplyException;
 import org.apache.geode.internal.admin.remote.AdminMultipleReplyProcessor;
 import org.apache.geode.internal.admin.remote.AdminRequest;
 import org.apache.geode.internal.admin.remote.AdminResponse;
 import org.apache.geode.internal.cache.DiskStoreImpl;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 
 /**
  * An instruction to all members with cache that they should compact their disk stores.
- * 
- * 
+ * <p>
+ * NOTE: Extracted from org/apache/geode/internal/admin/remote/CompactRequest.java
+ *
  * @since GemFire 7.0
  */
-// NOTE: This is copied from org/apache/geode/internal/admin/remote/CompactRequest.java
-// and modified as per requirements. (original-author Dan Smith)
 public class CompactRequest extends AdminRequest {
   private static final Logger logger = LogService.getLogger();
 
   private String diskStoreName;
+
   private static String notExecutedMembers;
 
   public static Map<DistributedMember, PersistentID> send(DM dm, String diskStoreName,
@@ -103,7 +103,7 @@ public class CompactRequest extends AdminRequest {
 
   public static PersistentID compactDiskStore(String diskStoreName) {
     PersistentID persistentID = null;
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+    InternalCache cache = GemFireCacheImpl.getInstance();
     if (cache != null && !cache.isClosed()) {
       DiskStoreImpl diskStore = (DiskStoreImpl) cache.findDiskStore(diskStoreName);
       if (diskStore != null && diskStore.forceCompaction()) {

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/AbstractCommandsController.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/AbstractCommandsController.java b/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/AbstractCommandsController.java
index e93363a..0b64a44 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/AbstractCommandsController.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/web/controllers/AbstractCommandsController.java
@@ -25,6 +25,7 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.Callable;
+
 import javax.management.JMX;
 import javax.management.MBeanServer;
 import javax.management.MalformedObjectNameException;
@@ -32,7 +33,20 @@ import javax.management.ObjectName;
 import javax.management.Query;
 import javax.management.QueryExp;
 
+import org.apache.logging.log4j.Logger;
+import org.springframework.beans.propertyeditors.StringArrayPropertyEditor;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.InitBinder;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.context.request.WebRequest;
+import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
+
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+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.logging.log4j.LogMarker;
@@ -51,18 +65,6 @@ import org.apache.geode.management.internal.web.controllers.support.LoginHandler
 import org.apache.geode.management.internal.web.util.UriUtils;
 import org.apache.geode.security.NotAuthorizedException;
 
-import org.apache.logging.log4j.Logger;
-import org.springframework.beans.propertyeditors.StringArrayPropertyEditor;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.WebDataBinder;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.InitBinder;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.ResponseStatus;
-import org.springframework.web.context.request.WebRequest;
-import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
-
 /**
  * The AbstractCommandsController class is the abstract base class encapsulating common
  * functionality across all Management Controller classes that expose REST API web service endpoints
@@ -89,22 +91,24 @@ public abstract class AbstractCommandsController {
 
   private Class accessControlKlass;
 
+  private InternalCache getCache() {
+    return GemFireCacheImpl.getInstance();
+  }
 
   // Convert a predefined exception to an HTTP Status code
   @ResponseStatus(value = HttpStatus.UNAUTHORIZED, reason = "Not authenticated") // 401
   @ExceptionHandler(org.apache.geode.security.AuthenticationFailedException.class)
   public void authenticate() {
-
+    // nothing
   }
 
   // Convert a predefined exception to an HTTP Status code
   @ResponseStatus(value = HttpStatus.FORBIDDEN, reason = "Access Denied") // 403
   @ExceptionHandler(java.lang.SecurityException.class)
   public void authorize() {
-
+    // nothing
   }
 
-
   /**
    * Asserts the argument is valid, as determined by the caller passing the result of an evaluated
    * expression to this assertion.
@@ -449,8 +453,8 @@ public abstract class AbstractCommandsController {
    */
   protected synchronized MemberMXBean getManagingMemberMXBean() {
     if (managingMemberMXBeanProxy == null) {
-      SystemManagementService service = (SystemManagementService) ManagementService
-          .getExistingManagementService(GemFireCacheImpl.getInstance());
+      SystemManagementService service =
+          (SystemManagementService) ManagementService.getExistingManagementService(getCache());
       MBeanServer mbs = getMBeanServer();
 
       final DistributedSystemMXBean distributedSystemMXBean = JMX.newMXBeanProxy(mbs,

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/pdx/PdxInstanceFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/PdxInstanceFactory.java b/geode-core/src/main/java/org/apache/geode/pdx/PdxInstanceFactory.java
index d458a22..2214456 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/PdxInstanceFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/PdxInstanceFactory.java
@@ -16,7 +16,6 @@ package org.apache.geode.pdx;
 
 import java.util.Date;
 
-import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.RegionService;
 
 /**
@@ -41,7 +40,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>char</code>.
+   * {@code char}.
    * <p>
    * Java char is mapped to .NET System.Char.
    * 
@@ -55,7 +54,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>boolean</code>.
+   * {@code boolean}.
    * <p>
    * Java boolean is mapped to .NET System.Boolean.
    * 
@@ -69,7 +68,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>byte</code>.
+   * {@code byte}.
    * <p>
    * Java byte is mapped to .NET System.SByte.
    * 
@@ -83,7 +82,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>short</code>.
+   * {@code short}.
    * <p>
    * Java short is mapped to .NET System.Int16.
    * 
@@ -97,7 +96,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>int</code>.
+   * {@code int}.
    * <p>
    * Java int is mapped to .NET System.Int32.
    * 
@@ -111,7 +110,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>long</code>.
+   * {@code long}.
    * <p>
    * Java long is mapped to .NET System.Int64.
    * 
@@ -125,7 +124,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>float</code>.
+   * {@code float}.
    * <p>
    * Java float is mapped to .NET System.Float.
    * 
@@ -139,7 +138,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>double</code>.
+   * {@code double}.
    * <p>
    * Java double is mapped to .NET System.Double.
    * 
@@ -153,7 +152,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>Date</code>.
+   * {@code Date}.
    * <p>
    * Java Date is mapped to .NET System.DateTime.
    * 
@@ -167,7 +166,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>String</code>.
+   * {@code String}.
    * <p>
    * Java String is mapped to .NET System.String.
    * 
@@ -181,7 +180,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>Object</code>.
+   * {@code Object}.
    * <p>
    * It is best to use one of the other writeXXX methods if your field type will always be XXX. This
    * method allows the field value to be anything that is an instance of Object. This gives you more
@@ -201,16 +200,16 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>Object</code>.
+   * {@code Object}.
    * <p>
    * It is best to use one of the other writeXXX methods if your field type will always be XXX. This
    * method allows the field value to be anything that is an instance of Object. This gives you more
    * flexibility but more space is used to store the serialized field.
    * <p>
    * Note that some Java objects serialized with this method may not be compatible with non-java
-   * languages. To ensure that only portable objects are serialized set the
-   * <code>checkPortability</code> parameter to true. The following is a list of the Java classes
-   * that are portable and the .NET class they are mapped to:
+   * languages. To ensure that only portable objects are serialized set the {@code checkPortability}
+   * parameter to true. The following is a list of the Java classes that are portable and the .NET
+   * class they are mapped to:
    * <ul>
    * <li>instances of {@link PdxSerializable}: .NET class of same name
    * <li>instances of {@link PdxInstance}: .NET class of same name
@@ -235,10 +234,10 @@ public interface PdxInstanceFactory {
    * <li>double[]: System.Double[]
    * <li>String[]: System.String[]
    * <li>byte[][]: System.Byte[][]
-   * <li>Object[]: System.Collections.Generic.List<Object>
-   * <li>java.util.HashMap: System.Collections.Generics.IDictionary<Object, Object>
+   * <li>Object[]: System.Collections.Generic.List&lt;Object&gt;
+   * <li>java.util.HashMap: System.Collections.Generics.IDictionary&lt;Object, Object&gt;
    * <li>java.util.Hashtable: System.Collections.Hashtable
-   * <li>java.util.ArrayList: System.Collections.Generic.IList<Object>
+   * <li>java.util.ArrayList: System.Collections.Generic.IList&lt;Object&gt;
    * <li>java.util.Vector: System.Collections.ArrayList
    * <li>java.util.HashSet: CacheableHashSet
    * <li>java.util.LinkedHashSet: CacheableLinkedHashSet
@@ -259,7 +258,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>boolean[]</code>.
+   * {@code boolean[]}.
    * <p>
    * Java boolean[] is mapped to .NET System.Boolean[].
    * 
@@ -273,7 +272,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>char[]</code>.
+   * {@code char[]}.
    * <p>
    * Java char[] is mapped to .NET System.Char[].
    * 
@@ -287,7 +286,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>byte[]</code>.
+   * {@code byte[]}.
    * <p>
    * Java byte[] is mapped to .NET System.Byte[].
    * 
@@ -301,7 +300,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>short[]</code>.
+   * {@code short[]}.
    * <p>
    * Java short[] is mapped to .NET System.Int16[].
    * 
@@ -315,7 +314,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>int[]</code>.
+   * {@code int[]}.
    * <p>
    * Java int[] is mapped to .NET System.Int32[].
    * 
@@ -329,7 +328,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>long[]</code>.
+   * {@code long[]}.
    * <p>
    * Java long[] is mapped to .NET System.Int64[].
    * 
@@ -343,7 +342,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>float[]</code>.
+   * {@code float[]}.
    * <p>
    * Java float[] is mapped to .NET System.Float[].
    * 
@@ -357,7 +356,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>double[]</code>.
+   * {@code double[]}.
    * <p>
    * Java double[] is mapped to .NET System.Double[].
    * 
@@ -371,7 +370,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>String[]</code>.
+   * {@code String[]}.
    * <p>
    * Java String[] is mapped to .NET System.String[].
    * 
@@ -385,12 +384,12 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>Object[]</code>.
+   * {@code Object[]}.
    * <p>
-   * Java Object[] is mapped to .NET System.Collections.Generic.List<Object>. For how each element
-   * of the array is a mapped to .NET see {@link #writeObject(String, Object, boolean) writeObject}.
-   * Note that this call may serialize elements that are not compatible with non-java languages. To
-   * ensure that only portable objects are serialized use
+   * Java Object[] is mapped to .NET System.Collections.Generic.List&lt;Object&gt;. For how each
+   * element of the array is a mapped to .NET see {@link #writeObject(String, Object, boolean)
+   * writeObject}. Note that this call may serialize elements that are not compatible with non-java
+   * languages. To ensure that only portable objects are serialized use
    * {@link #writeObjectArray(String, Object[], boolean)}.
    * 
    * @param fieldName the name of the field to write
@@ -403,13 +402,13 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>Object[]</code>.
+   * {@code Object[]}.
    * <p>
-   * Java Object[] is mapped to .NET System.Collections.Generic.List<Object>. For how each element
-   * of the array is a mapped to .NET see {@link #writeObject(String, Object, boolean) writeObject}.
-   * Note that this call may serialize elements that are not compatible with non-java languages. To
-   * ensure that only portable objects are serialized use
-   * {@link #writeObjectArray(String, Object[], boolean)}.
+   * Java Object[] is mapped to .NET System.Collections.Generic.List&lt;Object&gt;. For how each
+   * element of the array is a mapped to .NET see {@link #writeObject(String, Object, boolean)
+   * writeObject}. Note that this call may serialize elements that are not compatible with non-java
+   * languages. To ensure that only portable objects are serialized use
+   * {@code writeObjectArray(String, Object[], boolean)}.
    * 
    * @param fieldName the name of the field to write
    * @param value the value of the field to write
@@ -427,7 +426,7 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value to the serialized form. The fields type is
-   * <code>byte[][]</code>.
+   * {@code byte[][]}.
    * <p>
    * Java byte[][] is mapped to .NET System.Byte[][].
    * 
@@ -441,8 +440,8 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value and type to the serialized form. This method uses
-   * the <code>fieldType</code> to determine which writeXXX method it should call. If it can not
-   * find a specific match to a writeXXX method it will call {@link #writeObject(String, Object)
+   * the {@code fieldType} to determine which writeXXX method it should call. If it can not find a
+   * specific match to a writeXXX method it will call {@link #writeObject(String, Object)
    * writeObject}. This method may serialize objects that are not portable to non-java languages. To
    * ensure that only objects that are portable to non-java languages are serialized use
    * {@link #writeField(String, Object, Class, boolean)} instead.
@@ -476,7 +475,7 @@ public interface PdxInstanceFactory {
    * 
    * @param fieldName the name of the field to write
    * @param fieldValue the value of the field to write; this parameter's class must extend the
-   *        <code>fieldType</code>
+   *        {@code fieldType}
    * @param fieldType the type of the field to write
    * @return this PdxInstanceFactory
    * @throws PdxFieldAlreadyExistsException if the named field has already been written
@@ -487,11 +486,10 @@ public interface PdxInstanceFactory {
 
   /**
    * Writes the named field with the given value and type to the serialized form. This method uses
-   * the <code>fieldType</code> to determine which writeXXX method it should call. If it can not
-   * find a specific match to a writeXXX method it will call
-   * {@link #writeObject(String, Object, boolean) writeObject}. To ensure that only objects that are
-   * portable to non-java languages are serialized set the <code>checkPortability</code> parameter
-   * to true.
+   * the {@code fieldType} to determine which writeXXX method it should call. If it can not find a
+   * specific match to a writeXXX method it will call {@link #writeObject(String, Object, boolean)
+   * writeObject}. To ensure that only objects that are portable to non-java languages are
+   * serialized set the {@code checkPortability} parameter to true.
    * <p>
    * The fieldTypes that map to a specific method are:
    * <ul>
@@ -522,7 +520,7 @@ public interface PdxInstanceFactory {
    * 
    * @param fieldName the name of the field to write
    * @param fieldValue the value of the field to write; this parameter's class must extend the
-   *        <code>fieldType</code>
+   *        {@code fieldType}
    * @param fieldType the type of the field to write
    * @param checkPortability if true then an exception is thrown if a non-portable object is
    *        serialized

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/pdx/internal/CheckTypeRegistryState.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/CheckTypeRegistryState.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/CheckTypeRegistryState.java
index 8e628bf..d3e9f4f 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/CheckTypeRegistryState.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/CheckTypeRegistryState.java
@@ -28,10 +28,12 @@ import org.apache.geode.distributed.internal.ReplyException;
 import org.apache.geode.distributed.internal.ReplyMessage;
 import org.apache.geode.distributed.internal.ReplyProcessor21;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.pdx.PdxInitializationException;
 
 public class CheckTypeRegistryState extends HighPriorityDistributionMessage
     implements MessageWithReply {
+
   private int processorId;
 
   public CheckTypeRegistryState() {
@@ -68,7 +70,7 @@ public class CheckTypeRegistryState extends HighPriorityDistributionMessage
   protected void process(DistributionManager dm) {
     ReplyException e = null;
     try {
-      GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+      InternalCache cache = GemFireCacheImpl.getInstance();
       if (cache != null && !cache.isClosed()) {
         TypeRegistry pdxRegistry = cache.getPdxRegistry();
         if (pdxRegistry != null) {

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java
index 8c48473..c10de03 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java
@@ -36,7 +36,7 @@ import org.apache.geode.cache.client.internal.GetPDXTypeByIdOp;
 import org.apache.geode.cache.client.internal.GetPDXTypesOp;
 import org.apache.geode.cache.client.internal.PoolImpl;
 import org.apache.geode.cache.wan.GatewaySender;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PoolManagerImpl;
 import org.apache.geode.internal.logging.LogService;
 
@@ -44,9 +44,9 @@ public class ClientTypeRegistration implements TypeRegistration {
 
   private static final Logger logger = LogService.getLogger();
 
-  private final GemFireCacheImpl cache;
+  private final InternalCache cache;
 
-  public ClientTypeRegistration(GemFireCacheImpl cache) {
+  public ClientTypeRegistration(InternalCache cache) {
     this.cache = cache;
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/80bc00f0/geode-core/src/main/java/org/apache/geode/pdx/internal/LonerTypeRegistration.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/LonerTypeRegistration.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/LonerTypeRegistration.java
index 5b82611..0609dd4 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/LonerTypeRegistration.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/LonerTypeRegistration.java
@@ -17,22 +17,19 @@ package org.apache.geode.pdx.internal;
 import java.util.Map;
 
 import org.apache.geode.cache.wan.GatewaySender;
-import org.apache.geode.internal.cache.CacheConfig;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 
 /**
  * A type registration that is used for loners. In the loner case, we'll try to be helpful and not
  * decide what type registration to give the user until they actually use it.
- *
  */
 public class LonerTypeRegistration implements TypeRegistration {
 
   private volatile TypeRegistration delegate = null;
 
-  private final GemFireCacheImpl cache;
-
+  private final InternalCache cache;
 
-  public LonerTypeRegistration(GemFireCacheImpl cache) {
+  public LonerTypeRegistration(InternalCache cache) {
     this.cache = cache;
   }
 
@@ -104,10 +101,9 @@ public class LonerTypeRegistration implements TypeRegistration {
    * Check to see if the current member is a loner and we can't tell if the user wants a peer or a
    * client type registry.
    * 
-   * @param cache
    * @return true if this member is a loner and we can't determine what type of registry they want.
    */
-  public static boolean isIndeterminateLoner(GemFireCacheImpl cache) {
+  public static boolean isIndeterminateLoner(InternalCache cache) {
     boolean isLoner = cache.getInternalDistributedSystem().isLoner();
     boolean pdxConfigured = cache.getPdxPersistent();
     return isLoner && !pdxConfigured/* && !hasGateways */;


Mime
View raw message