geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject geode git commit: GEODE-3290: Removed effectively-dead classes FilterChain, LocalFilterChain, and RemoteFilterChain.
Date Wed, 26 Jul 2017 22:20:29 GMT
Repository: geode
Updated Branches:
  refs/heads/develop 7ae99960f -> 626780908


GEODE-3290: Removed effectively-dead classes FilterChain, LocalFilterChain, and RemoteFilterChain.

* this closes #653


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/62678090
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/62678090
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/62678090

Branch: refs/heads/develop
Commit: 6267809086a0ccd8d04263ea95c52bafed156965
Parents: 7ae9996
Author: Patrick Rhomberg <prhomberg@pivotal.io>
Authored: Mon Jul 24 14:00:43 2017 -0700
Committer: Jinmei Liao <jiliao@pivotal.io>
Committed: Wed Jul 26 15:19:03 2017 -0700

----------------------------------------------------------------------
 .../management/internal/FederatingManager.java  |  76 ++++----------
 .../geode/management/internal/FilterChain.java  |  54 ----------
 .../management/internal/LocalFilterChain.java   |  61 -----------
 .../management/internal/MBeanProxyFactory.java  |  92 +++--------------
 .../management/internal/RemoteFilterChain.java  | 101 -------------------
 .../internal/SystemManagementService.java       |  61 +++--------
 6 files changed, 46 insertions(+), 399 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/62678090/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
b/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
index b6ffa41..4300482 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
@@ -75,11 +75,6 @@ public class FederatingManager extends Manager {
    */
   protected MBeanProxyFactory proxyFactory;
 
-  /**
-   * Remote Filter chain for local MBean filters
-   */
-  private RemoteFilterChain remoteFilterChain;
-
   private MBeanJMXAdapter jmxAdapter;
 
   private MemberMessenger messenger;
@@ -87,7 +82,7 @@ public class FederatingManager extends Manager {
   private SystemManagementService service;
 
   /**
-   * @param jmxAdapter JMX Adpater
+   * @param jmxAdapter JMX Adapter
    * @param repo Management resource repo
    * @param system Internal Distributed System
    * @param service SystemManagement Service
@@ -95,9 +90,8 @@ public class FederatingManager extends Manager {
   public FederatingManager(MBeanJMXAdapter jmxAdapter, ManagementResourceRepo repo,
       InternalDistributedSystem system, SystemManagementService service, InternalCache cache)
{
     super(repo, system, cache);
-    this.remoteFilterChain = new RemoteFilterChain();
     this.service = service;
-    this.proxyFactory = new MBeanProxyFactory(remoteFilterChain, jmxAdapter, service);
+    this.proxyFactory = new MBeanProxyFactory(jmxAdapter, service);
     this.jmxAdapter = jmxAdapter;
     this.messenger = new MemberMessenger(jmxAdapter, repo, system);
   }
@@ -121,9 +115,6 @@ public class FederatingManager extends Manager {
 
       messenger.broadcastManagerInfo();
 
-    } catch (InterruptedException e) {
-      running = false;
-      throw new ManagementException(e);
     } catch (Exception e) {
       running = false;
       throw new ManagementException(e);
@@ -131,7 +122,7 @@ public class FederatingManager extends Manager {
   }
 
   public synchronized void stopManager() {
-    // remove hidden mgmt regions and federatedMBeans
+    // remove hidden management regions and federatedMBeans
     if (!running) {
       return;
     }
@@ -149,10 +140,9 @@ public class FederatingManager extends Manager {
   private void stopManagingActivity() {
     try {
       this.pooledMembershipExecutor.shutdownNow();
-      Iterator<DistributedMember> it = repo.getMonitoringRegionMap().keySet().iterator();
 
-      while (it.hasNext()) {
-        removeMemberArtifacts(it.next(), false);
+      for (DistributedMember distributedMember : repo.getMonitoringRegionMap().keySet())
{
+        removeMemberArtifacts(distributedMember, false);
       }
 
     } catch (Exception e) {
@@ -334,7 +324,7 @@ public class FederatingManager extends Manager {
   /**
    * Actual task of doing the GII
    * 
-   * It will perform the GII request which might originate from TranstionListener or Membership
+   * It will perform the GII request which might originate from TransitionListener or Membership
    * Listener.
    *
    * Managing Node side resources are created per member which is visible to this node
@@ -358,9 +348,8 @@ public class FederatingManager extends Manager {
     }
 
     public DistributedMember call() {
-      Region<String, Object> proxyMonitoringRegion = null;
-      Region<NotificationKey, Notification> proxyNotificationgRegion = null;
-      boolean proxyCreatedForMember = false;
+      Region<String, Object> proxyMonitoringRegion;
+      Region<NotificationKey, Notification> proxyNotificationRegion;
       try {
 
         // GII wont start at all if its interrupted
@@ -380,8 +369,7 @@ public class FederatingManager extends Manager {
           internalArgs.setCachePerfStatsHolder(monitoringRegionStats);
 
           // Monitoring region for member is created
-          AttributesFactory<String, Object> monitorAttrFactory =
-              new AttributesFactory<String, Object>();
+          AttributesFactory<String, Object> monitorAttrFactory = new AttributesFactory<>();
           monitorAttrFactory.setScope(Scope.DISTRIBUTED_NO_ACK);
           monitorAttrFactory.setDataPolicy(DataPolicy.REPLICATE);
           monitorAttrFactory.setConcurrencyChecksEnabled(false);
@@ -392,7 +380,7 @@ public class FederatingManager extends Manager {
 
           // Notification region for member is created
           AttributesFactory<NotificationKey, Notification> notifAttrFactory =
-              new AttributesFactory<NotificationKey, Notification>();
+              new AttributesFactory<>();
           notifAttrFactory.setScope(Scope.DISTRIBUTED_NO_ACK);
           notifAttrFactory.setDataPolicy(DataPolicy.REPLICATE);
           notifAttrFactory.setConcurrencyChecksEnabled(false);
@@ -421,23 +409,8 @@ public class FederatingManager extends Manager {
                     monitoringRegionAttrs, internalArgs);
             proxyMonitoringRegionCreated = true;
 
-          } catch (TimeoutException e) {
-            if (logger.isDebugEnabled()) {
-              logger.debug("Error During Internal Region creation {}", e.getMessage(), e);
-            }
-            throw new ManagementException(e);
-          } catch (RegionExistsException e) {
-            if (logger.isDebugEnabled()) {
-              logger.debug("Error During Internal Region creation {}", e.getMessage(), e);
-            }
-            throw new ManagementException(e);
-          } catch (IOException e) {
-            if (logger.isDebugEnabled()) {
-              logger.debug("Error During Internal Region creation {}", e.getMessage(), e);
-            }
-
-            throw new ManagementException(e);
-          } catch (ClassNotFoundException e) {
+          } catch (TimeoutException | RegionExistsException | IOException
+              | ClassNotFoundException e) {
             if (logger.isDebugEnabled()) {
               logger.debug("Error During Internal Region creation {}", e.getMessage(), e);
             }
@@ -448,26 +421,12 @@ public class FederatingManager extends Manager {
             if (!running) {
               return null;
             }
-            proxyNotificationgRegion =
+            proxyNotificationRegion =
                 cache.createVMRegion(ManagementConstants.NOTIFICATION_REGION + "_" + appender,
                     notifRegionAttrs, internalArgs);
             proxyNotifRegionCreated = true;
-          } catch (TimeoutException e) {
-            if (logger.isDebugEnabled()) {
-              logger.debug("Error During Internal Region creation {}", e.getMessage(), e);
-            }
-            throw new ManagementException(e);
-          } catch (RegionExistsException e) {
-            if (logger.isDebugEnabled()) {
-              logger.debug("Error During Internal Region creation {}", e.getMessage(), e);
-            }
-            throw new ManagementException(e);
-          } catch (IOException e) {
-            if (logger.isDebugEnabled()) {
-              logger.debug("Error During Internal Region creation {}", e.getMessage(), e);
-            }
-            throw new ManagementException(e);
-          } catch (ClassNotFoundException e) {
+          } catch (TimeoutException | RegionExistsException | IOException
+              | ClassNotFoundException e) {
             if (logger.isDebugEnabled()) {
               logger.debug("Error During Internal Region creation {}", e.getMessage(), e);
             }
@@ -484,19 +443,18 @@ public class FederatingManager extends Manager {
             logger.debug("Management Region created with Name : {}",
                 proxyMonitoringRegion.getName());
             logger.debug("Notification Region created with Name : {}",
-                proxyNotificationgRegion.getName());
+                proxyNotificationRegion.getName());
           }
 
           // Only the exception case would have destroyed the proxy
           // regions. We can safely proceed here.
           repo.putEntryInMonitoringRegionMap(member, proxyMonitoringRegion);
-          repo.putEntryInNotifRegionMap(member, proxyNotificationgRegion);
+          repo.putEntryInNotifRegionMap(member, proxyNotificationRegion);
           try {
             if (!running) {
               return null;
             }
             proxyFactory.createAllProxies(member, proxyMonitoringRegion);
-            proxyCreatedForMember = true;
 
             mgmtCacheListener.markReady();
             notifListener.markReady();

http://git-wip-us.apache.org/repos/asf/geode/blob/62678090/geode-core/src/main/java/org/apache/geode/management/internal/FilterChain.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/FilterChain.java
b/geode-core/src/main/java/org/apache/geode/management/internal/FilterChain.java
deleted file mode 100644
index 0a7919f..0000000
--- a/geode-core/src/main/java/org/apache/geode/management/internal/FilterChain.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information
regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version
2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain
a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express
- * or implied. See the License for the specific language governing permissions and limitations
under
- * the License.
- */
-package org.apache.geode.management.internal;
-
-
-/**
- * Abstract class containing methods which will be accesed by both Local and Remote filter
chains
- * 
- *
- */
-public abstract class FilterChain {
-
-  protected boolean isFiltered(boolean included, boolean excluded) {
-
-    if (excluded && included) {
-      return true;
-    }
-    if (!excluded && included) {
-      return false;
-    }
-    if (excluded && !included) {
-      return true;
-    }
-    if (!excluded && !included) {
-      return false;
-    }
-    return false;
-  }
-
-  /**
-   * This method splits the specified filters to array of string objects
-   */
-  protected FilterParam createFilterParam(String inclusionList, String exclusionList) {
-
-    String[] inclusionListArray = inclusionList.split(";");
-    String[] exclusionListArray = exclusionList.split(";");
-    return new FilterParam(inclusionListArray, exclusionListArray);
-  }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/62678090/geode-core/src/main/java/org/apache/geode/management/internal/LocalFilterChain.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/LocalFilterChain.java
b/geode-core/src/main/java/org/apache/geode/management/internal/LocalFilterChain.java
deleted file mode 100644
index b215145..0000000
--- a/geode-core/src/main/java/org/apache/geode/management/internal/LocalFilterChain.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information
regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version
2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain
a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express
- * or implied. See the License for the specific language governing permissions and limitations
under
- * the License.
- */
-package org.apache.geode.management.internal;
-
-import javax.management.ObjectName;
-
-import org.apache.geode.management.ManagementException;
-
-
-
-/**
- * This chain currently has only one filter. Have made it a chain to support future filters
which
- * should be evaluated locally before registering an MBean
- *
- */
-
-public class LocalFilterChain extends FilterChain {
-
-  private StringBasedFilter localMBeanFilter;
-
-  public LocalFilterChain() {
-    /*
-     * String excludeFilter = managementConfig.getLocalMBeanExcludeFilter(); String includeFilter
=
-     * managementConfig.getLocalMBeanIncludeFilter(); FilterParam param =
-     * createFilterParam(includeFilter, excludeFilter); localMBeanFilter = new
-     * StringBasedFilter(param);
-     */
-
-  }
-
-
-
-  public boolean isFiltered(ObjectName objectName) {
-
-    return false;
-
-    // For future use of filters
-
-    /*
-     * boolean isExcluded = localMBeanFilter.isExcluded(objectName.getCanonicalName()); boolean
-     * isIncluded = localMBeanFilter.isIncluded(objectName.getCanonicalName());
-     * 
-     * return isFiltered(isIncluded, isExcluded);
-     */
-  }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/62678090/geode-core/src/main/java/org/apache/geode/management/internal/MBeanProxyFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/MBeanProxyFactory.java
b/geode-core/src/main/java/org/apache/geode/management/internal/MBeanProxyFactory.java
index 62aa43f..0cce0be 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/MBeanProxyFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/MBeanProxyFactory.java
@@ -49,10 +49,6 @@ public class MBeanProxyFactory {
    */
   private MBeanProxyInfoRepository proxyRepo;
 
-  /**
-   * For Future release
-   */
-  private RemoteFilterChain remoteFilterChain;
 
   /**
    * Interface between GemFire federation layer and Java JMX layer
@@ -62,15 +58,11 @@ public class MBeanProxyFactory {
   private SystemManagementService service;
 
   /**
-   * 
-   * @param remoteFilterChain remote chain to filter out remote members
    * @param jmxAdapter adapter to interface between JMX and GemFire
    * @param service management service
    */
-  public MBeanProxyFactory(RemoteFilterChain remoteFilterChain, MBeanJMXAdapter jmxAdapter,
-      SystemManagementService service) {
+  public MBeanProxyFactory(MBeanJMXAdapter jmxAdapter, SystemManagementService service) {
 
-    this.remoteFilterChain = remoteFilterChain;
     this.jmxAdapter = jmxAdapter;
     this.proxyRepo = new MBeanProxyInfoRepository();
     this.service = service;
@@ -83,25 +75,12 @@ public class MBeanProxyFactory {
    * @param member {@link org.apache.geode.distributed.DistributedMember}
    * @param objectName {@link javax.management.ObjectName} of the Bean
    * @param monitoringRegion monitoring region containing the proxies
-   * @throws ManagementException
    */
   public void createProxy(DistributedMember member, ObjectName objectName,
       Region<String, Object> monitoringRegion, Object newVal) {
 
     try {
 
-      /*
-       * Check the complete filter chain to evaluate the applicability of the MBean
-       */
-
-      if (remoteFilterChain.isFiltered(objectName, member, "")) {
-        if (logger.isTraceEnabled()) {
-          logger.trace("Returning from filter");
-        }
-
-        return;
-      }
-
       Class interfaceClass = ClassLoadUtil
           .classFromName(((FederationComponent) monitoringRegion.get(objectName.toString()))
               .getMBeanInterfaceClass());
@@ -124,12 +103,8 @@ public class MBeanProxyFactory {
         logger.debug("Proxy Created for : {}", objectName);
       }
 
-    } catch (ClassNotFoundException e) {
-      throw new ManagementException(e);
-    } catch (IntrospectionException e) {
+    } catch (ClassNotFoundException | IntrospectionException e) {
       throw new ManagementException(e);
-    } catch (ManagementException e) {
-      throw e;
     }
 
   }
@@ -148,57 +123,22 @@ public class MBeanProxyFactory {
     if (logger.isDebugEnabled()) {
       logger.debug("Creating proxy for: {}", member.getId());
     }
-    /*
-     * Check for member and server group filters if the member is filtered no need to proceed
-     * further
-     */
-
-    if (remoteFilterChain.isServerGroupFiltered("")) {
-      if (logger.isTraceEnabled()) {
-        logger.trace("Returning from server group filter");
-      }
-      return;
-
-    }
-    if (remoteFilterChain.isManagedNodeFiltered(member)) {
-      if (logger.isTraceEnabled()) {
-        logger.trace("returning from managed node filter");
-      }
-      return;
-    }
 
     Set<String> mbeanNames = monitoringRegion.keySet();
 
-    Iterator<String> it = mbeanNames.iterator();
-
-    while (it.hasNext()) {
+    for (String mbeanName : mbeanNames) {
 
       ObjectName objectName = null;
-      /*
-       * This is for MBean filter check. If filtered MBean wont be registered
-       */
-
-      if (remoteFilterChain.isRemoteMBeanFiltered(objectName)) {
-        if (logger.isTraceEnabled()) {
-          logger.trace("continue  from remote MBEan node filter");
-        }
-
-        continue;
-      }
       try {
-        objectName = ObjectName.getInstance(it.next());
+        objectName = ObjectName.getInstance(mbeanName);
         if (logger.isDebugEnabled()) {
           logger.debug("Creating proxy for ObjectName: " + objectName.toString());
         }
 
         createProxy(member, objectName, monitoringRegion,
             monitoringRegion.get(objectName.toString()));
-      } catch (ManagementException e) {
-        logger.warn("Create Proxy failed for {} with exception {}", objectName, e.getMessage(),
e);
-        continue;
       } catch (Exception e) {
         logger.warn("Create Proxy failed for {} with exception {}", objectName, e.getMessage(),
e);
-        continue;
       }
 
     }
@@ -221,7 +161,7 @@ public class MBeanProxyFactory {
 
     while (entriesIt.hasNext()) {
       String key = null;
-      Object val = null;
+      Object val;
       try {
         Entry<String, Object> entry = entriesIt.next();
         key = entry.getKey();// MBean Name in String format.
@@ -232,7 +172,6 @@ public class MBeanProxyFactory {
         if (!(e.getCause() instanceof InstanceNotFoundException)) {
           logger.warn("Remove Proxy failed for {} due to {}", key, e.getMessage(), e);
         }
-        continue;
       }
     }
   }
@@ -250,18 +189,17 @@ public class MBeanProxyFactory {
         logger.debug("Removing proxy for ObjectName: {}", objectName);
 
       }
-      if (!remoteFilterChain.isRemoteMBeanFiltered(objectName)) {
-        ProxyInfo proxyInfo = proxyRepo.findProxyInfo(objectName);
-        proxyRepo.removeProxy(member, objectName);
-        if (proxyInfo != null) {
-          service.afterRemoveProxy(objectName, proxyInfo.getProxyInterface(),
-              proxyInfo.getProxyInstance(), (FederationComponent) oldVal);
-        }
-        jmxAdapter.unregisterMBean(objectName);
 
-        if (logger.isDebugEnabled()) {
-          logger.debug("Removed proxy for ObjectName: {}", objectName);
-        }
+      ProxyInfo proxyInfo = proxyRepo.findProxyInfo(objectName);
+      proxyRepo.removeProxy(member, objectName);
+      if (proxyInfo != null) {
+        service.afterRemoveProxy(objectName, proxyInfo.getProxyInterface(),
+            proxyInfo.getProxyInstance(), (FederationComponent) oldVal);
+      }
+      jmxAdapter.unregisterMBean(objectName);
+
+      if (logger.isDebugEnabled()) {
+        logger.debug("Removed proxy for ObjectName: {}", objectName);
       }
 
     } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/geode/blob/62678090/geode-core/src/main/java/org/apache/geode/management/internal/RemoteFilterChain.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/RemoteFilterChain.java
b/geode-core/src/main/java/org/apache/geode/management/internal/RemoteFilterChain.java
deleted file mode 100644
index c187dc8..0000000
--- a/geode-core/src/main/java/org/apache/geode/management/internal/RemoteFilterChain.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information
regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version
2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain
a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express
- * or implied. See the License for the specific language governing permissions and limitations
under
- * the License.
- */
-package org.apache.geode.management.internal;
-
-import javax.management.ObjectName;
-
-import org.apache.geode.distributed.DistributedMember;
-
-public class RemoteFilterChain extends FilterChain {
-
-  private StringBasedFilter serverGroupFilter;
-  private StringBasedFilter remoteMBeanFilter;
-  private StringBasedFilter managedMemberFilter;
-
-  public RemoteFilterChain() {
-
-
-    /*
-     * String remoteMBeanExcludeFilter = managementConfig.getRemoteMBeanExcludeFilter();
String
-     * remoteMBeanIncludeFilter = managementConfig.getRemoteMBeanIncludeFilter();
-     * 
-     * FilterParam remoteMBeanParam = createFilterParam(remoteMBeanIncludeFilter,
-     * remoteMBeanExcludeFilter); remoteMBeanFilter = new StringBasedFilter(remoteMBeanParam);
-     * 
-     * String memberNodeExcludeFilter = managementConfig.getMemberNodeExcludeFilter(); String
-     * memberNodeIncludeFilter = managementConfig.getMemberNodeIncludeFilter();
-     * 
-     * FilterParam memberNodeParam = createFilterParam(memberNodeIncludeFilter,
-     * memberNodeExcludeFilter); managedMemberFilter = new StringBasedFilter(memberNodeParam);
-     * 
-     * String serverGroupExcludeFilter = managementConfig.getServerGroupExcludeFilter();
String
-     * serverGroupIncludeFilter = managementConfig.getServerGroupIncludeFilter();
-     * 
-     * FilterParam serverGroupParam = createFilterParam(serverGroupIncludeFilter,
-     * serverGroupExcludeFilter); serverGroupFilter = new StringBasedFilter(serverGroupParam);
-     */
-
-  }
-
-  public boolean isFiltered(ObjectName name, DistributedMember member, String serverGroup)
{
-    return false;
-    // <For future use>
-    /*
-     * isRemoteMBeanFiltered(name); isManagedNodeFiltered(member);
-     * isServerGroupFiltered(serverGroup);
-     */
-
-
-  }
-
-  public boolean isRemoteMBeanFiltered(ObjectName objectName) {
-
-    return false;
-    // <For future use>
-    /*
-     * boolean isExcluded = remoteMBeanFilter.isExcluded(objectName.getCanonicalName());
boolean
-     * isIncluded = remoteMBeanFilter.isIncluded(objectName.getCanonicalName());
-     * 
-     * return isFiltered(isIncluded, isExcluded);
-     */
-
-  }
-
-  public boolean isManagedNodeFiltered(DistributedMember member) {
-    return false;
-    // <For future use>
-    /*
-     * boolean isExcluded = managedMemberFilter.isExcluded(member.getId()); boolean isIncluded
=
-     * managedMemberFilter.isIncluded(member.getId());
-     * 
-     * return isFiltered(isIncluded, isExcluded);
-     */
-
-  }
-
-
-  public boolean isServerGroupFiltered(String serverGroup) {
-    return false;
-    // <For future use>
-    /*
-     * boolean isExcluded = serverGroupFilter.isExcluded(serverGroup); boolean isIncluded
=
-     * serverGroupFilter.isIncluded(serverGroup);
-     * 
-     * return isFiltered(isIncluded, isExcluded);
-     */
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/62678090/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
b/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
index 11402f1..c770f89 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/SystemManagementService.java
@@ -79,11 +79,6 @@ public class SystemManagementService extends BaseManagementService {
   private NotificationHub notificationHub;
 
   /**
-   * Local Filter chain for local MBean filters
-   */
-  private LocalFilterChain localFilterChain;
-
-  /**
    * whether the service is closed or not if cache is closed automatically this service will
be
    * closed
    */
@@ -137,7 +132,6 @@ public class SystemManagementService extends BaseManagementService {
           LocalizedStrings.InternalDistributedSystem_THIS_CONNECTION_TO_A_DISTRIBUTED_SYSTEM_HAS_BEEN_DISCONNECTED
               .toLocalizedString());
     }
-    this.localFilterChain = new LocalFilterChain();
     this.jmxAdapter = new MBeanJMXAdapter();
     this.repo = new ManagementResourceRepo();
 
@@ -150,7 +144,7 @@ public class SystemManagementService extends BaseManagementService {
     }
     ManagementFunction function = new ManagementFunction(notificationHub);
     FunctionService.registerFunction(function);
-    this.proxyListeners = new CopyOnWriteArrayList<ProxyListener>();
+    this.proxyListeners = new CopyOnWriteArrayList<>();
   }
 
   /**
@@ -201,16 +195,7 @@ public class SystemManagementService extends BaseManagementService {
   }
 
   public boolean isStartedAndOpen() {
-    if (!isStarted) {
-      return false;
-    }
-    if (closed) {
-      return false;
-    }
-    if (!system.isConnected()) {
-      return false;
-    }
-    return true;
+    return isStarted && !closed && system.isConnected();
   }
 
   private void verifyManagementService() {
@@ -300,8 +285,7 @@ public class SystemManagementService extends BaseManagementService {
 
   @Override
   public CacheServerMXBean getLocalCacheServerMXBean(int serverPort) {
-    CacheServerMXBean bean = jmxAdapter.getClientServiceMXBean(serverPort);
-    return bean;
+    return jmxAdapter.getClientServiceMXBean(serverPort);
   }
 
   @Override
@@ -323,20 +307,17 @@ public class SystemManagementService extends BaseManagementService {
 
   @Override
   public DiskStoreMXBean getLocalDiskStoreMBean(String diskStoreName) {
-    DiskStoreMXBean bean = jmxAdapter.getLocalDiskStoreMXBean(diskStoreName);
-    return bean;
+    return jmxAdapter.getLocalDiskStoreMXBean(diskStoreName);
   }
 
   @Override
-  public LockServiceMXBean getLocalLockServiceMBean(String lockSreviceName) {
-    LockServiceMXBean bean = jmxAdapter.getLocalLockServiceMXBean(lockSreviceName);
-    return bean;
+  public LockServiceMXBean getLocalLockServiceMBean(String lockServiceName) {
+    return jmxAdapter.getLocalLockServiceMXBean(lockServiceName);
   }
 
   @Override
   public RegionMXBean getLocalRegionMBean(String regionPath) {
-    RegionMXBean bean = jmxAdapter.getLocalRegionMXBean(regionPath);
-    return bean;
+    return jmxAdapter.getLocalRegionMXBean(regionPath);
   }
 
   public <T> T getMBeanProxy(ObjectName objectName, Class<T> interfaceClass)
{ // TODO: this is too
@@ -380,17 +361,11 @@ public class SystemManagementService extends BaseManagementService {
   @Override
   public ObjectName registerMBean(Object object, ObjectName objectName) {
     verifyManagementService();
-    if (localFilterChain.isFiltered(objectName)) {
-      return null;
-    }
     return jmxAdapter.registerMBean(object, objectName, false);
   }
 
   public ObjectName registerInternalMBean(Object object, ObjectName objectName) {
     verifyManagementService();
-    if (localFilterChain.isFiltered(objectName)) {
-      return null;
-    }
     return jmxAdapter.registerMBean(object, objectName, true);
   }
 
@@ -420,10 +395,7 @@ public class SystemManagementService extends BaseManagementService {
   }
 
   public boolean isManagerCreated() {
-    if (!isStartedAndOpen()) {
-      return false;
-    }
-    return federatingManager != null;
+    return isStartedAndOpen() && federatingManager != null;
   }
 
   @Override
@@ -457,10 +429,7 @@ public class SystemManagementService extends BaseManagementService {
           }
           getInternalCache().getJmxManagerAdvisor().broadcastChange();
           started = true;
-        } catch (RuntimeException e) {
-          logger.error("Jmx manager could not be started because {}", e.getMessage(), e);
-          throw e;
-        } catch (Error e) {
+        } catch (RuntimeException | Error e) {
           logger.error("Jmx manager could not be started because {}", e.getMessage(), e);
           throw e;
         } finally {
@@ -581,8 +550,8 @@ public class SystemManagementService extends BaseManagementService {
   }
 
   @Override
-  public ObjectName getGatewaySenderMBeanName(DistributedMember member, String gatwaySenderId)
{
-    return MBeanJMXAdapter.getGatewaySenderMBeanName(member, gatwaySenderId);
+  public ObjectName getGatewaySenderMBeanName(DistributedMember member, String gatewaySenderId)
{
+    return MBeanJMXAdapter.getGatewaySenderMBeanName(member, gatewaySenderId);
   }
 
   @Override
@@ -716,8 +685,7 @@ public class SystemManagementService extends BaseManagementService {
 
   public static class UniversalListenerContainer {
 
-    private List<MembershipListener> membershipListeners =
-        new CopyOnWriteArrayList<MembershipListener>();
+    private List<MembershipListener> membershipListeners = new CopyOnWriteArrayList<>();
 
     public void memberJoined(InternalDistributedMember id) {
       MembershipEvent event = createEvent(id);
@@ -757,7 +725,8 @@ public class SystemManagementService extends BaseManagementService {
     private MembershipEvent createEvent(InternalDistributedMember id) {
       final String memberId = id.getId();
       final DistributedMember member = id;
-      MembershipEvent event = new MembershipEvent() {
+
+      return new MembershipEvent() {
 
         @Override
         public String getMemberId() {
@@ -769,8 +738,6 @@ public class SystemManagementService extends BaseManagementService {
           return member;
         }
       };
-
-      return event;
     }
 
     /**


Mime
View raw message