This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 30767df  remove getInstance calls in ShutdownAllRequest (#1429)
30767df is described below

commit 30767df9d3d407efdea759b0eb2e43a269084a83
Author: Darrel Schneider <dschnei...@pivotal.io>
AuthorDate: Mon Feb 12 15:06:37 2018 -0800

    remove getInstance calls in ShutdownAllRequest (#1429)
---
 .../geode/internal/admin/remote/ShutdownAllRequest.java       | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/ShutdownAllRequest.java
 
b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/ShutdownAllRequest.java
index 6e78c4d..9fc18cb 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/ShutdownAllRequest.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/ShutdownAllRequest.java
@@ -37,7 +37,6 @@ import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.distributed.internal.ReplyException;
 import org.apache.geode.distributed.internal.ReplyMessage;
 import 
org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.tcp.ConnectionTable;
@@ -61,7 +60,7 @@ public class ShutdownAllRequest extends AdminRequest {
    * the waitingThreadPool.
    */
   public static Set send(final DistributionManager dm, long timeout) {
-    boolean hadCache = hasCache();
+    boolean hadCache = hasCache(dm);
     ClusterDistributionManager dism =
         dm instanceof ClusterDistributionManager ? 
(ClusterDistributionManager) dm : null;
     InternalDistributedMember myId = dm.getDistributionManagerId();
@@ -140,7 +139,7 @@ public class ShutdownAllRequest extends AdminRequest {
 
   @Override
   protected void process(ClusterDistributionManager dm) {
-    boolean isToShutdown = hasCache();
+    boolean isToShutdown = hasCache(dm);
     super.process(dm);
 
     if (isToShutdown) {
@@ -168,14 +167,14 @@ public class ShutdownAllRequest extends AdminRequest {
     }
   }
 
-  private static boolean hasCache() {
-    InternalCache cache = GemFireCacheImpl.getInstance();
+  private static boolean hasCache(DistributionManager manager) {
+    InternalCache cache = manager.getCache();
     return cache != null && !cache.isClosed();
   }
 
   @Override
   protected AdminResponse createResponse(DistributionManager dm) {
-    boolean isToShutdown = hasCache();
+    boolean isToShutdown = hasCache(dm);
     if (isToShutdown) {
       boolean isSuccess = false;
       try {

-- 
To stop receiving notification emails like this one, please contact
dschnei...@apache.org.

Reply via email to