You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/10/27 17:18:53 UTC

[01/50] [abbrv] incubator-geode git commit: Merge branch 'release/1.0.0-incubating' into develop [Forced Update!]

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-288 a672c7d3e -> 20a32286b (forced update)


Merge branch 'release/1.0.0-incubating' into develop


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

Branch: refs/heads/feature/GEODE-288
Commit: ddc326821c74c170a8fe03642d7114a0e51311d9
Parents: cd06c8c 280a407
Author: Swapnil Bawaskar <sb...@apache.org>
Authored: Tue Oct 25 11:14:01 2016 -0700
Committer: Swapnil Bawaskar <sb...@apache.org>
Committed: Tue Oct 25 11:14:01 2016 -0700

----------------------------------------------------------------------
 KEYS | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 171 insertions(+)
----------------------------------------------------------------------



[43/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java
deleted file mode 100644
index 02e7ae4..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java
+++ /dev/null
@@ -1,258 +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.admin.internal;
-
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.ConfigurationParameter;
-import org.apache.geode.admin.ManagedEntityConfig;
-import org.apache.geode.internal.admin.GemFireVM;
-
-import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
-
-/**
- * A <code>SystemMember</code> that is also managed (or manageable) by the admin API.
- *
- * This class must be public so that its methods can be invoked reflectively (for MBean operations)
- * on instances of its subclasses.
- *
- * @since GemFire 4.0
- */
-public abstract class ManagedSystemMemberImpl extends SystemMemberImpl
-    implements InternalManagedEntity {
-
-  /** Controller for starting and stopping local or remote managers */
-  protected ManagedEntityController controller;
-
-  /** The state of this managed entity (see bug 32455) */
-  private int state = UNKNOWN;
-
-  /** A lock that is obtained while this entity's state changes */
-  private final Object stateChange = new Object();
-
-  ////////////////////// Constructors //////////////////////
-
-  /**
-   * Creates a new <code>ManagedSystemMemberImpl</code> that represents an existing member of an
-   * <code>AdminDistributedSystem</code>.
-   */
-  protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, GemFireVM vm)
-      throws AdminException {
-
-    super(system, vm);
-    this.controller = system.getEntityController();
-  }
-
-  /**
-   * Creates a new <code>ManagedSystemMemberImpl</code> that represents a non-existing member with
-   * the given <code>ManagedEntityConfig</code> that has not yet been started.
-   */
-  protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, ManagedEntityConfig config)
-      throws AdminException {
-
-    super(system);
-    this.internalId = null;
-    this.id = getNewId();
-    this.host = config.getHost();
-    this.name = this.id;
-    this.controller = system.getEntityController();
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  public String getWorkingDirectory() {
-    return this.getEntityConfig().getWorkingDirectory();
-  }
-
-  public void setWorkingDirectory(String workingDirectory) {
-    this.getEntityConfig().setWorkingDirectory(workingDirectory);
-  }
-
-  public String getProductDirectory() {
-    return this.getEntityConfig().getProductDirectory();
-  }
-
-  public void setProductDirectory(String productDirectory) {
-    this.getEntityConfig().setProductDirectory(productDirectory);
-  }
-
-  @Override
-  public String getHost() {
-    return this.getEntityConfig().getHost();
-  }
-
-  public int setState(int state) {
-    if (this.stateChange == null) {
-      // The initial state is set in the constructor before
-      // stateChange is initialized.
-      int oldState = this.state;
-      this.state = state;
-      return oldState;
-
-    } else {
-      synchronized (this.stateChange) {
-        int oldState = this.state;
-        this.state = state;
-
-        this.stateChange.notifyAll();
-
-        return oldState;
-      }
-    }
-  }
-
-  /**
-   * Returns whether or not this managed system member needs to be stopped. If this member is
-   * stopped or is stopping, then it does not need to be stopped. Otherwise, it will atomically
-   * place this member in the {@link #STOPPING} state. See bug 32455.
-   */
-  protected boolean needToStop() {
-    synchronized (this.stateChange) {
-      if (this.state == STOPPED || this.state == STOPPING) {
-        return false;
-
-      } else {
-        setState(STOPPING);
-        return true;
-      }
-    }
-  }
-
-  /**
-   * Returns whether or not this managed system member needs to be started. If this member is
-   * started or is starting, then it does not need to be started. Otherwise, it will atomically
-   * place this member in the {@link #STARTING} state. See bug 32455.
-   */
-  protected boolean needToStart() {
-    synchronized (this.stateChange) {
-      if (this.state == RUNNING || this.state == STARTING) {
-        return false;
-
-      } else {
-        setState(STARTING);
-        return true;
-      }
-    }
-  }
-
-  /**
-   * Sets the state of this managed system member depending on whether or not <code>vm</code> is
-   * <code>null</code>.
-   */
-  @Override
-  void setGemFireVM(GemFireVM vm) throws AdminException {
-    super.setGemFireVM(vm);
-    if (vm != null) {
-      this.setState(RUNNING);
-
-    } else {
-      this.setState(STOPPED);
-    }
-  }
-
-  /**
-   * Waits until this system member's "state" is {@link #RUNNING}.
-   */
-  public boolean waitToStart(long timeout) throws InterruptedException {
-
-    if (Thread.interrupted())
-      throw new InterruptedException();
-
-    long start = System.currentTimeMillis();
-    while (System.currentTimeMillis() - start < timeout) {
-      synchronized (this.stateChange) {
-        if (this.state == RUNNING) {
-          break;
-
-        } else {
-          this.stateChange.wait(System.currentTimeMillis() - start);
-        }
-      }
-    }
-
-    synchronized (this.stateChange) {
-      return this.state == RUNNING;
-    }
-  }
-
-  /**
-   * Waits until this system member's "state" is {@link #STOPPED}.
-   */
-  public boolean waitToStop(long timeout) throws InterruptedException {
-
-    if (Thread.interrupted())
-      throw new InterruptedException();
-    long start = System.currentTimeMillis();
-    while (System.currentTimeMillis() - start < timeout) {
-      synchronized (this.stateChange) {
-        if (this.state == STOPPED) {
-          break;
-
-        } else {
-          this.stateChange.wait(System.currentTimeMillis() - start);
-        }
-      }
-    }
-
-    synchronized (this.stateChange) {
-      return this.state == STOPPED;
-    }
-  }
-
-  /**
-   * Appends configuration information to a <code>StringBuffer</code> that contains a command line.
-   * Handles certain configuration parameters specially.
-   */
-  protected void appendConfiguration(StringBuffer sb) {
-    ConfigurationParameter[] params = this.getConfiguration();
-    for (int i = 0; i < params.length; i++) {
-      ConfigurationParameter param = params[i];
-
-      if (!param.isModifiable()) {
-        continue;
-      }
-
-      String name = param.getName();
-      String value = param.getValueAsString();
-
-      if (value != null && !value.equals("")) {
-        if (name.equals(LOCATORS)) {
-          // Use the new locator syntax so that is plays nicely with
-          // rsh. See bug 32306.
-          String locator = value;
-          int firstBracket = locator.indexOf('[');
-          int lastBracket = locator.indexOf(']');
-
-          if (firstBracket > -1 && lastBracket > -1) {
-            String host = locator.substring(0, firstBracket);
-            String port = locator.substring(firstBracket + 1, lastBracket);
-            locator = host + ":" + port;
-          }
-
-          sb.append(" ");
-          sb.append(name);
-          sb.append("=");
-          sb.append(locator);
-
-        } else {
-          sb.append(" ");
-          sb.append(name);
-          sb.append("=");
-          sb.append(value);
-        }
-      }
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthConfigImpl.java
deleted file mode 100644
index f250fee..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthConfigImpl.java
+++ /dev/null
@@ -1,95 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-
-// @todo Make this class (and all of its subclasses) {@link java.io.Externalizable} or
-// {@link org.apache.geode.DataSerializable}.
-/**
- * The implementation of <code>MemberHealthConfig</code>
- *
- *
- * @since GemFire 3.5
- */
-public abstract class MemberHealthConfigImpl implements MemberHealthConfig, java.io.Serializable {
-
-  private static final long serialVersionUID = 3966032573073580490L;
-
-  /**
-   * The maximum process size (in megabytes) of a healthy member of the distributed system.
-   */
-  private long maxVMProcessSize = DEFAULT_MAX_VM_PROCESS_SIZE;
-
-  /**
-   * The maximum number of enqueued incoming or outgoing messages that a healthy member of a
-   * distributed system can have.
-   */
-  private long maxMessageQueueSize = DEFAULT_MAX_MESSAGE_QUEUE_SIZE;
-
-  /**
-   * The maximum number message replies that can timeout in a healthy member.
-   */
-  private long maxReplyTimeouts = DEFAULT_MAX_REPLY_TIMEOUTS;
-
-  /**
-   * The maximum multicast retransmit / multicast message count ratio
-   */
-  private double maxRetransmissionRatio = DEFAULT_MAX_RETRANSMISSION_RATIO;
-
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>MemberHealthConfigImpl</code> with the default configuration.
-   */
-  MemberHealthConfigImpl() {
-
-  }
-
-  ///////////////////// Instance Methods //////////////////////
-
-  public long getMaxVMProcessSize() {
-    return this.maxVMProcessSize;
-  }
-
-  public void setMaxVMProcessSize(long size) {
-    this.maxVMProcessSize = size;
-  }
-
-  public long getMaxMessageQueueSize() {
-    return this.maxMessageQueueSize;
-  }
-
-  public void setMaxMessageQueueSize(long maxMessageQueueSize) {
-    this.maxMessageQueueSize = maxMessageQueueSize;
-  }
-
-  public long getMaxReplyTimeouts() {
-    return this.maxReplyTimeouts;
-  }
-
-  public void setMaxReplyTimeouts(long maxReplyTimeouts) {
-    this.maxReplyTimeouts = maxReplyTimeouts;
-  }
-
-  public double getMaxRetransmissionRatio() {
-    return this.maxRetransmissionRatio;
-  }
-
-  public void setMaxRetransmissionRatio(double ratio) {
-    this.maxRetransmissionRatio = ratio;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java
deleted file mode 100644
index 951b364..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java
+++ /dev/null
@@ -1,247 +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.admin.internal;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.admin.*;
-import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.distributed.internal.*;
-import org.apache.geode.internal.*;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.cache.CachePerfStats;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.statistics.GemFireStatSampler;
-import org.apache.geode.internal.statistics.platform.ProcessStats;
-
-import java.util.*;
-
-/**
- * Contains the logic for evaluating the health of a GemFire distributed system member according to
- * the thresholds provided in a {@link MemberHealthConfig}.
- *
- * @see VMStats
- * @see ProcessStats
- * @see DMStats
- *
- *
- * @since GemFire 3.5
- */
-/**
- *
- */
-class MemberHealthEvaluator extends AbstractHealthEvaluator {
-
-  /** The config from which we get the evaluation criteria */
-  private MemberHealthConfig config;
-
-  /** The description of the member being evaluated */
-  private String description;
-
-  // /** Statistics about this VM (may be null) */
-  // private VMStatsContract vmStats;
-
-  /** Statistics about this process (may be null) */
-  private ProcessStats processStats;
-
-  /** Statistics about the distribution manager */
-  private DMStats dmStats;
-
-  /** The previous value of the reply timeouts stat */
-  private long prevReplyTimeouts;
-
-  ////////////////////// Constructors //////////////////////
-
-  /**
-   * Creates a new <code>MemberHealthEvaluator</code>
-   */
-  MemberHealthEvaluator(GemFireHealthConfig config, DM dm) {
-    super(config, dm);
-
-    this.config = config;
-    InternalDistributedSystem system = dm.getSystem();
-
-    GemFireStatSampler sampler = system.getStatSampler();
-    if (sampler != null) {
-      // Sampling is enabled
-      // this.vmStats = sampler.getVMStats();
-      this.processStats = sampler.getProcessStats();
-    }
-
-    this.dmStats = dm.getStats();
-
-    StringBuffer sb = new StringBuffer();
-    sb.append("Application VM member ");
-    sb.append(dm.getId());
-    int pid = OSProcess.getId();
-    if (pid != 0) {
-      sb.append(" with pid ");
-      sb.append(pid);
-    }
-    this.description = sb.toString();
-  }
-
-  //////////////////// Instance Methods ////////////////////
-
-  @Override
-  protected String getDescription() {
-    return this.description;
-  }
-
-  /**
-   * Checks to make sure that the {@linkplain ProcessStats#getProcessSize VM's process size} is less
-   * than the {@linkplain MemberHealthConfig#getMaxVMProcessSize threshold}. If not, the status is
-   * "okay" health.
-   */
-  void checkVMProcessSize(List status) {
-    // There is no need to check isFirstEvaluation()
-    if (this.processStats == null) {
-      return;
-    }
-
-    long vmSize = this.processStats.getProcessSize();
-    long threshold = this.config.getMaxVMProcessSize();
-    if (vmSize > threshold) {
-      String s =
-          LocalizedStrings.MemberHealthEvaluator_THE_SIZE_OF_THIS_VM_0_MEGABYTES_EXCEEDS_THE_THRESHOLD_1_MEGABYTES
-              .toLocalizedString(new Object[] {Long.valueOf(vmSize), Long.valueOf(threshold)});
-      status.add(okayHealth(s));
-    }
-  }
-
-  /**
-   * Checks to make sure that the size of the distribution manager's
-   * {@linkplain DMStats#getOverflowQueueSize() overflow} message queue does not exceed the
-   * {@linkplain MemberHealthConfig#getMaxMessageQueueSize threshold}. If not, the status is "okay"
-   * health.
-   */
-  void checkMessageQueueSize(List status) {
-    long threshold = this.config.getMaxMessageQueueSize();
-    long overflowSize = this.dmStats.getOverflowQueueSize();
-    if (overflowSize > threshold) {
-      String s =
-          LocalizedStrings.MemberHealthEvaluator_THE_SIZE_OF_THE_OVERFLOW_QUEUE_0_EXCEEDS_THE_THRESHOLD_1
-              .toLocalizedString(
-                  new Object[] {Long.valueOf(overflowSize), Long.valueOf(threshold)});
-      status.add(okayHealth(s));
-    }
-  }
-
-  /**
-   * Checks to make sure that the number of {@linkplain DMStats#getReplyTimeouts reply timeouts}
-   * does not exceed the {@linkplain MemberHealthConfig#getMaxReplyTimeouts threshold}. If not, the
-   * status is "okay" health.
-   */
-  void checkReplyTimeouts(List status) {
-    if (isFirstEvaluation()) {
-      return;
-    }
-
-    long threshold = this.config.getMaxReplyTimeouts();
-    long deltaReplyTimeouts = this.dmStats.getReplyTimeouts() - prevReplyTimeouts;
-    if (deltaReplyTimeouts > threshold) {
-      String s =
-          LocalizedStrings.MemberHealthEvaluator_THE_NUMBER_OF_MESSAGE_REPLY_TIMEOUTS_0_EXCEEDS_THE_THRESHOLD_1
-              .toLocalizedString(
-                  new Object[] {Long.valueOf(deltaReplyTimeouts), Long.valueOf(threshold)});
-      status.add(okayHealth(s));
-    }
-  }
-
-  /**
-   * See if the multicast retransmission ratio is okay
-   */
-  void checkRetransmissionRatio(List status) {
-    double threshold = this.config.getMaxRetransmissionRatio();
-    int mcastMessages = this.dmStats.getMcastWrites();
-    if (mcastMessages > 100000) { // avoid initial state & int overflow
-      // the ratio we actually use here is (retransmit requests) / (mcast datagram writes)
-      // a single retransmit request may include multiple missed messages
-      double ratio =
-          (this.dmStats.getMcastRetransmits() * 1.0) / (this.dmStats.getMcastWrites() * 1.0);
-      if (ratio > threshold) {
-        String s = "The number of message retransmissions (" + ratio + ") exceeds the threshold ("
-            + threshold + ")";
-        status.add(okayHealth(s));
-      }
-    }
-  }
-
-  /**
-   * The function keeps updating the health of the cache based on roles required by the regions and
-   * their reliablity policies.
-   * 
-   */
-
-  void checkCacheRequiredRolesMeet(List status) {
-    // will have to call here okeyHealth() or poorHealth()
-    // GemFireCache cache = (GemFireCache)CacheFactory.getAnyInstance();
-
-    // CachePerfStats cPStats= null;
-    try {
-      GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
-      CachePerfStats cPStats = null;
-      cPStats = cache.getCachePerfStats();
-
-      if (cPStats.getReliableRegionsMissingFullAccess() > 0) {
-        // health is okay.
-        int numRegions = cPStats.getReliableRegionsMissingFullAccess();
-        status.add(okayHealth(
-            LocalizedStrings.MemberHealthEvaluator_THERE_ARE_0_REGIONS_MISSING_REQUIRED_ROLES_BUT_ARE_CONFIGURED_FOR_FULL_ACCESS
-                .toLocalizedString(Integer.valueOf(numRegions))));
-      } else if (cPStats.getReliableRegionsMissingLimitedAccess() > 0) {
-        // health is poor
-        int numRegions = cPStats.getReliableRegionsMissingLimitedAccess();
-        status.add(poorHealth(
-            LocalizedStrings.MemberHealthEvaluator_THERE_ARE_0_REGIONS_MISSING_REQUIRED_ROLES_AND_CONFIGURED_WITH_LIMITED_ACCESS
-                .toLocalizedString(Integer.valueOf(numRegions))));
-      } else if (cPStats.getReliableRegionsMissingNoAccess() > 0) {
-        // health is poor
-        int numRegions = cPStats.getReliableRegionsMissingNoAccess();
-        status.add(poorHealth(
-            LocalizedStrings.MemberHealthEvaluator_THERE_ARE_0_REGIONS_MISSING_REQUIRED_ROLES_AND_CONFIGURED_WITHOUT_ACCESS
-                .toLocalizedString(Integer.valueOf(numRegions))));
-      } // else{
-        // health is good/okay
-        // status.add(okayHealth("All regions have there required roles meet"));
-        // }
-    } catch (CancelException ignore) {
-    }
-  }
-
-
-  /**
-   * Updates the previous values of statistics
-   */
-  private void updatePrevious() {
-    this.prevReplyTimeouts = this.dmStats.getReplyTimeouts();
-  }
-
-  @Override
-  protected void check(List status) {
-    checkVMProcessSize(status);
-    checkMessageQueueSize(status);
-    checkReplyTimeouts(status);
-    // will have to add another call to check for roles
-    // missing and reliablity attributed.
-    checkCacheRequiredRolesMeet(status);
-
-    updatePrevious();
-  }
-
-  @Override
-  void close() {
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupRequest.java b/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupRequest.java
deleted file mode 100644
index 7025721..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupRequest.java
+++ /dev/null
@@ -1,133 +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.admin.internal;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.cache.persistence.PersistentID;
-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.ReplyException;
-import org.apache.geode.internal.admin.remote.AdminFailureResponse;
-import org.apache.geode.internal.admin.remote.AdminMultipleReplyProcessor;
-import org.apache.geode.internal.admin.remote.AdminResponse;
-import org.apache.geode.internal.admin.remote.CliLegacyMessage;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.cache.persistence.BackupManager;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-
-/**
- * A request to from an admin VM to all non admin members to start a backup. In the prepare phase of
- * the backup, the members will suspend bucket destroys to make sure buckets aren't missed during
- * the backup.
- * 
- *
- */
-public class PrepareBackupRequest extends CliLegacyMessage {
-  private static final Logger logger = LogService.getLogger();
-
-  public PrepareBackupRequest() {
-
-  }
-
-  public static Map<DistributedMember, Set<PersistentID>> send(DM dm, Set recipients) {
-    PrepareBackupRequest request = new PrepareBackupRequest();
-    request.setRecipients(recipients);
-
-    PrepareBackupReplyProcessor replyProcessor = new PrepareBackupReplyProcessor(dm, recipients);
-    request.msgId = replyProcessor.getProcessorId();
-    dm.putOutgoing(request);
-    try {
-      replyProcessor.waitForReplies();
-    } catch (ReplyException e) {
-      if (!(e.getCause() instanceof CancelException)) {
-        throw e;
-      }
-    } catch (InterruptedException e) {
-      e.printStackTrace();
-    }
-    AdminResponse response = request.createResponse((DistributionManager) dm);
-    response.setSender(dm.getDistributionManagerId());
-    replyProcessor.process(response);
-    return replyProcessor.results;
-  }
-
-  @Override
-  protected AdminResponse createResponse(DistributionManager dm) {
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-    HashSet<PersistentID> persistentIds;
-    if (cache == null) {
-      persistentIds = new HashSet<PersistentID>();
-    } else {
-      try {
-        BackupManager manager = cache.startBackup(getSender());
-        persistentIds = manager.prepareBackup();
-      } catch (IOException e) {
-        logger.error(
-            LocalizedMessage.create(LocalizedStrings.CliLegacyMessage_ERROR, this.getClass()), e);
-        return AdminFailureResponse.create(dm, getSender(), e);
-      }
-    }
-
-
-    return new PrepareBackupResponse(this.getSender(), persistentIds);
-  }
-
-  public int getDSFID() {
-    return PREPARE_BACKUP_REQUEST;
-  }
-
-  private static class PrepareBackupReplyProcessor extends AdminMultipleReplyProcessor {
-    Map<DistributedMember, Set<PersistentID>> results =
-        Collections.synchronizedMap(new HashMap<DistributedMember, Set<PersistentID>>());
-
-    public PrepareBackupReplyProcessor(DM dm, Collection initMembers) {
-      super(dm, initMembers);
-    }
-
-    @Override
-    protected boolean stopBecauseOfExceptions() {
-      return false;
-    }
-
-    @Override
-    protected void process(DistributionMessage msg, boolean warn) {
-      if (msg instanceof PrepareBackupResponse) {
-        final HashSet<PersistentID> persistentIds =
-            ((PrepareBackupResponse) msg).getPersistentIds();
-        if (persistentIds != null && !persistentIds.isEmpty()) {
-          results.put(msg.getSender(), persistentIds);
-        }
-      }
-      super.process(msg, warn);
-    }
-
-
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupResponse.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupResponse.java b/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupResponse.java
deleted file mode 100644
index 2ba6817..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/PrepareBackupResponse.java
+++ /dev/null
@@ -1,80 +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.admin.internal;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.HashSet;
-
-import org.apache.geode.DataSerializer;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.admin.remote.AdminResponse;
-
-/**
- * The response to the {@link PrepareBackupRequest}
- * 
- *
- */
-public class PrepareBackupResponse extends AdminResponse {
-
-  private HashSet<PersistentID> persistentIds;
-
-  public PrepareBackupResponse() {
-    super();
-  }
-
-  public PrepareBackupResponse(InternalDistributedMember sender,
-      HashSet<PersistentID> persistentIds) {
-    this.setRecipient(sender);
-    this.persistentIds = persistentIds;
-  }
-
-  public HashSet<PersistentID> getPersistentIds() {
-    return persistentIds;
-  }
-
-  @Override
-  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
-    super.fromData(in);
-    persistentIds = DataSerializer.readHashSet(in);
-  }
-
-
-
-  @Override
-  public void toData(DataOutput out) throws IOException {
-    super.toData(out);
-    DataSerializer.writeHashSet(persistentIds, out);
-  }
-
-
-
-  @Override
-  protected Object clone() throws CloneNotSupportedException {
-    // TODO Auto-generated method stub
-    return super.clone();
-  }
-
-  public int getDSFID() {
-    return PREPARE_BACKUP_RESPONSE;
-  }
-
-  @Override
-  public String toString() {
-    return getClass().getName() + ": " + persistentIds;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/StatisticImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/StatisticImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/StatisticImpl.java
deleted file mode 100755
index 517f0a0..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/StatisticImpl.java
+++ /dev/null
@@ -1,92 +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.admin.internal;
-
-import org.apache.geode.internal.admin.Stat;
-
-/**
- * Implementation of a single statistic in a <code>StatisticResource</code>
- *
- * @since GemFire 3.5
- *
- */
-public class StatisticImpl implements org.apache.geode.admin.Statistic {
-
-  private static final long serialVersionUID = 3899296873901634399L;
-
-  private Stat internalStat;
-
-  protected StatisticImpl() {}
-
-  protected StatisticImpl(Stat internalStat) {
-    this.internalStat = internalStat;
-  }
-
-  /**
-   * @return the identifying name of this stat
-   */
-  public String getName() {
-    return this.internalStat.getName();
-  }
-
-  /**
-   * @return the value of this stat as a <code>java.lang.Number</code>
-   */
-  public Number getValue() {
-    return this.internalStat.getValue();
-  }
-
-  /**
-   * @return a display string for the unit of measurement (if any) this stat represents
-   */
-  public String getUnits() {
-    return this.internalStat.getUnits();
-  }
-
-  /**
-   * @return true if this stat represents a numeric value which always increases
-   */
-  public boolean isCounter() {
-    return this.internalStat.isCounter();
-  }
-
-  /**
-   * @return the full description of this stat
-   */
-  public String getDescription() {
-    return this.internalStat.getDescription();
-  }
-
-  /**
-   * Sets the internal stat which allows us to reuse the wrapper object and handle refreshes along
-   * with isWriteable set to false on the attribute.
-   */
-  protected void setStat(Stat internalStat) {
-    this.internalStat = internalStat;
-  }
-
-  /**
-   * Returns a string representation of the object.
-   * 
-   * @return a string representation of the object
-   */
-  @Override
-  public String toString() {
-    return getName();
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/StatisticResourceImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/StatisticResourceImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/StatisticResourceImpl.java
deleted file mode 100755
index c6f60cb..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/StatisticResourceImpl.java
+++ /dev/null
@@ -1,177 +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.admin.internal;
-
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.SystemMember;
-import org.apache.geode.admin.Statistic;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.admin.Stat;
-import org.apache.geode.internal.admin.StatResource;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-// import org.apache.geode.internal.admin.SystemMember;
-
-import java.util.ArrayList;
-// import java.util.Date;
-import java.util.List;
-
-/**
- * Provides monitoring of a statistic resource.
- *
- * @since GemFire 3.5
- */
-public class StatisticResourceImpl implements org.apache.geode.admin.StatisticResource {
-
-  /** The underlying remote StatResource which this object delegates to */
-  protected StatResource statResource;
-  /** Displayable name of this statistic resource */
-  protected String name;
-  /** Description of this statistic resource */
-  protected String description;
-  /** Classification type of this statistic resource */
-  protected String type;
-  /** GemFire system member which owns this statistic resource */
-  protected SystemMember member;
-  /** The array of statistics in this resource */
-  protected Statistic[] statistics; // = new Statistic[0];
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs an instance of StatisticResourceImpl.
-   *
-   * @param statResource the admin StatResource to manage/monitor
-   * @param member the SystemMember owning this resource
-   * @exception org.apache.geode.admin.AdminException if unable to create this StatisticResource for
-   *            administration
-   */
-  public StatisticResourceImpl(StatResource statResource, SystemMember member)
-      throws org.apache.geode.admin.AdminException {
-    this.statResource = statResource;
-    this.member = member;
-    this.name = this.statResource.getName();
-    this.description = this.statResource.getDescription();
-    this.type = this.statResource.getType();
-  }
-
-  // -------------------------------------------------------------------------
-  // Attributes accessors and mutators
-  // -------------------------------------------------------------------------
-
-  public String getName() {
-    return this.name;
-  }
-
-  public String getDescription() {
-    return this.description;
-  }
-
-  public String getType() {
-    return this.type;
-  }
-
-  public String getOwner() {
-    return this.member.toString();
-  }
-
-  public Statistic[] getStatistics() {
-    if (this.statistics == null) {
-      try {
-        refresh();
-      } catch (AdminException e) {
-        this.statistics = new Statistic[0];
-      }
-    }
-    return this.statistics;
-  }
-
-  public long getUniqueId() {
-    return this.statResource.getResourceUniqueID();
-  }
-
-  // -------------------------------------------------------------------------
-  // Operations
-  // -------------------------------------------------------------------------
-
-  public void refresh() throws org.apache.geode.admin.AdminException {
-    Stat[] stats = null;
-    if (this.statResource != null) {
-      stats = this.statResource.getStats();
-    }
-    if (stats == null || stats.length < 1) {
-      throw new AdminException(
-          LocalizedStrings.StatisticResourceImpl_FAILED_TO_REFRESH_STATISTICS_0_FOR_1
-              .toLocalizedString(getType() + "-" + getName(), getOwner()));
-    }
-
-    if (this.statistics == null || this.statistics.length < 1) {
-      // define new statistics instances...
-      List statList = new ArrayList();
-      for (int i = 0; i < stats.length; i++) {
-        statList.add(createStatistic(stats[i]));
-      }
-      this.statistics = (Statistic[]) statList.toArray(new Statistic[0]);
-    } else {
-      // update the existing instances...
-      for (int i = 0; i < stats.length; i++) {
-        updateStatistic(stats[i]);
-      }
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // Non-public implementation methods
-  // -------------------------------------------------------------------------
-
-  /**
-   * Updates the value of the {@link Statistic} corresponding to the internal
-   * {@link org.apache.geode.internal.admin.Stat}
-   *
-   * @param stat the internal stat to use in updating the matching statistic
-   */
-  private void updateStatistic(Stat stat) {
-    for (int i = 0; i < this.statistics.length; i++) {
-      if (this.statistics[i].getName().equals(stat.getName())) {
-        ((StatisticImpl) this.statistics[i]).setStat(stat);
-        return;
-      }
-    }
-    Assert.assertTrue(false, "Unknown stat: " + stat.getName());
-  }
-
-  /**
-   * Creates a new {@link StatisticImpl} to represent the internal
-   * {@link org.apache.geode.internal.admin.Stat}
-   *
-   * @param stat the internal stat to wrap in a new statistic
-   */
-  protected Statistic createStatistic(Stat stat) {
-    return new StatisticImpl(stat);
-  }
-
-  /**
-   * Returns a string representation of the object.
-   * 
-   * @return a string representation of the object
-   */
-  @Override
-  public String toString() {
-    return getName();
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberBridgeServerImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberBridgeServerImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberBridgeServerImpl.java
deleted file mode 100644
index 4e530ef..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberBridgeServerImpl.java
+++ /dev/null
@@ -1,234 +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.admin.internal;
-
-import java.io.Serializable;
-
-import org.apache.geode.InternalGemFireException;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.SystemMemberBridgeServer;
-import org.apache.geode.admin.SystemMemberCacheServer;
-import org.apache.geode.cache.server.ServerLoadProbe;
-import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-/**
- * Implementation of an object used for managing cache servers.
- *
- * @since GemFire 4.0
- */
-public class SystemMemberBridgeServerImpl
-    implements SystemMemberCacheServer, SystemMemberBridgeServer {
-
-  /** The VM in which the bridge server resides */
-  private final GemFireVM vm;
-
-  /** The cache server by this bridge server */
-  private CacheInfo cache;
-
-  /** Information about the bridge server */
-  private AdminBridgeServer bridgeInfo;
-
-  ///////////////////// Constructors /////////////////////
-
-  /**
-   * Creates a new <code>SystemMemberBridgeServerImpl</code> that administers the given bridge
-   * server in the given VM.
-   */
-  protected SystemMemberBridgeServerImpl(SystemMemberCacheImpl cache, AdminBridgeServer bridgeInfo)
-
-      throws AdminException {
-
-    this.vm = cache.getVM();
-    this.cache = cache.getCacheInfo();
-    this.bridgeInfo = bridgeInfo;
-  }
-
-  //////////////////// Instance Methods ////////////////////
-
-  /**
-   * Throws an <code>AdminException</code> if this bridge server is running.
-   */
-  private void checkRunning() throws AdminException {
-    if (this.isRunning()) {
-      throw new AdminException(
-          LocalizedStrings.SystemMemberBridgeServerImpl_CANNOT_CHANGE_THE_CONFIGURATION_OF_A_RUNNING_BRIDGE_SERVER
-              .toLocalizedString());
-    }
-  }
-
-  public int getPort() {
-    return this.bridgeInfo.getPort();
-  }
-
-  public void setPort(int port) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setPort(port);
-  }
-
-  public void start() throws AdminException {
-    this.vm.startBridgeServer(this.cache, this.bridgeInfo);
-  }
-
-  public boolean isRunning() {
-    return this.bridgeInfo.isRunning();
-  }
-
-  public void stop() throws AdminException {
-    this.vm.stopBridgeServer(this.cache, this.bridgeInfo);
-  }
-
-  /**
-   * Returns the VM-unique id of this bridge server
-   */
-  protected int getBridgeId() {
-    return this.bridgeInfo.getId();
-  }
-
-  public void refresh() {
-    try {
-      this.bridgeInfo = this.vm.getBridgeInfo(this.cache, this.bridgeInfo.getId());
-
-    } catch (AdminException ex) {
-      throw new InternalGemFireException(
-          LocalizedStrings.SystemMemberBridgeServerImpl_UNEXPECTED_EXCEPTION_WHILE_REFRESHING
-              .toLocalizedString(),
-          ex);
-    }
-  }
-
-  public String getBindAddress() {
-    return this.bridgeInfo.getBindAddress();
-  }
-
-  public void setBindAddress(String address) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setBindAddress(address);
-  }
-
-  public String getHostnameForClients() {
-    return this.bridgeInfo.getHostnameForClients();
-  }
-
-  public void setHostnameForClients(String name) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setHostnameForClients(name);
-  }
-
-  public void setNotifyBySubscription(boolean b) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setNotifyBySubscription(b);
-  }
-
-  public boolean getNotifyBySubscription() {
-    return this.bridgeInfo.getNotifyBySubscription();
-  }
-
-  public void setSocketBufferSize(int socketBufferSize) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setSocketBufferSize(socketBufferSize);
-  }
-
-  public int getSocketBufferSize() {
-    return this.bridgeInfo.getSocketBufferSize();
-  }
-
-  public void setTcpDelay(boolean setting) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setTcpNoDelay(setting);
-  }
-
-  public boolean getTcpDelay() {
-    return this.bridgeInfo.getTcpNoDelay();
-  }
-
-  public void setMaximumTimeBetweenPings(int maximumTimeBetweenPings) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setMaximumTimeBetweenPings(maximumTimeBetweenPings);
-  }
-
-  public int getMaximumTimeBetweenPings() {
-    return this.bridgeInfo.getMaximumTimeBetweenPings();
-  }
-
-  public int getMaxConnections() {
-    return this.bridgeInfo.getMaxConnections();
-  }
-
-  public void setMaxConnections(int maxCons) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setMaxConnections(maxCons);
-  }
-
-  public int getMaxThreads() {
-    return this.bridgeInfo.getMaxThreads();
-  }
-
-  public void setMaxThreads(int maxThreads) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setMaxThreads(maxThreads);
-  }
-
-  public int getMaximumMessageCount() {
-    return this.bridgeInfo.getMaximumMessageCount();
-  }
-
-  public void setMaximumMessageCount(int maxMessageCount) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setMaximumMessageCount(maxMessageCount);
-  }
-
-  public int getMessageTimeToLive() {
-    return this.bridgeInfo.getMessageTimeToLive();
-  }
-
-  public void setMessageTimeToLive(int messageTimeToLive) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setMessageTimeToLive(messageTimeToLive);
-  }
-
-  public void setGroups(String[] groups) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setGroups(groups);
-  }
-
-  public String[] getGroups() {
-    return this.bridgeInfo.getGroups();
-  }
-
-  public String getLoadProbe() {
-    return this.bridgeInfo.getLoadProbe().toString();
-  }
-
-  public void setLoadProbe(ServerLoadProbe loadProbe) throws AdminException {
-    checkRunning();
-    if (!(loadProbe instanceof Serializable)) {
-      throw new IllegalArgumentException(
-          "Load probe must be Serializable to be used with admin API");
-    }
-    this.bridgeInfo.setLoadProbe(loadProbe);
-  }
-
-  public long getLoadPollInterval() {
-    return this.bridgeInfo.getLoadPollInterval();
-  }
-
-  public void setLoadPollInterval(long loadPollInterval) throws AdminException {
-    checkRunning();
-    this.bridgeInfo.setLoadPollInterval(loadPollInterval);
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheEventImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheEventImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheEventImpl.java
deleted file mode 100644
index b6b386e..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheEventImpl.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.admin.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.cache.Operation;
-
-/**
- * An event that describes an operation on a cache. Instances of this are delivered to a
- * {@link SystemMemberCacheListener} when a a cache is created or closed.
- *
- * @since GemFire 5.0
- */
-public class SystemMemberCacheEventImpl extends SystemMembershipEventImpl
-    implements SystemMemberCacheEvent {
-
-  /** The operation done by this event */
-  private Operation op;
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>SystemMemberCacheEvent</code> for the member with the given id.
-   */
-  protected SystemMemberCacheEventImpl(DistributedMember id, Operation op) {
-    super(id);
-    this.op = op;
-  }
-
-  ///////////////////// Instance Methods /////////////////////
-
-  public Operation getOperation() {
-    return this.op;
-  }
-
-  @Override
-  public String toString() {
-    return super.toString() + " op=" + this.op;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheEventProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheEventProcessor.java b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheEventProcessor.java
deleted file mode 100644
index 8afafdb..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheEventProcessor.java
+++ /dev/null
@@ -1,146 +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.admin.internal;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.DataSerializer;
-import org.apache.geode.admin.SystemMemberCacheEvent;
-import org.apache.geode.admin.SystemMemberCacheListener;
-import org.apache.geode.admin.SystemMemberRegionEvent;
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.Operation;
-import org.apache.geode.cache.Region;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.distributed.internal.HighPriorityDistributionMessage;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.internal.logging.LogService;
-
-/**
- * This class processes the message to be delivered to admin node. [This needs to be redesigned and
- * reimplemented... see 32887]
- * 
- * @since GemFire 5.0
- */
-public class SystemMemberCacheEventProcessor {
-  private static final Logger logger = LogService.getLogger();
-
-
-  /*
-   * Sends cache create/close message to Admin VMs
-   */
-  public static void send(Cache c, Operation op) {
-    send(c, null, op);
-  }
-
-  /*
-   * Sends region creation/destroy message to Admin VMs
-   */
-  public static void send(Cache c, Region region, Operation op) {
-    InternalDistributedSystem system = (InternalDistributedSystem) c.getDistributedSystem();
-    Set recps = system.getDistributionManager().getAdminMemberSet();
-    // @todo darrel: find out if any of these guys have region listeners
-    if (recps.isEmpty()) {
-      return;
-    }
-    SystemMemberCacheMessage msg = new SystemMemberCacheMessage();
-    if (region == null) {
-      msg.regionPath = null;
-    } else {
-      msg.regionPath = region.getFullPath();
-    }
-    msg.setRecipients(recps);
-    msg.op = op;
-    system.getDistributionManager().putOutgoing(msg);
-  }
-
-
-  public static final class SystemMemberCacheMessage extends HighPriorityDistributionMessage {
-    protected String regionPath;
-    protected Operation op;
-
-    @Override
-    protected void process(DistributionManager dm) {
-      AdminDistributedSystemImpl admin = AdminDistributedSystemImpl.getConnectedInstance();
-      if (admin == null) {
-        if (logger.isDebugEnabled()) {
-          logger.debug("Ignoring message because there is no admin distributed system present: {}",
-              this);
-        }
-        return; // probably shutting down or still connecting
-      }
-      List listeners = admin.getCacheListeners();
-      Iterator itr = listeners.iterator();
-      SystemMemberCacheListener listener = null;
-      while (itr.hasNext()) {
-        listener = (SystemMemberCacheListener) itr.next();
-        if (this.regionPath == null) {
-          SystemMemberCacheEvent event = new SystemMemberCacheEventImpl(getSender(), this.op);
-          if (this.op == Operation.CACHE_CREATE) {
-            listener.afterCacheCreate(event);
-          } else {
-            listener.afterCacheClose(event);
-          }
-        } else {
-          SystemMemberRegionEvent event =
-              new SystemMemberRegionEventImpl(getSender(), this.op, this.regionPath);
-          if (this.op.isRegionDestroy()) {
-            listener.afterRegionLoss(event);
-          } else {
-            listener.afterRegionCreate(event);
-          }
-        }
-      }
-    }
-
-    public int getDSFID() {
-      return ADMIN_CACHE_EVENT_MESSAGE;
-    }
-
-    @Override
-    public void fromData(DataInput in) throws IOException, ClassNotFoundException {
-      super.fromData(in);
-      this.regionPath = DataSerializer.readString(in);
-      this.op = Operation.fromOrdinal(in.readByte());
-    }
-
-    @Override
-    public void toData(DataOutput out) throws IOException {
-      super.toData(out);
-      DataSerializer.writeString(this.regionPath, out);
-      out.writeByte(this.op.ordinal);
-    }
-
-    @Override
-    public String toString() {
-      StringBuffer buff = new StringBuffer();
-      buff.append("SystemMemberCacheMessage (region='");
-      buff.append(this.regionPath);
-      buff.append("'; sender=");
-      buff.append(this.sender);
-      buff.append("; op=");
-      buff.append(this.op);
-      buff.append(")");
-      return buff.toString();
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheImpl.java
deleted file mode 100644
index 62076f0..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberCacheImpl.java
+++ /dev/null
@@ -1,303 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.cache.*;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.ObjIdMap;
-import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import java.util.*;
-
-/**
- * View of a GemFire system member's cache.
- *
- * @since GemFire 3.5
- */
-public class SystemMemberCacheImpl implements SystemMemberCache {
-  protected final GemFireVM vm;
-  protected CacheInfo info;
-  protected Statistic[] statistics;
-
-  /** Maps the id of a bridge server to its SystemMemberBridgeServer */
-  private ObjIdMap bridgeServers = new ObjIdMap();
-
-  // constructors
-  public SystemMemberCacheImpl(GemFireVM vm) throws CacheDoesNotExistException {
-    this.vm = vm;
-    this.info = vm.getCacheInfo();
-    if (this.info == null) {
-      throw new CacheDoesNotExistException(
-          LocalizedStrings.SystemMemberCacheImpl_THE_VM_0_DOES_NOT_CURRENTLY_HAVE_A_CACHE
-              .toLocalizedString(vm.getId()));
-    }
-    initStats();
-  }
-
-  // attributes
-  /**
-   * The name of the cache.
-   */
-  public String getName() {
-    String result = this.info.getName();
-    if (result == null || result.length() == 0) {
-      result = "default";
-    }
-    return result;
-  }
-
-  /**
-   * Value that uniquely identifies an instance of a cache for a given member.
-   */
-  public int getId() {
-    return this.info.getId();
-  }
-
-  public boolean isClosed() {
-    return this.info.isClosed();
-  }
-
-  public int getLockTimeout() {
-    return this.info.getLockTimeout();
-  }
-
-  public void setLockTimeout(int seconds) throws AdminException {
-    this.info = this.vm.setCacheLockTimeout(this.info, seconds);
-  }
-
-  public int getLockLease() {
-    return this.info.getLockLease();
-  }
-
-  public void setLockLease(int seconds) throws AdminException {
-    this.info = this.vm.setCacheLockLease(this.info, seconds);
-  }
-
-  public int getSearchTimeout() {
-    return this.info.getSearchTimeout();
-  }
-
-  public void setSearchTimeout(int seconds) throws AdminException {
-    this.info = this.vm.setCacheSearchTimeout(this.info, seconds);
-  }
-
-  public int getUpTime() {
-    return this.info.getUpTime();
-  }
-
-  public java.util.Set getRootRegionNames() {
-    Set set = this.info.getRootRegionNames();
-    if (set == null) {
-      set = Collections.EMPTY_SET;
-    }
-    return set;
-  }
-  // operations
-
-  public void refresh() {
-    if (!this.info.isClosed()) {
-      CacheInfo cur = vm.getCacheInfo();
-      if (cur == null || (this.info.getId() != cur.getId())) {
-        // it is a different instance of the cache. So set our version
-        // to closed
-        this.info.setClosed();
-      } else {
-        this.info = cur;
-        updateStats();
-      }
-    }
-  }
-
-  public GemFireMemberStatus getSnapshot() {
-    // System.out.println(">>>SystemMemberCacheJmxImpl::getSnapshot:pre::: " + this.vm);
-    GemFireMemberStatus stat = this.vm.getSnapshot();
-    // System.out.println(">>>SystemMemberCacheJmxImpl::getSnapshot:post::: " + stat);
-    return stat;
-  }
-
-  public RegionSubRegionSnapshot getRegionSnapshot() {
-    // System.out.println(">>>SystemMemberCacheJmxImpl::getRegionSnapshot:pre::: " + this.vm);
-    RegionSubRegionSnapshot snap = this.vm.getRegionSnapshot();
-    // System.out.println(">>>SystemMemberCacheJmxImpl::getRegionSnapshot:post::: " + snap);
-    return snap;
-  }
-
-  public Statistic[] getStatistics() {
-    return this.statistics;
-  }
-
-  public SystemMemberRegion getRegion(String path) throws org.apache.geode.admin.AdminException {
-    Region r = this.vm.getRegion(this.info, path);
-    if (r == null) {
-      return null;
-    } else {
-      return createSystemMemberRegion(r);
-    }
-  }
-
-  public SystemMemberRegion createRegion(String name, RegionAttributes attrs)
-      throws AdminException {
-    Region r = this.vm.createVMRootRegion(this.info, name, attrs);
-    if (r == null) {
-      return null;
-
-    } else {
-      return createSystemMemberRegion(r);
-    }
-  }
-
-  public SystemMemberRegion createVMRegion(String name, RegionAttributes attrs)
-      throws AdminException {
-    return createRegion(name, attrs);
-  }
-
-
-  // internal methods
-  private void initStats() {
-    StatResource resource = this.info.getPerfStats();
-    if (resource == null) {
-      // See bug 31397
-      Assert.assertTrue(this.isClosed());
-      return;
-    }
-
-    Stat[] stats = resource.getStats();
-    if (stats == null || stats.length < 1) {
-      this.statistics = new Statistic[0];
-      return;
-    }
-
-    // define new statistics instances...
-    List statList = new ArrayList();
-    for (int i = 0; i < stats.length; i++) {
-      statList.add(createStatistic(stats[i]));
-    }
-    this.statistics = (Statistic[]) statList.toArray(new Statistic[statList.size()]);
-  }
-
-  private void updateStats() {
-    StatResource resource = this.info.getPerfStats();
-    if (resource == null) {
-      // See bug 31397
-      Assert.assertTrue(this.isClosed());
-      return;
-    }
-
-    Stat[] stats = resource.getStats();
-    if (stats == null || stats.length < 1) {
-      return;
-    }
-
-    for (int i = 0; i < stats.length; i++) {
-      updateStatistic(stats[i]);
-    }
-  }
-
-  private void updateStatistic(Stat stat) {
-    for (int i = 0; i < this.statistics.length; i++) {
-      if (this.statistics[i].getName().equals(stat.getName())) {
-        ((StatisticImpl) this.statistics[i]).setStat(stat);
-        return;
-      }
-    }
-    Assert.assertTrue(false, "Unknown stat: " + stat.getName());
-  }
-
-  /**
-   * Returns the <code>CacheInfo</code> that describes this cache. Note that this operation does not
-   * {@link #refresh} the <code>CacheInfo</code>.
-   */
-  public CacheInfo getCacheInfo() {
-    return this.info;
-  }
-
-  public GemFireVM getVM() {
-    return this.vm;
-  }
-
-  protected Statistic createStatistic(Stat stat) {
-    return new StatisticImpl(stat);
-  }
-
-  protected SystemMemberRegion createSystemMemberRegion(Region r)
-      throws org.apache.geode.admin.AdminException {
-    SystemMemberRegionImpl sysMemberRegion = new SystemMemberRegionImpl(this, r);
-    sysMemberRegion.refresh();
-    return sysMemberRegion;
-  }
-
-  public SystemMemberCacheServer addCacheServer() throws AdminException {
-
-    AdminBridgeServer bridge = this.vm.addCacheServer(this.info);
-    SystemMemberCacheServer admin = createSystemMemberBridgeServer(bridge);
-    bridgeServers.put(bridge.getId(), admin);
-    return admin;
-  }
-
-  private Collection getCacheServersCollection() throws AdminException {
-    Collection bridges = new ArrayList();
-
-    int[] bridgeIds = this.info.getBridgeServerIds();
-    for (int i = 0; i < bridgeIds.length; i++) {
-      int id = bridgeIds[i];
-      SystemMemberBridgeServer bridge = (SystemMemberBridgeServer) bridgeServers.get(id);
-      if (bridge == null) {
-        AdminBridgeServer info = this.vm.getBridgeInfo(this.info, id);
-        if (info != null) {
-          bridge = createSystemMemberBridgeServer(info);
-          bridgeServers.put(info.getId(), bridge);
-        }
-      }
-
-      if (bridge != null) {
-        bridges.add(bridge);
-      }
-    }
-    return bridges;
-  }
-
-  public SystemMemberCacheServer[] getCacheServers() throws AdminException {
-    Collection bridges = getCacheServersCollection();
-    SystemMemberCacheServer[] array = new SystemMemberCacheServer[bridges.size()];
-    return (SystemMemberCacheServer[]) bridges.toArray(array);
-  };
-
-  /**
-   * Creates a new instance of <Code>SystemMemberBridgeServer</code> with the given configuration.
-   */
-  protected SystemMemberBridgeServerImpl createSystemMemberBridgeServer(AdminBridgeServer bridge)
-      throws AdminException {
-
-    return new SystemMemberBridgeServerImpl(this, bridge);
-  }
-
-  public boolean isServer() throws AdminException {
-    return this.info.isServer();
-  }
-
-
-  /**
-   * Returns a string representation of the object.
-   * 
-   * @return a string representation of the object
-   */
-  @Override
-  public String toString() {
-    return getName();
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberImpl.java
deleted file mode 100755
index 1e2d2a7..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberImpl.java
+++ /dev/null
@@ -1,487 +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.admin.internal;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.*;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.Role;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.DistributionConfigImpl;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.Config;
-import org.apache.geode.internal.ConfigSource;
-import org.apache.geode.internal.admin.GemFireVM;
-import org.apache.geode.internal.admin.StatResource;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.logging.log4j.Logger;
-
-import java.net.InetAddress;
-import java.util.*;
-
-/**
- * Member of a GemFire system.
- *
- * @since GemFire 3.5
- */
-public class SystemMemberImpl implements org.apache.geode.admin.SystemMember,
-    org.apache.geode.admin.internal.ConfigurationParameterListener {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /**
-   * Identifying name of this member. Note that by default this is the string form of internalId but
-   * the ManagedSystemMemberImpl subclass resets it to getNewId()
-   */
-  protected String id;
-
-  /** Unique internal id that the system impl identifies this member with */
-  protected InternalDistributedMember internalId;
-
-  /** The name of this system member */
-  protected String name;
-
-  /** Host name of the machine this member resides on */
-  protected String host;
-
-  /** The internal configuration this impl delegates to for runtime config */
-  // private Config config;
-
-  /**
-   * The configuration parameters for this member. Maps the name of the ConfigurationParameter to
-   * the ConfigurationParameter.
-   */
-  protected Map parms = new HashMap();
-
-  /** The {@link AdminDistributedSystem} this is a member of */
-  protected AdminDistributedSystem system;
-
-  /** Internal GemFire vm to delegate to */
-  private GemFireVM vm;
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs new <code>SystemMemberImpl</code> for a <code>ManagedEntity</code> that has yet to
-   * be started.
-   *
-   * @param system the distributed system this member belongs to
-   */
-  protected SystemMemberImpl(AdminDistributedSystem system) throws AdminException {
-
-    this.system = system;
-    refreshConfig(getDefaultConfig());
-  }
-
-  /**
-   * Constructs new <code>SystemMemberImpl</code> from the given <code>GemFireVM</code>. This
-   * constructor is invoked when we discover a new member of the distributed system.
-   *
-   * @param system the distributed system this member belongs to
-   * @param vm internal GemFire vm to delegate to
-   */
-  public SystemMemberImpl(AdminDistributedSystem system, GemFireVM vm) throws AdminException {
-
-    this(system);
-    setGemFireVM(vm);
-  }
-
-  /**
-   * Constructs the instance of SystemMember using the corresponding InternalDistributedMember
-   * instance of a DS member for the given AdminDistributedSystem.
-   * 
-   * @param system Current AdminDistributedSystem instance
-   * @param member InternalDistributedMember instance for which a SystemMember instance is to be
-   *        constructed.
-   * @throws AdminException if construction of SystemMember fails
-   * 
-   * @since GemFire 6.5
-   */
-  protected SystemMemberImpl(AdminDistributedSystem system, InternalDistributedMember member)
-      throws AdminException {
-    this(system);
-    updateByInternalDistributedMember(member);
-  }
-
-  // -------------------------------------------------------------------------
-  // Attribute accessors and mutators
-  // -------------------------------------------------------------------------
-
-  /**
-   * Returns a <code>Config</code> object with the appropriate default values for a newly-created
-   * system member.
-   */
-  protected Config getDefaultConfig() {
-    Properties props = new Properties();
-    return new DistributionConfigImpl(props);
-  }
-
-  public final AdminDistributedSystem getDistributedSystem() {
-    return this.system;
-  }
-
-  public final InternalDistributedMember getInternalId() {
-    return internalId;
-  }
-
-  public final String getId() {
-    return this.id;
-  }
-
-  public final String getName() {
-    return this.name;
-  }
-
-  public String getHost() {
-    return this.host;
-  }
-
-  public final InetAddress getHostAddress() {
-    return InetAddressUtil.toInetAddress(this.getHost());
-  }
-
-  // -------------------------------------------------------------------------
-  // Operations
-  // -------------------------------------------------------------------------
-
-  public final String getLog() {
-    String childTail = null;
-    String mainTail = null;
-    GemFireVM vm = getGemFireVM();
-    if (vm != null) {
-      String[] log = vm.getSystemLogs();
-      if (log != null && log.length > 0)
-        mainTail = log[0];
-      if (log != null && log.length > 1)
-        childTail = log[1];
-    }
-
-    if (childTail == null && mainTail == null) {
-      return LocalizedStrings.SystemMemberImpl_NO_LOG_FILE_CONFIGURED_LOG_MESSAGES_WILL_BE_DIRECTED_TO_STDOUT
-          .toLocalizedString();
-    } else {
-      StringBuffer result = new StringBuffer();
-      if (mainTail != null) {
-        result.append(mainTail);
-      }
-      if (childTail != null) {
-        result.append(
-            "\n" + LocalizedStrings.SystemMemberImpl_TAIL_OF_CHILD_LOG.toLocalizedString() + "\n");
-        result.append(childTail);
-      }
-      return result.toString();
-    }
-  }
-
-  public final java.util.Properties getLicense() {
-    GemFireVM vm = getGemFireVM();
-    if (vm == null)
-      return null;
-    return new Properties();
-  }
-
-  public final String getVersion() {
-    GemFireVM vm = getGemFireVM();
-    if (vm == null)
-      return null;
-    return vm.getVersionInfo();
-  }
-
-  public StatisticResource[] getStat(String statisticsTypeName)
-      throws org.apache.geode.admin.AdminException {
-    StatisticResource[] res = new StatisticResource[0];
-    if (this.vm != null) {
-      res = getStatsImpl(this.vm.getStats(statisticsTypeName));
-    }
-    return res.length == 0 ? null : res;
-  }
-
-  public StatisticResource[] getStats() throws org.apache.geode.admin.AdminException {
-    StatisticResource[] statsImpl = new StatisticResource[0];
-    if (this.vm != null) {
-      statsImpl = getStatsImpl(this.vm.getStats(null));
-    }
-    return statsImpl;
-  }
-
-  public final boolean hasCache() {
-    GemFireVM member = getGemFireVM();
-    if (member == null) {
-      return false;
-
-    } else {
-      return member.getCacheInfo() != null;
-    }
-  }
-
-  public final SystemMemberCache getCache() throws org.apache.geode.admin.AdminException {
-    GemFireVM vm = getGemFireVM(); // fix for bug 33505
-    if (vm == null)
-      return null;
-    try {
-      return createSystemMemberCache(vm);
-
-    } catch (CancelException ex) {
-      return null;
-
-    } catch (CacheDoesNotExistException ex) {
-      return null;
-    }
-  }
-
-  public void refreshConfig() throws org.apache.geode.admin.AdminException {
-    GemFireVM vm = getGemFireVM();
-    if (vm == null)
-      return;
-    refreshConfig(vm.getConfig());
-  }
-
-  /**
-   * Sets the value of this system member's distribution-related configuration based on the given
-   * <code>Config</code> object.
-   */
-  public final void refreshConfig(Config config) throws org.apache.geode.admin.AdminException {
-    if (config == null) {
-      throw new AdminException(
-          LocalizedStrings.SystemMemberImpl_FAILED_TO_REFRESH_CONFIGURATION_PARAMETERS_FOR_0
-              .toLocalizedString(new Object[] {getId()}));
-    }
-
-    String[] names = config.getAttributeNames();
-    if (names == null || names.length < 1) {
-      throw new AdminException(
-          LocalizedStrings.SystemMemberImpl_FAILED_TO_REFRESH_CONFIGURATION_PARAMETERS_FOR_0
-              .toLocalizedString(new Object[] {getId()}));
-    }
-
-    for (int i = 0; i < names.length; i++) {
-      String name = names[i];
-      Object value = config.getAttributeObject(name);
-      if (value != null) {
-        ConfigurationParameter parm = createConfigurationParameter(name, // name
-            config.getAttributeDescription(name), // description
-            value, // value
-            config.getAttributeType(name), // valueType
-            config.isAttributeModifiable(name)); // isModifiable
-        ((ConfigurationParameterImpl) parm).addConfigurationParameterListener(this);
-        this.parms.put(name, parm);
-      }
-    }
-  }
-
-  public final ConfigurationParameter[] getConfiguration() {
-    ConfigurationParameter[] array = new ConfigurationParameter[this.parms.size()];
-    this.parms.values().toArray(array);
-    return array;
-  }
-
-  public ConfigurationParameter[] setConfiguration(ConfigurationParameter[] parms)
-      throws AdminException {
-
-    for (int i = 0; i < parms.length; i++) {
-      ConfigurationParameter parm = parms[i];
-      this.parms.put(parm.getName(), parm);
-    }
-
-    GemFireVM vm = getGemFireVM();
-    if (vm != null) {
-      // update internal vm's config...
-      Config config = vm.getConfig();
-      for (int i = 0; i < parms.length; i++) {
-        config.setAttributeObject(parms[i].getName(), parms[i].getValue(), ConfigSource.runtime());
-      }
-      vm.setConfig(config);
-    }
-
-    return this.getConfiguration();
-  }
-
-  public SystemMemberType getType() {
-    return SystemMemberType.APPLICATION;
-  }
-
-  // -------------------------------------------------------------------------
-  // Listener callbacks
-  // -------------------------------------------------------------------------
-
-  // -- org.apache.geode.admin.internal.ConfigurationParameterListener ---
-  public void configurationParameterValueChanged(ConfigurationParameter parm) {
-    try {
-      setConfiguration(new ConfigurationParameter[] {parm});
-    } catch (org.apache.geode.admin.AdminException e) {
-      // this shouldn't occur since this is a config listener method...
-      logger.warn(e.getMessage(), e);
-      throw new RuntimeAdminException(e);
-    } catch (java.lang.Exception e) {
-      logger.warn(e.getMessage(), e);
-    }
-    // catch (java.lang.RuntimeException e) {
-    // logWriter.warning(e);
-    // throw e;
-    // }
-    catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (java.lang.Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // Overridden method(s) from java.lang.Object
-  // -------------------------------------------------------------------------
-
-  @Override
-  public String toString() {
-    return getName();
-  }
-
-  // -------------------------------------------------------------------------
-  // Template methods with default behavior impl'ed. Override if needed.
-  // -------------------------------------------------------------------------
-
-  /**
-   * Returns the <code>GemFireVM</code> that underlies this <code>SystemMember</code>.
-   */
-  protected final GemFireVM getGemFireVM() {
-    return this.vm;
-  }
-
-  /**
-   * Sets the <code>GemFireVM</code> that underlies this <code>SystemMember</code>. This method is
-   * used when a member, such as a cache server, is started by the admin API.
-   */
-  void setGemFireVM(GemFireVM vm) throws AdminException {
-    this.vm = vm;
-    if (vm != null) {
-      this.internalId = vm.getId();
-      this.id = this.internalId.toString();
-      this.name = vm.getName();
-      this.host = InetAddressUtil.toString(vm.getHost());
-    } else {
-      this.internalId = null;
-      this.id = null;
-      // leave this.name set to what it is (how come?)
-      this.host = this.getHost();
-    }
-
-    if (DistributionConfig.DEFAULT_NAME.equals(this.name)) {
-      // Fix bug 32877
-      this.name = this.id;
-    }
-
-    if (vm != null) {
-      this.refreshConfig();
-    }
-  }
-
-  /**
-   * Updates this SystemMember instance using the corresponding InternalDistributedMember
-   * 
-   * @param member InternalDistributedMember instance to update this SystemMember
-   * 
-   * @since GemFire 6.5
-   */
-  private void updateByInternalDistributedMember(InternalDistributedMember member) {
-    if (member != null) {
-      this.internalId = member;
-      this.id = this.internalId.toString();
-      this.host = this.internalId.getHost();
-      this.name = this.internalId.getName();
-      if (this.name == null || DistributionConfig.DEFAULT_NAME.equals(this.name)) {
-        /*
-         * name could be null & referring to description of a fix for 32877
-         */
-        this.name = this.id;
-      }
-    }
-  }
-
-  /**
-   * Template method for creating {@link StatisticResource}.
-   *
-   * @param stat the internal stat resource to wrap with {@link StatisticResource}
-   * @return new impl instance of {@link StatisticResource}
-   */
-  protected StatisticResource createStatisticResource(StatResource stat)
-      throws org.apache.geode.admin.AdminException {
-    return new StatisticResourceImpl(stat, this);
-  }
-
-  /**
-   * Template method for creating {@link ConfigurationParameter}.
-   *
-   * @param name the name of this parameter which cannot change
-   * @param description full description to use
-   * @param value the value of this parameter
-   * @param type the class type of the value
-   * @param userModifiable true if this is modifiable; false if read-only
-   * @return new impl instance of {@link ConfigurationParameter}
-   */
-  protected ConfigurationParameter createConfigurationParameter(String name, String description,
-      Object value, Class type, boolean userModifiable) {
-    return new ConfigurationParameterImpl(name, description, value, type, userModifiable);
-  }
-
-  /**
-   * Template method for creating {@link SystemMemberCache}.
-   *
-   * @param vm the GemFire vm to retrieve cache info from
-   * @return new impl instance of {@link SystemMemberCache}
-   */
-  protected SystemMemberCache createSystemMemberCache(GemFireVM vm)
-      throws org.apache.geode.admin.AdminException {
-    return new SystemMemberCacheImpl(vm);
-  }
-
-  /** Wrap the internal stats with impls of {@link StatisticResource} */
-  protected StatisticResource[] getStatsImpl(StatResource[] stats)
-      throws org.apache.geode.admin.AdminException {
-    List statList = new ArrayList();
-    for (int i = 0; i < stats.length; i++) {
-      statList.add(createStatisticResource(stats[i]));
-    }
-    return (StatisticResource[]) statList.toArray(new StatisticResource[0]);
-  }
-
-  public String[] getRoles() {
-    Set roles = this.internalId.getRoles();
-    String[] roleNames = new String[roles.size()];
-    Iterator iter = roles.iterator();
-    for (int i = 0; i < roleNames.length; i++) {
-      Role role = (Role) iter.next();
-      roleNames[i] = role.getName();
-    }
-    return roleNames;
-  }
-
-  public DistributedMember getDistributedMember() {
-    return this.internalId;
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionEventImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionEventImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionEventImpl.java
deleted file mode 100644
index 74115bb..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionEventImpl.java
+++ /dev/null
@@ -1,56 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.cache.Operation;
-
-/**
- * An event that describes an operation on a region. Instances of this are delivered to a
- * {@link SystemMemberCacheListener} when a a region comes or goes.
- *
- * @since GemFire 5.0
- */
-public class SystemMemberRegionEventImpl extends SystemMemberCacheEventImpl
-    implements SystemMemberRegionEvent {
-
-  /**
-   * The path of region created/destroyed
-   */
-  private final String regionPath;
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>SystemMemberRegionEvent</code> for the member with the given id.
-   */
-  protected SystemMemberRegionEventImpl(DistributedMember id, Operation op, String regionPath) {
-    super(id, op);
-    this.regionPath = regionPath;
-  }
-
-  ///////////////////// Instance Methods /////////////////////
-
-  public String getRegionPath() {
-    return this.regionPath;
-  }
-
-  @Override
-  public String toString() {
-    return super.toString() + " region=" + this.regionPath;
-  }
-
-}


[49/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/CacheVmConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/CacheVmConfig.java b/geode-core/src/main/java/org/apache/geode/admin/CacheVmConfig.java
deleted file mode 100755
index 81f4a38..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/CacheVmConfig.java
+++ /dev/null
@@ -1,51 +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.admin;
-
-/**
- * Configuration for a GemFire cache server VM that is managed by the administration API. The VM may
- * or may not be running.
- *
- * @see AdminDistributedSystem#addCacheVm()
- *
- * @since GemFire 5.7
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface CacheVmConfig extends ManagedEntityConfig {
-  /**
-   * Returns the <code>cache.xml</code> declarative caching initialization file used to configure
-   * this cache server VM. By default, a cache server VM is started without an XML file.
-   */
-  public String getCacheXMLFile();
-
-  /**
-   * Sets the <code>cache.xml</code> declarative caching initialization file used to configure this
-   * cache server VM.
-   */
-  public void setCacheXMLFile(String cacheXml);
-
-  /**
-   * Returns the location(s) of user classes (such as cache loaders) required by the cache server
-   * VM.
-   */
-  public String getClassPath();
-
-  /**
-   * Sets the location(s) of user classes (such as cache loaders) required by the cache server VM.
-   */
-  public void setClassPath(String classpath);
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java b/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java
deleted file mode 100755
index 74e1510..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/ConfigurationParameter.java
+++ /dev/null
@@ -1,72 +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.admin;
-
-/**
- * A single configuration parameter of a {@link SystemMember}.
- *
- * @since GemFire 3.5
- *
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface ConfigurationParameter {
-
-  /** Gets the identifying name of this configuration parameter. */
-  public String getName();
-
-  /** Gets the full description of this configuration parameter */
-  public String getDescription();
-
-  /** Gets the current value */
-  public Object getValue();
-
-  /** Gets the current value as a string */
-  public String getValueAsString();
-
-  /** Gets the class type of the value */
-  public Class getValueType();
-
-  /** True if this is modifiable; false if read-only */
-  public boolean isModifiable();
-
-  /** Returns true if this config parameter uses a string array for value. */
-  public boolean isArray();
-
-  /** Returns true if this config parameter represents an InetAddress value. */
-  public boolean isInetAddress();
-
-  /** Returns true if this config parameter represents a File value. */
-  public boolean isFile();
-
-  /** Returns true if this config parameter represents an octal value. */
-  public boolean isOctal();
-
-  /** Returns true if this config parameter represents a string value. */
-  public boolean isString();
-
-  /**
-   * Sets a new value for this configuration parameter.
-   *
-   * @param value the new value which must be of type {@link #getValueType}
-   * @throws IllegalArgumentException if value type does not match {@link #getValueType}
-   * @throws UnmodifiableConfigurationException if attempting to set value when isModifiable is
-   *         false
-   */
-  public void setValue(Object value) throws UnmodifiableConfigurationException;
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/DistributedSystemConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/DistributedSystemConfig.java b/geode-core/src/main/java/org/apache/geode/admin/DistributedSystemConfig.java
deleted file mode 100755
index 940d306..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/DistributedSystemConfig.java
+++ /dev/null
@@ -1,626 +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.admin;
-
-import org.apache.geode.admin.internal.InetAddressUtil;
-import org.apache.geode.distributed.internal.DistributionConfig;
-
-import java.util.Properties;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-
-/**
- * Configuration for defining a GemFire distributed system to administrate. This configuration
- * includes information about the discovery mechanism used to find members of the distributed system
- * and information about {@linkplain ManagedEntity managed entities} such as
- * {@linkplain DistributionLocator distribution locators} and {@linkplain CacheVm GemFire cache vms}
- * that can be {@linkplain AdminDistributedSystem#start started}.
- *
- * <P>
- *
- * Detailed descriptions of many of these configuration attributes can be found in the
- * {@link org.apache.geode.distributed.DistributedSystem DistributedSystem} class. Note that the
- * default values of these configuration attributes can be specified using Java system properties.
- *
- * <P>
- *
- * A <code>DistributedSystemConfig</code> can be modified using a number of mutator methods until
- * the <code>AdminDistributedSystem</code> that it configures
- * {@linkplain AdminDistributedSystem#connect connects} to the distributed system. After that,
- * attempts to modify most attributes in the <code>DistributedSystemConfig</code> will result in an
- * {@link IllegalStateException} being thrown. If you wish to use the same
- * <code>DistributedSystemConfig</code> to configure multiple <code>AdminDistributedSystem</code>s,
- * a copy of the <code>DistributedSystemConfig</code> object can be made by invoking the
- * {@link #clone} method.
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface DistributedSystemConfig extends Cloneable {
-
-  /**
-   * The name of an XML file that specifies the configuration for the {@linkplain ManagedEntity
-   * managed entities} administered by the <code>DistributedSystem</code>. The XML file must conform
-   * to a <a href="doc-files/ds5_0.dtd">dtd</a>.
-   */
-  String ENTITY_CONFIG_XML_FILE_NAME = "entity-config-xml-file";
-
-  /**
-   * The default value of the "entity-config-xml-file" property ("distributed-system.xml").
-   */
-  String DEFAULT_ENTITY_CONFIG_XML_FILE = "distributed-system.xml";
-
-  /** The name of the "system-id" property */
-  String SYSTEM_ID_NAME = "system-id";
-
-  /** The default value of the "system-id" property ("") */
-  String DEFAULT_SYSTEM_ID = "Default System";
-
-  /** The name of the "name" property. See {@link #getSystemName()}. */
-  String NAME_NAME = NAME;
-
-  /** The default value of the "name" property (""). See {@link #getSystemName()}. */
-  String DEFAULT_NAME = "";
-
-  /** The name of the "mcastPort" property */
-  String MCAST_PORT_NAME = MCAST_PORT;
-
-  /** The default value of the "mcastPort" property (10334) */
-  int DEFAULT_MCAST_PORT = DistributionConfig.DEFAULT_MCAST_PORT;
-
-  /** The minimum mcastPort (0) */
-  int MIN_MCAST_PORT = DistributionConfig.MIN_MCAST_PORT;
-
-  /** The maximum mcastPort (65535) */
-  int MAX_MCAST_PORT = DistributionConfig.MAX_MCAST_PORT;
-
-  /** The name of the "mcastAddress" property */
-  String MCAST_ADDRESS_NAME = MCAST_ADDRESS;
-
-  /** The default value of the "mcastAddress" property (239.192.81.1). */
-  String DEFAULT_MCAST_ADDRESS = InetAddressUtil.toString(DistributionConfig.DEFAULT_MCAST_ADDRESS);
-
-  /**
-   * The name of the "membership-port-range" property
-   * 
-   * @since GemFire 6.5
-   */
-  String MEMBERSHIP_PORT_RANGE_NAME = MEMBERSHIP_PORT_RANGE;
-
-  /**
-   * The default membership-port-range.
-   * <p>
-   * Actual value is <code>[1024,65535]</code>.
-   * 
-   * @since GemFire 6.5
-   */
-  int[] DEFAULT_MEMBERSHIP_PORT_RANGE = DistributionConfig.DEFAULT_MEMBERSHIP_PORT_RANGE;
-
-  /**
-   * settings for tcp-port
-   * 
-   * @since GemFire 6.5
-   */
-  String TCP_PORT_NAME = TCP_PORT;
-  /**
-   * The default value of the "tcpPort" property.
-   * <p>
-   * Actual value is <code>0</code>.
-   * 
-   * @since GemFire 6.5
-   */
-  int DEFAULT_TCP_PORT = DistributionConfig.DEFAULT_TCP_PORT;
-
-  /**
-   * The default AckWaitThreshold.
-   * <p>
-   * Actual value of this constant is <code>15</code> seconds.
-   */
-  int DEFAULT_ACK_WAIT_THRESHOLD = DistributionConfig.DEFAULT_ACK_WAIT_THRESHOLD;
-  /**
-   * The minimum AckWaitThreshold.
-   * <p>
-   * Actual value of this constant is <code>1</code> second.
-   */
-  int MIN_ACK_WAIT_THRESHOLD = DistributionConfig.MIN_ACK_WAIT_THRESHOLD;
-  /**
-   * The maximum AckWaitThreshold.
-   * <p>
-   * Actual value of this constant is <code>MAX_INT</code> seconds.
-   */
-  int MAX_ACK_WAIT_THRESHOLD = DistributionConfig.MIN_ACK_WAIT_THRESHOLD;
-
-  /**
-   * The default ackSevereAlertThreshold.
-   * <p>
-   * Actual value of this constant is <code>0</code> seconds, which turns off forced disconnects
-   * based on ack wait periods.
-   */
-  int DEFAULT_ACK_SEVERE_ALERT_THRESHOLD = DistributionConfig.DEFAULT_ACK_SEVERE_ALERT_THRESHOLD;
-  /**
-   * The minimum ackSevereAlertThreshold.
-   * <p>
-   * Actual value of this constant is <code>0</code> second, which turns off forced disconnects
-   * based on ack wait periods.
-   */
-  int MIN_ACK_SEVERE_ALERT_THRESHOLD = DistributionConfig.MIN_ACK_SEVERE_ALERT_THRESHOLD;
-  /**
-   * The maximum ackSevereAlertThreshold.
-   * <p>
-   * Actual value of this constant is <code>MAX_INT</code> seconds.
-   */
-  int MAX_ACK_SEVERE_ALERT_THRESHOLD = DistributionConfig.MAX_ACK_SEVERE_ALERT_THRESHOLD;
-
-  /** The name of the "locators" property (comma-delimited host[port] list) */
-  String LOCATORS_NAME = LOCATORS;
-
-  /** The default value of the "locators" property ("") */
-  String DEFAULT_LOCATORS = DistributionConfig.DEFAULT_LOCATORS;
-
-  /** The name of the "bindAddress" property */
-  String BIND_ADDRESS_NAME = BIND_ADDRESS;
-
-  /** The default value of the "bindAddress" property */
-  String DEFAULT_BIND_ADDRESS = DistributionConfig.DEFAULT_BIND_ADDRESS;
-
-  /** The name of the remote-command property */
-  String REMOTE_COMMAND_NAME = "remote-command";
-
-  /** The default value of the remote-command property */
-  String DEFAULT_REMOTE_COMMAND = "rsh -n {HOST} {CMD}";
-
-  /** The default disable-tcp value (<code>false</code>) */
-  boolean DEFAULT_DISABLE_TCP = DistributionConfig.DEFAULT_DISABLE_TCP;
-
-  /** The default enable-network-partition-detection setting (<code>false</code>) */
-  boolean DEFAULT_ENABLE_NETWORK_PARTITION_DETECTION =
-      DistributionConfig.DEFAULT_ENABLE_NETWORK_PARTITION_DETECTION;
-
-  /** The default disable-auto-reconnect setting (<code>false</code>) */
-  boolean DEFAULT_DISABLE_AUTO_RECONNECT = DistributionConfig.DEFAULT_DISABLE_AUTO_RECONNECT;
-
-  /** The default failure-detection timeout period for member heart-beat responses */
-  int DEFAULT_MEMBER_TIMEOUT = DistributionConfig.DEFAULT_MEMBER_TIMEOUT;
-
-  /** The name of the "logFile" property */
-  String LOG_FILE_NAME = LOG_FILE;
-
-  /**
-   * The default log-file value ("" which directs logging to standard output)
-   */
-  String DEFAULT_LOG_FILE = "";
-
-  /** The name of the "logLevel" property */
-  String LOG_LEVEL_NAME = LOG_LEVEL;
-
-  /** The default log level ("config") */
-  String DEFAULT_LOG_LEVEL = "config";
-
-  /** The name of the "LogDiskSpaceLimit" property */
-  String LOG_DISK_SPACE_LIMIT_NAME = LOG_DISK_SPACE_LIMIT;
-
-  /** The default log disk space limit in megabytes (0) */
-  int DEFAULT_LOG_DISK_SPACE_LIMIT = DistributionConfig.DEFAULT_LOG_DISK_SPACE_LIMIT;
-
-  /** The minimum log disk space limit in megabytes (0) */
-  int MIN_LOG_DISK_SPACE_LIMIT = DistributionConfig.MIN_LOG_DISK_SPACE_LIMIT;
-
-  /** The minimum log disk space limit in megabytes (1000000) */
-  int MAX_LOG_DISK_SPACE_LIMIT = DistributionConfig.MAX_LOG_DISK_SPACE_LIMIT;
-
-  /** The name of the "LogFileSizeLimit" property */
-  String LOG_FILE_SIZE_LIMIT_NAME = LOG_FILE_SIZE_LIMIT;
-
-  /** The default log file size limit in megabytes (0) */
-  int DEFAULT_LOG_FILE_SIZE_LIMIT = DistributionConfig.DEFAULT_LOG_FILE_SIZE_LIMIT;
-
-  /** The minimum log file size limit in megabytes (0) */
-  int MIN_LOG_FILE_SIZE_LIMIT = DistributionConfig.MIN_LOG_FILE_SIZE_LIMIT;
-
-  /** The minimum log file size limit in megabytes (1000000) */
-  int MAX_LOG_FILE_SIZE_LIMIT = DistributionConfig.MAX_LOG_FILE_SIZE_LIMIT;
-
-  /**
-   * The name of the "refreshInterval" property which will apply to SystemMember, SystemMemberCache
-   * and StatisticResource refresh. This interval (in seconds) is used for auto-polling and updating
-   * AdminDistributedSystem constituents including SystemMember, CacheServer, SystemMemberCache and
-   * StatisticResource. This interval is read-only and retains the value set when the config is
-   * created. Note that the resource MBeans actually refresh and hit the DS only if there is an RMI
-   * client connected
-   */
-  String REFRESH_INTERVAL_NAME = "refresh-interval";
-
-  /**
-   * The default "refreshInterval" in seconds which will apply to REFRESH_INTERVAL_NAME property.
-   * The default value is 15 secs
-   */
-  int DEFAULT_REFRESH_INTERVAL = 15;
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Returns the name of the XML file that specifies the configuration of the
-   * {@linkplain org.apache.geode.admin.ManagedEntity managed entities} administered by the
-   * <code>DistributedSystem</code>. The XML file must conform to a
-   * <a href="doc-files/ds5_0.dtd">dtd</a>.
-   *
-   * @since GemFire 4.0
-   */
-  public String getEntityConfigXMLFile();
-
-  /**
-   * Sets the name of the XML file that specifies the configuration of managed entities administered
-   * by the <code>DistributedSystem</code>.
-   */
-  public void setEntityConfigXMLFile(String xmlFile);
-
-  /** Returns the string identity for the system */
-  public String getSystemId();
-
-  /** Sets the string identity for the system */
-  public void setSystemId(String systemId);
-
-  /** Returns the optional non-unique name for the system */
-  public String getSystemName();
-
-  /** Sets the optional non-unique name for the system */
-  public void setSystemName(final String name);
-
-  /** Returns the multicast address for the system */
-  public String getMcastAddress();
-
-  /** Sets the multicast address for the system */
-  public void setMcastAddress(String mcastAddress);
-
-  /** Returns the multicast port for the system */
-  public int getMcastPort();
-
-  /** Sets the multicast port for the system */
-  public void setMcastPort(int mcastPort);
-
-  /** Returns the ack-wait-threshold for the system */
-  public int getAckWaitThreshold();
-
-  /** Sets the ack-wait-threshold for the system */
-  public void setAckWaitThreshold(int seconds);
-
-  /** Returns the ack-severe-alert-threshold for the system */
-  public int getAckSevereAlertThreshold();
-
-  /** Sets the ack-severe-alert-threshold for the system */
-  public void setAckSevereAlertThreshold(int seconds);
-
-  /** Returns a comma-delimited list of locators for the system */
-  public String getLocators();
-
-  /** Sets the comma-delimited list of locators for the system */
-  public void setLocators(String locators);
-
-  /**
-   * Returns the membership-port-range property of the Distributed System. This range is given as
-   * two numbers separated by a minus sign.
-   * 
-   * @since GemFire 6.5
-   */
-  public String getMembershipPortRange();
-
-  /**
-   * Sets the membership-port-range property of the Distributed System. This range is given as two
-   * numbers separated by a minus sign.
-   * 
-   * @since GemFire 6.5
-   */
-  public void setMembershipPortRange(String membershipPortRange);
-
-
-  /**
-   * Sets the primary communication port number for the Distributed System.
-   * 
-   * @since GemFire 6.5
-   */
-  public void setTcpPort(int port);
-
-  /**
-   * Returns the primary communication port number for the Distributed System.
-   * 
-   * @since GemFire 6.5
-   */
-  public int getTcpPort();
-
-
-  /**
-   * Sets the disable-tcp property for the system. When tcp is disabled, the cache uses udp for
-   * unicast messaging. This must be consistent across all members of the distributed system. The
-   * default is to enable tcp.
-   */
-  public void setDisableTcp(boolean flag);
-
-  /**
-   * Returns the disable-tcp property for the system. When tcp is disabled, the cache uses udp for
-   * unicast messaging. This must be consistent across all members of the distributed system. The
-   * default is to enable tcp.
-   */
-  public boolean getDisableTcp();
-
-
-  /**
-   * Turns on network partition detection
-   */
-  public void setEnableNetworkPartitionDetection(boolean newValue);
-
-  /**
-   * Returns true if network partition detection is enabled.
-   */
-  public boolean getEnableNetworkPartitionDetection();
-
-  /**
-   * Disables auto reconnect after being forced out of the distributed system
-   */
-  public void setDisableAutoReconnect(boolean newValue);
-
-  /**
-   * Returns true if auto reconnect is disabled
-   */
-  public boolean getDisableAutoReconnect();
-
-
-
-  /**
-   * Returns the member-timeout millisecond value used in failure-detection protocols
-   */
-  public int getMemberTimeout();
-
-  /**
-   * Set the millisecond value of the member-timeout used in failure-detection protocols. This
-   * timeout determines how long a member has to respond to a heartbeat request. The member is given
-   * three chances before being kicked out of the distributed system with a SystemConnectException.
-   */
-  public void setMemberTimeout(int value);
-
-  /**
-   * Returns the IP address to which the distributed system's server sockets are bound.
-   *
-   * @since GemFire 4.0
-   */
-  public String getBindAddress();
-
-  /**
-   * Sets the IP address to which the distributed system's server sockets are bound.
-   *
-   * @since GemFire 4.0
-   */
-  public void setBindAddress(String bindAddress);
-
-
-  /**
-   * Returns the IP address to which client/server server sockets are bound
-   */
-  public String getServerBindAddress();
-
-  /**
-   * Sets the IP address to which a server cache will bind when listening for client cache
-   * connections.
-   */
-  public void setServerBindAddress(String bindAddress);
-
-
-  /** Returns the remote command setting to use for remote administration */
-  public String getRemoteCommand();
-
-  /**
-   * Sets the remote command setting to use for remote administration. This attribute may be
-   * modified after this <code>DistributedSystemConfig</code> has been used to create an
-   * <codE>AdminDistributedSystem</code>.
-   */
-  public void setRemoteCommand(String command);
-
-  /** Returns the value of the "ssl-enabled" property. */
-  public boolean isSSLEnabled();
-
-  /** Sets the value of the "ssl-enabled" property. */
-  public void setSSLEnabled(boolean enabled);
-
-  /** Returns the value of the "ssl-protocols" property. */
-  public String getSSLProtocols();
-
-  /** Sets the value of the "ssl-protocols" property. */
-  public void setSSLProtocols(String protocols);
-
-  /** Returns the value of the "ssl-ciphers" property. */
-  public String getSSLCiphers();
-
-  /** Sets the value of the "ssl-ciphers" property. */
-  public void setSSLCiphers(String ciphers);
-
-  /** Returns the value of the "ssl-require-authentication" property. */
-  public boolean isSSLAuthenticationRequired();
-
-  /** Sets the value of the "ssl-require-authentication" property. */
-  public void setSSLAuthenticationRequired(boolean authRequired);
-
-  /** Returns the provider-specific properties for SSL. */
-  public Properties getSSLProperties();
-
-  /** Sets the provider-specific properties for SSL. */
-  public void setSSLProperties(Properties sslProperties);
-
-  /** Adds an SSL property */
-  public void addSSLProperty(String key, String value);
-
-  /** Removes an SSL property */
-  public void removeSSLProperty(String key);
-
-  /**
-   * Returns the name of the log file to which informational messages are written.
-   *
-   * @see org.apache.geode.i18n.LogWriterI18n
-   */
-  public String getLogFile();
-
-  /**
-   * Sets the name of the log file to which informational messages are written.
-   *
-   * @see org.apache.geode.i18n.LogWriterI18n
-   */
-  public void setLogFile(String logFile);
-
-  /**
-   * Returns the level at which informational messages are logged.
-   */
-  public String getLogLevel();
-
-  /**
-   * Sets the level at which information messages are logged.
-   */
-  public void setLogLevel(String logLevel);
-
-  /**
-   * Returns the log disk space limit in megabytes
-   */
-  public int getLogDiskSpaceLimit();
-
-  /**
-   * Sets the log disk space limit in megabytes
-   */
-  public void setLogDiskSpaceLimit(int limit);
-
-  /**
-   * Returns the log file size limit in megabytes
-   */
-  public int getLogFileSizeLimit();
-
-  /**
-   * Sets the log file size limit in megabytes
-   */
-  public void setLogFileSizeLimit(int limit);
-
-  /**
-   * Returns the refreshInterval in seconds used for auto-polling and updating
-   * AdminDistributedSystem constituents including SystemMember, CacheServer, SystemMemberCache and
-   * StatisticResource
-   * 
-   * @since GemFire 6.0
-   */
-  public int getRefreshInterval();
-
-  /**
-   * Sets the refreshInterval in seconds
-   * 
-   * @since GemFire 6.0
-   */
-  public void setRefreshInterval(int timeInSecs);
-
-  /**
-   * Returns an array of configurations for statically known <code>CacheServers</code>.
-   * 
-   * @deprecated as of 5.7 use {@link #getCacheVmConfigs} instead.
-   */
-  @Deprecated
-  public CacheServerConfig[] getCacheServerConfigs();
-
-  /**
-   * Creates the configuration for a CacheServer
-   * 
-   * @deprecated as of 5.7 use {@link #createCacheVmConfig} instead.
-   */
-  @Deprecated
-  public CacheServerConfig createCacheServerConfig();
-
-  /**
-   * Removes the configuration for a CacheServer
-   * 
-   * @deprecated as of 5.7 use {@link #removeCacheVmConfig} instead.
-   */
-  @Deprecated
-  public void removeCacheServerConfig(CacheServerConfig managerConfig);
-
-  /**
-   * Returns an array of configurations for statically known {@link CacheVm}s.
-   * 
-   * @since GemFire 5.7
-   */
-  public CacheVmConfig[] getCacheVmConfigs();
-
-  /**
-   * Creates the configuration for a {@link CacheVm}.
-   * 
-   * @since GemFire 5.7
-   */
-  public CacheVmConfig createCacheVmConfig();
-
-  /**
-   * Removes the configuration for a {@link CacheVm}
-   * 
-   * @since GemFire 5.7
-   */
-  public void removeCacheVmConfig(CacheVmConfig existing);
-
-  /**
-   * Returns configuration information about {@link DistributionLocator}s that are managed by an
-   * <code>AdminDistributedSystem</code>.
-   */
-  public DistributionLocatorConfig[] getDistributionLocatorConfigs();
-
-  /**
-   * Creates a new <code>DistributionLocatorConfig</code> for a distribution locator that is managed
-   * in this distributed system. The default locator config is set to not use multicast
-   */
-  public DistributionLocatorConfig createDistributionLocatorConfig();
-
-  /**
-   * Removes a <code>DistributionLocatorConfig</code> from the distributed system.
-   */
-  public void removeDistributionLocatorConfig(DistributionLocatorConfig config);
-
-  /** Registers listener for notification of changes in this config. */
-  public void addListener(ConfigListener listener);
-
-  /** Removes previously registered listener of this config. */
-  public void removeListener(ConfigListener listener);
-
-  /**
-   * Validates that this distributed system configuration is correct and consistent.
-   *
-   * @throws IllegalStateException If this config is not valid
-   * @throws AdminXmlException If the {@linkplain #getEntityConfigXMLFile entity config XML file} is
-   *         not valid
-   */
-  public void validate();
-
-  /**
-   * Returns a copy of this <code>DistributedSystemConfig</code> object whose configuration can be
-   * modified. Note that this {@link DistributedSystemConfig.ConfigListener ConfigListener}s that
-   * are registered on this config object are not cloned.
-   *
-   * @since GemFire 4.0
-   */
-  public Object clone() throws CloneNotSupportedException;
-
-  ////////////////////// Inner Classes //////////////////////
-
-  /**
-   * A listener whose callback methods are invoked when this config changes.
-   */
-  public interface ConfigListener extends java.util.EventListener {
-
-    /** Invoked when this configurated is changed. */
-    public void configChanged(DistributedSystemConfig config);
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/DistributedSystemHealthConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/DistributedSystemHealthConfig.java b/geode-core/src/main/java/org/apache/geode/admin/DistributedSystemHealthConfig.java
deleted file mode 100644
index d7f7751..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/DistributedSystemHealthConfig.java
+++ /dev/null
@@ -1,74 +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.admin;
-
-/**
- * Provides configuration information relating to the health of an entire GemFire distributed
- * system.
- *
- * <P>
- *
- * If any of the following criteria is true, then the distributed system is considered to be in
- * {@link GemFireHealth#OKAY_HEALTH OKAY_HEALTH}.
- *
- * <UL>
- *
- * </UL>
- *
- * If any of the following criteria is true, then the distributed system is considered to be in
- * {@link GemFireHealth#POOR_HEALTH POOR_HEALTH}.
- *
- * <UL>
- *
- * <LI>Too many application members {@linkplain #getMaxDepartedApplications unexpectedly leave} the
- * distributed system.</LI>
- *
- * <LI>Too many application members {@linkplain #getMaxDepartedApplications unexpectedly leave} the
- * distributed system.</LI>
- *
- * </UL>
- *
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface DistributedSystemHealthConfig {
-
-  /**
-   * The default maximum number of application members that can unexceptedly leave a healthy the
-   * distributed system.
-   */
-  public static final long DEFAULT_MAX_DEPARTED_APPLICATIONS = 10;
-
-  /////////////////////// Instance Methods ///////////////////////
-
-  /**
-   * Returns the maximum number of application members that can unexceptedly leave a healthy the
-   * distributed system.
-   *
-   * @see #DEFAULT_MAX_DEPARTED_APPLICATIONS
-   */
-  public long getMaxDepartedApplications();
-
-  /**
-   * Sets the maximum number of application members that can unexceptedly leave a healthy the
-   * distributed system.
-   *
-   * @see #getMaxDepartedApplications
-   */
-  public void setMaxDepartedApplications(long maxDepartedApplications);
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/DistributionLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/DistributionLocator.java b/geode-core/src/main/java/org/apache/geode/admin/DistributionLocator.java
deleted file mode 100755
index cb82679..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/DistributionLocator.java
+++ /dev/null
@@ -1,45 +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.admin;
-
-/**
- * Represents a single distribution locator server, of which a distributed system may use zero or
- * many. The distributed system will be configured to use either multicast discovery or locator
- * service.
- *
- * @see DistributionLocatorConfig
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface DistributionLocator extends ManagedEntity {
-
-  /**
-   * Returns the identity name for this locator.
-   */
-  public String getId();
-
-  /**
-   * Returns the configuration object for this distribution locator.
-   *
-   * @since GemFire 4.0
-   */
-  public DistributionLocatorConfig getConfig();
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/DistributionLocatorConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/DistributionLocatorConfig.java b/geode-core/src/main/java/org/apache/geode/admin/DistributionLocatorConfig.java
deleted file mode 100644
index 6e8794d..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/DistributionLocatorConfig.java
+++ /dev/null
@@ -1,81 +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.admin;
-
-import java.util.Properties;
-
-/**
- * Describes the configuration of a {@link DistributionLocator} managed by the GemFire
- * administration APIs.
- *
- * <P>
- *
- * A <code>DistributionLocatorConfig</code> can be modified using a number of mutator methods until
- * the <code>DistributionLocator</code> configured by this object is {@linkplain ManagedEntity#start
- * started}. After that, attempts to modify most attributes in the
- * <code>DistributionLocatorConfig</code> will result in an {@link IllegalStateException} being
- * thrown. If you wish to use the same <code>DistributionLocatorConfig</code> to configure another
- * <code>DistributionLocator</code>s, a copy of the <code>DistributionLocatorConfig</code> object
- * can be made by invoking the {@link Object#clone} method.
- *
- * @see AdminDistributedSystem#addDistributionLocator
- * @see org.apache.geode.distributed.Locator
- *
- * @since GemFire 4.0
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface DistributionLocatorConfig extends ManagedEntityConfig {
-
-  /**
-   * Returns the port on which ths distribution locator listens for members to connect. There is no
-   * default locator port, so a non-default port must be specified.
-   */
-  public int getPort();
-
-  /**
-   * Sets the port on which the distribution locator listens for members to connect.
-   */
-  public void setPort(int port);
-
-  /**
-   * Returns the address to which the distribution locator's port is (or will be) bound. By default,
-   * the bind address is <code>null</code> meaning that the port will be bound to all network
-   * addresses on the host.
-   */
-  public String getBindAddress();
-
-  /**
-   * Sets the address to which the distribution locator's port is (or will be) bound.
-   */
-  public void setBindAddress(String bindAddress);
-
-  /**
-   * Sets the properties used to configure the locator's DistributedSystem.
-   * 
-   * @since GemFire 5.0
-   */
-  public void setDistributedSystemProperties(Properties props);
-
-  /**
-   * Retrieves the properties used to configure the locator's DistributedSystem.
-   * 
-   * @since GemFire 5.0
-   */
-  public Properties getDistributedSystemProperties();
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/GemFireHealth.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/GemFireHealth.java b/geode-core/src/main/java/org/apache/geode/admin/GemFireHealth.java
deleted file mode 100644
index bb8590a..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/GemFireHealth.java
+++ /dev/null
@@ -1,209 +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.admin;
-
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-/**
- * Provides information about the aggregate health of the members of a GemFire distributed system
- * ("components"). The {@link #getHealth getHealth} method provides an indication of the overall
- * health. Health is expressed as one of three levels: {@link #GOOD_HEALTH GOOD_HEALTH},
- * {@link #OKAY_HEALTH OKAY_HEALTH}, and {@link #POOR_HEALTH POOR_HEALTH}. The {@link #getDiagnosis
- * getDiagnosis} method provides a more detailed explanation of the cause of ill health.
- *
- * <P>
- *
- * The aggregate health of the GemFire component is evaluated
- * {@linkplain GemFireHealthConfig#setHealthEvaluationInterval every so often} and if certain
- * criteria are met, then the overall health of the component changes accordingly. If any of the
- * components is in <code>OKAY_HEALTH</code>, then the overall health is <code>OKAY_HEALTH</code>.
- * If any of the components is in <code>POOR_HEALTH</code>, then the overall health is
- * <code>POOR_HEALTH</code>.
- *
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface GemFireHealth {
-
-  /**
-   * An indicator that the GemFire components are healthy.
-   *
-   * @see #getHealth
-   */
-  public static final Health GOOD_HEALTH = new Health(Health.GOOD_STRING);
-
-  /**
-   * An indicator that one or more GemFire components is slightly unhealthy. The problem may or may
-   * not require configuration changes and may not necessarily lead to poorer component health.
-   *
-   * @see #getHealth
-   */
-  public static final Health OKAY_HEALTH = new Health(Health.OKAY_STRING);
-
-  /**
-   * An indicator that one or more GemFire components is unhealthy. While it may be possible for the
-   * components to recover on their own, it is likely that they will have to be restarted.
-   *
-   * @see #getHealth
-   */
-  public static final Health POOR_HEALTH = new Health(Health.POOR_STRING);
-
-  /////////////////////// Instance Methods ///////////////////////
-
-  /**
-   * Returns an indicator of the overall health of the GemFire components.
-   *
-   * @see #GOOD_HEALTH
-   * @see #OKAY_HEALTH
-   * @see #POOR_HEALTH
-   */
-  public Health getHealth();
-
-  /**
-   * Resets the overall health of the GemFire components to {@link #GOOD_HEALTH}. This operation
-   * should be invoked when the operator has determined that warnings about the components's health
-   * do not need to be regarded.
-   */
-  public void resetHealth();
-
-  /**
-   * Returns a message that provides a description of the cause of a component's ill health.
-   */
-  public String getDiagnosis();
-
-  /**
-   * Returns the configuration for determining the health of the distributed system itself.
-   */
-  public DistributedSystemHealthConfig getDistributedSystemHealthConfig();
-
-  /**
-   * Sets the configuration for determining the health of the distributed system itself.
-   */
-  public void setDistributedSystemHealthConfig(DistributedSystemHealthConfig config);
-
-  /**
-   * Returns the <code>GemFireHealthConfig</code> for GemFire components whose configurations are
-   * not overridden on a per-host basis. Note that changes made to the returned
-   * <code>GemFireHealthConfig</code> will not take effect until
-   * {@link #setDefaultGemFireHealthConfig} is invoked.
-   */
-  public GemFireHealthConfig getDefaultGemFireHealthConfig();
-
-  /**
-   * Sets the <code>GemFireHealthConfig</code> for GemFire components whose configurations are not
-   * overridden on a per-host basis.
-   *
-   * @throws IllegalArgumentException If <code>config</code> specifies the config for a host
-   */
-  public void setDefaultGemFireHealthConfig(GemFireHealthConfig config);
-
-  /**
-   * Returns the <code>GemFireHealthConfig</code> for GemFire components that reside on a given
-   * host. This configuration will override the {@linkplain #getDefaultGemFireHealthConfig default}
-   * configuration.
-   *
-   * @param hostName The {@linkplain java.net.InetAddress#getCanonicalHostName canonical} name of
-   *        the host.
-   */
-  public GemFireHealthConfig getGemFireHealthConfig(String hostName);
-
-  /**
-   * Sets the <code>GemFireHealthConfig</code> for GemFire components that reside on a given host.
-   * This configuration will override the {@linkplain #getDefaultGemFireHealthConfig default}
-   * configuration. Note that changes made to the returned <code>GemFireHealthConfig</code> will not
-   * take effect until {@link #setDefaultGemFireHealthConfig} is invoked.
-   *
-   * @param hostName The {@linkplain java.net.InetAddress#getCanonicalHostName canonical} name of
-   *        the host.
-   *
-   * @throws IllegalArgumentException If host <code>hostName</code> does not exist or if there are
-   *         no GemFire components running on that host or if <code>config</code> does not configure
-   *         host <code>hostName</code>.
-   */
-  public void setGemFireHealthConfig(String hostName, GemFireHealthConfig config);
-
-  /**
-   * Closes this health monitor and releases all resources associated with it.
-   */
-  public void close();
-
-  /**
-   * Returns whether or not this <code>GemFireHealth</code> is {@linkplain #close closed}.
-   */
-  public boolean isClosed();
-
-  ////////////////////// Inner Classes //////////////////////
-
-  /**
-   * An enumerated type for the health of GemFire.
-   */
-  public static class Health implements java.io.Serializable {
-    private static final long serialVersionUID = 3039539430412151801L;
-    /** The string for good health */
-    static final String GOOD_STRING = LocalizedStrings.GemFireHealth_GOOD.toLocalizedString();
-
-    /** The string for okay health */
-    static final String OKAY_STRING = LocalizedStrings.GemFireHealth_OKAY.toLocalizedString();
-
-    /** The string for poor health */
-    static final String POOR_STRING = LocalizedStrings.GemFireHealth_POOR.toLocalizedString();
-
-    //////////////////// Instance Fields ////////////////////
-
-    /** The string for this health */
-    private String healthString;
-
-    ///////////////////// Constructors //////////////////////
-
-    /**
-     * Creates a new <code>Health</code> with the given string
-     */
-    protected Health(String healthString) {
-      this.healthString = healthString;
-    }
-
-    //////////////////// Instance Methods ////////////////////
-
-    /**
-     * Returns the appropriate canonical instance of <code>Health</code>.
-     */
-    public Object readResolve() {
-      if (this.healthString.equals(GOOD_STRING)) {
-        return GemFireHealth.GOOD_HEALTH;
-
-      } else if (this.healthString.equals(OKAY_STRING)) {
-        return GemFireHealth.OKAY_HEALTH;
-
-      } else if (this.healthString.equals(POOR_STRING)) {
-        return GemFireHealth.POOR_HEALTH;
-
-      } else {
-        Assert.assertTrue(false, "Unknown healthString: " + this.healthString);
-        return null;
-      }
-    }
-
-    @Override
-    public String toString() {
-      return this.healthString;
-    }
-
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/GemFireHealthConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/GemFireHealthConfig.java b/geode-core/src/main/java/org/apache/geode/admin/GemFireHealthConfig.java
deleted file mode 100644
index b31861f..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/GemFireHealthConfig.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.admin;
-
-/**
- * Provides configuration information relating to all of the components of a GemFire distributed
- * system.
- *
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface GemFireHealthConfig extends MemberHealthConfig, CacheHealthConfig {
-
-  /**
-   * The default number of seconds between assessments of the health of the GemFire components.
-   */
-  public static final int DEFAULT_HEALTH_EVALUATION_INTERVAL = 30;
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Returns the name of the host to which this configuration applies. If this is the "default"
-   * configuration, then <code>null</code> is returned.
-   *
-   * @see GemFireHealth#getGemFireHealthConfig
-   */
-  public String getHostName();
-
-  /**
-   * Sets the number of seconds between assessments of the health of the GemFire components.
-   */
-  public void setHealthEvaluationInterval(int interval);
-
-  /**
-   * Returns the number of seconds between assessments of the health of the GemFire components.
-   */
-  public int getHealthEvaluationInterval();
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java b/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java
deleted file mode 100755
index 5b4e59e..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/GemFireMemberStatus.java
+++ /dev/null
@@ -1,670 +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.admin;
-
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.client.PoolManager;
-import org.apache.geode.cache.server.CacheServer;
-import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.distributed.Locator;
-import org.apache.geode.distributed.internal.DM;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.internal.admin.ClientHealthMonitoringRegion;
-import org.apache.geode.internal.admin.remote.ClientHealthStats;
-import org.apache.geode.internal.cache.*;
-import org.apache.geode.internal.cache.tier.InternalClientMembership;
-import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.net.InetAddress;
-import java.util.*;
-
-/**
- * Class <code>GemFireMemberStatus</code> provides the status of a specific GemFire member VM. This
- * VM can be a peer, a client, a server and/or a gateway.
- * 
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class GemFireMemberStatus implements Serializable {
-  private static final long serialVersionUID = 3389997790525991310L;
-
-  /**
-   * Notifies whether this member is a client to a cache server.
-   */
-  protected boolean _isClient;
-
-  /**
-   * Notifies whether this member is a cache server.
-   */
-  protected boolean _isServer;
-
-  /**
-   * Notifies whether this member is a hub for WAN gateways.
-   */
-  protected boolean _isGatewayHub;
-
-  /**
-   * Notifies whether this member is a locator.
-   */
-  protected boolean _isLocator;
-
-  protected boolean _isPrimaryGatewayHub;
-
-  protected Object/* GatewayHubStatus */ _gatewayHubStatus;
-
-  protected boolean _isConnected;
-  protected Serializable _memberId;
-  protected Set _connectedPeers;
-  protected Set _connectedServers;
-  protected Set _unconnectedServers;
-  protected Set _connectedClients;
-  protected Map _connectedIncomingGateways;
-  protected Map _outgoingGateways;
-
-  protected Map _clientHostNames;
-  protected Map _clientQueueSizes;
-  protected Map _gatewayQueueSizes;
-  protected Map _regionStatuses;
-  protected Map _clientHealthStats;
-
-  protected String _memberName;
-  protected int _mcastPort;
-  protected int _serverPort;
-  protected InetAddress _mcastAddress;
-  protected String _bindAddress;
-  protected String _locators;
-  protected InetAddress _hostAddress;
-
-  protected long _maximumHeapSize;
-  protected long _freeHeapSize;
-
-  protected long upTime = -1;
-
-  protected transient final Cache cache;
-
-  public GemFireMemberStatus() {
-    this(null);
-  }
-
-  public GemFireMemberStatus(Cache cache) {
-    this.cache = cache;
-    DistributedSystem ds = null;
-    if (cache != null) {
-      ds = cache.getDistributedSystem();
-    }
-    initialize(ds);
-  }
-
-  public boolean getIsConnected() {
-    return this._isConnected;
-  }
-
-  protected void setIsConnected(boolean isConnected) {
-    this._isConnected = isConnected;
-  }
-
-  /**
-   * Returns whether this member is a client to a cache server
-   * 
-   * @return whether this member is a client to a cache server
-   */
-  public boolean getIsClient() {
-    return this._isClient;
-  }
-
-  /**
-   * Sets whether this member is a client to a cache server
-   * 
-   * @param isClient Boolean defining whether this member is a client to a cache server
-   */
-  protected void setIsClient(boolean isClient) {
-    this._isClient = isClient;
-  }
-
-  /**
-   * Returns whether this member is a cache server
-   * 
-   * @return whether this member is a cache server
-   */
-  public boolean getIsServer() {
-    return this._isServer;
-  }
-
-  /**
-   * Sets whether this member is a cache server
-   * 
-   * @param isServer Boolean defining whether this member is a cache server
-   */
-  protected void setIsServer(boolean isServer) {
-    this._isServer = isServer;
-  }
-
-  public int getServerPort() {
-    return this._serverPort;
-  }
-
-  protected void setServerPort(int port) {
-    this._serverPort = port;
-  }
-
-  /**
-   * Returns whether this member is a hub for WAN gateways
-   * 
-   * @return whether this member is a hub for WAN gateways
-   */
-  public boolean getIsGatewayHub() {
-    return this._isGatewayHub;
-  }
-
-  /**
-   * Sets whether this member is a cache server
-   * 
-   * @param isGatewayHub Boolean defining whether this member is a hub for WAN gateways
-   */
-  protected void setIsGatewayHub(boolean isGatewayHub) {
-    this._isGatewayHub = isGatewayHub;
-  }
-
-  public boolean getIsLocator() {
-    return this._isLocator;
-  }
-
-  protected void setIsLocator(boolean isLocator) {
-    this._isLocator = isLocator;
-  }
-
-  public boolean getIsPrimaryGatewayHub() {
-    return this._isPrimaryGatewayHub;
-  }
-
-  protected void setIsPrimaryGatewayHub(boolean isPrimaryGatewayHub) {
-    this._isPrimaryGatewayHub = isPrimaryGatewayHub;
-  }
-
-  /**
-   * For internal use only
-   * 
-   * @return status of the gateway hub
-   */
-  public Object/* GatewayHubStatus */ getGatewayHubStatus() {
-    return this._gatewayHubStatus;
-  }
-
-  // protected void setGatewayHubStatus(GatewayHubStatus gatewayHubStatus) {
-  // this._gatewayHubStatus = gatewayHubStatus;
-  // }
-
-  public boolean getIsSecondaryGatewayHub() {
-    return !this._isPrimaryGatewayHub;
-  }
-
-  public Set getConnectedPeers() {
-    return this._connectedPeers;
-  }
-
-  protected void setConnectedPeers(Set connectedPeers) {
-    this._connectedPeers = connectedPeers;
-  }
-
-  public Set getConnectedServers() {
-    return this._connectedServers;
-  }
-
-  protected void setConnectedServers(Set connectedServers) {
-    this._connectedServers = connectedServers;
-  }
-
-  protected void addConnectedServer(String connectedServer) {
-    this._connectedServers.add(connectedServer);
-  }
-
-  public Set getUnconnectedServers() {
-    return this._unconnectedServers;
-  }
-
-  protected void setUnconnectedServers(Set unconnectedServers) {
-    this._unconnectedServers = unconnectedServers;
-  }
-
-  protected void addUnconnectedServer(String unconnectedServer) {
-    this._unconnectedServers.add(unconnectedServer);
-  }
-
-  public Set getConnectedClients() {
-    return this._connectedClients;
-  }
-
-  protected void addConnectedClient(String connectedClient) {
-    this._connectedClients.add(connectedClient);
-  }
-
-  public Map getOutgoingGateways() {
-    return this._outgoingGateways;
-  }
-
-  public Map getConnectedIncomingGateways() {
-    return this._connectedIncomingGateways;
-  }
-
-  protected void setConnectedIncomingGateways(Map connectedIncomingGateways) {
-    this._connectedIncomingGateways = connectedIncomingGateways;
-  }
-
-  public Map getClientQueueSizes() {
-    return this._clientQueueSizes;
-  }
-
-  protected void setClientQueueSizes(Map clientQueueSizes) {
-    this._clientQueueSizes = clientQueueSizes;
-  }
-
-  public int getClientQueueSize(String clientMemberId) {
-    Integer clientQueueSize = (Integer) getClientQueueSizes().get(clientMemberId);
-    return clientQueueSize == null ? 0 : clientQueueSize.intValue();
-  }
-
-  protected void putClientQueueSize(String clientMemberId, int size) {
-    getClientQueueSizes().put(clientMemberId, Integer.valueOf(size));
-  }
-
-  public Map getClientHealthStats() {
-    return this._clientHealthStats;
-  }
-
-  protected void setClientHealthStats(Map stats) {
-    this._clientHealthStats = stats;
-  }
-
-  /**
-   * For internal use only
-   * 
-   * @param clientID client for health
-   * @return the client's health
-   */
-  public Object/* ClientHealthStats */ getClientHealthStats(String clientID) {
-    return this._clientHealthStats.get(clientID);
-  }
-
-  protected void setClientHealthStats(String clientID, ClientHealthStats stats) {
-    this._clientHealthStats.put(clientID, stats);
-  }
-
-  protected void putClientHostName(String clientId, String hostName) {
-    this._clientHostNames.put(clientId, hostName);
-  }
-
-  public String getClientHostName(String clientId) {
-    return (String) this._clientHostNames.get(clientId);
-  }
-
-  public Map getRegionStatuses() {
-    return this._regionStatuses;
-  }
-
-  /**
-   * For internal use only
-   * 
-   * @param fullRegionPath region path
-   * @return status for the region
-   */
-  public Object/* RegionStatus */ getRegionStatus(String fullRegionPath) {
-    return getRegionStatuses().get(fullRegionPath);
-  }
-
-  protected void putRegionStatus(String fullRegionPath, RegionStatus status) {
-    getRegionStatuses().put(fullRegionPath, status);
-  }
-
-  public Serializable getMemberId() {
-    return this._memberId;
-  }
-
-  protected void setMemberId(Serializable memberId) {
-    this._memberId = memberId;
-  }
-
-  public String getMemberName() {
-    return this._memberName;
-  }
-
-  protected void setMemberName(String memberName) {
-    this._memberName = memberName;
-  }
-
-  public int getMcastPort() {
-    return this._mcastPort;
-  }
-
-  protected void setMcastPort(int mcastPort) {
-    this._mcastPort = mcastPort;
-  }
-
-  public InetAddress getMcastAddress() {
-    return this._mcastAddress;
-  }
-
-  protected void setMcastAddress(InetAddress mcastAddress) {
-    this._mcastAddress = mcastAddress;
-  }
-
-  public InetAddress getHostAddress() {
-    return this._hostAddress;
-  }
-
-  protected void setHostAddress(InetAddress hostAddress) {
-    this._hostAddress = hostAddress;
-  }
-
-  public String getBindAddress() {
-    return this._bindAddress;
-  }
-
-  protected void setBindAddress(String bindAddress) {
-    this._bindAddress = bindAddress;
-  }
-
-  public String getLocators() {
-    return this._locators;
-  }
-
-  protected void setLocators(String locators) {
-    this._locators = locators;
-  }
-
-  public long getMaximumHeapSize() {
-    return this._maximumHeapSize;
-  }
-
-  protected void setMaximumHeapSize(long size) {
-    this._maximumHeapSize = size;
-  }
-
-  public long getFreeHeapSize() {
-    return this._freeHeapSize;
-  }
-
-  protected void setFreeHeapSize(long size) {
-    this._freeHeapSize = size;
-  }
-
-  public long getUsedHeapSize() {
-    return getMaximumHeapSize() - getFreeHeapSize();
-  }
-
-  public long getUpTime() {
-    return upTime;
-  }
-
-  public void setUpTime(long upTime) {
-    this.upTime = upTime;
-  }
-
-  @Override
-  public String toString() {
-    StringBuffer buffer = new StringBuffer();
-    buffer.append("GemFireMemberStatus[").append("isConnected=").append(this._isConnected)
-        .append("; memberName=").append(this._memberName).append("; memberId=")
-        .append(this._memberId).append("; hostAddress=").append(this._hostAddress)
-        .append("; mcastPort=").append(this._mcastPort).append("; mcastAddress=")
-        .append(this._mcastAddress).append("; bindAddress=").append(this._bindAddress)
-        .append("; serverPort=").append(this._serverPort).append("; locators=")
-        .append(this._locators).append("; isClient=").append(this._isClient).append("; isServer=")
-        .append(this._isServer).append("; isGatewayHub=").append(this._isGatewayHub)
-        .append("; isLocator=").append(this._isLocator).append("; isPrimaryGatewayHub=")
-        .append(this._isPrimaryGatewayHub).append("; gatewayHubStatus=")
-        .append(this._gatewayHubStatus).append("; connectedPeers=").append(this._connectedPeers)
-        .append("; connectedServers=").append(this._connectedServers)
-        .append("; unconnectedServers=").append(this._unconnectedServers)
-        .append("; connectedClients=").append(this._connectedClients).append("; clientHostNames=")
-        .append(this._clientHostNames).append("; clientQueueSizes=").append(this._clientQueueSizes)
-        .append("; clientHealthStats=").append(this._clientHealthStats)
-        .append("; gatewayQueueSizes=").append(this._gatewayQueueSizes).append("; regionStatuses=")
-        .append(this._regionStatuses).append("; maximumHeapSize=").append(this._maximumHeapSize)
-        .append("; freeHeapSize=").append(this._freeHeapSize).append("; upTime=")
-        .append(this.upTime).append("]");
-    return buffer.toString();
-  }
-
-  protected void initialize(DistributedSystem distributedSystem) {
-    // Initialize instance variables
-    initializeInstanceVariables();
-
-    // If the cache is set, initialize the status.
-    // If the cache is not set, then this is most
-    // likely an unconnected status.
-    if (cache != null) {
-      // Initialize server
-      initializeServer();
-
-      // Initialize client
-      initializeClient();
-
-      // Initialize region sizes
-      initializeRegionSizes();
-    }
-
-    if (distributedSystem != null) {
-      // Initialize all
-      initializeAll(distributedSystem);
-    }
-
-    // If this is a locator, initialize the locator status
-    if (Locator.getLocators().size() > 0) {
-      setIsLocator(true);
-    }
-  }
-
-  protected void initializeInstanceVariables() {
-    // Variables for servers
-    this._connectedClients = new HashSet();
-    this._clientQueueSizes = new HashMap();
-    this._clientHealthStats = new HashMap();
-    this._clientHostNames = new HashMap();
-
-    // Variables for gateway hubs
-    this._outgoingGateways = new HashMap();
-    // this._connectedOutgoingGateways = new HashSet();
-    // this._unconnectedOutgoingGateways = new HashSet();
-    this._connectedIncomingGateways = new HashMap();
-    this._gatewayQueueSizes = new HashMap();
-
-    // Variables for clients
-    this._connectedServers = new HashSet();
-    this._unconnectedServers = new HashSet();
-
-    // Variables for all
-    this._connectedPeers = new HashSet();
-    this._regionStatuses = new HashMap();
-  }
-
-  protected void initializeServer() {
-    Collection servers = cache.getCacheServers();
-    if (servers.size() == 0) {
-      setIsServer(false);
-    } else {
-      setIsServer(true);
-
-      // Get connected clients.
-      // The following method returns a map of client member id to a cache
-      // client info. For now, keep track of the member ids in the set of
-      // _connectedClients.
-      Map allConnectedClients =
-          InternalClientMembership.getStatusForAllClientsIgnoreSubscriptionStatus();
-      Iterator allConnectedClientsIterator = allConnectedClients.values().iterator();
-      while (allConnectedClientsIterator.hasNext()) {
-        CacheClientStatus ccs = (CacheClientStatus) allConnectedClientsIterator.next();
-        addConnectedClient(ccs.getMemberId());
-        // host address is available directly by id, hence CacheClientStatus need not be populated
-        putClientHostName(ccs.getMemberId(), ccs.getHostAddress());
-      }
-
-      // Get client queue sizes
-      Map clientQueueSize = getClientIDMap(InternalClientMembership.getClientQueueSizes());
-      setClientQueueSizes(clientQueueSize);
-
-      // Set server acceptor port (set it based on the first CacheServer)
-      CacheServer server = (CacheServer) servers.toArray()[0];
-      setServerPort(server.getPort());
-
-      // Get Client Health Stats
-      // Assert.assertTrue(cache != null); (cannot be null)
-      Region clientHealthMonitoringRegion =
-          ClientHealthMonitoringRegion.getInstance((GemFireCacheImpl) cache);
-      if (clientHealthMonitoringRegion != null) {
-        String[] clients = (String[]) clientHealthMonitoringRegion.keySet().toArray(new String[0]);
-        for (int i = 0; i < clients.length; i++) {
-          String clientId = clients[i];
-          ClientHealthStats stats = (ClientHealthStats) clientHealthMonitoringRegion.get(clientId);
-          setClientHealthStats(clientId, stats);
-        }
-      }
-    }
-  }
-
-  /**
-   * returning Map of client queue size against client Id
-   * 
-   * param clientMap is a Map of client queue size against ClientProxyMembershipID
-   */
-  private Map getClientIDMap(Map ClientProxyMembershipIDMap) {
-    Map clientIdMap = new HashMap();
-    Set entrySet = ClientProxyMembershipIDMap.entrySet();
-    Iterator entries = entrySet.iterator();
-    while (entries.hasNext()) {
-      Map.Entry entry = (Map.Entry) entries.next();
-      ClientProxyMembershipID key = (ClientProxyMembershipID) entry.getKey();
-      Integer size = (Integer) entry.getValue();
-      clientIdMap.put(key.getDSMembership(), size);
-    }
-    return clientIdMap;
-  }
-
-  protected void initializeClient() {
-    Map poolMap = PoolManager.getAll();
-    if (poolMap.size() == 0) {
-      setIsClient(false);
-    } else {
-      setIsClient(true);
-
-      // Get connected servers.
-      // The following method returns a map of server name to a count of logical
-      // connections. A logical connection will be made for each region that
-      // references the live server. If the client is not connected to the server,
-      // the logical connections for that server will be 0. For now, keep track
-      // of the keys (server names) of this map in the sets of _connectedServers
-      // and _unconnectedServers.
-      Map connectedServers = InternalClientMembership.getConnectedServers();
-      if (!connectedServers.isEmpty()) {
-        Iterator connected = connectedServers.entrySet().iterator();
-        while (connected.hasNext()) {
-          Map.Entry entry = (Map.Entry) connected.next();
-          String server = (String) entry.getKey();
-          // Integer connections = (Integer) entry.getValue();
-          // if (connections.intValue()==0) {
-          // addUnconnectedServer(server);
-          // } else {
-          addConnectedServer(server);
-          // }
-          // System.out.println(connections.size() + " logical connnections to server " + server);
-        }
-      }
-    }
-  }
-
-  protected void initializeAll(DistributedSystem distributedSystem) {
-    // Initialize isConnected
-    setIsConnected(true);
-
-    // Initialize distributed system status
-    initializeDistributedSystem(distributedSystem);
-
-    // Initialize peers
-    initializePeers(distributedSystem);
-
-    // Initialize memory
-    initializeMemory();
-  }
-
-  protected void initializeDistributedSystem(DistributedSystem distributedSystem) {
-    InternalDistributedSystem ids = (InternalDistributedSystem) distributedSystem;
-    setMemberId(ids.getMemberId());
-    DistributionConfig config = ids.getConfig();
-    setMemberName(config.getName());
-    setMcastPort(config.getMcastPort());
-    setMcastAddress(config.getMcastAddress());
-    String bindAddress = config.getBindAddress();
-    setBindAddress(bindAddress);
-    setLocators(config.getLocators());
-    setUpTime(System.currentTimeMillis() - ids.getStartTime());
-    try {
-      setHostAddress((bindAddress != null && bindAddress.length() > 0)
-          ? InetAddress.getByName(bindAddress) : SocketCreator.getLocalHost());
-    } catch (IOException e) {
-      /* ignore - leave null host address */}
-  }
-
-  protected void initializePeers(DistributedSystem distributedSystem) {
-    InternalDistributedSystem ids = (InternalDistributedSystem) distributedSystem;
-    DM dm = ids.getDistributionManager();
-    Set connections = dm.getOtherNormalDistributionManagerIds();
-    Set connectionsIDs = new HashSet(connections.size());
-    for (Iterator iter = connections.iterator(); iter.hasNext();) {
-      InternalDistributedMember idm = (InternalDistributedMember) iter.next();
-      connectionsIDs.add(idm.getId());
-    }
-    setConnectedPeers(connectionsIDs);
-  }
-
-  protected void initializeMemory() {
-    // InternalDistributedSystem system = (InternalDistributedSystem)
-    // region.getCache().getDistributedSystem();
-    // GemFireStatSampler sampler = system.getStatSampler();
-    // VMStatsContract statsContract = sampler.getVMStats();
-
-    Runtime rt = Runtime.getRuntime();
-    setMaximumHeapSize(rt.maxMemory());
-    setFreeHeapSize(rt.freeMemory());
-  }
-
-  protected void initializeRegionSizes() {
-    Iterator rootRegions = cache.rootRegions().iterator();
-
-    while (rootRegions.hasNext()) {
-      LocalRegion rootRegion = (LocalRegion) rootRegions.next();
-      if (!(rootRegion instanceof HARegion)) {
-        RegionStatus rootRegionStatus = rootRegion instanceof PartitionedRegion
-            ? new PartitionedRegionStatus((PartitionedRegion) rootRegion)
-            : new RegionStatus(rootRegion);
-        putRegionStatus(rootRegion.getFullPath(), rootRegionStatus);
-        Iterator subRegions = rootRegion.subregions(true).iterator();
-        while (subRegions.hasNext()) {
-          LocalRegion subRegion = (LocalRegion) subRegions.next();
-          RegionStatus subRegionStatus = subRegion instanceof PartitionedRegion
-              ? new PartitionedRegionStatus((PartitionedRegion) subRegion)
-              : new RegionStatus(subRegion);
-          putRegionStatus(subRegion.getFullPath(), subRegionStatus);
-        }
-      }
-    }
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/ManagedEntity.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/ManagedEntity.java b/geode-core/src/main/java/org/apache/geode/admin/ManagedEntity.java
deleted file mode 100644
index 1eaa892..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/ManagedEntity.java
+++ /dev/null
@@ -1,100 +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.admin;
-
-/**
- * A entity that can be managed with the GemFire administration API.
- *
- * @see ManagedEntityConfig
- *
- * @since GemFire 4.0
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface ManagedEntity {
-
-  /**
-   * Starts this managed entity. Note that this method may return before the managed entity is
-   * actually started.
-   *
-   * @throws AdminException If a problem is encountered while starting this managed entity.
-   * @throws IllegalStateException If this managed entity resides on a remote machine and a
-   *         <code>null</code> or empty (<code>""</code>)
-   *         {@linkplain ManagedEntityConfig#getRemoteCommand remote command} has been specified.
-   *
-   * @see #waitToStart
-   */
-  public void start() throws AdminException;
-
-  /**
-   * Stops this managed entity. Note that this method may return before the managed entity is
-   * actually stopped.
-   *
-   * @throws AdminException If a problem is encountered while stopping this managed entity.
-   * @throws IllegalStateException If this managed entity resides on a remote machine and a
-   *         <code>null</code> or empty (<code>""</code>)
-   *         {@linkplain ManagedEntityConfig#getRemoteCommand remote command} has been specified.
-   *
-   * @see #waitToStop
-   */
-  public void stop() throws AdminException;
-
-  /**
-   * Waits for up to a given number of milliseconds for this managed entity to {@linkplain #start
-   * start}.
-   *
-   * @param timeout The number of milliseconds to wait for this managed entity to start.
-   *
-   * @return Whether or not the entity has started. <code>false</code>, if the method times out.
-   *
-   * @throws InterruptedException If the thread invoking this method is interrupted while waiting.
-   */
-  public boolean waitToStart(long timeout) throws InterruptedException;
-
-  /**
-   * Waits for up to a given number of milliseconds for this managed entity to {@linkplain #stop
-   * stop}.
-   *
-   * @param timeout The number of milliseconds to wait for this managed entity to stop.
-   *
-   * @return Whether or not the entity has stopped. <code>false</code>, if the method times out.
-   *
-   * @throws InterruptedException If the thread invoking this method is interrupted while waiting.
-   */
-  public boolean waitToStop(long timeout) throws InterruptedException;
-
-  /**
-   * Returns whether or not this managed entity is running. Note that this operation may attempt to
-   * contact the managed entity.
-   *
-   * @throws IllegalStateException If this managed entity resides on a remote machine and a
-   *         <code>null</code> or empty (<code>""</code>)
-   *         {@linkplain ManagedEntityConfig#getRemoteCommand remote command} has been specified.
-   */
-  public boolean isRunning();
-
-  /**
-   * Returns the tail of this manage entity's log file. Note that not all managed entities implement
-   * this functionality.
-   *
-   * @throws AdminException If a problem is encountered while getting the log of this managed
-   *         entity.
-   * @throws UnsupportedOperationException If this managed entity does not support retrieving its
-   *         log.
-   */
-  public String getLog() throws AdminException;
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/ManagedEntityConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/ManagedEntityConfig.java b/geode-core/src/main/java/org/apache/geode/admin/ManagedEntityConfig.java
deleted file mode 100644
index 0b7acd7..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/ManagedEntityConfig.java
+++ /dev/null
@@ -1,88 +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.admin;
-
-/**
- * Common configuration for all entities that can be managed using the GemFire administration API.
- * Note that once a managed entity has been {@linkplain ManagedEntity#start started}, attempts to
- * modify its configuration will cause an {@link IllegalStateException} to be thrown.
- *
- * @see ManagedEntity
- *
- * @since GemFire 4.0
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface ManagedEntityConfig extends Cloneable {
-
-  /**
-   * Returns the name of the host on which the managed entity runs or will run.
-   */
-  public String getHost();
-
-  /**
-   * Sets the name of the host on which the managed entity will run.
-   */
-  public void setHost(String host);
-
-  /**
-   * Returns the name of the working directory in which the managed entity runs or will run.
-   */
-  public String getWorkingDirectory();
-
-  /**
-   * Sets the name of the working directory in which the managed entity will run.
-   */
-  public void setWorkingDirectory(String dir);
-
-  /**
-   * Returns the name of the GemFire product directory to use when administering the managed entity.
-   */
-  public String getProductDirectory();
-
-  /**
-   * Sets the name of the GemFire product directory to use when administering the managed entity.
-   */
-  public void setProductDirectory(String dir);
-
-  /**
-   * Returns the command prefix used to administer a managed entity that is hosted on a remote
-   * machine. If the remote command is <code>null</code> (the default value), then the remote
-   * command associated with the {@linkplain AdminDistributedSystem#getRemoteCommand() distributed
-   * system} will be used.
-   */
-  public String getRemoteCommand();
-
-  /**
-   * Sets the command prefix used to administer a managed entity that is hosted on a remote machine.
-   */
-  public void setRemoteCommand(String remoteCommand);
-
-  /**
-   * Validates this configuration.
-   *
-   * @throws IllegalStateException If a managed entity cannot be administered using this
-   *         configuration
-   */
-  public void validate();
-
-  /**
-   * Returns a new <code>ManagedEntityConfig</code> with the same configuration as this
-   * <code>ManagedEntityConfig</code>.
-   */
-  public Object clone() throws CloneNotSupportedException;
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/MemberHealthConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/MemberHealthConfig.java b/geode-core/src/main/java/org/apache/geode/admin/MemberHealthConfig.java
deleted file mode 100644
index 63dd605..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/MemberHealthConfig.java
+++ /dev/null
@@ -1,142 +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.admin;
-
-/**
- * Provides configuration information relating to the health of a member of a GemFire distributed
- * system.
- *
- * <P>
- *
- * If any of the following criteria is true, then a member is considered to be in
- * {@link GemFireHealth#OKAY_HEALTH OKAY_HEALTH}.
- *
- * <UL>
- *
- * <LI>The size of the {@linkplain #getMaxVMProcessSize VM process} is too large.</LI>
- *
- * <LI>There are too many {@linkplain #getMaxMessageQueueSize enqueued} incoming/outgoing
- * messages.</LI>
- *
- * <LI>Too many message sends {@link #getMaxReplyTimeouts timeout} while waiting for a reply.</LI>
- *
- * </UL>
- *
- * If any of the following criteria is true, then a member is considered to be in
- * {@link GemFireHealth#POOR_HEALTH POOR_HEALTH}.
- *
- * <UL>
- *
- * </UL>
- *
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface MemberHealthConfig {
-
-  /**
-   * The default maximum VM process size (in megabytes) of a health member of the distributed
-   * system. The default value is 1000.
-   */
-  public static final long DEFAULT_MAX_VM_PROCESS_SIZE = 1000;
-
-  /**
-   * The default maximum number of enqueued incoming or outgoing messages that a healthy member of a
-   * distributed system can have. The default value is 1000.
-   */
-  public static final long DEFAULT_MAX_MESSAGE_QUEUE_SIZE = 1000;
-
-  /**
-   * The default maximum number of message reply timeouts that can occur in a given health
-   * monitoring interval. The default value is zero.
-   */
-  public static final long DEFAULT_MAX_REPLY_TIMEOUTS = 0;
-
-  /**
-   * The default maximum multicast retransmission ratio. The default value is 0.20 (twenty percent
-   * of messages retransmitted)
-   */
-  public static final double DEFAULT_MAX_RETRANSMISSION_RATIO = 0.20;
-
-  /////////////////////// Instance Methods ///////////////////////
-
-  /**
-   * Returns the maximum VM process size (in megabytes) of a healthy member of the distributed
-   * system.
-   *
-   * @see #DEFAULT_MAX_VM_PROCESS_SIZE
-   */
-  public long getMaxVMProcessSize();
-
-  /**
-   * Sets the maximum VM process size (in megabytes) of a healthy member of the distributed system.
-   *
-   * @see #getMaxVMProcessSize
-   */
-  public void setMaxVMProcessSize(long size);
-
-  /**
-   * Returns the maximum number of enqueued incoming or outgoing messages that a healthy member of a
-   * distributed system can have.
-   *
-   * @see #DEFAULT_MAX_MESSAGE_QUEUE_SIZE
-   */
-  public long getMaxMessageQueueSize();
-
-  /**
-   * Sets the maximum number of enqueued incoming or outgoing messages that a healthy member of a
-   * distributed system can have.
-   *
-   * @see #getMaxMessageQueueSize
-   */
-  public void setMaxMessageQueueSize(long maxMessageQueueSize);
-
-  /**
-   * Returns the maximum number message replies that can timeout in a healthy member.
-   *
-   * @see #DEFAULT_MAX_REPLY_TIMEOUTS
-   */
-  public long getMaxReplyTimeouts();
-
-  /**
-   * Sets the maximum number message replies that can timeout in a healthy member.
-   *
-   * @see #getMaxReplyTimeouts
-   */
-  public void setMaxReplyTimeouts(long maxReplyTimeouts);
-
-  /**
-   * Returns the maximum ratio of multicast retransmissions / total multicast messages.
-   * Retransmissions are requestor-specific (i.e., unicast), so a single lost message may result in
-   * multiple retransmissions.
-   * <p>
-   * A high retransmission ratio may indicate poor network conditions requiring reduced flow-control
-   * settings, a udp-fragment-size setting that is too high.
-   * 
-   * @see #DEFAULT_MAX_RETRANSMISSION_RATIO
-   */
-  public double getMaxRetransmissionRatio();
-
-  /**
-   * Sets the maximum ratio of multicast retransmissions / total multicast messages.
-   * 
-   * @see #getMaxRetransmissionRatio
-   */
-  public void setMaxRetransmissionRatio(double ratio);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/OperationCancelledException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/OperationCancelledException.java b/geode-core/src/main/java/org/apache/geode/admin/OperationCancelledException.java
deleted file mode 100644
index 0328641..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/OperationCancelledException.java
+++ /dev/null
@@ -1,47 +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.admin;
-
-// import org.apache.geode.GemFireException;
-
-/**
- * Thrown when an administration operation that accesses information in a remote system member is
- * cancelled. The cancelation may occur because the system member has left the distributed system.
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class OperationCancelledException extends RuntimeAdminException {
-  private static final long serialVersionUID = 5474068770227602546L;
-
-  public OperationCancelledException() {
-    super();
-  }
-
-  public OperationCancelledException(String message) {
-    super(message);
-  }
-
-  public OperationCancelledException(Throwable cause) {
-    super(cause);
-  }
-
-  public OperationCancelledException(String message, Throwable cause) {
-    super(message, cause);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/RegionNotFoundException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/RegionNotFoundException.java b/geode-core/src/main/java/org/apache/geode/admin/RegionNotFoundException.java
deleted file mode 100644
index e849a70..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/RegionNotFoundException.java
+++ /dev/null
@@ -1,39 +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.admin;
-
-// import org.apache.geode.cache.CacheException;
-import org.apache.geode.cache.CacheRuntimeException;
-
-/**
- * Thrown by the administration API when the region administered by a {@link SystemMemberRegion} has
- * been closed or destroyed in system member.
- * <P>
- * Also thrown by {@link org.apache.geode.DataSerializer#readRegion(java.io.DataInput)} if the named
- * region no longer exists.
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class RegionNotFoundException extends CacheRuntimeException {
-  private static final long serialVersionUID = 1758668137691463909L;
-
-  public RegionNotFoundException(String message) {
-    super(message);
-  }
-
-}



[31/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java
new file mode 100755
index 0000000..6bac386
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java
@@ -0,0 +1,670 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.client.PoolManager;
+import org.apache.geode.cache.server.CacheServer;
+import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.distributed.Locator;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.internal.admin.ClientHealthMonitoringRegion;
+import org.apache.geode.internal.admin.remote.ClientHealthStats;
+import org.apache.geode.internal.cache.*;
+import org.apache.geode.internal.cache.tier.InternalClientMembership;
+import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.net.InetAddress;
+import java.util.*;
+
+/**
+ * Class <code>GemFireMemberStatus</code> provides the status of a specific GemFire member VM. This
+ * VM can be a peer, a client, a server and/or a gateway.
+ * 
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class GemFireMemberStatus implements Serializable {
+  private static final long serialVersionUID = 3389997790525991310L;
+
+  /**
+   * Notifies whether this member is a client to a cache server.
+   */
+  protected boolean _isClient;
+
+  /**
+   * Notifies whether this member is a cache server.
+   */
+  protected boolean _isServer;
+
+  /**
+   * Notifies whether this member is a hub for WAN gateways.
+   */
+  protected boolean _isGatewayHub;
+
+  /**
+   * Notifies whether this member is a locator.
+   */
+  protected boolean _isLocator;
+
+  protected boolean _isPrimaryGatewayHub;
+
+  protected Object/* GatewayHubStatus */ _gatewayHubStatus;
+
+  protected boolean _isConnected;
+  protected Serializable _memberId;
+  protected Set _connectedPeers;
+  protected Set _connectedServers;
+  protected Set _unconnectedServers;
+  protected Set _connectedClients;
+  protected Map _connectedIncomingGateways;
+  protected Map _outgoingGateways;
+
+  protected Map _clientHostNames;
+  protected Map _clientQueueSizes;
+  protected Map _gatewayQueueSizes;
+  protected Map _regionStatuses;
+  protected Map _clientHealthStats;
+
+  protected String _memberName;
+  protected int _mcastPort;
+  protected int _serverPort;
+  protected InetAddress _mcastAddress;
+  protected String _bindAddress;
+  protected String _locators;
+  protected InetAddress _hostAddress;
+
+  protected long _maximumHeapSize;
+  protected long _freeHeapSize;
+
+  protected long upTime = -1;
+
+  protected transient final Cache cache;
+
+  public GemFireMemberStatus() {
+    this(null);
+  }
+
+  public GemFireMemberStatus(Cache cache) {
+    this.cache = cache;
+    DistributedSystem ds = null;
+    if (cache != null) {
+      ds = cache.getDistributedSystem();
+    }
+    initialize(ds);
+  }
+
+  public boolean getIsConnected() {
+    return this._isConnected;
+  }
+
+  protected void setIsConnected(boolean isConnected) {
+    this._isConnected = isConnected;
+  }
+
+  /**
+   * Returns whether this member is a client to a cache server
+   * 
+   * @return whether this member is a client to a cache server
+   */
+  public boolean getIsClient() {
+    return this._isClient;
+  }
+
+  /**
+   * Sets whether this member is a client to a cache server
+   * 
+   * @param isClient Boolean defining whether this member is a client to a cache server
+   */
+  protected void setIsClient(boolean isClient) {
+    this._isClient = isClient;
+  }
+
+  /**
+   * Returns whether this member is a cache server
+   * 
+   * @return whether this member is a cache server
+   */
+  public boolean getIsServer() {
+    return this._isServer;
+  }
+
+  /**
+   * Sets whether this member is a cache server
+   * 
+   * @param isServer Boolean defining whether this member is a cache server
+   */
+  protected void setIsServer(boolean isServer) {
+    this._isServer = isServer;
+  }
+
+  public int getServerPort() {
+    return this._serverPort;
+  }
+
+  protected void setServerPort(int port) {
+    this._serverPort = port;
+  }
+
+  /**
+   * Returns whether this member is a hub for WAN gateways
+   * 
+   * @return whether this member is a hub for WAN gateways
+   */
+  public boolean getIsGatewayHub() {
+    return this._isGatewayHub;
+  }
+
+  /**
+   * Sets whether this member is a cache server
+   * 
+   * @param isGatewayHub Boolean defining whether this member is a hub for WAN gateways
+   */
+  protected void setIsGatewayHub(boolean isGatewayHub) {
+    this._isGatewayHub = isGatewayHub;
+  }
+
+  public boolean getIsLocator() {
+    return this._isLocator;
+  }
+
+  protected void setIsLocator(boolean isLocator) {
+    this._isLocator = isLocator;
+  }
+
+  public boolean getIsPrimaryGatewayHub() {
+    return this._isPrimaryGatewayHub;
+  }
+
+  protected void setIsPrimaryGatewayHub(boolean isPrimaryGatewayHub) {
+    this._isPrimaryGatewayHub = isPrimaryGatewayHub;
+  }
+
+  /**
+   * For internal use only
+   * 
+   * @return status of the gateway hub
+   */
+  public Object/* GatewayHubStatus */ getGatewayHubStatus() {
+    return this._gatewayHubStatus;
+  }
+
+  // protected void setGatewayHubStatus(GatewayHubStatus gatewayHubStatus) {
+  // this._gatewayHubStatus = gatewayHubStatus;
+  // }
+
+  public boolean getIsSecondaryGatewayHub() {
+    return !this._isPrimaryGatewayHub;
+  }
+
+  public Set getConnectedPeers() {
+    return this._connectedPeers;
+  }
+
+  protected void setConnectedPeers(Set connectedPeers) {
+    this._connectedPeers = connectedPeers;
+  }
+
+  public Set getConnectedServers() {
+    return this._connectedServers;
+  }
+
+  protected void setConnectedServers(Set connectedServers) {
+    this._connectedServers = connectedServers;
+  }
+
+  protected void addConnectedServer(String connectedServer) {
+    this._connectedServers.add(connectedServer);
+  }
+
+  public Set getUnconnectedServers() {
+    return this._unconnectedServers;
+  }
+
+  protected void setUnconnectedServers(Set unconnectedServers) {
+    this._unconnectedServers = unconnectedServers;
+  }
+
+  protected void addUnconnectedServer(String unconnectedServer) {
+    this._unconnectedServers.add(unconnectedServer);
+  }
+
+  public Set getConnectedClients() {
+    return this._connectedClients;
+  }
+
+  protected void addConnectedClient(String connectedClient) {
+    this._connectedClients.add(connectedClient);
+  }
+
+  public Map getOutgoingGateways() {
+    return this._outgoingGateways;
+  }
+
+  public Map getConnectedIncomingGateways() {
+    return this._connectedIncomingGateways;
+  }
+
+  protected void setConnectedIncomingGateways(Map connectedIncomingGateways) {
+    this._connectedIncomingGateways = connectedIncomingGateways;
+  }
+
+  public Map getClientQueueSizes() {
+    return this._clientQueueSizes;
+  }
+
+  protected void setClientQueueSizes(Map clientQueueSizes) {
+    this._clientQueueSizes = clientQueueSizes;
+  }
+
+  public int getClientQueueSize(String clientMemberId) {
+    Integer clientQueueSize = (Integer) getClientQueueSizes().get(clientMemberId);
+    return clientQueueSize == null ? 0 : clientQueueSize.intValue();
+  }
+
+  protected void putClientQueueSize(String clientMemberId, int size) {
+    getClientQueueSizes().put(clientMemberId, Integer.valueOf(size));
+  }
+
+  public Map getClientHealthStats() {
+    return this._clientHealthStats;
+  }
+
+  protected void setClientHealthStats(Map stats) {
+    this._clientHealthStats = stats;
+  }
+
+  /**
+   * For internal use only
+   * 
+   * @param clientID client for health
+   * @return the client's health
+   */
+  public Object/* ClientHealthStats */ getClientHealthStats(String clientID) {
+    return this._clientHealthStats.get(clientID);
+  }
+
+  protected void setClientHealthStats(String clientID, ClientHealthStats stats) {
+    this._clientHealthStats.put(clientID, stats);
+  }
+
+  protected void putClientHostName(String clientId, String hostName) {
+    this._clientHostNames.put(clientId, hostName);
+  }
+
+  public String getClientHostName(String clientId) {
+    return (String) this._clientHostNames.get(clientId);
+  }
+
+  public Map getRegionStatuses() {
+    return this._regionStatuses;
+  }
+
+  /**
+   * For internal use only
+   * 
+   * @param fullRegionPath region path
+   * @return status for the region
+   */
+  public Object/* RegionStatus */ getRegionStatus(String fullRegionPath) {
+    return getRegionStatuses().get(fullRegionPath);
+  }
+
+  protected void putRegionStatus(String fullRegionPath, RegionStatus status) {
+    getRegionStatuses().put(fullRegionPath, status);
+  }
+
+  public Serializable getMemberId() {
+    return this._memberId;
+  }
+
+  protected void setMemberId(Serializable memberId) {
+    this._memberId = memberId;
+  }
+
+  public String getMemberName() {
+    return this._memberName;
+  }
+
+  protected void setMemberName(String memberName) {
+    this._memberName = memberName;
+  }
+
+  public int getMcastPort() {
+    return this._mcastPort;
+  }
+
+  protected void setMcastPort(int mcastPort) {
+    this._mcastPort = mcastPort;
+  }
+
+  public InetAddress getMcastAddress() {
+    return this._mcastAddress;
+  }
+
+  protected void setMcastAddress(InetAddress mcastAddress) {
+    this._mcastAddress = mcastAddress;
+  }
+
+  public InetAddress getHostAddress() {
+    return this._hostAddress;
+  }
+
+  protected void setHostAddress(InetAddress hostAddress) {
+    this._hostAddress = hostAddress;
+  }
+
+  public String getBindAddress() {
+    return this._bindAddress;
+  }
+
+  protected void setBindAddress(String bindAddress) {
+    this._bindAddress = bindAddress;
+  }
+
+  public String getLocators() {
+    return this._locators;
+  }
+
+  protected void setLocators(String locators) {
+    this._locators = locators;
+  }
+
+  public long getMaximumHeapSize() {
+    return this._maximumHeapSize;
+  }
+
+  protected void setMaximumHeapSize(long size) {
+    this._maximumHeapSize = size;
+  }
+
+  public long getFreeHeapSize() {
+    return this._freeHeapSize;
+  }
+
+  protected void setFreeHeapSize(long size) {
+    this._freeHeapSize = size;
+  }
+
+  public long getUsedHeapSize() {
+    return getMaximumHeapSize() - getFreeHeapSize();
+  }
+
+  public long getUpTime() {
+    return upTime;
+  }
+
+  public void setUpTime(long upTime) {
+    this.upTime = upTime;
+  }
+
+  @Override
+  public String toString() {
+    StringBuffer buffer = new StringBuffer();
+    buffer.append("GemFireMemberStatus[").append("isConnected=").append(this._isConnected)
+        .append("; memberName=").append(this._memberName).append("; memberId=")
+        .append(this._memberId).append("; hostAddress=").append(this._hostAddress)
+        .append("; mcastPort=").append(this._mcastPort).append("; mcastAddress=")
+        .append(this._mcastAddress).append("; bindAddress=").append(this._bindAddress)
+        .append("; serverPort=").append(this._serverPort).append("; locators=")
+        .append(this._locators).append("; isClient=").append(this._isClient).append("; isServer=")
+        .append(this._isServer).append("; isGatewayHub=").append(this._isGatewayHub)
+        .append("; isLocator=").append(this._isLocator).append("; isPrimaryGatewayHub=")
+        .append(this._isPrimaryGatewayHub).append("; gatewayHubStatus=")
+        .append(this._gatewayHubStatus).append("; connectedPeers=").append(this._connectedPeers)
+        .append("; connectedServers=").append(this._connectedServers)
+        .append("; unconnectedServers=").append(this._unconnectedServers)
+        .append("; connectedClients=").append(this._connectedClients).append("; clientHostNames=")
+        .append(this._clientHostNames).append("; clientQueueSizes=").append(this._clientQueueSizes)
+        .append("; clientHealthStats=").append(this._clientHealthStats)
+        .append("; gatewayQueueSizes=").append(this._gatewayQueueSizes).append("; regionStatuses=")
+        .append(this._regionStatuses).append("; maximumHeapSize=").append(this._maximumHeapSize)
+        .append("; freeHeapSize=").append(this._freeHeapSize).append("; upTime=")
+        .append(this.upTime).append("]");
+    return buffer.toString();
+  }
+
+  protected void initialize(DistributedSystem distributedSystem) {
+    // Initialize instance variables
+    initializeInstanceVariables();
+
+    // If the cache is set, initialize the status.
+    // If the cache is not set, then this is most
+    // likely an unconnected status.
+    if (cache != null) {
+      // Initialize server
+      initializeServer();
+
+      // Initialize client
+      initializeClient();
+
+      // Initialize region sizes
+      initializeRegionSizes();
+    }
+
+    if (distributedSystem != null) {
+      // Initialize all
+      initializeAll(distributedSystem);
+    }
+
+    // If this is a locator, initialize the locator status
+    if (Locator.getLocators().size() > 0) {
+      setIsLocator(true);
+    }
+  }
+
+  protected void initializeInstanceVariables() {
+    // Variables for servers
+    this._connectedClients = new HashSet();
+    this._clientQueueSizes = new HashMap();
+    this._clientHealthStats = new HashMap();
+    this._clientHostNames = new HashMap();
+
+    // Variables for gateway hubs
+    this._outgoingGateways = new HashMap();
+    // this._connectedOutgoingGateways = new HashSet();
+    // this._unconnectedOutgoingGateways = new HashSet();
+    this._connectedIncomingGateways = new HashMap();
+    this._gatewayQueueSizes = new HashMap();
+
+    // Variables for clients
+    this._connectedServers = new HashSet();
+    this._unconnectedServers = new HashSet();
+
+    // Variables for all
+    this._connectedPeers = new HashSet();
+    this._regionStatuses = new HashMap();
+  }
+
+  protected void initializeServer() {
+    Collection servers = cache.getCacheServers();
+    if (servers.size() == 0) {
+      setIsServer(false);
+    } else {
+      setIsServer(true);
+
+      // Get connected clients.
+      // The following method returns a map of client member id to a cache
+      // client info. For now, keep track of the member ids in the set of
+      // _connectedClients.
+      Map allConnectedClients =
+          InternalClientMembership.getStatusForAllClientsIgnoreSubscriptionStatus();
+      Iterator allConnectedClientsIterator = allConnectedClients.values().iterator();
+      while (allConnectedClientsIterator.hasNext()) {
+        CacheClientStatus ccs = (CacheClientStatus) allConnectedClientsIterator.next();
+        addConnectedClient(ccs.getMemberId());
+        // host address is available directly by id, hence CacheClientStatus need not be populated
+        putClientHostName(ccs.getMemberId(), ccs.getHostAddress());
+      }
+
+      // Get client queue sizes
+      Map clientQueueSize = getClientIDMap(InternalClientMembership.getClientQueueSizes());
+      setClientQueueSizes(clientQueueSize);
+
+      // Set server acceptor port (set it based on the first CacheServer)
+      CacheServer server = (CacheServer) servers.toArray()[0];
+      setServerPort(server.getPort());
+
+      // Get Client Health Stats
+      // Assert.assertTrue(cache != null); (cannot be null)
+      Region clientHealthMonitoringRegion =
+          ClientHealthMonitoringRegion.getInstance((GemFireCacheImpl) cache);
+      if (clientHealthMonitoringRegion != null) {
+        String[] clients = (String[]) clientHealthMonitoringRegion.keySet().toArray(new String[0]);
+        for (int i = 0; i < clients.length; i++) {
+          String clientId = clients[i];
+          ClientHealthStats stats = (ClientHealthStats) clientHealthMonitoringRegion.get(clientId);
+          setClientHealthStats(clientId, stats);
+        }
+      }
+    }
+  }
+
+  /**
+   * returning Map of client queue size against client Id
+   * 
+   * param clientMap is a Map of client queue size against ClientProxyMembershipID
+   */
+  private Map getClientIDMap(Map ClientProxyMembershipIDMap) {
+    Map clientIdMap = new HashMap();
+    Set entrySet = ClientProxyMembershipIDMap.entrySet();
+    Iterator entries = entrySet.iterator();
+    while (entries.hasNext()) {
+      Map.Entry entry = (Map.Entry) entries.next();
+      ClientProxyMembershipID key = (ClientProxyMembershipID) entry.getKey();
+      Integer size = (Integer) entry.getValue();
+      clientIdMap.put(key.getDSMembership(), size);
+    }
+    return clientIdMap;
+  }
+
+  protected void initializeClient() {
+    Map poolMap = PoolManager.getAll();
+    if (poolMap.size() == 0) {
+      setIsClient(false);
+    } else {
+      setIsClient(true);
+
+      // Get connected servers.
+      // The following method returns a map of server name to a count of logical
+      // connections. A logical connection will be made for each region that
+      // references the live server. If the client is not connected to the server,
+      // the logical connections for that server will be 0. For now, keep track
+      // of the keys (server names) of this map in the sets of _connectedServers
+      // and _unconnectedServers.
+      Map connectedServers = InternalClientMembership.getConnectedServers();
+      if (!connectedServers.isEmpty()) {
+        Iterator connected = connectedServers.entrySet().iterator();
+        while (connected.hasNext()) {
+          Map.Entry entry = (Map.Entry) connected.next();
+          String server = (String) entry.getKey();
+          // Integer connections = (Integer) entry.getValue();
+          // if (connections.intValue()==0) {
+          // addUnconnectedServer(server);
+          // } else {
+          addConnectedServer(server);
+          // }
+          // System.out.println(connections.size() + " logical connnections to server " + server);
+        }
+      }
+    }
+  }
+
+  protected void initializeAll(DistributedSystem distributedSystem) {
+    // Initialize isConnected
+    setIsConnected(true);
+
+    // Initialize distributed system status
+    initializeDistributedSystem(distributedSystem);
+
+    // Initialize peers
+    initializePeers(distributedSystem);
+
+    // Initialize memory
+    initializeMemory();
+  }
+
+  protected void initializeDistributedSystem(DistributedSystem distributedSystem) {
+    InternalDistributedSystem ids = (InternalDistributedSystem) distributedSystem;
+    setMemberId(ids.getMemberId());
+    DistributionConfig config = ids.getConfig();
+    setMemberName(config.getName());
+    setMcastPort(config.getMcastPort());
+    setMcastAddress(config.getMcastAddress());
+    String bindAddress = config.getBindAddress();
+    setBindAddress(bindAddress);
+    setLocators(config.getLocators());
+    setUpTime(System.currentTimeMillis() - ids.getStartTime());
+    try {
+      setHostAddress((bindAddress != null && bindAddress.length() > 0)
+          ? InetAddress.getByName(bindAddress) : SocketCreator.getLocalHost());
+    } catch (IOException e) {
+      /* ignore - leave null host address */}
+  }
+
+  protected void initializePeers(DistributedSystem distributedSystem) {
+    InternalDistributedSystem ids = (InternalDistributedSystem) distributedSystem;
+    DM dm = ids.getDistributionManager();
+    Set connections = dm.getOtherNormalDistributionManagerIds();
+    Set connectionsIDs = new HashSet(connections.size());
+    for (Iterator iter = connections.iterator(); iter.hasNext();) {
+      InternalDistributedMember idm = (InternalDistributedMember) iter.next();
+      connectionsIDs.add(idm.getId());
+    }
+    setConnectedPeers(connectionsIDs);
+  }
+
+  protected void initializeMemory() {
+    // InternalDistributedSystem system = (InternalDistributedSystem)
+    // region.getCache().getDistributedSystem();
+    // GemFireStatSampler sampler = system.getStatSampler();
+    // VMStatsContract statsContract = sampler.getVMStats();
+
+    Runtime rt = Runtime.getRuntime();
+    setMaximumHeapSize(rt.maxMemory());
+    setFreeHeapSize(rt.freeMemory());
+  }
+
+  protected void initializeRegionSizes() {
+    Iterator rootRegions = cache.rootRegions().iterator();
+
+    while (rootRegions.hasNext()) {
+      LocalRegion rootRegion = (LocalRegion) rootRegions.next();
+      if (!(rootRegion instanceof HARegion)) {
+        RegionStatus rootRegionStatus = rootRegion instanceof PartitionedRegion
+            ? new PartitionedRegionStatus((PartitionedRegion) rootRegion)
+            : new RegionStatus(rootRegion);
+        putRegionStatus(rootRegion.getFullPath(), rootRegionStatus);
+        Iterator subRegions = rootRegion.subregions(true).iterator();
+        while (subRegions.hasNext()) {
+          LocalRegion subRegion = (LocalRegion) subRegions.next();
+          RegionStatus subRegionStatus = subRegion instanceof PartitionedRegion
+              ? new PartitionedRegionStatus((PartitionedRegion) subRegion)
+              : new RegionStatus(subRegion);
+          putRegionStatus(subRegion.getFullPath(), subRegionStatus);
+        }
+      }
+    }
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntity.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntity.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntity.java
new file mode 100644
index 0000000..2e823d0
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntity.java
@@ -0,0 +1,100 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * A entity that can be managed with the GemFire administration API.
+ *
+ * @see ManagedEntityConfig
+ *
+ * @since GemFire 4.0
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface ManagedEntity {
+
+  /**
+   * Starts this managed entity. Note that this method may return before the managed entity is
+   * actually started.
+   *
+   * @throws AdminException If a problem is encountered while starting this managed entity.
+   * @throws IllegalStateException If this managed entity resides on a remote machine and a
+   *         <code>null</code> or empty (<code>""</code>)
+   *         {@linkplain ManagedEntityConfig#getRemoteCommand remote command} has been specified.
+   *
+   * @see #waitToStart
+   */
+  public void start() throws AdminException;
+
+  /**
+   * Stops this managed entity. Note that this method may return before the managed entity is
+   * actually stopped.
+   *
+   * @throws AdminException If a problem is encountered while stopping this managed entity.
+   * @throws IllegalStateException If this managed entity resides on a remote machine and a
+   *         <code>null</code> or empty (<code>""</code>)
+   *         {@linkplain ManagedEntityConfig#getRemoteCommand remote command} has been specified.
+   *
+   * @see #waitToStop
+   */
+  public void stop() throws AdminException;
+
+  /**
+   * Waits for up to a given number of milliseconds for this managed entity to {@linkplain #start
+   * start}.
+   *
+   * @param timeout The number of milliseconds to wait for this managed entity to start.
+   *
+   * @return Whether or not the entity has started. <code>false</code>, if the method times out.
+   *
+   * @throws InterruptedException If the thread invoking this method is interrupted while waiting.
+   */
+  public boolean waitToStart(long timeout) throws InterruptedException;
+
+  /**
+   * Waits for up to a given number of milliseconds for this managed entity to {@linkplain #stop
+   * stop}.
+   *
+   * @param timeout The number of milliseconds to wait for this managed entity to stop.
+   *
+   * @return Whether or not the entity has stopped. <code>false</code>, if the method times out.
+   *
+   * @throws InterruptedException If the thread invoking this method is interrupted while waiting.
+   */
+  public boolean waitToStop(long timeout) throws InterruptedException;
+
+  /**
+   * Returns whether or not this managed entity is running. Note that this operation may attempt to
+   * contact the managed entity.
+   *
+   * @throws IllegalStateException If this managed entity resides on a remote machine and a
+   *         <code>null</code> or empty (<code>""</code>)
+   *         {@linkplain ManagedEntityConfig#getRemoteCommand remote command} has been specified.
+   */
+  public boolean isRunning();
+
+  /**
+   * Returns the tail of this manage entity's log file. Note that not all managed entities implement
+   * this functionality.
+   *
+   * @throws AdminException If a problem is encountered while getting the log of this managed
+   *         entity.
+   * @throws UnsupportedOperationException If this managed entity does not support retrieving its
+   *         log.
+   */
+  public String getLog() throws AdminException;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntityConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntityConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntityConfig.java
new file mode 100644
index 0000000..8154988
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntityConfig.java
@@ -0,0 +1,88 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * Common configuration for all entities that can be managed using the GemFire administration API.
+ * Note that once a managed entity has been {@linkplain ManagedEntity#start started}, attempts to
+ * modify its configuration will cause an {@link IllegalStateException} to be thrown.
+ *
+ * @see ManagedEntity
+ *
+ * @since GemFire 4.0
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface ManagedEntityConfig extends Cloneable {
+
+  /**
+   * Returns the name of the host on which the managed entity runs or will run.
+   */
+  public String getHost();
+
+  /**
+   * Sets the name of the host on which the managed entity will run.
+   */
+  public void setHost(String host);
+
+  /**
+   * Returns the name of the working directory in which the managed entity runs or will run.
+   */
+  public String getWorkingDirectory();
+
+  /**
+   * Sets the name of the working directory in which the managed entity will run.
+   */
+  public void setWorkingDirectory(String dir);
+
+  /**
+   * Returns the name of the GemFire product directory to use when administering the managed entity.
+   */
+  public String getProductDirectory();
+
+  /**
+   * Sets the name of the GemFire product directory to use when administering the managed entity.
+   */
+  public void setProductDirectory(String dir);
+
+  /**
+   * Returns the command prefix used to administer a managed entity that is hosted on a remote
+   * machine. If the remote command is <code>null</code> (the default value), then the remote
+   * command associated with the {@linkplain AdminDistributedSystem#getRemoteCommand() distributed
+   * system} will be used.
+   */
+  public String getRemoteCommand();
+
+  /**
+   * Sets the command prefix used to administer a managed entity that is hosted on a remote machine.
+   */
+  public void setRemoteCommand(String remoteCommand);
+
+  /**
+   * Validates this configuration.
+   *
+   * @throws IllegalStateException If a managed entity cannot be administered using this
+   *         configuration
+   */
+  public void validate();
+
+  /**
+   * Returns a new <code>ManagedEntityConfig</code> with the same configuration as this
+   * <code>ManagedEntityConfig</code>.
+   */
+  public Object clone() throws CloneNotSupportedException;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/MemberHealthConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/MemberHealthConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/MemberHealthConfig.java
new file mode 100644
index 0000000..30bfce4
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/MemberHealthConfig.java
@@ -0,0 +1,142 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * Provides configuration information relating to the health of a member of a GemFire distributed
+ * system.
+ *
+ * <P>
+ *
+ * If any of the following criteria is true, then a member is considered to be in
+ * {@link GemFireHealth#OKAY_HEALTH OKAY_HEALTH}.
+ *
+ * <UL>
+ *
+ * <LI>The size of the {@linkplain #getMaxVMProcessSize VM process} is too large.</LI>
+ *
+ * <LI>There are too many {@linkplain #getMaxMessageQueueSize enqueued} incoming/outgoing
+ * messages.</LI>
+ *
+ * <LI>Too many message sends {@link #getMaxReplyTimeouts timeout} while waiting for a reply.</LI>
+ *
+ * </UL>
+ *
+ * If any of the following criteria is true, then a member is considered to be in
+ * {@link GemFireHealth#POOR_HEALTH POOR_HEALTH}.
+ *
+ * <UL>
+ *
+ * </UL>
+ *
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface MemberHealthConfig {
+
+  /**
+   * The default maximum VM process size (in megabytes) of a health member of the distributed
+   * system. The default value is 1000.
+   */
+  public static final long DEFAULT_MAX_VM_PROCESS_SIZE = 1000;
+
+  /**
+   * The default maximum number of enqueued incoming or outgoing messages that a healthy member of a
+   * distributed system can have. The default value is 1000.
+   */
+  public static final long DEFAULT_MAX_MESSAGE_QUEUE_SIZE = 1000;
+
+  /**
+   * The default maximum number of message reply timeouts that can occur in a given health
+   * monitoring interval. The default value is zero.
+   */
+  public static final long DEFAULT_MAX_REPLY_TIMEOUTS = 0;
+
+  /**
+   * The default maximum multicast retransmission ratio. The default value is 0.20 (twenty percent
+   * of messages retransmitted)
+   */
+  public static final double DEFAULT_MAX_RETRANSMISSION_RATIO = 0.20;
+
+  /////////////////////// Instance Methods ///////////////////////
+
+  /**
+   * Returns the maximum VM process size (in megabytes) of a healthy member of the distributed
+   * system.
+   *
+   * @see #DEFAULT_MAX_VM_PROCESS_SIZE
+   */
+  public long getMaxVMProcessSize();
+
+  /**
+   * Sets the maximum VM process size (in megabytes) of a healthy member of the distributed system.
+   *
+   * @see #getMaxVMProcessSize
+   */
+  public void setMaxVMProcessSize(long size);
+
+  /**
+   * Returns the maximum number of enqueued incoming or outgoing messages that a healthy member of a
+   * distributed system can have.
+   *
+   * @see #DEFAULT_MAX_MESSAGE_QUEUE_SIZE
+   */
+  public long getMaxMessageQueueSize();
+
+  /**
+   * Sets the maximum number of enqueued incoming or outgoing messages that a healthy member of a
+   * distributed system can have.
+   *
+   * @see #getMaxMessageQueueSize
+   */
+  public void setMaxMessageQueueSize(long maxMessageQueueSize);
+
+  /**
+   * Returns the maximum number message replies that can timeout in a healthy member.
+   *
+   * @see #DEFAULT_MAX_REPLY_TIMEOUTS
+   */
+  public long getMaxReplyTimeouts();
+
+  /**
+   * Sets the maximum number message replies that can timeout in a healthy member.
+   *
+   * @see #getMaxReplyTimeouts
+   */
+  public void setMaxReplyTimeouts(long maxReplyTimeouts);
+
+  /**
+   * Returns the maximum ratio of multicast retransmissions / total multicast messages.
+   * Retransmissions are requestor-specific (i.e., unicast), so a single lost message may result in
+   * multiple retransmissions.
+   * <p>
+   * A high retransmission ratio may indicate poor network conditions requiring reduced flow-control
+   * settings, a udp-fragment-size setting that is too high.
+   * 
+   * @see #DEFAULT_MAX_RETRANSMISSION_RATIO
+   */
+  public double getMaxRetransmissionRatio();
+
+  /**
+   * Sets the maximum ratio of multicast retransmissions / total multicast messages.
+   * 
+   * @see #getMaxRetransmissionRatio
+   */
+  public void setMaxRetransmissionRatio(double ratio);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/OperationCancelledException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/OperationCancelledException.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/OperationCancelledException.java
new file mode 100644
index 0000000..4c78a90
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/OperationCancelledException.java
@@ -0,0 +1,47 @@
+/*
+ * 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.internal.admin.api;
+
+// import org.apache.geode.GemFireException;
+
+/**
+ * Thrown when an administration operation that accesses information in a remote system member is
+ * cancelled. The cancelation may occur because the system member has left the distributed system.
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class OperationCancelledException extends RuntimeAdminException {
+  private static final long serialVersionUID = 5474068770227602546L;
+
+  public OperationCancelledException() {
+    super();
+  }
+
+  public OperationCancelledException(String message) {
+    super(message);
+  }
+
+  public OperationCancelledException(Throwable cause) {
+    super(cause);
+  }
+
+  public OperationCancelledException(String message, Throwable cause) {
+    super(message, cause);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionNotFoundException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionNotFoundException.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionNotFoundException.java
new file mode 100644
index 0000000..4b452ea
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionNotFoundException.java
@@ -0,0 +1,39 @@
+/*
+ * 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.internal.admin.api;
+
+// import org.apache.geode.cache.CacheException;
+import org.apache.geode.cache.CacheRuntimeException;
+
+/**
+ * Thrown by the administration API when the region administered by a {@link SystemMemberRegion} has
+ * been closed or destroyed in system member.
+ * <P>
+ * Also thrown by {@link org.apache.geode.DataSerializer#readRegion(java.io.DataInput)} if the named
+ * region no longer exists.
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class RegionNotFoundException extends CacheRuntimeException {
+  private static final long serialVersionUID = 1758668137691463909L;
+
+  public RegionNotFoundException(String message) {
+    super(message);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionSubRegionSnapshot.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionSubRegionSnapshot.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionSubRegionSnapshot.java
new file mode 100644
index 0000000..d6b32fe
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionSubRegionSnapshot.java
@@ -0,0 +1,183 @@
+/*
+ * 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.internal.admin.api;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.geode.DataSerializable;
+import org.apache.geode.DataSerializer;
+import org.apache.geode.cache.Region;
+import org.apache.geode.i18n.LogWriterI18n;
+import org.apache.geode.internal.cache.PartitionedRegion;
+
+/**
+ * Class <code>RegionSubRegionSnapshot</code> provides information about <code>Region</code>s. This
+ * also provides the information about sub regions This class is used by the monitoring tool.
+ * 
+ * 
+ * @since GemFire 5.7
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class RegionSubRegionSnapshot implements DataSerializable {
+  private static final long serialVersionUID = -8052137675270041871L;
+
+  public RegionSubRegionSnapshot() {
+    this.parent = null;
+    this.subRegionSnapshots = new HashSet();
+  }
+
+  public RegionSubRegionSnapshot(Region reg) {
+    this();
+    this.name = reg.getName();
+    if (reg instanceof PartitionedRegion) {
+      PartitionedRegion p_reg = (PartitionedRegion) reg;
+      this.entryCount = p_reg.entryCount(true);
+    } else {
+      this.entryCount = reg.entrySet().size();
+    }
+    final LogWriterI18n logger = reg.getCache().getLoggerI18n();
+    if ((logger != null) && logger.fineEnabled()) {
+      logger.fine("RegionSubRegionSnapshot Region entry count =" + this.entryCount + " for region ="
+          + this.name);
+    }
+  }
+
+  /**
+   * add the snapshot of sub region
+   * 
+   * @param snap snapshot of sub region
+   * @return true if operation is successful
+   */
+  public boolean addSubRegion(RegionSubRegionSnapshot snap) {
+    if (subRegionSnapshots.contains(snap)) {
+      return true;
+    }
+
+    if (subRegionSnapshots.add(snap)) {
+      snap.setParent(this);
+      return true;
+    }
+
+    return false;
+  }
+
+  /**
+   * @return get entry count of region
+   */
+  public final int getEntryCount() {
+    return entryCount;
+  }
+
+  /**
+   * @param entryCount entry count of region
+   */
+  public final void setEntryCount(int entryCount) {
+    this.entryCount = entryCount;
+  }
+
+  /**
+   * @return name of region
+   */
+  public final String getName() {
+    return name;
+  }
+
+  /**
+   * @param name name of region
+   */
+  public final void setName(String name) {
+    this.name = name;
+  }
+
+  /**
+   * @return subRegionSnapshots of all the sub regions
+   */
+  public final Set getSubRegionSnapshots() {
+    return subRegionSnapshots;
+  }
+
+  /**
+   * @param subRegionSnapshots subRegionSnapshots of all the sub regions
+   */
+  public final void setSubRegionSnapshots(Set subRegionSnapshots) {
+    this.subRegionSnapshots = subRegionSnapshots;
+  }
+
+  /**
+   * @return snapshot of parent region
+   */
+  public final RegionSubRegionSnapshot getParent() {
+    return parent;
+  }
+
+  /**
+   * @param parent snapshot of parent region
+   */
+  public final void setParent(RegionSubRegionSnapshot parent) {
+    this.parent = parent;
+  }
+
+  /**
+   * 
+   * @return full path of region
+   */
+  public String getFullPath() {
+    return (getParent() == null ? "/" : getParent().getFullPath()) + getName() + "/";
+  }
+
+  public void toData(DataOutput out) throws IOException {
+    DataSerializer.writeString(this.name, out);
+    out.writeInt(this.entryCount);
+    DataSerializer.writeHashSet((HashSet) this.subRegionSnapshots, out);
+  }
+
+  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
+    this.name = DataSerializer.readString(in);
+    this.entryCount = in.readInt();
+    this.subRegionSnapshots = DataSerializer.readHashSet(in);
+    for (Iterator iter = this.subRegionSnapshots.iterator(); iter.hasNext();) {
+      ((RegionSubRegionSnapshot) iter.next()).setParent(this);
+    }
+  }
+
+  @Override
+  public String toString() {
+    String toStr = "RegionSnapshot [" + "path=" + this.getFullPath() + ",parent="
+        + (this.parent == null ? "null" : this.parent.name) + ", entryCount=" + this.entryCount
+        + ", subRegionCount=" + this.subRegionSnapshots.size() + "<<";
+
+    for (Iterator iter = subRegionSnapshots.iterator(); iter.hasNext();) {
+      toStr = toStr + ((RegionSubRegionSnapshot) iter.next()).getName() + ", ";
+    }
+
+    toStr = toStr + ">>" + "]";
+    return toStr;
+  }
+
+  protected String name;
+
+  protected int entryCount;
+
+  protected RegionSubRegionSnapshot parent;
+
+  protected Set subRegionSnapshots;
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/RuntimeAdminException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/RuntimeAdminException.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RuntimeAdminException.java
new file mode 100755
index 0000000..6504957
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RuntimeAdminException.java
@@ -0,0 +1,48 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * A <code>RuntimeAdminException</code> is thrown when a runtime errors occurs during administration
+ * or monitoring of GemFire.
+ *
+ * @since GemFire 3.5
+ *
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class RuntimeAdminException extends org.apache.geode.GemFireException {
+
+  private static final long serialVersionUID = -7512771113818634005L;
+
+  public RuntimeAdminException() {
+    super();
+  }
+
+  public RuntimeAdminException(String message) {
+    super(message);
+  }
+
+  public RuntimeAdminException(String message, Throwable cause) {
+    super(message, cause);
+  }
+
+  public RuntimeAdminException(Throwable cause) {
+    super(cause);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/Statistic.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/Statistic.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/Statistic.java
new file mode 100755
index 0000000..95d3ef0
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/Statistic.java
@@ -0,0 +1,64 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * Interface to represent a single statistic of a <code>StatisticResource</code>
+ *
+ * @since GemFire 3.5
+ *
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface Statistic extends java.io.Serializable {
+
+  /**
+   * Gets the identifying name of this statistic.
+   *
+   * @return the identifying name of this statistic
+   */
+  public String getName();
+
+  /**
+   * Gets the value of this statistic as a <code>java.lang.Number</code>.
+   *
+   * @return the value of this statistic
+   */
+  public Number getValue();
+
+  /**
+   * Gets the unit of measurement (if any) this statistic represents.
+   *
+   * @return the unit of measurement (if any) this statistic represents
+   */
+  public String getUnits();
+
+  /**
+   * Returns true if this statistic represents a numeric value which always increases.
+   *
+   * @return true if this statistic represents a value which always increases
+   */
+  public boolean isCounter();
+
+  /**
+   * Gets the full description of this statistic.
+   *
+   * @return the full description of this statistic
+   */
+  public String getDescription();
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/StatisticResource.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/StatisticResource.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/StatisticResource.java
new file mode 100755
index 0000000..8b698dc
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/StatisticResource.java
@@ -0,0 +1,82 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * Adminitrative interface for monitoring a statistic resource in a GemFire system member. A
+ * resource is comprised of one or many <code>Statistics</code>.
+ *
+ * @since GemFire 3.5
+ *
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface StatisticResource {
+
+  /**
+   * Gets the identifying name of this resource.
+   *
+   * @return the identifying name of this resource
+   */
+  public String getName();
+
+  /**
+   * Gets the full description of this resource.
+   *
+   * @return the full description of this resource
+   */
+  public String getDescription();
+
+  /**
+   * Gets the classification type of this resource.
+   *
+   * @return the classification type of this resource
+   * @since GemFire 5.0
+   */
+  public String getType();
+
+  /**
+   * Returns a display string of the {@link SystemMember} owning this resource.
+   *
+   * @return a display string of the owning {@link SystemMember}
+   */
+  public String getOwner();
+
+  /**
+   * Returns an ID that uniquely identifies the resource within the {@link SystemMember} it belongs
+   * to.
+   *
+   * @return unique id within the owning {@link SystemMember}
+   */
+  public long getUniqueId();
+
+  /**
+   * Returns a read-only array of every {@link Statistic} in this resource.
+   *
+   * @return read-only array of every {@link Statistic} in this resource
+   */
+  public Statistic[] getStatistics();
+
+  /**
+   * Refreshes the values of every {@link Statistic} in this resource by retrieving them from the
+   * member's VM.
+   *
+   * @throws AdminException if unable to refresh statistic values
+   */
+  public void refresh() throws AdminException;
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMember.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMember.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMember.java
new file mode 100755
index 0000000..98bf598
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMember.java
@@ -0,0 +1,144 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.distributed.DistributedMember;
+
+import java.net.InetAddress;
+
+/**
+ * Administrative interface for monitoring a GemFire system member.
+ *
+ * @since GemFire 3.5
+ *
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface SystemMember {
+
+  /** Gets the {@link AdminDistributedSystem} this member belongs to. */
+  public AdminDistributedSystem getDistributedSystem();
+
+  /**
+   * Gets identifying name of this member. For applications this is the string form of
+   * {@link #getDistributedMember}. For cache servers it is a unique cache server string.
+   */
+  public String getId();
+
+  /**
+   * Retrieves display friendly name for this member. If this member defined an optional name for
+   * its connection to the distributed system, that name will be returned. Otherwise the returned
+   * value will be {@link SystemMember#getId}.
+   *
+   * @see org.apache.geode.distributed.DistributedSystem#connect
+   * @see org.apache.geode.distributed.DistributedSystem#getName
+   */
+  public String getName();
+
+  /** Gets the type of {@link SystemMemberType} this member is. */
+  public SystemMemberType getType();
+
+  /** Gets host name of the machine this member resides on. */
+  public String getHost();
+
+  /** Gets the host of this member as an <code>java.net.InetAddress<code>. */
+  public InetAddress getHostAddress();
+
+  /** Retrieves the log for this member. */
+  public String getLog();
+
+  /**
+   * Returns the GemFire license this member is using.
+   *
+   * @deprecated Removed licensing in 8.0.
+   */
+  @Deprecated
+  public java.util.Properties getLicense();
+
+  /** Returns this member's GemFire version information. */
+  public String getVersion();
+
+  /**
+   * Gets the configuration parameters for this member.
+   */
+  public ConfigurationParameter[] getConfiguration();
+
+  /**
+   * Sets the configuration of this member. The argument is an array of any and all configuration
+   * parameters that are to be updated in the member.
+   * <p>
+   * The entire array of configuration parameters is then returned.
+   *
+   * @param parms subset of the configuration parameters to be changed
+   * @return all configuration parameters including those that were changed
+   * @throws AdminException if this fails to make the configuration changes
+   */
+  public ConfigurationParameter[] setConfiguration(ConfigurationParameter[] parms)
+      throws AdminException;
+
+  /** Refreshes this member's configuration from the member or it's properties */
+  public void refreshConfig() throws AdminException;
+
+  /**
+   * Retrieves this members statistic resources. If the member is not running then an empty array is
+   * returned.
+   *
+   * @param statisticsTypeName String ame of the Statistics Type
+   * @return array of runtime statistic resources owned by this member
+   * @since GemFire 5.7
+   */
+  public StatisticResource[] getStat(String statisticsTypeName) throws AdminException;
+
+  /**
+   * Retrieves this members statistic resources. If the member is not running then an empty array is
+   * returned. All Stats are returned
+   *
+   * @return array of runtime statistic resources owned by this member
+   */
+  public StatisticResource[] getStats() throws AdminException;
+
+  /**
+   * Returns whether or not this system member hosts a GemFire {@link org.apache.geode.cache.Cache
+   * Cache}.
+   *
+   * @see #getCache
+   */
+  public boolean hasCache() throws AdminException;
+
+  /**
+   * Returns an object that provides admin access to this member's cache. If the member currently
+   * has no cache then <code>null</code> is returned.
+   */
+  public SystemMemberCache getCache() throws AdminException;
+
+  /**
+   * Returns the names of the membership roles filled by this member.
+   *
+   * @return array of string membership role names
+   * @since GemFire 5.0
+   */
+  public String[] getRoles();
+
+  /**
+   * Returns the {@link org.apache.geode.distributed.DistributedMember} that represents this system
+   * member.
+   *
+   * @return DistributedMember instance representing this system member
+   * @since GemFire 5.0
+   */
+  public DistributedMember getDistributedMember();
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberBridgeServer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberBridgeServer.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberBridgeServer.java
new file mode 100644
index 0000000..56ed17a
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberBridgeServer.java
@@ -0,0 +1,307 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.cache.server.ServerLoadProbe;
+
+/**
+ * Administrative interface that represents a CacheServer that serves the contents of a system
+ * member's cache.
+ *
+ * @see SystemMemberCache#addCacheServer
+ *
+ * @since GemFire 4.0
+ * @deprecated as of 5.7 use {@link SystemMemberCacheServer} instead.
+ */
+@Deprecated
+public interface SystemMemberBridgeServer {
+
+  /**
+   * Returns the port on which this bridge server listens for bridge clients to connect.
+   */
+  public int getPort();
+
+  /**
+   * Sets the port on which this bridge server listens for bridge clients to connect.
+   *
+   * @throws AdminException If this bridge server is running
+   */
+  public void setPort(int port) throws AdminException;
+
+  /**
+   * Starts this bridge server. Once the server is running, its configuration cannot be changed.
+   *
+   * @throws AdminException If an error occurs while starting the bridge server
+   */
+  public void start() throws AdminException;
+
+  /**
+   * Returns whether or not this bridge server is running
+   */
+  public boolean isRunning();
+
+  /**
+   * Stops this bridge server. Note that the <code>BridgeServer</code> can be reconfigured and
+   * restarted if desired.
+   */
+  public void stop() throws AdminException;
+
+  /**
+   * Updates the information about this bridge server.
+   */
+  public void refresh();
+
+  /**
+   * Returns a string representing the ip address or host name that this server will listen on.
+   * 
+   * @return the ip address or host name that this server is to listen on
+   * @since GemFire 5.7
+   */
+  public String getBindAddress();
+
+  /**
+   * Sets the ip address or host name that this server is to listen on for client connections.
+   * <p>
+   * Setting a specific bind address will cause the bridge server to always use this address and
+   * ignore any address specified by "server-bind-address" or "bind-address" in the
+   * <code>gemfire.properties</code> file (see
+   * {@link org.apache.geode.distributed.DistributedSystem} for a description of these properties).
+   * <p>
+   * A <code>null</code> value will be treated the same as the default "".
+   * <p>
+   * The default value does not override the gemfire.properties. If you wish to override the
+   * properties and want to have your server bind to all local addresses then use this string
+   * <code>"0.0.0.0"</code>.
+   * 
+   * @param address the ip address or host name that this server is to listen on
+   * @throws AdminException if this bridge server is running
+   * @since GemFire 5.7
+   */
+  public void setBindAddress(String address) throws AdminException;
+
+  /**
+   * Returns a string representing the ip address or host name that server locators will tell
+   * clients that this server is listening on.
+   * 
+   * @return the ip address or host name to give to clients so they can connect to this server
+   * @since GemFire 5.7
+   */
+  public String getHostnameForClients();
+
+  /**
+   * Sets the ip address or host name that this server is to listen on for client connections.
+   * <p>
+   * Setting a specific hostname-for-clients will cause server locators to use this value when
+   * telling clients how to connect to this server.
+   * <p>
+   * The default value causes the bind-address to be given to clients
+   * <p>
+   * A <code>null</code> value will be treated the same as the default "".
+   * 
+   * @param name the ip address or host name that will be given to clients so they can connect to
+   *        this server
+   * @throws AdminException if this bridge server is running
+   * @since GemFire 5.7
+   */
+  public void setHostnameForClients(String name) throws AdminException;
+
+  /**
+   * Sets whether or not this bridge server should notify clients based on key subscription.
+   *
+   * If false, then an update to any key on the server causes an update to be sent to all clients.
+   * This update does not push the actual data to the clients. Instead, it causes the client to
+   * locally invalidate or destroy the corresponding entry. The next time the client requests the
+   * key, it goes to the bridge server for the value.
+   *
+   * If true, then an update to any key on the server causes an update to be sent to only those
+   * clients who have registered interest in that key. Other clients are not notified of the change.
+   * In addition, the actual value is pushed to the client. The client does not need to request the
+   * new value from the bridge server.
+   * 
+   * @throws AdminException if this bridge server is running
+   * @since GemFire 5.7
+   */
+  public void setNotifyBySubscription(boolean b) throws AdminException;
+
+  /**
+   * Answers whether or not this bridge server should notify clients based on key subscription.
+   * 
+   * @since GemFire 5.7
+   */
+  public boolean getNotifyBySubscription();
+
+  /**
+   * Sets the buffer size in bytes of the socket connection for this <code>BridgeServer</code>. The
+   * default is 32768 bytes.
+   *
+   * @param socketBufferSize The size in bytes of the socket buffer
+   * @throws AdminException if this bridge server is running
+   * @since GemFire 5.7
+   */
+  public void setSocketBufferSize(int socketBufferSize) throws AdminException;
+
+  /**
+   * Returns the configured buffer size of the socket connection for this <code>BridgeServer</code>.
+   * The default is 32768 bytes.
+   * 
+   * @return the configured buffer size of the socket connection for this <code>BridgeServer</code>
+   * @since GemFire 5.7
+   */
+  public int getSocketBufferSize();
+
+  /**
+   * Sets the maximum amount of time between client pings. This value is used by the
+   * <code>ClientHealthMonitor</code> to determine the health of this <code>BridgeServer</code>'s
+   * clients. The default is 60000 ms.
+   *
+   * @param maximumTimeBetweenPings The maximum amount of time between client pings
+   * @throws AdminException if this bridge server is running
+   * @since GemFire 5.7
+   */
+  public void setMaximumTimeBetweenPings(int maximumTimeBetweenPings) throws AdminException;
+
+  /**
+   * Returns the maximum amount of time between client pings. This value is used by the
+   * <code>ClientHealthMonitor</code> to determine the health of this <code>BridgeServer</code>'s
+   * clients. The default is 60000 ms.
+   * 
+   * @return the maximum amount of time between client pings.
+   * @since GemFire 5.7
+   */
+  public int getMaximumTimeBetweenPings();
+
+  /**
+   * Returns the maximum allowed client connections
+   * 
+   * @since GemFire 5.7
+   */
+  public int getMaxConnections();
+
+  /**
+   * Sets the maxium number of client connections allowed. When the maximum is reached the server
+   * will stop accepting connections.
+   * 
+   * @throws AdminException if this bridge server is running
+   * @since GemFire 5.7
+   */
+  public void setMaxConnections(int maxCons) throws AdminException;
+
+  /**
+   * Returns the maxium number of threads allowed in this server to service client requests. The
+   * default of <code>0</code> causes the server to dedicate a thread for every client connection.
+   * 
+   * @since GemFire 5.7
+   */
+  public int getMaxThreads();
+
+  /**
+   * Sets the maxium number of threads allowed in this server to service client requests. The
+   * default of <code>0</code> causes the server to dedicate a thread for every client connection.
+   * 
+   * @throws AdminException if this bridge server is running
+   * @since GemFire 5.7
+   */
+  public void setMaxThreads(int maxThreads) throws AdminException;
+
+  /**
+   * Returns the maximum number of messages that can be enqueued in a client-queue.
+   * 
+   * @since GemFire 5.7
+   */
+  public int getMaximumMessageCount();
+
+  /**
+   * Sets maximum number of messages that can be enqueued in a client-queue.
+   * 
+   * @throws AdminException if this bridge server is running
+   * @since GemFire 5.7
+   */
+  public void setMaximumMessageCount(int maxMessageCount) throws AdminException;
+
+  /**
+   * Returns the time (in seconds ) after which a message in the client queue will expire.
+   * 
+   * @since GemFire 5.7
+   */
+  public int getMessageTimeToLive();
+
+  /**
+   * Sets the time (in seconds ) after which a message in the client queue will expire.
+   * 
+   * @throws AdminException if this bridge server is running
+   * @since GemFire 5.7
+   */
+  public void setMessageTimeToLive(int messageTimeToLive) throws AdminException;
+
+  /**
+   * Sets the list of server groups this bridge server will belong to. By default bridge servers
+   * belong to the default global server group which all bridge servers always belong to.
+   * 
+   * @param groups possibly empty array of <code>String</code> where each string is a server groups
+   *        that this bridge server will be a member of.
+   * @throws AdminException if this bridge server is running
+   * @since GemFire 5.7
+   */
+  public void setGroups(String[] groups) throws AdminException;
+
+  /**
+   * Returns the list of server groups that this bridge server belongs to.
+   * 
+   * @return a possibly empty array of <code>String</code>s where each string is a server group.
+   *         Modifying this array will not change the server groups that this bridge server belongs
+   *         to.
+   * @since GemFire 5.7
+   */
+  public String[] getGroups();
+
+  /**
+   * Get a description of the load probe for this bridge server. {@link ServerLoadProbe} for details
+   * on the load probe.
+   * 
+   * @return the load probe used by this bridge server.
+   * @since GemFire 5.7
+   */
+  public String getLoadProbe();
+
+  /**
+   * Set the load probe for this bridge server. See {@link ServerLoadProbe} for details on how to
+   * implement a load probe.
+   * 
+   * The load probe should implement DataSerializable if it is used with this interface, because it
+   * will be sent to the remote VM.
+   * 
+   * @param loadProbe the load probe to use for this bridge server.
+   * @throws AdminException if the bridge server is running
+   * @since GemFire 5.7
+   */
+  public void setLoadProbe(ServerLoadProbe loadProbe) throws AdminException;
+
+  /**
+   * Get the frequency in milliseconds to poll the load probe on this bridge server.
+   * 
+   * @return the frequency in milliseconds that we will poll the load probe.
+   */
+  public long getLoadPollInterval();
+
+  /**
+   * Set the frequency in milliseconds to poll the load probe on this bridge server
+   * 
+   * @param loadPollInterval the frequency in milliseconds to poll the load probe. Must be greater
+   *        than 0.
+   * @throws AdminException if the bridge server is running
+   */
+  public void setLoadPollInterval(long loadPollInterval) throws AdminException;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCache.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCache.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCache.java
new file mode 100644
index 0000000..092a17a
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCache.java
@@ -0,0 +1,183 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.cache.RegionAttributes;
+
+/**
+ * Administrative interface that represent's the {@link SystemMember}'s view of its
+ * {@link org.apache.geode.cache.Cache}.
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface SystemMemberCache {
+  // attributes
+  /**
+   * The name of the cache.
+   */
+  public String getName();
+
+  /**
+   * Value that uniquely identifies an instance of a cache for a given member.
+   */
+  public int getId();
+
+  /**
+   * Indicates if this cache has been closed.
+   * 
+   * @return true, if this cache is closed; false, otherwise
+   */
+  public boolean isClosed();
+
+  /**
+   * Gets the number of seconds a cache operation will wait to obtain a distributed lock lease.
+   */
+  public int getLockTimeout();
+
+  /**
+   * Sets the number of seconds a cache operation may wait to obtain a distributed lock lease before
+   * timing out.
+   *
+   * @throws AdminException If a problem is encountered while setting the lock timeout
+   *
+   * @see org.apache.geode.cache.Cache#setLockTimeout
+   */
+  public void setLockTimeout(int seconds) throws AdminException;
+
+  /**
+   * Gets the length, in seconds, of distributed lock leases obtained by this cache.
+   */
+  public int getLockLease();
+
+  /**
+   * Sets the length, in seconds, of distributed lock leases obtained by this cache.
+   *
+   * @throws AdminException If a problem is encountered while setting the lock lease
+   *
+   * @see org.apache.geode.cache.Cache#setLockLease
+   */
+  public void setLockLease(int seconds) throws AdminException;
+
+  /**
+   * Gets the number of seconds a cache {@link org.apache.geode.cache.Region#get(Object) get}
+   * operation can spend searching for a value before it times out. The search includes any time
+   * spent loading the object. When the search times out it causes the get to fail by throwing an
+   * exception.
+   */
+  public int getSearchTimeout();
+
+  /**
+   * Sets the number of seconds a cache get operation can spend searching for a value.
+   *
+   * @throws AdminException If a problem is encountered while setting the search timeout
+   *
+   * @see org.apache.geode.cache.Cache#setSearchTimeout
+   */
+  public void setSearchTimeout(int seconds) throws AdminException;
+
+  /**
+   * Returns number of seconds since this member's cache has been created. Returns <code>-1</code>
+   * if this member does not have a cache or its cache has been closed.
+   */
+  public int getUpTime();
+
+  /**
+   * Returns the names of all the root regions currently in this cache.
+   */
+  public java.util.Set getRootRegionNames();
+
+  // operations
+
+  /**
+   * Returns statistics related to this cache's performance.
+   */
+  public Statistic[] getStatistics();
+
+  /**
+   * Return the existing region (or subregion) with the specified path that already exists in the
+   * cache. Whether or not the path starts with a forward slash it is interpreted as a full path
+   * starting at a root.
+   *
+   * @param path the path to the region
+   * @return the Region or null if not found
+   * @throws IllegalArgumentException if path is null, the empty string, or "/"
+   */
+  public SystemMemberRegion getRegion(String path) throws AdminException;
+
+  /**
+   * Creates a VM root <code>Region</code> in this cache.
+   *
+   * @param name The name of the region to create
+   * @param attrs The attributes of the root region
+   *
+   * @throws AdminException If the region cannot be created
+   *
+   * @since GemFire 4.0
+   * @deprecated as of GemFire 5.0, use {@link #createRegion} instead
+   */
+  @Deprecated
+  public SystemMemberRegion createVMRegion(String name, RegionAttributes attrs)
+      throws AdminException;
+
+  /**
+   * Creates a root <code>Region</code> in this cache.
+   *
+   * @param name The name of the region to create
+   * @param attrs The attributes of the root region
+   *
+   * @throws AdminException If the region cannot be created
+   *
+   * @since GemFire 5.0
+   */
+  public SystemMemberRegion createRegion(String name, RegionAttributes attrs) throws AdminException;
+
+  /**
+   * Updates the state of this cache instance. Note that once a cache instance is closed refresh
+   * will never change the state of that instance.
+   */
+  public void refresh();
+
+  /**
+   * Adds a new, unstarted cache server that will serve the contents of this cache to clients.
+   *
+   * @see org.apache.geode.cache.Cache#addCacheServer
+   *
+   * @since GemFire 5.7
+   */
+  public SystemMemberCacheServer addCacheServer() throws AdminException;
+
+  /**
+   * Returns the cache servers that run in this member's VM. Note that this list will not be updated
+   * until {@link #refresh} is called.
+   *
+   * @see org.apache.geode.cache.Cache#getCacheServers
+   *
+   * @since GemFire 5.7
+   */
+  public SystemMemberCacheServer[] getCacheServers() throws AdminException;
+
+  /**
+   * Returns whether or not this cache acts as a server. This method will always return
+   * <code>true</code> for the <code>SystemMemberCache</code> obtained from a {@link CacheServer}.
+   * Note that this value will not be updated until {@link #refresh} is invoked.
+   *
+   * @since GemFire 4.0
+   */
+  public boolean isServer() throws AdminException;
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheEvent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheEvent.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheEvent.java
new file mode 100644
index 0000000..d90400e
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheEvent.java
@@ -0,0 +1,33 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.cache.Operation;
+
+/**
+ * An event that describes an operation on a cache. Instances of this are delivered to a
+ * {@link SystemMemberCacheListener} when a a cache is created or closed.
+ *
+ * @since GemFire 5.0
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface SystemMemberCacheEvent extends SystemMembershipEvent {
+  /**
+   * Returns the actual operation that caused this event.
+   */
+  public Operation getOperation();
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheListener.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheListener.java
new file mode 100644
index 0000000..af949b3
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheListener.java
@@ -0,0 +1,76 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.cache.*;
+
+/**
+ * A listener whose callback methods can be used to track the lifecycle of {@link Cache caches} and
+ * {@link Region regions} in the GemFire distributed system.
+ *
+ * @see AdminDistributedSystem#addCacheListener
+ * @see AdminDistributedSystem#removeCacheListener
+ *
+ * @since GemFire 5.0
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface SystemMemberCacheListener {
+
+  /**
+   * Invoked after a region is created in any node of distributed system.
+   * 
+   * @param event describes the region that was created.
+   * @see CacheFactory#create
+   * @see Cache#createRegion
+   * @see Region#createSubregion
+   */
+  public void afterRegionCreate(SystemMemberRegionEvent event);
+
+  /**
+   * Invoked when a region is destroyed or closed in any node of distributed system.
+   * 
+   * @param event describes the region that was lost. The operation on this event can be used to
+   *        determine the actual operation that caused the loss. Note that {@link Cache#close()}
+   *        invokes this callback with <code>Operation.CACHE_CLOSE</code> for each region in the
+   *        closed cache and it invokes {@link #afterCacheClose}.
+   * 
+   * @see Cache#close()
+   * @see Region#close
+   * @see Region#localDestroyRegion()
+   * @see Region#destroyRegion()
+   */
+  public void afterRegionLoss(SystemMemberRegionEvent event);
+
+  /**
+   * Invoked after a cache is created in any node of a distributed system. Note that this callback
+   * will be done before any regions are created in the cache.
+   * 
+   * @param event describes the member that created the cache.
+   * @see CacheFactory#create
+   */
+  public void afterCacheCreate(SystemMemberCacheEvent event);
+
+  /**
+   * Invoked after a cache is closed in any node of a distributed system. This callback is done
+   * after those done for each region in the cache. This callback is not done if the distributed
+   * member that has a cache crashes.
+   * 
+   * @param event describes the member that closed its cache.
+   * @see Cache#close()
+   */
+  public void afterCacheClose(SystemMemberCacheEvent event);
+}


[05/50] [abbrv] incubator-geode git commit: Revert "GEODE-2000 Now ClientMembershipListener returns host on which"

Posted by kl...@apache.org.
Revert "GEODE-2000 Now ClientMembershipListener returns host on which"

This reverts commit 8a080323070dbbc1d7037612d0d8e1188dcf1507.

This change caused some CI failures that folks suppressed.  The fix needs
to be revisited.


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

Branch: refs/heads/feature/GEODE-288
Commit: be2a40488b44ebeccdac0d8b6c8a3810df00f9da
Parents: 60f8a80
Author: Bruce Schuchardt <bs...@pivotal.io>
Authored: Tue Oct 25 14:08:10 2016 -0700
Committer: Bruce Schuchardt <bs...@pivotal.io>
Committed: Tue Oct 25 14:51:58 2016 -0700

----------------------------------------------------------------------
 .../membership/InternalDistributedMember.java   |  6 +----
 .../internal/cache/tier/sockets/HandShake.java  |  9 +++----
 .../AutoConnectionSourceImplJUnitTest.java      | 27 --------------------
 3 files changed, 4 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/be2a4048/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
index ac8379b..82dd055 100755
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
@@ -1171,11 +1171,7 @@ public class InternalDistributedMember implements DistributedMember, Externaliza
   }
 
   public String getHost() {
-    return this.hostName;
-  }
-
-  public void setHost(String h) {
-    this.hostName = h;
+    return this.netMbr.getInetAddress().getCanonicalHostName();
   }
 
   public int getProcessId() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/be2a4048/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
index 5e13be0..95e531d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
@@ -1253,7 +1253,7 @@ public class HandShake implements ClientHandShake {
       int qSize = dis.readInt();
 
       // Read the server member
-      member = readServerMember(dis, location);
+      member = readServerMember(dis);
       serverQStatus = new ServerQueueStatus(epType, qSize, member);
 
       // Read the message (if any)
@@ -1368,8 +1368,7 @@ public class HandShake implements ClientHandShake {
     return sqs;
   }
 
-  public static DistributedMember readServerMember(DataInputStream p_dis,
-      ServerLocation serverLocation) throws IOException {
+  protected DistributedMember readServerMember(DataInputStream p_dis) throws IOException {
 
     byte[] memberBytes = DataSerializer.readByteArray(p_dis);
     ByteArrayInputStream bais = new ByteArrayInputStream(memberBytes);
@@ -1379,9 +1378,7 @@ public class HandShake implements ClientHandShake {
       dis = new VersionedDataInputStream(dis, v);
     }
     try {
-      InternalDistributedMember ids = (InternalDistributedMember) DataSerializer.readObject(dis);
-      ids.setHost(serverLocation.getHostName());
-      return ids;
+      return (DistributedMember) DataSerializer.readObject(dis);
     } catch (EOFException e) {
       throw e;
     } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/be2a4048/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
index 63fc8d5..913edf2 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
@@ -15,7 +15,6 @@
 package org.apache.geode.cache.client.internal;
 
 import org.apache.geode.CancelCriterion;
-import org.apache.geode.DataSerializer;
 import org.apache.geode.cache.*;
 import org.apache.geode.cache.client.NoAvailableLocatorsException;
 import org.apache.geode.cache.client.SubscriptionNotEnabledException;
@@ -23,29 +22,22 @@ import org.apache.geode.cache.client.internal.locator.ClientConnectionRequest;
 import org.apache.geode.cache.client.internal.locator.ClientConnectionResponse;
 import org.apache.geode.cache.client.internal.locator.LocatorListResponse;
 import org.apache.geode.cache.query.QueryService;
-import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.PoolStatHelper;
 import org.apache.geode.distributed.internal.ServerLocation;
 import org.apache.geode.distributed.internal.SharedConfiguration;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 import org.apache.geode.distributed.internal.tcpserver.TcpHandler;
 import org.apache.geode.distributed.internal.tcpserver.TcpServer;
 import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.HeapDataOutputStream;
-import org.apache.geode.internal.Version;
 import org.apache.geode.internal.cache.PoolStats;
-import org.apache.geode.internal.cache.tier.sockets.HandShake;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
 import java.io.IOException;
 import java.net.ConnectException;
 import java.net.InetAddress;
@@ -146,25 +138,6 @@ public class AutoConnectionSourceImplJUnitTest {
   }
 
   @Test
-  public void testClientMembershipListenerHostAtClient() throws IOException {
-    String fakeHost = "fake.com";
-    InternalDistributedMember member = new InternalDistributedMember("localhost", 54638);
-    ServerLocation sl = new ServerLocation(fakeHost, 420);
-
-    HeapDataOutputStream dos = new HeapDataOutputStream(Version.CURRENT);
-    HeapDataOutputStream hdos = new HeapDataOutputStream(Version.CURRENT);
-    DataSerializer.writeObject(member, hdos);
-    DataSerializer.writeByteArray(hdos.toByteArray(), dos);
-    hdos.close();
-
-    DataInputStream dis = new DataInputStream(new ByteArrayInputStream(dos.toByteArray()));
-
-    DistributedMember ret = (DistributedMember) HandShake.readServerMember(dis, sl);
-
-    assertEquals(fakeHost, ret.getHost());
-  }
-
-  @Test
   public void testNoServers() throws Exception {
     startFakeLocator();
     handler.nextConnectionResponse = new ClientConnectionResponse(null);


[46/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java b/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
deleted file mode 100644
index eae674b..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreResult.java
+++ /dev/null
@@ -1,48 +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.admin.internal;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-
-public class BackupDataStoreResult {
-
-  private Map<DistributedMember, Set<PersistentID>> existingDataStores;
-
-  private Map<DistributedMember, Set<PersistentID>> successfulMembers;
-
-  public BackupDataStoreResult(Map<DistributedMember, Set<PersistentID>> existingDataStores,
-      Map<DistributedMember, Set<PersistentID>> successfulMembers) {
-    this.existingDataStores = existingDataStores;
-    this.successfulMembers = successfulMembers;
-  }
-
-  public Map<DistributedMember, Set<PersistentID>> getExistingDataStores() {
-    return this.existingDataStores;
-  }
-
-  public Map<DistributedMember, Set<PersistentID>> getSuccessfulMembers() {
-    return this.successfulMembers;
-  }
-
-  public String toString() {
-    return new StringBuilder().append(getClass().getSimpleName()).append("[")
-        .append("existingDataStores=").append(this.existingDataStores)
-        .append("; successfulMembers=").append(this.successfulMembers).append("]").toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java
deleted file mode 100644
index 4256c3c..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupStatusImpl.java
+++ /dev/null
@@ -1,59 +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.admin.internal;
-
-import java.io.Serializable;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.geode.admin.BackupStatus;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-
-/**
- * Holds the result of a backup operation.
- * 
- *
- */
-public class BackupStatusImpl implements BackupStatus, Serializable {
-  private static final long serialVersionUID = 3704162840296921840L;
-
-  private Map<DistributedMember, Set<PersistentID>> backedUpDiskStores;
-  private Set<PersistentID> offlineDiskStores;
-
-  public BackupStatusImpl(Map<DistributedMember, Set<PersistentID>> backedUpDiskStores,
-      Set<PersistentID> offlineDiskStores) {
-    super();
-    this.backedUpDiskStores = backedUpDiskStores;
-    this.offlineDiskStores = offlineDiskStores;
-  }
-
-  public Map<DistributedMember, Set<PersistentID>> getBackedUpDiskStores() {
-    return backedUpDiskStores;
-  }
-
-  public Set<PersistentID> getOfflineDiskStores() {
-    return offlineDiskStores;
-  }
-
-  @Override
-  public String toString() {
-    return "BackupStatus[backedUpDiskStores=" + backedUpDiskStores + ", offlineDiskStores="
-        + offlineDiskStores + "]";
-  }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthConfigImpl.java
deleted file mode 100644
index 3c57ef4..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthConfigImpl.java
+++ /dev/null
@@ -1,91 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-
-/**
- * The implementation of <code>CacheHealthConfig</code>
- *
- *
- * @since GemFire 3.5
- */
-public abstract class CacheHealthConfigImpl extends MemberHealthConfigImpl
-    implements CacheHealthConfig {
-
-  /**
-   * The maximum number of milliseconds a <code>netSearch</code> operation can take before the cache
-   * member is considered to be unhealthy.
-   */
-  private long maxNetSearchTime = DEFAULT_MAX_NET_SEARCH_TIME;
-
-  /**
-   * The maximum mumber of milliseconds a cache <code>load</code> operation can take before the
-   * cache member is considered to be unhealthy.
-   */
-  private long maxLoadTime = DEFAULT_MAX_LOAD_TIME;
-
-  /** The minimum hit ratio of a healthy cache member. */
-  private double minHitRatio = DEFAULT_MIN_HIT_RATIO;
-
-  /**
-   * The maximum number of entries in the event delivery queue of a healthy cache member.
-   */
-  private long maxEventQueueSize = DEFAULT_MAX_EVENT_QUEUE_SIZE;
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>CacheHealthConfigImpl</code> with the default configuration.
-   */
-  CacheHealthConfigImpl() {
-
-  }
-
-  ////////////////////// Instance Methods /////////////////////
-
-  public long getMaxNetSearchTime() {
-    return this.maxNetSearchTime;
-  }
-
-  public void setMaxNetSearchTime(long maxNetSearchTime) {
-    this.maxNetSearchTime = maxNetSearchTime;
-  }
-
-  public long getMaxLoadTime() {
-    return this.maxLoadTime;
-  }
-
-  public void setMaxLoadTime(long maxLoadTime) {
-    this.maxLoadTime = maxLoadTime;
-  }
-
-  public double getMinHitRatio() {
-    return this.minHitRatio;
-  }
-
-  public void setMinHitRatio(double minHitRatio) {
-    this.minHitRatio = minHitRatio;
-  }
-
-  public long getMaxEventQueueSize() {
-    return this.maxEventQueueSize;
-  }
-
-  public void setMaxEventQueueSize(long maxEventQueueSize) {
-    this.maxEventQueueSize = maxEventQueueSize;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthEvaluator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthEvaluator.java
deleted file mode 100644
index f7ff9ed..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/CacheHealthEvaluator.java
+++ /dev/null
@@ -1,306 +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.admin.internal;
-
-import java.util.List;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.admin.CacheHealthConfig;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.distributed.internal.DM;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.internal.OSProcess;
-import org.apache.geode.internal.cache.CacheLifecycleListener;
-import org.apache.geode.internal.cache.CachePerfStats;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-
-/**
- * Contains the logic for evaluating the health of a GemFire <code>Cache</code> instance according
- * to the thresholds provided in a {@link CacheHealthConfig}.
- *
- *
- * @since GemFire 3.5
- */
-class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifecycleListener {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /** The config from which we get the evaulation criteria */
-  private CacheHealthConfig config;
-
-  /** The description of the cache being evaluated */
-  private String description;
-
-  /**
-   * Statistics about the <code>Cache</code> instance. If no cache has been created in this VM, this
-   * field will be <code>null</code>
-   */
-  private CachePerfStats cacheStats;
-
-  /** The previous value of the netsearchTime stat (in nanoseconds) */
-  private long prevNetsearchTime;
-
-  /** The previous value of the netsearchedCompleted stat */
-  private long prevNetsearchesCompleted;
-
-  /** The previous value of the loadTime stat (in nanoseconds) */
-  private long prevLoadTime;
-
-  /** The previous value of the loadedCompleted stat */
-  private long prevLoadsCompleted;
-
-  /** The previous value of the gets stat */
-  private long prevGets;
-
-  ////////////////////// Constructors //////////////////////
-
-  /**
-   * Creates a new <code>CacheHealthEvaluator</code>
-   */
-  CacheHealthEvaluator(GemFireHealthConfig config, DM dm) {
-    super(config, dm);
-
-    this.config = config;
-    InternalDistributedSystem system = dm.getSystem();
-    GemFireCacheImpl cache;
-    try {
-      cache = (GemFireCacheImpl) CacheFactory.getInstance(system);
-
-    } catch (CancelException ex) {
-      // No cache in this VM
-      cache = null;
-    }
-
-    initialize(cache, dm);
-    GemFireCacheImpl.addCacheLifecycleListener(this);
-  }
-
-  //////////////////// Instance Methods ////////////////////
-
-  @Override
-  protected String getDescription() {
-    return this.description;
-  }
-
-  /**
-   * Initializes the state of this evaluator based on the given cache instance.
-   */
-  private void initialize(GemFireCacheImpl cache, DM dm) {
-    StringBuffer sb = new StringBuffer();
-    if (cache != null) {
-      this.cacheStats = cache.getCachePerfStats();
-
-      sb.append("Cache \"");
-      sb.append(cache.getName());
-      sb.append("\"");
-
-    } else {
-      sb.append("No Cache");
-    }
-
-    sb.append(" in member ");
-    sb.append(dm.getId());
-    int pid = OSProcess.getId();
-    if (pid != 0) {
-      sb.append(" with pid ");
-      sb.append(pid);
-    }
-    this.description = sb.toString();
-  }
-
-  public void cacheCreated(GemFireCacheImpl cache) {
-    InternalDistributedSystem system = (InternalDistributedSystem) cache.getDistributedSystem();
-    DM dm = system.getDistributionManager();
-    initialize(cache, dm);
-  }
-
-  /**
-   * Checks to make sure that the average <code>netSearch</code> time during the previous health
-   * check interval is less than the {@linkplain CacheHealthConfig#getMaxNetSearchTime threshold}.
-   * If not, the status is "okay" health.
-   *
-   * @see CachePerfStats#getNetsearchTime
-   * @see CachePerfStats#getNetsearchesCompleted
-   */
-  void checkNetSearchTime(List status) {
-    if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) {
-      return;
-    }
-
-    long deltaNetsearchTime = this.cacheStats.getNetsearchTime() - this.prevNetsearchTime;
-    long deltaNetsearchesCompleted =
-        this.cacheStats.getNetsearchesCompleted() - this.prevNetsearchesCompleted;
-
-    if (deltaNetsearchesCompleted != 0) {
-      long ratio = deltaNetsearchTime / deltaNetsearchesCompleted;
-      ratio /= 1000000;
-      long threshold = this.config.getMaxNetSearchTime();
-
-      if (ratio > threshold) {
-        String s =
-            LocalizedStrings.CacheHealthEvaluator_THE_AVERAGE_DURATION_OF_A_CACHE_NETSEARCH_0_MS_EXCEEDS_THE_THRESHOLD_1_MS
-                .toLocalizedString(new Object[] {ratio, threshold});
-        status.add(okayHealth(s));
-      }
-    }
-  }
-
-  /**
-   * Checks to make sure that the average <code>load</code> time during the previous health check
-   * interval is less than the {@linkplain CacheHealthConfig#getMaxLoadTime threshold}. If not, the
-   * status is "okay" health.
-   *
-   * @see CachePerfStats#getLoadTime
-   * @see CachePerfStats#getLoadsCompleted
-   */
-  void checkLoadTime(List status) {
-    if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) {
-      return;
-    }
-
-    if (!isFirstEvaluation()) {
-      long deltaLoadTime = this.cacheStats.getLoadTime() - this.prevLoadTime;
-      long deltaLoadsCompleted = this.cacheStats.getLoadsCompleted() - this.prevLoadsCompleted;
-
-      if (logger.isDebugEnabled()) {
-        logger.debug("Completed {} loads in {} ms", deltaLoadsCompleted, (deltaLoadTime / 1000000));
-      }
-
-      if (deltaLoadsCompleted != 0) {
-        long ratio = deltaLoadTime / deltaLoadsCompleted;
-        ratio /= 1000000;
-        long threshold = this.config.getMaxLoadTime();
-
-        if (ratio > threshold) {
-          String s =
-              LocalizedStrings.CacheHealthEvaluator_THE_AVERAGE_DURATION_OF_A_CACHE_LOAD_0_MS_EXCEEDS_THE_THRESHOLD_1_MS
-                  .toLocalizedString(new Object[] {ratio, threshold});
-          if (logger.isDebugEnabled()) {
-            logger.debug(s);
-          }
-          status.add(okayHealth(s));
-        }
-      }
-    }
-  }
-
-  /**
-   * Checks to make sure that the cache hit ratio during the previous health check interval is less
-   * than the {@linkplain CacheHealthConfig#getMinHitRatio threshold}. If not, the status is "okay"
-   * health.
-   *
-   * <P>
-   *
-   * The following formula is used to compute the hit ratio:
-   *
-   * <PRE>
-   * hitRatio = (gets - (loadsCompleted + netsearchesCompleted)) / (gets)
-   * </PRE>
-   *
-   *
-   * @see CachePerfStats#getGets
-   * @see CachePerfStats#getLoadsCompleted
-   * @see CachePerfStats#getNetsearchesCompleted
-   */
-  void checkHitRatio(List status) {
-    if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) {
-      return;
-    }
-
-    long deltaGets = this.cacheStats.getGets() - this.prevGets;
-    if (deltaGets != 0) {
-      long deltaLoadsCompleted = this.cacheStats.getLoadsCompleted() - this.prevLoadsCompleted;
-      long deltaNetsearchesCompleted =
-          this.cacheStats.getNetsearchesCompleted() - this.prevNetsearchesCompleted;
-
-      double hits = (deltaGets - (deltaLoadsCompleted + deltaNetsearchesCompleted));
-      double hitRatio = hits / deltaGets;
-      double threshold = this.config.getMinHitRatio();
-      if (hitRatio < threshold) {
-        String s = "The hit ratio of this Cache (" + hitRatio + ") is below the threshold ("
-            + threshold + ")";
-        status.add(okayHealth(s));
-      }
-    }
-  }
-
-  /**
-   * Checks to make sure that the {@linkplain CachePerfStats#getEventQueueSize cache event queue
-   * size} does not exceed the {@linkplain CacheHealthConfig#getMaxEventQueueSize threshold}. If it
-   * does, the status is "okay" health.
-   */
-  void checkEventQueueSize(List status) {
-    if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) {
-      return;
-    }
-
-    long eventQueueSize = this.cacheStats.getEventQueueSize();
-    long threshold = this.config.getMaxEventQueueSize();
-    if (eventQueueSize > threshold) {
-      String s =
-          LocalizedStrings.CacheHealthEvaluator_THE_SIZE_OF_THE_CACHE_EVENT_QUEUE_0_MS_EXCEEDS_THE_THRESHOLD_1_MS
-              .toLocalizedString(
-                  new Object[] {Long.valueOf(eventQueueSize), Long.valueOf(threshold)});
-      status.add(okayHealth(s));
-    }
-  }
-
-
-  /**
-   * Updates the previous values of statistics
-   */
-  private void updatePrevious() {
-    if (this.cacheStats != null && !this.cacheStats.isClosed()) {
-      this.prevLoadTime = this.cacheStats.getLoadTime();
-      this.prevLoadsCompleted = this.cacheStats.getLoadsCompleted();
-      this.prevNetsearchTime = this.cacheStats.getNetsearchTime();
-      this.prevNetsearchesCompleted = this.cacheStats.getNetsearchesCompleted();
-      this.prevGets = this.cacheStats.getGets();
-
-    } else {
-      this.prevLoadTime = 0L;
-      this.prevLoadsCompleted = 0L;
-      this.prevNetsearchTime = 0L;
-      this.prevNetsearchesCompleted = 0L;
-      this.prevGets = 0L;
-    }
-  }
-
-  @Override
-  protected void check(List status) {
-
-    checkNetSearchTime(status);
-    checkLoadTime(status);
-    checkHitRatio(status);
-    checkEventQueueSize(status);
-
-    updatePrevious();
-  }
-
-  @Override
-  public void close() {
-    GemFireCacheImpl.removeCacheLifecycleListener(this);
-  }
-
-  @Override
-  public void cacheClosed(GemFireCacheImpl cache) {
-    // do nothing
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/CacheServerConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/CacheServerConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/CacheServerConfigImpl.java
deleted file mode 100644
index dbf860f..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/CacheServerConfigImpl.java
+++ /dev/null
@@ -1,133 +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.admin.internal;
-
-import org.apache.geode.admin.CacheServerConfig;
-import org.apache.geode.admin.CacheVmConfig;
-import org.apache.geode.internal.admin.GemFireVM;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-/**
- * An implementation of <code>CacheVmConfig</code>
- *
- * @since GemFire 4.0
- */
-public class CacheServerConfigImpl extends ManagedEntityConfigImpl
-    implements CacheVmConfig, CacheServerConfig {
-
-  /**
-   * Declarative caching XML file that is used to initialize the Cache in the cache server.
-   */
-  private String cacheXMLFile;
-
-  /** Extra classpath for the cache server */
-  private String classpath;
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>CacheServerConfigImpl</code> with the default configuration settings.
-   */
-  public CacheServerConfigImpl() {
-    this.cacheXMLFile = null;
-    this.classpath = null;
-  }
-
-  /**
-   * Creates a new <code>CacheServerConfigImpl</code> for a running cache server.
-   */
-  public CacheServerConfigImpl(GemFireVM vm) {
-    super(vm);
-
-    String name = CACHE_XML_FILE;
-    this.cacheXMLFile = vm.getConfig().getAttribute(name);
-    this.classpath = null;
-  }
-
-  /**
-   * Copy constructor
-   */
-  public CacheServerConfigImpl(CacheServerConfig other) {
-    super(other);
-    this.cacheXMLFile = other.getCacheXMLFile();
-    this.classpath = other.getClassPath();
-  }
-
-  /**
-   * Copy constructor
-   */
-  public CacheServerConfigImpl(CacheVmConfig other) {
-    super(other);
-    this.cacheXMLFile = other.getCacheXMLFile();
-    this.classpath = other.getClassPath();
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  public String getCacheXMLFile() {
-    return this.cacheXMLFile;
-  }
-
-  public void setCacheXMLFile(String cacheXMLFile) {
-    checkReadOnly();
-    this.cacheXMLFile = cacheXMLFile;
-    configChanged();
-  }
-
-  public String getClassPath() {
-    return this.classpath;
-  }
-
-  public void setClassPath(String classpath) {
-    checkReadOnly();
-    this.classpath = classpath;
-    configChanged();
-  }
-
-  @Override
-  public void validate() {
-    super.validate();
-
-    // Nothing to validate really. Cache.xml file could live on
-    // different file system.
-  }
-
-  /**
-   * Currently, listeners are not supported on the locator config.
-   */
-  @Override
-  protected void configChanged() {
-
-  }
-
-  @Override
-  public Object clone() throws CloneNotSupportedException {
-    return new CacheServerConfigImpl((CacheVmConfig) this);
-  }
-
-  @Override
-  public String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.append(super.toString());
-    sb.append(" cacheXMLFile=");
-    sb.append(this.getCacheXMLFile());
-    sb.append(" classPath=");
-    sb.append(this.getClassPath());
-
-    return sb.toString();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/CacheServerImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/CacheServerImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/CacheServerImpl.java
deleted file mode 100644
index c10c6f8..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/CacheServerImpl.java
+++ /dev/null
@@ -1,190 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.distributed.internal.DM;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.internal.admin.GemFireVM;
-import org.apache.geode.internal.admin.remote.RemoteApplicationVM;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-/**
- * Implements the administrative interface to a cache server.
- *
- * @since GemFire 3.5
- */
-public class CacheServerImpl extends ManagedSystemMemberImpl implements CacheVm, CacheServer {
-
-  /** How many new <code>CacheServer</code>s have been created? */
-  private static int newCacheServers = 0;
-
-  /////////////////////// Instance Fields ///////////////////////
-
-  /** The configuration object for this cache server */
-  private final CacheServerConfigImpl config;
-
-  ///////////////////////// Constructors ////////////////////////
-
-  /**
-   * Creates a new <code>CacheServerImpl</code> that represents a non-existsing (unstarted) cache
-   * server in a given distributed system.
-   */
-  public CacheServerImpl(AdminDistributedSystemImpl system, CacheVmConfig config)
-      throws AdminException {
-
-    super(system, config);
-
-    this.config = (CacheServerConfigImpl) config;
-    this.config.setManagedEntity(this);
-  }
-
-  /**
-   * Creates a new <code>CacheServerImpl</code> that represents an existing dedicated cache server
-   * in a given distributed system.
-   */
-  public CacheServerImpl(AdminDistributedSystemImpl system, GemFireVM vm) throws AdminException {
-
-    super(system, vm);
-    this.config = new CacheServerConfigImpl(vm);
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  @Override
-  public SystemMemberType getType() {
-    return SystemMemberType.CACHE_VM;
-  }
-
-  public String getNewId() {
-    synchronized (CacheServerImpl.class) {
-      return "CacheVm" + (++newCacheServers);
-    }
-  }
-
-  public void start() throws AdminException {
-    if (!needToStart()) {
-      return;
-    }
-
-    this.config.validate();
-    this.controller.start(this);
-    this.config.setManagedEntity(this);
-  }
-
-  public void stop() {
-    if (!needToStop()) {
-      return;
-    }
-
-    this.controller.stop(this);
-    // NOTE: DistributedSystem nodeLeft will then set this.manager to null
-    this.config.setManagedEntity(null);
-  }
-
-  public boolean isRunning() {
-    DM dm = ((AdminDistributedSystemImpl) getDistributedSystem()).getDistributionManager();
-    if (dm == null) {
-      try {
-        return this.controller.isRunning(this);
-      } catch (IllegalStateException e) {
-        return false;
-      }
-    }
-    return ((DistributionManager) dm).getDistributionManagerIdsIncludingAdmin()
-        .contains(getDistributedMember());
-  }
-
-  public CacheServerConfig getConfig() {
-    return this.config;
-  }
-
-  public CacheVmConfig getVmConfig() {
-    return this.config;
-  }
-
-  //////////////////////// Command execution ////////////////////////
-
-  public ManagedEntityConfig getEntityConfig() {
-    return this.getConfig();
-  }
-
-  public String getEntityType() {
-    // Fix bug 32564
-    return "Cache Vm";
-  }
-
-  public String getStartCommand() {
-    StringBuffer sb = new StringBuffer();
-    sb.append(this.controller.getProductExecutable(this, "cacheserver"));
-    sb.append(" start -dir=");
-    sb.append(this.getConfig().getWorkingDirectory());
-
-    String file = this.getConfig().getCacheXMLFile();
-    if (file != null && file.length() > 0) {
-      sb.append(" ");
-      sb.append(CACHE_XML_FILE);
-      sb.append("=");
-      sb.append(file);
-    }
-
-    String classpath = this.getConfig().getClassPath();
-    if (classpath != null && classpath.length() > 0) {
-      sb.append(" -classpath=");
-      sb.append(classpath);
-    }
-
-    appendConfiguration(sb);
-
-    return sb.toString().trim();
-  }
-
-  public String getStopCommand() {
-    StringBuffer sb = new StringBuffer();
-    sb.append(this.controller.getProductExecutable(this, "cacheserver"));
-    sb.append(" stop -dir=");
-    sb.append(this.getConfig().getWorkingDirectory());
-
-    return sb.toString().trim();
-  }
-
-  public String getIsRunningCommand() {
-    StringBuffer sb = new StringBuffer();
-    sb.append(this.controller.getProductExecutable(this, "cacheserver"));
-    sb.append(" status -dir=");
-    sb.append(this.getConfig().getWorkingDirectory());
-
-    return sb.toString().trim();
-  }
-
-  /**
-   * Find whether this server is primary for given client (durableClientId)
-   * 
-   * @param durableClientId - durable-id of the client
-   * @return true if the server is primary for given client
-   * 
-   * @since GemFire 5.6
-   */
-  public boolean isPrimaryForDurableClient(String durableClientId) {
-    RemoteApplicationVM vm = (RemoteApplicationVM) this.getGemFireVM();
-    boolean isPrimary = false;
-    if (vm != null) {
-      isPrimary = vm.isPrimaryForDurableClient(durableClientId);
-    }
-    return isPrimary;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/ConfigurationParameterImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/ConfigurationParameterImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/ConfigurationParameterImpl.java
deleted file mode 100755
index 8e5707d..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/ConfigurationParameterImpl.java
+++ /dev/null
@@ -1,282 +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.admin.internal;
-
-import org.apache.geode.admin.ConfigurationParameter;
-import org.apache.geode.admin.UnmodifiableConfigurationException;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import java.io.File;
-// import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * A single configuration parameter of a system member.
- *
- * @since GemFire 3.5
- *
- */
-public class ConfigurationParameterImpl implements org.apache.geode.admin.ConfigurationParameter {
-
-  /** Identifying name of this configuration parameter */
-  protected String name;
-  /** Full description of this configuration parameter */
-  protected String description;
-  /** The current value */
-  protected Object value;
-  /** Class type of the value */
-  protected Class type;
-  /** True if this is modifiable; false if read-only */
-  protected boolean userModifiable;
-  /** List of listeners to notify when value changes */
-  private final List listeners = new ArrayList();
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs new <code>ConfigurationParameterImpl</code>.
-   *
-   * @param name the name of this parameter which cannot change
-   * @param description full description to use
-   * @param value the value of this parameter
-   * @param type the class type of the value
-   * @param userModifiable true if this is modifiable; false if read-only
-   */
-  protected ConfigurationParameterImpl(String name, String description, Object value, Class type,
-      boolean userModifiable) {
-    if (name == null || name.length() == 0) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.ConfigurationParameterImpl_CONFIGURATIONPARAMETER_NAME_MUST_BE_SPECIFIED
-              .toLocalizedString());
-    }
-
-    this.name = name;
-    setInternalState(description, value, type, userModifiable);
-  }
-
-  /**
-   * Constructs new <code>ConfigurationParameterImpl</code>.
-   *
-   * @param name the name of this parameter which cannot change
-   * @param value the value of this parameter
-   */
-  protected ConfigurationParameterImpl(String name, Object value) {
-    if (name == null || name.length() == 0) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.ConfigurationParameterImpl_CONFIGURATIONPARAMETER_NAME_MUST_BE_SPECIFIED
-              .toLocalizedString());
-    }
-
-    this.name = name;
-    setInternalState(name, value, value.getClass(), true);
-  }
-
-  /** Constructor to allow serialization by subclass */
-  protected ConfigurationParameterImpl() {}
-
-  // -------------------------------------------------------------------------
-  // Attribute accessors and mutators
-  // -------------------------------------------------------------------------
-
-  public String getName() {
-    return this.name;
-  }
-
-  public String getDescription() {
-    return this.description;
-  }
-
-  public Object getValue() {
-    return this.value;
-  }
-
-  public String getValueAsString() {
-    if (isString()) {
-      return (String) this.value;
-    } else if (isInetAddress()) {
-      return InetAddressUtil.toString(this.value);
-    } else if (isFile()) {
-      return this.value.toString();
-    } else if (isOctal()) {
-      String strVal = Integer.toOctalString(((Integer) this.value).intValue());
-      if (!strVal.startsWith("0")) {
-        strVal = "0" + strVal;
-      }
-      return strVal;
-    } else if (isArray()) {
-      List list = Arrays.asList((Object[]) this.value);
-      return list.toString();
-    } else {
-      return this.value.toString();
-    }
-  }
-
-  public Class getValueType() {
-    return this.type;
-  }
-
-  public boolean isModifiable() {
-    return this.userModifiable;
-  }
-
-  public boolean isArray() {
-    return "manager-parameters".equals(this.name) || "manager-classpaths".equals(this.name);
-  }
-
-  public boolean isInetAddress() {
-    return java.net.InetAddress.class.isAssignableFrom(this.type);
-  }
-
-  public boolean isFile() {
-    return java.io.File.class.equals(this.type);
-  }
-
-  public boolean isOctal() {
-    return "shared-memory-permissions".equals(this.name);
-  }
-
-  public boolean isString() {
-    return java.lang.String.class.equals(this.type);
-  }
-
-  public void setValue(Object value) throws UnmodifiableConfigurationException {
-    if (!isModifiable()) {
-      throw new UnmodifiableConfigurationException(
-          LocalizedStrings.ConfigurationParameterImpl_0_IS_NOT_A_MODIFIABLE_CONFIGURATION_PARAMETER
-              .toLocalizedString(getName()));
-    }
-    if (value == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.ConfigurationParameterImpl_UNABLE_TO_SET_0_TO_NULL_VALUE
-              .toLocalizedString(getName()));
-    }
-    if (!getValueType().equals(value.getClass())) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.ConfigurationParameterImpl_UNABLE_TO_SET_TYPE_0_WITH_TYPE_1
-              .toLocalizedString(
-                  new Object[] {getValueType().getName(), value.getClass().getName()}));
-    }
-
-    if (value instanceof String && !isString()) {
-      // we need to check what the type should be and convert to it...
-      setValueFromString((String) value);
-    } else {
-      this.value = value;
-    }
-    fireConfigurationParameterValueChanged(this);
-  }
-
-  // -------------------------------------------------------------------------
-  // Operations for handling the registration of listeners
-  // Note: this is only for use within impl pkg and subclass pkgs
-  // -------------------------------------------------------------------------
-
-  /** Adds the listener for any changes to this configuration parameter. */
-  public void addConfigurationParameterListener(ConfigurationParameterListener listener) {
-    if (!this.listeners.contains(listener)) {
-      this.listeners.add(listener);
-    }
-  }
-
-  /** Removes the listener if it's currently registered. */
-  public void removeConfigurationParameterListener(ConfigurationParameterListener listener) {
-    if (this.listeners.contains(listener)) {
-      this.listeners.remove(listener);
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // Implementation methods
-  // -------------------------------------------------------------------------
-
-  protected void setValueFromString(String newValue) {
-    if (newValue == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.ConfigurationParameterImpl_UNABLE_TO_SET_0_TO_NULL_VALUE
-              .toLocalizedString(getName()));
-    }
-
-    if (isInetAddress()) {
-      this.value = InetAddressUtil.toInetAddress(newValue);
-    } else if (isFile()) {
-      this.value = new File(newValue);
-    } else if (isOctal()) {
-      if (!newValue.startsWith("0")) {
-        newValue = "0" + newValue;
-      }
-      this.value = Integer.valueOf(Integer.parseInt(newValue, 8));
-    } else if (isArray()) {
-      // parse it TODO
-      throw new IllegalArgumentException(
-          LocalizedStrings.ConfigurationParameterImpl_SETTING_ARRAY_VALUE_FROM_DELIMITED_STRING_IS_NOT_SUPPORTED
-              .toLocalizedString());
-    } else {
-      this.value = newValue;
-    }
-  }
-
-  /**
-   * Fires changed configuration parameter to registered listeners.
-   *
-   * @param parm the configuration parameter the changed
-   */
-  protected void fireConfigurationParameterValueChanged(ConfigurationParameter parm) {
-    ConfigurationParameterListener[] listeners = (ConfigurationParameterListener[]) this.listeners
-        .toArray(new ConfigurationParameterListener[0]);
-    for (int i = 0; i < listeners.length; i++) {
-      listeners[i].configurationParameterValueChanged(parm);
-    }
-  }
-
-  /**
-   * Sets the internal state of this configuration parameter.
-   *
-   * @param description full description to use
-   * @param value the value of this parameter
-   * @param type the class type of the value
-   * @param userModifiable true if this is modifiable; false if read-only
-   */
-  protected void setInternalState(String description, Object value, Class type,
-      boolean userModifiable) {
-    if (description == null || description.length() == 0) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.ConfigurationParameterImpl_CONFIGURATIONPARAMETER_DESCRIPTION_MUST_BE_SPECIFIED
-              .toLocalizedString());
-    }
-    this.description = description;
-    this.type = type;
-    this.userModifiable = userModifiable;
-
-    if (value == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.ConfigurationParameterImpl_UNABLE_TO_SET_0_TO_NULL_VALUE
-              .toLocalizedString(getName()));
-    }
-
-    this.value = value;
-  }
-
-  @Override
-  public String toString() {
-    return this.name;
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/ConfigurationParameterListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/ConfigurationParameterListener.java b/geode-core/src/main/java/org/apache/geode/admin/internal/ConfigurationParameterListener.java
deleted file mode 100755
index 8865429..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/ConfigurationParameterListener.java
+++ /dev/null
@@ -1,30 +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.admin.internal;
-
-import org.apache.geode.admin.ConfigurationParameter;
-
-/**
- * Listens to value changes of a {@link org.apache.geode.admin.ConfigurationParameter}. This is for
- * internal use only to allow a {@link SystemMemberImpl} to keep track of configuration changes made
- * through {@link ConfigurationParameterImpl#setValue}.
- *
- * @since GemFire 3.5
- *
- */
-public interface ConfigurationParameterListener {
-  public void configurationParameterValueChanged(ConfigurationParameter parm);
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/DisabledManagedEntityController.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DisabledManagedEntityController.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DisabledManagedEntityController.java
deleted file mode 100755
index e4eb49f..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/DisabledManagedEntityController.java
+++ /dev/null
@@ -1,94 +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.admin.internal;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.admin.DistributedSystemConfig;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LogMarker;
-
-/**
- * This is a disabled implementation of ManagedEntityController for bug #47909.
- *
- * The old ManagedEntityController was a concrete class which has been renamed to
- * ManagedEntityControllerImpl. The build.xml now skips building ManagedEntityControllerImpl. If
- * ManagedEntityControllerImpl is not found in the classpath then the code uses
- * DisabledManagedEntityController as a place holder.
- *
- */
-class DisabledManagedEntityController implements ManagedEntityController {
-
-  private static final Logger logger = LogService.getLogger();
-
-  private static final String EXCEPTION_MESSAGE =
-      "Local and remote OS command invocations are disabled for the Admin API.";
-
-  DisabledManagedEntityController() {}
-
-  @Override
-  public void start(InternalManagedEntity entity) {
-    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
-      logger.warn(LogMarker.MANAGED_ENTITY, "DisabledManagedEntityController#start {}",
-          EXCEPTION_MESSAGE);
-    }
-    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
-  }
-
-  @Override
-  public void stop(InternalManagedEntity entity) {
-    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
-      logger.warn(LogMarker.MANAGED_ENTITY, "DisabledManagedEntityController#stop {}",
-          EXCEPTION_MESSAGE);
-    }
-    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
-  }
-
-  @Override
-  public boolean isRunning(InternalManagedEntity entity) {
-    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
-      logger.warn(LogMarker.MANAGED_ENTITY, "DisabledManagedEntityController#isRunning {}",
-          EXCEPTION_MESSAGE);
-    }
-    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
-  }
-
-  @Override
-  public String getLog(DistributionLocatorImpl locator) {
-    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
-      logger.warn(LogMarker.MANAGED_ENTITY, "DisabledManagedEntityController#getLog {}",
-          EXCEPTION_MESSAGE);
-    }
-    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
-  }
-
-  @Override
-  public String buildSSLArguments(DistributedSystemConfig config) {
-    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
-      logger.warn(LogMarker.MANAGED_ENTITY, "DisabledManagedEntityController#buildSSLArguments {}",
-          EXCEPTION_MESSAGE);
-    }
-    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
-  }
-
-  @Override
-  public String getProductExecutable(InternalManagedEntity entity, String executable) {
-    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
-      logger.warn(LogMarker.MANAGED_ENTITY,
-          "DisabledManagedEntityController#getProductExecutable {}", EXCEPTION_MESSAGE);
-    }
-    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemConfigImpl.java
deleted file mode 100755
index a89d390..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemConfigImpl.java
+++ /dev/null
@@ -1,1109 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.DistributionConfigImpl;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.InternalLogWriter;
-import org.apache.geode.internal.logging.LogConfig;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.LogWriterImpl;
-import org.apache.logging.log4j.Logger;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.*;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-/**
- * An implementation of the configuration object for an <code>AdminDistributedSystem</code>. After a
- * config has been used to create an <code>AdminDistributedSystem</code> most of the configuration
- * attributes cannot be changed. However, some operations (such as getting information about GemFire
- * managers and distribution locators) are "passed through" to the
- * <code>AdminDistributedSystem</code> associated with this configuration object.
- *
- * @since GemFire 3.5
- */
-public class DistributedSystemConfigImpl implements DistributedSystemConfig {
-
-  private static final Logger logger = LogService.getLogger();
-
-  private String entityConfigXMLFile = DEFAULT_ENTITY_CONFIG_XML_FILE;
-  private String systemId = DEFAULT_SYSTEM_ID;
-  private String mcastAddress = DEFAULT_MCAST_ADDRESS;
-  private int mcastPort = DEFAULT_MCAST_PORT;
-  private int ackWaitThreshold = DEFAULT_ACK_WAIT_THRESHOLD;
-  private int ackSevereAlertThreshold = DEFAULT_ACK_SEVERE_ALERT_THRESHOLD;
-  private String locators = DEFAULT_LOCATORS;
-  private String bindAddress = DEFAULT_BIND_ADDRESS;
-  private String serverBindAddress = DEFAULT_BIND_ADDRESS;
-  private String remoteCommand = DEFAULT_REMOTE_COMMAND;
-  private boolean disableTcp = DEFAULT_DISABLE_TCP;
-  private boolean enableNetworkPartitionDetection = DEFAULT_ENABLE_NETWORK_PARTITION_DETECTION;
-  private boolean disableAutoReconnect = DEFAULT_DISABLE_AUTO_RECONNECT;
-  private int memberTimeout = DEFAULT_MEMBER_TIMEOUT;
-  private String membershipPortRange = getMembershipPortRangeString(DEFAULT_MEMBERSHIP_PORT_RANGE);
-  private int tcpPort = DEFAULT_TCP_PORT;
-
-  private String logFile = DEFAULT_LOG_FILE;
-  private String logLevel = DEFAULT_LOG_LEVEL;
-  private int logDiskSpaceLimit = DEFAULT_LOG_DISK_SPACE_LIMIT;
-  private int logFileSizeLimit = DEFAULT_LOG_FILE_SIZE_LIMIT;
-  private int refreshInterval = DEFAULT_REFRESH_INTERVAL;
-  private Properties gfSecurityProperties = new Properties();
-
-  /**
-   * Listeners to notify when this DistributedSystemConfig changes
-   */
-  private Set listeners = new HashSet();
-
-  /**
-   * Configs for CacheServers that this system config is aware of
-   */
-  private Set cacheServerConfigs = new HashSet();
-
-  /**
-   * Configs for the managed distribution locators in the distributed system
-   */
-  private Set locatorConfigs = new HashSet();
-
-  /**
-   * The display name of this distributed system
-   */
-  private String systemName = DEFAULT_NAME;
-
-  /**
-   * The admin distributed system object that is configured by this config object.
-   *
-   * @since GemFire 4.0
-   */
-  private AdminDistributedSystemImpl system;
-
-  /**
-   * The GemFire log writer used by the distributed system
-   */
-  private InternalLogWriter logWriter;
-
-  /////////////////////// Static Methods ///////////////////////
-
-  /**
-   * Filters out all properties that are unique to the admin <code>DistributedSystemConfig</code>
-   * that are not present in the internal <code>DistributionConfig</code>.
-   *
-   * @since GemFire 4.0
-   */
-  private static Properties filterOutAdminProperties(Properties props) {
-
-    Properties props2 = new Properties();
-    for (Enumeration names = props.propertyNames(); names.hasMoreElements();) {
-      String name = (String) names.nextElement();
-      if (!(ENTITY_CONFIG_XML_FILE_NAME.equals(name) || REFRESH_INTERVAL_NAME.equals(name)
-          || REMOTE_COMMAND_NAME.equals(name))) {
-        String value = props.getProperty(name);
-        if ((name != null) && (value != null)) {
-          props2.setProperty(name, value);
-        }
-      }
-    }
-
-    return props2;
-  }
-
-  //////////////////////// Constructors ////////////////////////
-
-  /**
-   * Creates a new <code>DistributedSystemConfigImpl</code> based on the configuration stored in a
-   * <code>DistributedSystem</code>'s <code>DistributionConfig</code>.
-   */
-  public DistributedSystemConfigImpl(DistributionConfig distConfig, String remoteCommand) {
-    if (distConfig == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.DistributedSystemConfigImpl_DISTRIBUTIONCONFIG_MUST_NOT_BE_NULL
-              .toLocalizedString());
-    }
-
-    this.mcastAddress = InetAddressUtil.toString(distConfig.getMcastAddress());
-    this.mcastPort = distConfig.getMcastPort();
-    this.locators = distConfig.getLocators();
-    this.membershipPortRange = getMembershipPortRangeString(distConfig.getMembershipPortRange());
-
-    this.systemName = distConfig.getName();
-
-    this.sslEnabled = distConfig.getClusterSSLEnabled();
-    this.sslCiphers = distConfig.getClusterSSLCiphers();
-    this.sslProtocols = distConfig.getClusterSSLProtocols();
-    this.sslAuthenticationRequired = distConfig.getClusterSSLRequireAuthentication();
-
-    this.logFile = distConfig.getLogFile().getPath();
-    this.logLevel = LogWriterImpl.levelToString(distConfig.getLogLevel());
-    this.logDiskSpaceLimit = distConfig.getLogDiskSpaceLimit();
-    this.logFileSizeLimit = distConfig.getLogFileSizeLimit();
-
-    basicSetBindAddress(distConfig.getBindAddress());
-    this.tcpPort = distConfig.getTcpPort();
-
-    this.disableTcp = distConfig.getDisableTcp();
-
-    this.remoteCommand = remoteCommand;
-    this.serverBindAddress = distConfig.getServerBindAddress();
-    this.enableNetworkPartitionDetection = distConfig.getEnableNetworkPartitionDetection();
-    this.memberTimeout = distConfig.getMemberTimeout();
-    this.refreshInterval = DistributedSystemConfig.DEFAULT_REFRESH_INTERVAL;
-    this.gfSecurityProperties = (Properties) distConfig.getSSLProperties().clone();
-  }
-
-  /**
-   * Zero-argument constructor to be used only by subclasses.
-   *
-   * @since GemFire 4.0
-   */
-  protected DistributedSystemConfigImpl() {
-
-  }
-
-  /**
-   * Creates a new <code>DistributedSystemConifgImpl</code> whose configuration is specified by the
-   * given <code>Properties</code> object.
-   */
-  protected DistributedSystemConfigImpl(Properties props) {
-    this(props, false);
-  }
-
-  /**
-   * Creates a new <code>DistributedSystemConifgImpl</code> whose configuration is specified by the
-   * given <code>Properties</code> object.
-   * 
-   * @param props The configuration properties specified by the caller
-   * @param ignoreGemFirePropsFile whether to skip loading distributed system properties from
-   *        gemfire.properties file
-   * 
-   * @since GemFire 6.5
-   */
-  protected DistributedSystemConfigImpl(Properties props, boolean ignoreGemFirePropsFile) {
-    this(new DistributionConfigImpl(filterOutAdminProperties(props), ignoreGemFirePropsFile),
-        DEFAULT_REMOTE_COMMAND);
-    String remoteCommand = props.getProperty(REMOTE_COMMAND_NAME);
-    if (remoteCommand != null) {
-      this.remoteCommand = remoteCommand;
-    }
-
-    String entityConfigXMLFile = props.getProperty(ENTITY_CONFIG_XML_FILE_NAME);
-    if (entityConfigXMLFile != null) {
-      this.entityConfigXMLFile = entityConfigXMLFile;
-    }
-
-    String refreshInterval = props.getProperty(REFRESH_INTERVAL_NAME);
-    if (refreshInterval != null) {
-      try {
-        this.refreshInterval = Integer.parseInt(refreshInterval);
-      } catch (NumberFormatException nfEx) {
-        throw new IllegalArgumentException(
-            LocalizedStrings.DistributedSystemConfigImpl_0_IS_NOT_A_VALID_INTEGER_1
-                .toLocalizedString(new Object[] {refreshInterval, REFRESH_INTERVAL_NAME}));
-      }
-    }
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Returns the <code>LogWriterI18n</code> to be used when administering the distributed system.
-   * Returns null if nothing has been provided via <code>setInternalLogWriter</code>.
-   *
-   * @since GemFire 4.0
-   */
-  public InternalLogWriter getInternalLogWriter() {
-    // LOG: used only for sharing between IDS, AdminDSImpl and AgentImpl -- to prevent multiple
-    // banners, etc.
-    synchronized (this) {
-      return this.logWriter;
-    }
-  }
-
-  /**
-   * Sets the <code>LogWriterI18n</code> to be used when administering the distributed system.
-   */
-  public void setInternalLogWriter(InternalLogWriter logWriter) {
-    // LOG: used only for sharing between IDS, AdminDSImpl and AgentImpl -- to prevent multiple
-    // banners, etc.
-    synchronized (this) {
-      this.logWriter = logWriter;
-    }
-  }
-
-  public LogConfig createLogConfig() {
-    return new LogConfig() {
-      @Override
-      public int getLogLevel() {
-        return LogWriterImpl.levelNameToCode(DistributedSystemConfigImpl.this.getLogLevel());
-      }
-
-      @Override
-      public File getLogFile() {
-        return new File(DistributedSystemConfigImpl.this.getLogFile());
-      }
-
-      @Override
-      public int getLogFileSizeLimit() {
-        return DistributedSystemConfigImpl.this.getLogFileSizeLimit();
-      }
-
-      @Override
-      public int getLogDiskSpaceLimit() {
-        return DistributedSystemConfigImpl.this.getLogDiskSpaceLimit();
-      }
-
-      @Override
-      public String getName() {
-        return DistributedSystemConfigImpl.this.getSystemName();
-      }
-
-      @Override
-      public String toLoggerString() {
-        return DistributedSystemConfigImpl.this.toString();
-      }
-    };
-  }
-
-  /**
-   * Marks this config object as "read only". Attempts to modify a config object will result in a
-   * {@link IllegalStateException} being thrown.
-   *
-   * @since GemFire 4.0
-   */
-  void setDistributedSystem(AdminDistributedSystemImpl system) {
-    this.system = system;
-  }
-
-  /**
-   * Checks to see if this config object is "read only". If it is, then an
-   * {@link IllegalStateException} is thrown.
-   *
-   * @since GemFire 4.0
-   */
-  protected void checkReadOnly() {
-    if (this.system != null) {
-      throw new IllegalStateException(
-          LocalizedStrings.DistributedSystemConfigImpl_A_DISTRIBUTEDSYSTEMCONFIG_OBJECT_CANNOT_BE_MODIFIED_AFTER_IT_HAS_BEEN_USED_TO_CREATE_AN_ADMINDISTRIBUTEDSYSTEM
-              .toLocalizedString());
-    }
-  }
-
-  public String getEntityConfigXMLFile() {
-    return this.entityConfigXMLFile;
-  }
-
-  public void setEntityConfigXMLFile(String xmlFile) {
-    checkReadOnly();
-    this.entityConfigXMLFile = xmlFile;
-    configChanged();
-  }
-
-  /**
-   * Parses the XML configuration file that describes managed entities.
-   *
-   * @throws AdminXmlException If a problem is encountered while parsing the XML file.
-   */
-  private void parseEntityConfigXMLFile() {
-    String fileName = this.entityConfigXMLFile;
-    File xmlFile = new File(fileName);
-    if (!xmlFile.exists()) {
-      if (DEFAULT_ENTITY_CONFIG_XML_FILE.equals(fileName)) {
-        // Default doesn't exist, no big deal
-        return;
-      } else {
-        throw new AdminXmlException(
-            LocalizedStrings.DistributedSystemConfigImpl_ENTITY_CONFIGURATION_XML_FILE_0_DOES_NOT_EXIST
-                .toLocalizedString(fileName));
-      }
-    }
-
-    try {
-      InputStream is = new FileInputStream(xmlFile);
-      try {
-        ManagedEntityConfigXmlParser.parse(is, this);
-      } finally {
-        is.close();
-      }
-    } catch (IOException ex) {
-      throw new AdminXmlException(
-          LocalizedStrings.DistributedSystemConfigImpl_WHILE_PARSING_0.toLocalizedString(fileName),
-          ex);
-    }
-  }
-
-  public String getSystemId() {
-    return this.systemId;
-  }
-
-  public void setSystemId(String systemId) {
-    checkReadOnly();
-    this.systemId = systemId;
-    configChanged();
-  }
-
-  /**
-   * Returns the multicast address for the system
-   */
-  public String getMcastAddress() {
-    return this.mcastAddress;
-  }
-
-  public void setMcastAddress(String mcastAddress) {
-    checkReadOnly();
-    this.mcastAddress = mcastAddress;
-    configChanged();
-  }
-
-  /**
-   * Returns the multicast port for the system
-   */
-  public int getMcastPort() {
-    return this.mcastPort;
-  }
-
-  public void setMcastPort(int mcastPort) {
-    checkReadOnly();
-    this.mcastPort = mcastPort;
-    configChanged();
-  }
-
-  public int getAckWaitThreshold() {
-    return this.ackWaitThreshold;
-  }
-
-  public void setAckWaitThreshold(int seconds) {
-    checkReadOnly();
-    this.ackWaitThreshold = seconds;
-    configChanged();
-  }
-
-  public int getAckSevereAlertThreshold() {
-    return this.ackSevereAlertThreshold;
-  }
-
-  public void setAckSevereAlertThreshold(int seconds) {
-    checkReadOnly();
-    this.ackSevereAlertThreshold = seconds;
-    configChanged();
-  }
-
-  /**
-   * Returns the comma-delimited list of locators for the system
-   */
-  public String getLocators() {
-    return this.locators;
-  }
-
-  public void setLocators(String locators) {
-    checkReadOnly();
-    if (locators == null) {
-      this.locators = "";
-    } else {
-      this.locators = locators;
-    }
-    configChanged();
-  }
-
-  /**
-   * Returns the value for membership-port-range
-   *
-   * @return the value for the Distributed System property membership-port-range
-   */
-  public String getMembershipPortRange() {
-    return this.membershipPortRange;
-  }
-
-  /**
-   * Sets the Distributed System property membership-port-range
-   *
-   * @param membershipPortRangeStr the value for membership-port-range given as two numbers
-   *        separated by a minus sign.
-   */
-  public void setMembershipPortRange(String membershipPortRangeStr) {
-    /*
-     * FIXME: Setting attributes in DistributedSystemConfig has no effect on DistributionConfig
-     * which is actually used for connection with DS. This is true for all such attributes. Should
-     * be addressed in the Admin Revamp if we want these 'set' calls to affect anything. Then we can
-     * use the validation code in DistributionConfigImpl code.
-     */
-    checkReadOnly();
-    if (membershipPortRangeStr == null) {
-      this.membershipPortRange = getMembershipPortRangeString(DEFAULT_MEMBERSHIP_PORT_RANGE);
-    } else {
-      try {
-        if (validateMembershipRange(membershipPortRangeStr)) {
-          this.membershipPortRange = membershipPortRangeStr;
-        } else {
-          throw new IllegalArgumentException(
-              LocalizedStrings.DistributedSystemConfigImpl_INVALID_VALUE_FOR_MEMBERSHIP_PORT_RANGE
-                  .toLocalizedString(
-                      new Object[] {membershipPortRangeStr, MEMBERSHIP_PORT_RANGE_NAME}));
-        }
-      } catch (Exception e) {
-        if (logger.isDebugEnabled()) {
-          logger.debug(e.getMessage(), e);
-        }
-      }
-    }
-  }
-
-  public void setTcpPort(int port) {
-    checkReadOnly();
-    this.tcpPort = port;
-    configChanged();
-  }
-
-  public int getTcpPort() {
-    return this.tcpPort;
-  }
-
-  /**
-   * Validates the given string - which is expected in the format as two numbers separated by a
-   * minus sign - in to an integer array of length 2 with first element as lower end & second
-   * element as upper end of the range.
-   *
-   * @param membershipPortRange membership-port-range given as two numbers separated by a minus
-   *        sign.
-   * @return true if the membership-port-range string is valid, false otherwise
-   */
-  private boolean validateMembershipRange(String membershipPortRange) {
-    int[] range = null;
-    if (membershipPortRange != null && membershipPortRange.trim().length() > 0) {
-      String[] splitted = membershipPortRange.split("-");
-      range = new int[2];
-      range[0] = Integer.parseInt(splitted[0].trim());
-      range[1] = Integer.parseInt(splitted[1].trim());
-      // NumberFormatException if any could be thrown
-
-      if (range[0] < 0 || range[0] >= range[1] || range[1] < 0 || range[1] > 65535) {
-        range = null;
-      }
-    }
-    return range != null;
-  }
-
-  /**
-   * @return the String representation of membershipPortRange with lower & upper limits of the port
-   *         range separated by '-' e.g. 1-65535
-   */
-  private static String getMembershipPortRangeString(int[] membershipPortRange) {
-    String membershipPortRangeString = "";
-    if (membershipPortRange != null && membershipPortRange.length == 2) {
-      membershipPortRangeString = membershipPortRange[0] + "-" + membershipPortRange[1];
-    }
-
-    return membershipPortRangeString;
-  }
-
-  public String getBindAddress() {
-    return this.bindAddress;
-  }
-
-  public void setBindAddress(String bindAddress) {
-    checkReadOnly();
-    basicSetBindAddress(bindAddress);
-    configChanged();
-  }
-
-  public String getServerBindAddress() {
-    return this.serverBindAddress;
-  }
-
-  public void setServerBindAddress(String bindAddress) {
-    checkReadOnly();
-    basicSetServerBindAddress(bindAddress);
-    configChanged();
-  }
-
-  public boolean getDisableTcp() {
-    return this.disableTcp;
-  }
-
-  public void setDisableTcp(boolean flag) {
-    checkReadOnly();
-    disableTcp = flag;
-    configChanged();
-  }
-
-  public void setEnableNetworkPartitionDetection(boolean newValue) {
-    checkReadOnly();
-    this.enableNetworkPartitionDetection = newValue;
-    configChanged();
-  }
-
-  public boolean getEnableNetworkPartitionDetection() {
-    return this.enableNetworkPartitionDetection;
-  }
-
-  public void setDisableAutoReconnect(boolean newValue) {
-    checkReadOnly();
-    this.disableAutoReconnect = newValue;
-    configChanged();
-  }
-
-  public boolean getDisableAutoReconnect() {
-    return this.disableAutoReconnect;
-  }
-
-  public int getMemberTimeout() {
-    return this.memberTimeout;
-  }
-
-  public void setMemberTimeout(int value) {
-    checkReadOnly();
-    this.memberTimeout = value;
-    configChanged();
-  }
-
-  private void basicSetBindAddress(String bindAddress) {
-    if (!validateBindAddress(bindAddress)) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.DistributedSystemConfigImpl_INVALID_BIND_ADDRESS_0
-              .toLocalizedString(bindAddress));
-    }
-    this.bindAddress = bindAddress;
-  }
-
-  private void basicSetServerBindAddress(String bindAddress) {
-    if (!validateBindAddress(bindAddress)) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.DistributedSystemConfigImpl_INVALID_BIND_ADDRESS_0
-              .toLocalizedString(bindAddress));
-    }
-    this.serverBindAddress = bindAddress;
-  }
-
-  /**
-   * Returns the remote command setting to use for remote administration
-   */
-  public String getRemoteCommand() {
-    return this.remoteCommand;
-  }
-
-  /**
-   * Sets the remote command for this config object. This attribute may be modified after this
-   * config object has been used to create an admin distributed system.
-   */
-  public void setRemoteCommand(String remoteCommand) {
-    if (!ALLOW_ALL_REMOTE_COMMANDS) {
-      checkRemoteCommand(remoteCommand);
-    }
-    this.remoteCommand = remoteCommand;
-    configChanged();
-  }
-
-  private static final boolean ALLOW_ALL_REMOTE_COMMANDS =
-      Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "admin.ALLOW_ALL_REMOTE_COMMANDS");
-  private static final String[] LEGAL_REMOTE_COMMANDS = {"rsh", "ssh"};
-  private static final String ILLEGAL_REMOTE_COMMAND_RSH_OR_SSH =
-      "Allowed remote commands include \"rsh {HOST} {CMD}\" or \"ssh {HOST} {CMD}\" with valid rsh or ssh switches. Invalid: ";
-
-  private final void checkRemoteCommand(final String remoteCommand) {
-    if (remoteCommand == null || remoteCommand.isEmpty()) {
-      return;
-    }
-    final String command = remoteCommand.toLowerCase().trim();
-    if (!command.contains("{host}") || !command.contains("{cmd}")) {
-      throw new IllegalArgumentException(ILLEGAL_REMOTE_COMMAND_RSH_OR_SSH + remoteCommand);
-    }
-
-    final StringTokenizer tokenizer = new StringTokenizer(command, " ");
-    final ArrayList<String> array = new ArrayList<String>();
-    for (int i = 0; tokenizer.hasMoreTokens(); i++) {
-      String string = tokenizer.nextToken();
-      if (i == 0) {
-        // first element must be rsh or ssh
-        boolean found = false;
-        for (int j = 0; j < LEGAL_REMOTE_COMMANDS.length; j++) {
-          if (string.contains(LEGAL_REMOTE_COMMANDS[j])) {
-            // verify command is at end of string
-            if (!(string.endsWith(LEGAL_REMOTE_COMMANDS[j])
-                || string.endsWith(LEGAL_REMOTE_COMMANDS[j] + ".exe"))) {
-              throw new IllegalArgumentException(ILLEGAL_REMOTE_COMMAND_RSH_OR_SSH + remoteCommand);
-            }
-            found = true;
-          }
-        }
-        if (!found) {
-          throw new IllegalArgumentException(ILLEGAL_REMOTE_COMMAND_RSH_OR_SSH + remoteCommand);
-        }
-      } else {
-        final boolean isSwitch = string.startsWith("-");
-        final boolean isHostOrCmd = string.equals("{host}") || string.equals("{cmd}");
-
-        // additional elements must be switches or values-for-switches or {host} or user@{host} or
-        // {cmd}
-        if (!isSwitch && !isHostOrCmd) {
-          final String previous =
-              (array == null || array.isEmpty()) ? null : array.get(array.size() - 1);
-          final boolean isValueForSwitch = previous != null && previous.startsWith("-");
-          final boolean isHostWithUser = string.contains("@") && string.endsWith("{host}");
-
-          if (!(isValueForSwitch || isHostWithUser)) {
-            throw new IllegalArgumentException(ILLEGAL_REMOTE_COMMAND_RSH_OR_SSH + remoteCommand);
-          }
-        }
-      }
-      array.add(string);
-    }
-  }
-
-  public String getSystemName() {
-    return this.systemName;
-  }
-
-  public void setSystemName(final String systemName) {
-    checkReadOnly();
-    this.systemName = systemName;
-    configChanged();
-  }
-
-  /**
-   * Returns an array of configurations for statically known CacheServers
-   *
-   * @since GemFire 4.0
-   */
-  public CacheServerConfig[] getCacheServerConfigs() {
-    return (CacheServerConfig[]) this.cacheServerConfigs
-        .toArray(new CacheServerConfig[this.cacheServerConfigs.size()]);
-  }
-
-  public CacheVmConfig[] getCacheVmConfigs() {
-    return (CacheVmConfig[]) this.cacheServerConfigs
-        .toArray(new CacheVmConfig[this.cacheServerConfigs.size()]);
-  }
-
-  /**
-   * Creates the configuration for a CacheServer
-   *
-   * @since GemFire 4.0
-   */
-  public CacheServerConfig createCacheServerConfig() {
-    CacheServerConfig config = new CacheServerConfigImpl();
-    addCacheServerConfig(config);
-    return config;
-  }
-
-  public CacheVmConfig createCacheVmConfig() {
-    return (CacheVmConfig) createCacheServerConfig();
-  }
-
-  /**
-   * Adds the configuration for a CacheServer
-   *
-   * @since GemFire 4.0
-   */
-  private void addCacheServerConfig(CacheServerConfig managerConfig) {
-    checkReadOnly();
-
-    if (managerConfig == null)
-      return;
-    for (Iterator iter = this.cacheServerConfigs.iterator(); iter.hasNext();) {
-      CacheServerConfigImpl impl = (CacheServerConfigImpl) iter.next();
-      if (impl.equals(managerConfig)) {
-        return;
-      }
-    }
-    this.cacheServerConfigs.add(managerConfig);
-    configChanged();
-  }
-
-  /**
-   * Removes the configuration for a CacheServer
-   *
-   * @since GemFire 4.0
-   */
-  public void removeCacheServerConfig(CacheServerConfig managerConfig) {
-    removeCacheVmConfig((CacheVmConfig) managerConfig);
-  }
-
-  public void removeCacheVmConfig(CacheVmConfig managerConfig) {
-    checkReadOnly();
-    this.cacheServerConfigs.remove(managerConfig);
-    configChanged();
-  }
-
-  /**
-   * Returns the configurations of all managed distribution locators
-   */
-  public DistributionLocatorConfig[] getDistributionLocatorConfigs() {
-    if (this.system != null) {
-      DistributionLocator[] locators = this.system.getDistributionLocators();
-      DistributionLocatorConfig[] configs = new DistributionLocatorConfig[locators.length];
-      for (int i = 0; i < locators.length; i++) {
-        configs[i] = locators[i].getConfig();
-      }
-      return configs;
-
-    } else {
-      Object[] array = new DistributionLocatorConfig[this.locatorConfigs.size()];
-      return (DistributionLocatorConfig[]) this.locatorConfigs.toArray(array);
-    }
-  }
-
-  /**
-   * Creates the configuration for a DistributionLocator
-   */
-  public DistributionLocatorConfig createDistributionLocatorConfig() {
-    checkReadOnly();
-    DistributionLocatorConfig config = new DistributionLocatorConfigImpl();
-    addDistributionLocatorConfig(config);
-    return config;
-  }
-
-  /**
-   * Adds the configuration for a DistributionLocator
-   */
-  private void addDistributionLocatorConfig(DistributionLocatorConfig config) {
-    checkReadOnly();
-    this.locatorConfigs.add(config);
-    configChanged();
-  }
-
-  /**
-   * Removes the configuration for a DistributionLocator
-   */
-  public void removeDistributionLocatorConfig(DistributionLocatorConfig config) {
-    checkReadOnly();
-    this.locatorConfigs.remove(config);
-    configChanged();
-  }
-
-  /**
-   * Validates the bind address. The address may be a host name or IP address, but it must not be
-   * empty and must be usable for creating an InetAddress. Cannot have a leading '/' (which
-   * InetAddress.toString() produces).
-   *
-   * @param bindAddress host name or IP address to validate
-   */
-  public static boolean validateBindAddress(String bindAddress) {
-    if (bindAddress == null || bindAddress.length() == 0)
-      return true;
-    if (InetAddressUtil.validateHost(bindAddress) == null)
-      return false;
-    return true;
-  }
-
-  public synchronized void configChanged() {
-    ConfigListener[] clients = null;
-    synchronized (this.listeners) {
-      clients = (ConfigListener[]) listeners.toArray(new ConfigListener[this.listeners.size()]);
-    }
-    for (int i = 0; i < clients.length; i++) {
-      try {
-        clients[i].configChanged(this);
-      } catch (Exception e) {
-        logger.warn(e.getMessage(), e);
-      }
-    }
-  }
-
-  /**
-   * Registers listener for notification of changes in this config.
-   */
-  public void addListener(ConfigListener listener) {
-    synchronized (this.listeners) {
-      this.listeners.add(listener);
-    }
-  }
-
-  /**
-   * Removes previously registered listener of this config.
-   */
-  public void removeListener(ConfigListener listener) {
-    synchronized (this.listeners) {
-      this.listeners.remove(listener);
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // SSL support...
-  // -------------------------------------------------------------------------
-  private boolean sslEnabled = DistributionConfig.DEFAULT_SSL_ENABLED;
-  private String sslProtocols = DistributionConfig.DEFAULT_SSL_PROTOCOLS;
-  private String sslCiphers = DistributionConfig.DEFAULT_SSL_CIPHERS;
-  private boolean sslAuthenticationRequired = DistributionConfig.DEFAULT_SSL_REQUIRE_AUTHENTICATION;
-  private Properties sslProperties = new Properties();
-
-  public boolean isSSLEnabled() {
-    return this.sslEnabled;
-  }
-
-  public void setSSLEnabled(boolean enabled) {
-    checkReadOnly();
-    this.sslEnabled = enabled;
-    configChanged();
-  }
-
-  public String getSSLProtocols() {
-    return this.sslProtocols;
-  }
-
-  public void setSSLProtocols(String protocols) {
-    checkReadOnly();
-    this.sslProtocols = protocols;
-    configChanged();
-  }
-
-  public String getSSLCiphers() {
-    return this.sslCiphers;
-  }
-
-  public void setSSLCiphers(String ciphers) {
-    checkReadOnly();
-    this.sslCiphers = ciphers;
-    configChanged();
-  }
-
-  public boolean isSSLAuthenticationRequired() {
-    return this.sslAuthenticationRequired;
-  }
-
-  public void setSSLAuthenticationRequired(boolean authRequired) {
-    checkReadOnly();
-    this.sslAuthenticationRequired = authRequired;
-    configChanged();
-  }
-
-  public Properties getSSLProperties() {
-    return this.sslProperties;
-  }
-
-  public void setSSLProperties(Properties sslProperties) {
-    checkReadOnly();
-    this.sslProperties = sslProperties;
-    if (this.sslProperties == null) {
-      this.sslProperties = new Properties();
-    }
-    configChanged();
-  }
-
-  public void addSSLProperty(String key, String value) {
-    checkReadOnly();
-    this.sslProperties.put(key, value);
-    configChanged();
-  }
-
-  public void removeSSLProperty(String key) {
-    checkReadOnly();
-    this.sslProperties.remove(key);
-    configChanged();
-  }
-
-  /**
-   * @return the gfSecurityProperties
-   * @since GemFire 6.6.3
-   */
-  public Properties getGfSecurityProperties() {
-    return gfSecurityProperties;
-  }
-
-  public String getLogFile() {
-    return this.logFile;
-  }
-
-  public void setLogFile(String logFile) {
-    checkReadOnly();
-    this.logFile = logFile;
-    configChanged();
-  }
-
-  public String getLogLevel() {
-    return this.logLevel;
-  }
-
-  public void setLogLevel(String logLevel) {
-    checkReadOnly();
-    this.logLevel = logLevel;
-    configChanged();
-  }
-
-  public int getLogDiskSpaceLimit() {
-    return this.logDiskSpaceLimit;
-  }
-
-  public void setLogDiskSpaceLimit(int limit) {
-    checkReadOnly();
-    this.logDiskSpaceLimit = limit;
-    configChanged();
-  }
-
-  public int getLogFileSizeLimit() {
-    return this.logFileSizeLimit;
-  }
-
-  public void setLogFileSizeLimit(int limit) {
-    checkReadOnly();
-    this.logFileSizeLimit = limit;
-    configChanged();
-  }
-
-  /**
-   * Returns the refreshInterval in seconds
-   */
-  public int getRefreshInterval() {
-    return this.refreshInterval;
-  }
-
-  /**
-   * Sets the refreshInterval in seconds
-   */
-  public void setRefreshInterval(int timeInSecs) {
-    checkReadOnly();
-    this.refreshInterval = timeInSecs;
-    configChanged();
-  }
-
-  /**
-   * Makes sure that the mcast port and locators are correct and consistent.
-   *
-   * @throws IllegalArgumentException If configuration is not valid
-   */
-  public void validate() {
-    if (this.getMcastPort() < MIN_MCAST_PORT || this.getMcastPort() > MAX_MCAST_PORT) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.DistributedSystemConfigImpl_MCASTPORT_MUST_BE_AN_INTEGER_INCLUSIVELY_BETWEEN_0_AND_1
-              .toLocalizedString(
-                  new Object[] {Integer.valueOf(MIN_MCAST_PORT), Integer.valueOf(MAX_MCAST_PORT)}));
-    }
-
-    // disabled in 5.1 - multicast and locators can be used together
-    // if (!DEFAULT_LOCATORS.equals(this.getLocators()) &&
-    // this.mcastPort > 0) {
-    // throw new IllegalArgumentException(
-    // "mcastPort must be zero when locators are specified");
-    // }
-
-    LogWriterImpl.levelNameToCode(this.logLevel);
-
-    if (this.logFileSizeLimit < MIN_LOG_FILE_SIZE_LIMIT
-        || this.logFileSizeLimit > MAX_LOG_FILE_SIZE_LIMIT) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.DistributedSystemConfigImpl_LOGFILESIZELIMIT_MUST_BE_AN_INTEGER_BETWEEN_0_AND_1
-              .toLocalizedString(new Object[] {Integer.valueOf(MIN_LOG_FILE_SIZE_LIMIT),
-                  Integer.valueOf(MAX_LOG_FILE_SIZE_LIMIT)}));
-    }
-
-    if (this.logDiskSpaceLimit < MIN_LOG_DISK_SPACE_LIMIT
-        || this.logDiskSpaceLimit > MAX_LOG_DISK_SPACE_LIMIT) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.DistributedSystemConfigImpl_LOGDISKSPACELIMIT_MUST_BE_AN_INTEGER_BETWEEN_0_AND_1
-              .toLocalizedString(new Object[] {Integer.valueOf(MIN_LOG_DISK_SPACE_LIMIT),
-                  Integer.valueOf(MAX_LOG_DISK_SPACE_LIMIT)}));
-    }
-
-    parseEntityConfigXMLFile();
-  }
-
-  /**
-   * Makes a deep copy of this config object.
-   */
-  @Override
-  public Object clone() throws CloneNotSupportedException {
-    DistributedSystemConfigImpl other = (DistributedSystemConfigImpl) super.clone();
-    other.system = null;
-    other.cacheServerConfigs = new HashSet();
-    other.locatorConfigs = new HashSet();
-
-    DistributionLocatorConfig[] myLocators = this.getDistributionLocatorConfigs();
-    for (int i = 0; i < myLocators.length; i++) {
-      DistributionLocatorConfig locator = myLocators[i];
-      other.addDistributionLocatorConfig((DistributionLocatorConfig) locator.clone());
-    }
-
-    CacheServerConfig[] myCacheServers = this.getCacheServerConfigs();
-    for (int i = 0; i < myCacheServers.length; i++) {
-      CacheServerConfig locator = myCacheServers[i];
-      other.addCacheServerConfig((CacheServerConfig) locator.clone());
-    }
-
-    return other;
-  }
-
-  @Override
-  public String toString() {
-    StringBuffer buf = new StringBuffer(1000);
-    String lf = System.getProperty("line.separator");
-    if (lf == null)
-      lf = ",";
-
-    buf.append("DistributedSystemConfig(");
-    buf.append(lf);
-    buf.append("  system-name=");
-    buf.append(String.valueOf(this.systemName));
-    buf.append(lf);
-    buf.append("  " + MCAST_ADDRESS + "=");
-    buf.append(String.valueOf(this.mcastAddress));
-    buf.append(lf);
-    buf.append("  " + MCAST_PORT + "=");
-    buf.append(String.valueOf(this.mcastPort));
-    buf.append(lf);
-    buf.append("  " + LOCATORS + "=");
-    buf.append(String.valueOf(this.locators));
-    buf.append(lf);
-    buf.append("  " + MEMBERSHIP_PORT_RANGE_NAME + "=");
-    buf.append(getMembershipPortRange());
-    buf.append(lf);
-    buf.append("  " + BIND_ADDRESS + "=");
-    buf.append(String.valueOf(this.bindAddress));
-    buf.append(lf);
-    buf.append("  " + TCP_PORT + "=" + this.tcpPort);
-    buf.append(lf);
-    buf.append("  " + DISABLE_TCP + "=");
-    buf.append(String.valueOf(this.disableTcp));
-    buf.append(lf);
-    buf.append("  " + DISABLE_AUTO_RECONNECT + "=");
-    buf.append(String.valueOf(this.disableAutoReconnect));
-    buf.append(lf);
-    buf.append("  " + REMOTE_COMMAND_NAME + "=");
-    buf.append(String.valueOf(this.remoteCommand));
-    buf.append(lf);
-    buf.append("  " + CLUSTER_SSL_ENABLED + "=");
-    buf.append(String.valueOf(this.sslEnabled));
-    buf.append(lf);
-    buf.append("  " + CLUSTER_SSL_CIPHERS + "=");
-    buf.append(String.valueOf(this.sslCiphers));
-    buf.append(lf);
-    buf.append("  " + CLUSTER_SSL_PROTOCOLS + "=");
-    buf.append(String.valueOf(this.sslProtocols));
-    buf.append(lf);
-    buf.append("  " + CLUSTER_SSL_REQUIRE_AUTHENTICATION + "=");
-    buf.append(String.valueOf(this.sslAuthenticationRequired));
-    buf.append(lf);
-    buf.append("  " + LOG_FILE_NAME + "=");
-    buf.append(String.valueOf(this.logFile));
-    buf.append(lf);
-    buf.append("  " + LOG_LEVEL_NAME + "=");
-    buf.append(String.valueOf(this.logLevel));
-    buf.append(lf);
-    buf.append("  " + LOG_DISK_SPACE_LIMIT_NAME + "=");
-    buf.append(String.valueOf(this.logDiskSpaceLimit));
-    buf.append(lf);
-    buf.append("  " + LOG_FILE_SIZE_LIMIT_NAME + "=");
-    buf.append(String.valueOf(this.logFileSizeLimit));
-    buf.append(lf);
-    buf.append("  " + REFRESH_INTERVAL_NAME + "=");
-    buf.append(String.valueOf(this.refreshInterval));
-    buf.append(")");
-    return buf.toString();
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthConfigImpl.java
deleted file mode 100644
index 41b7f12..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthConfigImpl.java
+++ /dev/null
@@ -1,53 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-
-/**
- * The implementation of <code>DistributedSystemHealthConfig</code>. Note that because it never
- * leaves the management VM, it is not <code>Serializable</code> and is not part of the
- * {@link GemFireHealthConfigImpl} class hierarchy.
- *
- *
- * @since GemFire 3.5
- */
-public class DistributedSystemHealthConfigImpl implements DistributedSystemHealthConfig {
-
-  /**
-   * The maximum number of application members that can unexceptedly leave a healthy the distributed
-   * system.
-   */
-  private long maxDepartedApplications = DEFAULT_MAX_DEPARTED_APPLICATIONS;
-
-  ////////////////////// Constructors //////////////////////
-
-  /**
-   * Creates a new <code>DistributedSystemHealthConfigImpl</code> with the default configuration.
-   */
-  protected DistributedSystemHealthConfigImpl() {
-
-  }
-
-  ///////////////////// Instance Methods /////////////////////
-
-  public long getMaxDepartedApplications() {
-    return this.maxDepartedApplications;
-  }
-
-  public void setMaxDepartedApplications(long maxDepartedApplications) {
-    this.maxDepartedApplications = maxDepartedApplications;
-  }
-}


[07/50] [abbrv] incubator-geode git commit: GEODE-2014: Upgrade Swagger libraries

Posted by kl...@apache.org.
GEODE-2014: Upgrade Swagger libraries

* Updated gradle exclusions to remove items no longer used.
* Updated distribution LICENSE file
* Corrected LICENSE file as jquery-ui is still used in pulse, updated version
* Updated rat configuration.
* This closes #271

(cherry picked from commit a6018ab)


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

Branch: refs/heads/feature/GEODE-288
Commit: ee0666a3ca5a8807648eb44f0c844c8aefde01fe
Parents: 1d9a4ed
Author: Kevin Duling <kd...@pivotal.io>
Authored: Tue Oct 25 15:52:56 2016 -0700
Committer: Jinmei Liao <ji...@pivotal.io>
Committed: Wed Oct 26 09:30:04 2016 -0700

----------------------------------------------------------------------
 LICENSE                                       |  5 +--
 geode-assembly/src/main/dist/LICENSE          | 40 ++--------------------
 geode-web-api/src/main/webapp/docs/index.html | 13 +++++++
 gradle/rat.gradle                             | 19 ----------
 4 files changed, 16 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee0666a3/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 3f777c7..231239b 100644
--- a/LICENSE
+++ b/LICENSE
@@ -346,11 +346,8 @@ Apache Geode bundles the following files under the MIT license:
   - jQuery UI MultiSelect Widget v1.14pre
     (http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/),
     Copyright (c) 2011 Eric Hynds
-  - jQuery UI v1.8.18 (http://jqueryui.com/about), Copyright (c) jQuery
+  - jQuery UI v1.10.2 (http://jqueryui.com/about), Copyright (c) jQuery
     Foundation and other contributors, http://jquery.org
-  - jQuery Wiggle (https://github.com/wilhelm-murdoch/jQuery-Wiggle),
-    Copyright (c) 2011 Wilhelm Murdoch <wi...@gmail.com>,
-     TheDrunkenEpic <http://www.thedrunkenepic.com>
   - jScrollPane (http://jscrollpane.kelvinluck.com/), Copyright (c) 2010
     Kelvin Luck
   - matchMedia() polyfill (https://github.com/paulirish/matchMedia.js),

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee0666a3/geode-assembly/src/main/dist/LICENSE
----------------------------------------------------------------------
diff --git a/geode-assembly/src/main/dist/LICENSE b/geode-assembly/src/main/dist/LICENSE
index 04ce74c..92e95b3 100644
--- a/geode-assembly/src/main/dist/LICENSE
+++ b/geode-assembly/src/main/dist/LICENSE
@@ -221,8 +221,6 @@ Apache Geode bundles the following files under the BSD 3-Clause License:
     Copyright (c) 2002-2007 Marc Prud'hommeaux.
   - Antlr v2.7.7 (http://www.antlr.org), Copyright (c) 2012 Terrence Parr
     and Sam Harwell
-  - highlight.js v7.3 (https://highlightjs.org), Copyright (c) 2006, Ivan
-    Sagalaev
   - JLine v2.12 (http://jline.sourceforge.net), Copyright (c) 2002-2006,
     Marc Prud'hommeaux <mw...@cornell.edu>
   - jQuery Sparklines v2.0 (http://omnipotent.net/jquery.sparkline/),
@@ -597,26 +595,6 @@ Federal Courts of the Northern District of California and the state courts
 of the State of California, with venue lying in Santa Clara County,
 California.
 
----------------------------------------------------------------------------
-The ISC License (http://opensource.org/licenses/ISC)
----------------------------------------------------------------------------
-
-Apache Geode bundles the following file under the ISC license:
-
-  - Shred (https://github.com/pandastrike/shred), Copyright (c) 2012-2015
-    Panda Strike, LLC and Dan Yoder <da...@pandastrike.com>
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 ---------------------------------------------------------------------------
 The JSON License (http://www.json.org/license.html)
@@ -653,16 +631,12 @@ The MIT License (http://opensource.org/licenses/mit-license.html)
 
 Apache Geode bundles the following files under the MIT license:
 
-  - Backbone.js v0.9.2 (http://backbonejs.org), Copyright (c) 2010-2012
-    Jeremy Ashkenas, DocumentCloud Inc.
   - Bootflat v1.0.1 (http://bootflat.github.io/), Copyright (c) 2014
     bootflat
   - Bootstrap v3.0.0 (http://getbootstrap.com/), Copyright (c) 2011-2016
     Twitter, Inc.
   - Font Awesome v4.0.3 (code files) (http://fontawesome.io), Copyright (c)
     Dave Gandy
-  - Handlebars v1.0.0 (http://handlebarsjs.com), Copyright (c) 2011, Yehuda
-    Katz
   - HeadJS v0.96 (http://headjs.com/), Copyright (c) 2013 Tero Piirainen
     (tipiirai)
   - HTML5 Shiv v3.6.2pre (https://github.com/aFarkas/html5shiv), Copyright
@@ -673,10 +647,8 @@ Apache Geode bundles the following files under the MIT license:
     Copyright (c) 2011 Sencha Inc.
   - JOpt Simple (http://pholser.github.io/jopt-simple/), Copyright (c)
     2004-2015 Paul R. Holser, Jr.
-  - jQuery JavaScript Library v1.7.2, v1.8.0 (https://jquery.com), Copyright (c)
+  - jQuery JavaScript Library v1.7.2 (https://jquery.com), Copyright (c)
     jQuery Foundation and other contributors, http://jquery.org
-  - jQuery BBQ v1.2.1 (http://benalman.com/projects/jquery-bbq-plugin/),
-    Copyright (c) 2010, "Cowboy" Ben Alman
   - jQuery.i18n.properties v1.0.x
     (https://github.com/jquery-i18n-properties/jquery-i18n-properties),
     Copyright (c) 2011 Nuno Miguel Correia Serra Fernandes
@@ -687,16 +659,11 @@ Apache Geode bundles the following files under the MIT license:
     Brandon Aaron
   - jQuery Placeholder (http://webcloud.se), Copyright (c) 2010 Daniel
     Stocks
-  - jQuery-slideto (https://github.com/Sleavely/jQuery-slideto), Copyright
-    (c) 2015 Joakim Hedlund
   - jQuery UI MultiSelect Widget v1.14pre
     (http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/),
     Copyright (c) 2011 Eric Hynds
-  - jQuery UI v1.8.18 (http://jqueryui.com/about), Copyright (c) jQuery
+  - jQuery UI v1.10.2 (http://jqueryui.com/about), Copyright (c) jQuery
     Foundation and other contributors, http://jquery.org
-  - jQuery Wiggle (https://github.com/wilhelm-murdoch/jQuery-Wiggle),
-    Copyright (c) 2011 Wilhelm Murdoch <wi...@gmail.com>,
-    TheDrunkenEpic <http://www.thedrunkenepic.com>
   - jScrollPane (http://jscrollpane.kelvinluck.com/), Copyright (c) 2010
     Kelvin Luck
   - matchMedia() polyfill (https://github.com/paulirish/matchMedia.js),
@@ -716,8 +683,6 @@ Apache Geode bundles the following files under the MIT license:
     contributors
   - Timeago v1.3.0 (http://timeago.yarp.com), Copyright (c) 2008-2015 Ryan
     McGeary
-  - Underscore (http://underscorejs.org), Copyright (c) 2009-2016 Jeremy
-    Ashkenas, DocumentCloud, and Investigative Reporters & Editors
   - zTree v3.5.02 (http://zTree.me/), Copyright (c) 2010 Hunter.z
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -803,7 +768,6 @@ domain:
   - AOP Alliance v1.0 (http://aopalliance.sourceforge.net)
   - CompactConcurrentHashSet2, derived from JSR-166 ConcurrentHashMap v1.43
     (http://gee.cs.oswego.edu/dl/concurrency-interest).
-  - Reset CSS (http://meyerweb.com/eric/tools/css/reset/)
   - tooltip.js v1.2.6 (https://github.com/jquerytools/jquerytools)
 
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee0666a3/geode-web-api/src/main/webapp/docs/index.html
----------------------------------------------------------------------
diff --git a/geode-web-api/src/main/webapp/docs/index.html b/geode-web-api/src/main/webapp/docs/index.html
index 021fbc2..99089b4 100644
--- a/geode-web-api/src/main/webapp/docs/index.html
+++ b/geode-web-api/src/main/webapp/docs/index.html
@@ -1 +1,14 @@
+<!-- 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. -->
+
 <meta http-equiv="refresh" content="0; URL='/geode/swagger-ui.html'"/>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee0666a3/gradle/rat.gradle
----------------------------------------------------------------------
diff --git a/gradle/rat.gradle b/gradle/rat.gradle
index 990ff63..e9fc70f 100644
--- a/gradle/rat.gradle
+++ b/gradle/rat.gradle
@@ -154,7 +154,6 @@ rat {
     // --- Other Licenses ---
 
     // Public Domain http://meyerweb.com/eric/tools/css/reset/
-    'geode-web-api/src/main/webapp/docs/css/reset.css',
     'geode-pulse/src/main/webapp/scripts/lib/tooltip.js',
 
     // JSON License - permissive, used for Good, not Evil
@@ -178,12 +177,6 @@ rat {
     'geode-json/src/main/java/org/json/XMLTokener.java',
 
     // MIT License
-    'geode-web-api/src/main/webapp/docs/lib/backbone-min.js',
-    'geode-web-api/src/main/webapp/docs/lib/jquery-1.8.0.min.js',
-    'geode-web-api/src/main/webapp/docs/lib/jquery.ba-bbq.min.js',
-    'geode-web-api/src/main/webapp/docs/lib/jquery.slideto.min.js',
-    'geode-web-api/src/main/webapp/docs/lib/jquery.wiggle.min.js',
-    'geode-web-api/src/main/webapp/docs/lib/underscore-min.js',
     'geode-site/src/jbake/**',
     'geode-pulse/src/main/webapp/scripts/lib/jquery.jqGrid.src.js',
     'geode-pulse/src/main/webapp/scripts/lib/grid.locale-en.js',
@@ -209,23 +202,11 @@ rat {
     'geode-pulse/src/main/webapp/css/jquery.ztreestyle.css',
     'geode-pulse/src/main/webapp/css/jquery-ui.css',
 
-    // MIT or ISC
-    'geode-web-api/src/main/webapp/docs/lib/shred.bundle.js',
-    'geode-web-api/src/main/webapp/docs/lib/shred/content.js',
-
     // BSD License
-    'geode-web-api/src/main/webapp/docs/lib/highlight.7.3.pack.js',
     'geode-core/src/main/java/org/apache/geode/management/internal/cli/shell/jline/ANSIBuffer.java',
     'geode-pulse/src/main/webapp/scripts/lib/jquery.sparkline.js',
 
     // Apache License
-    'geode-web-api/src/main/webapp/docs/o2c.html',
-    'geode-web-api/src/main/webapp/docs/index.html',
-    'geode-web-api/src/main/webapp/docs/lib/swagger-oauth.js',
-    'geode-web-api/src/main/webapp/docs/lib/swagger.js',
-    'geode-web-api/src/main/webapp/docs/css/screen.css',
-    'geode-web-api/src/main/webapp/docs/swagger-ui.js',
-    'geode-web-api/src/main/webapp/docs/swagger-ui.min.js',
     'geode-pulse/src/main/webapp/scripts/multiselect/prettify.js',
 
     // MX4J License


[24/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionImpl.java
new file mode 100644
index 0000000..87a06b8
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionImpl.java
@@ -0,0 +1,372 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.cache.*;
+// import org.apache.geode.internal.Assert;
+// import org.apache.geode.internal.admin.*;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.SystemMemberRegion;
+import org.apache.geode.internal.admin.remote.*;
+
+import java.io.File;
+import java.util.*;
+
+/**
+ * View of a region in a GemFire system member's cache.
+ *
+ * @since GemFire 3.5
+ */
+public class SystemMemberRegionImpl implements SystemMemberRegion {
+
+  private AdminRegion r;
+  private RegionAttributes ra;
+  private CacheStatistics rs;
+  private Set subregionNames;
+  private Set subregionFullPaths;
+  private int entryCount;
+  private int subregionCount;
+
+  /** The cache to which this region belongs */
+  private final SystemMemberCacheImpl cache;
+
+  // constructors
+  public SystemMemberRegionImpl(SystemMemberCacheImpl cache, Region r) {
+    this.cache = cache;
+    this.r = (AdminRegion) r;
+  }
+
+  private void refreshFields() {
+    this.ra = this.r.getAttributes();
+    if (getStatisticsEnabled() && !this.ra.getDataPolicy().withPartitioning()) {
+      this.rs = this.r.getStatistics();
+    } else {
+      this.rs = null;
+    }
+    { // set subregionNames
+      Set s = this.r.subregions(false);
+      Set names = new TreeSet();
+      Set paths = new TreeSet();
+      Iterator it = s.iterator();
+      while (it.hasNext()) {
+        Region r = (Region) it.next();
+        String name = r.getName();
+        names.add(name);
+        paths.add(this.getFullPath() + Region.SEPARATOR_CHAR + name);
+      }
+      this.subregionNames = names;
+      this.subregionFullPaths = paths;
+    }
+    try {
+      int[] sizes = this.r.sizes();
+      this.entryCount = sizes[0];
+      this.subregionCount = sizes[1];
+    } catch (CacheException ignore) {
+      this.entryCount = 0;
+      this.subregionCount = 0;
+    }
+  }
+
+  // attributes
+  public String getName() {
+    return this.r.getName();
+  }
+
+  public String getFullPath() {
+    return this.r.getFullPath();
+  }
+
+  public java.util.Set getSubregionNames() {
+    return this.subregionNames;
+  }
+
+  public java.util.Set getSubregionFullPaths() {
+    return this.subregionFullPaths;
+  }
+
+  public String getUserAttribute() {
+    return (String) r.getUserAttribute();
+  }
+
+  public String getCacheLoader() {
+    Object o = this.ra.getCacheLoader();
+    if (o == null) {
+      return "";
+    } else {
+      return o.toString();
+    }
+  }
+
+  public String getCacheWriter() {
+    Object o = this.ra.getCacheWriter();
+    if (o == null) {
+      return "";
+    } else {
+      return o.toString();
+    }
+  }
+
+  public String getKeyConstraint() {
+    Class constraint = this.ra.getKeyConstraint();
+    if (constraint == null) {
+      return "";
+    } else {
+      return constraint.getName();
+    }
+  }
+
+  public String getValueConstraint() {
+    Class constraint = this.ra.getValueConstraint();
+    if (constraint == null) {
+      return "";
+    } else {
+      return constraint.getName();
+    }
+  }
+
+  public boolean getEarlyAck() {
+    return this.ra.getEarlyAck();
+  }
+
+  public int getRegionTimeToLiveTimeLimit() {
+    return this.ra.getRegionTimeToLive().getTimeout();
+  }
+
+  public ExpirationAction getRegionTimeToLiveAction() {
+    return this.ra.getRegionTimeToLive().getAction();
+  }
+
+  public int getEntryTimeToLiveTimeLimit() {
+    return this.ra.getEntryTimeToLive().getTimeout();
+  }
+
+  public ExpirationAction getEntryTimeToLiveAction() {
+    return this.ra.getEntryTimeToLive().getAction();
+  }
+
+  public String getCustomEntryTimeToLive() {
+    Object o = this.ra.getCustomEntryTimeToLive();
+    if (o == null) {
+      return "";
+    } else {
+      return o.toString();
+    }
+  }
+
+  public int getRegionIdleTimeoutTimeLimit() {
+    return this.ra.getRegionIdleTimeout().getTimeout();
+  }
+
+  public ExpirationAction getRegionIdleTimeoutAction() {
+    return this.ra.getRegionIdleTimeout().getAction();
+  }
+
+  public int getEntryIdleTimeoutTimeLimit() {
+    return this.ra.getEntryIdleTimeout().getTimeout();
+  }
+
+  public ExpirationAction getEntryIdleTimeoutAction() {
+    return this.ra.getEntryIdleTimeout().getAction();
+  }
+
+  public String getCustomEntryIdleTimeout() {
+    Object o = this.ra.getCustomEntryIdleTimeout();
+    if (o == null) {
+      return "";
+    } else {
+      return o.toString();
+    }
+  }
+
+  public MirrorType getMirrorType() {
+    return this.ra.getMirrorType();
+  }
+
+  public DataPolicy getDataPolicy() {
+    return this.ra.getDataPolicy();
+  }
+
+  public Scope getScope() {
+    return this.ra.getScope();
+  }
+
+  public EvictionAttributes getEvictionAttributes() {
+    return this.ra.getEvictionAttributes();
+  }
+
+  /**
+   * This method will return an empty string if there are no CacheListeners defined on the region.
+   * If there are more than 1 CacheListeners defined, this method will return the description of the
+   * 1st CacheListener in the list returned by the getCacheListeners method. If there is only one
+   * CacheListener defined this method will return it's description
+   * 
+   * @return String the region's <code>CacheListener</code> description
+   * @deprecated as of 6.0, use {@link #getCacheListeners} instead
+   */
+  @Deprecated
+  public String getCacheListener() {
+    String[] o = this.getCacheListeners();
+    if (o.length == 0) {
+      return "";
+    } else {
+      return o[0].toString();
+    }
+  }
+
+  /**
+   * This method will return an empty array if there are no CacheListeners defined on the region. If
+   * there are one or more than 1 CacheListeners defined, this method will return an array which has
+   * the description of all the CacheListeners
+   * 
+   * @return String[] the region's <code>CacheListeners</code> descriptions as a String array
+   * @since GemFire 6.0
+   */
+  public String[] getCacheListeners() {
+    Object[] o = this.ra.getCacheListeners();
+    String[] ret = null;
+    if (o == null || o.length == 0) {
+      ret = new String[0];
+    } else {
+      ret = new String[o.length];
+      for (int i = 0; i < o.length; i++) {
+        ret[i] = o[i].toString();
+      }
+    }
+    return ret;
+  }
+
+  public int getInitialCapacity() {
+    return this.ra.getInitialCapacity();
+  }
+
+  public float getLoadFactor() {
+    return this.ra.getLoadFactor();
+  }
+
+  public int getConcurrencyLevel() {
+    return this.ra.getConcurrencyLevel();
+  }
+
+  public boolean getConcurrencyChecksEnabled() {
+    return this.ra.getConcurrencyChecksEnabled();
+  }
+
+  public boolean getStatisticsEnabled() {
+    return this.ra.getStatisticsEnabled();
+  }
+
+  public boolean getPersistBackup() {
+    return this.ra.getPersistBackup();
+  }
+
+  public DiskWriteAttributes getDiskWriteAttributes() {
+    return this.ra.getDiskWriteAttributes();
+  }
+
+  public File[] getDiskDirs() {
+    return this.ra.getDiskDirs();
+  }
+
+  public int getEntryCount() {
+    return this.entryCount;
+  }
+
+  public int getSubregionCount() {
+    return this.subregionCount;
+  }
+
+  public long getLastModifiedTime() {
+    if (this.rs == null) {
+      return 0;
+    } else {
+      return this.rs.getLastModifiedTime();
+    }
+  }
+
+  public long getLastAccessedTime() {
+    if (this.rs == null) {
+      return 0;
+    } else {
+      return this.rs.getLastAccessedTime();
+    }
+  }
+
+  public long getHitCount() {
+    if (this.rs == null) {
+      return 0;
+    } else {
+      return this.rs.getHitCount();
+    }
+  }
+
+  public long getMissCount() {
+    if (this.rs == null) {
+      return 0;
+    } else {
+      return this.rs.getMissCount();
+    }
+  }
+
+  public float getHitRatio() {
+    if (this.rs == null) {
+      return 0;
+    } else {
+      return this.rs.getHitRatio();
+    }
+  }
+
+  // operations
+  public void refresh() {
+    refreshFields();
+  }
+
+  /**
+   * Returns a string representation of the object.
+   * 
+   * @return a string representation of the object
+   */
+  @Override
+  public String toString() {
+    return getName();
+  }
+
+  public SystemMemberRegion createSubregion(String name, RegionAttributes attrs)
+      throws AdminException {
+
+    Region r = this.cache.getVM().createSubregion(this.cache.getCacheInfo(), this.getFullPath(),
+        name, attrs);
+    if (r == null) {
+      return null;
+
+    } else {
+      return this.cache.createSystemMemberRegion(r);
+    }
+
+  }
+
+  public MembershipAttributes getMembershipAttributes() {
+    return this.ra.getMembershipAttributes();
+  }
+
+  public SubscriptionAttributes getSubscriptionAttributes() {
+    return this.ra.getSubscriptionAttributes();
+  }
+
+  public PartitionAttributes getPartitionAttributes() {
+    return this.ra.getPartitionAttributes();
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMembershipEventImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMembershipEventImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMembershipEventImpl.java
new file mode 100644
index 0000000..9703498
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMembershipEventImpl.java
@@ -0,0 +1,68 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.internal.admin.api.SystemMembershipEvent;
+import org.apache.geode.internal.admin.api.SystemMembershipListener;
+
+/**
+ * An event delivered to a {@link SystemMembershipListener} when a member has joined or left the
+ * distributed system.
+ *
+ * @since GemFire 5.0
+ */
+public class SystemMembershipEventImpl implements SystemMembershipEvent {
+
+  /** The id of the member that generated this event */
+  private DistributedMember id;
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>SystemMembershipEvent</code> for the member with the given id.
+   */
+  protected SystemMembershipEventImpl(DistributedMember id) {
+    this.id = id;
+  }
+
+  ///////////////////// Instance Methods /////////////////////
+
+  public String getMemberId() {
+    return this.id.toString();
+  }
+
+  public DistributedMember getDistributedMember() {
+    return this.id;
+  }
+
+  // /**
+  // * Returns the user specified callback object associated with this
+  // * membership event. Note that the callback argument is always
+  // * <code>null</code> for the event delivered to the {@link
+  // * SystemMembershipListener#memberCrashed} method.
+  // *
+  // * @since GemFire 4.0
+  // */
+  // public Object getCallbackArgument() {
+  // throw new UnsupportedOperationException("Not implemented yet");
+  // }
+
+  @Override
+  public String toString() {
+    return "Member " + this.getMemberId();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/package.html
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/package.html b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/package.html
new file mode 100644
index 0000000..cfa4e41
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/package.html
@@ -0,0 +1,53 @@
+<!--
+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.
+-->
+<HTML>
+<BODY>
+
+<P>Contains the implementation of the external admin APIs from
+<a href="{@docRoot}/org/apache/geode/internal/admin/api/package-summary.html#package_description">org.apache.geode.internal.admin.api</a>.</P>
+
+<H2>Monitoring the "health" of GemFire</H2>
+
+<P>The health monitoring implementation comes in two pieces.  On the
+client (administrator) side there is a {@link
+GemFireHealthImpl} object that is
+responsible for configuring a {@link
+org.apache.geode.distributed.internal.HealthMonitorImpl} that runs
+in the member VMs.  The communication between the administration
+process and the member process is accomplised via a {@link
+org.apache.geode.internal.admin.GemFireVM GemFireVM} from the
+"internal admin" API.  The <code>HealthMonitorImpl</code> is a thread
+that periodically consults a {@link
+GemFireHealthEvaluator} that uses
+a {@link GemFireHealthConfigImpl}
+to determine the health of a GemFire component.  Most of the health
+criteria are based on {@linkplain org.apache.geode.Statistics
+statistics} that are maintained by GemFire.  When the
+<code>HealthMonitorImpl</code> determines that the health of a GemFire
+component has changed, it alerts the administrator process via a
+{@link org.apache.geode.internal.admin.HealthListener}.</P>
+
+
+<P>The below diagram explains how the classes that monitor the health
+of GemFire are implemented.</P>
+
+<CENTER>
+<IMG src="{@docRoot}/javadoc-images/health-classes.gif" HEIGHT="803" />
+</CENTER>
+
+</BODY>
+</HTML>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/Agent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/Agent.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/Agent.java
new file mode 100644
index 0000000..0179a38
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/Agent.java
@@ -0,0 +1,145 @@
+/*
+ * 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.internal.admin.api.jmx;
+
+import org.apache.geode.LogWriter;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+
+// import javax.management.MBeanException;
+import javax.management.MalformedObjectNameException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+/**
+ * A server component that provides administration-related information about a GemFire distributed
+ * system via the Java Management Extension JMX API. When a JMX <code>Agent</code> is created, it
+ * registers an MBean that represents {@link #getObjectName itself}. Click
+ * <A href="doc-files/mbeans-descriptions.html">here</A> for a description of the attributes,
+ * operations, and notifications of this and other GemFire JMX MBeans.
+ *
+ * <P>
+ *
+ * The GemFire JMX Agent currently supports three JMX "adapters" through which clients can access
+ * the GemFire management beans: an "HTTP adapter" that allows a web browser client to view and
+ * modify management beans via HTTP or HTTPS, an "RMI adapter" that allows Java programs to access
+ * management beans using Remote Method Invocation, and an "SNMP adapter" that allows SNMP to access
+ * management beans. Information about configuring these adapters can be found in
+ * {@link AgentConfig}.
+ *
+ * <P>
+ *
+ * In most distributed caching architectures, JMX administration agents are run in their own
+ * processes. A stand-alone JMX agent is managed using the <code>agent</code> command line utility:
+ *
+ * <PRE>
+ * $ agent start
+ * </PRE>
+ *
+ * This class allows a GemFire application VM to host a JMX management agent. Architectures with
+ * "co-located" JMX agents reduce the number of overall proceses required. However, hosting a JMX
+ * management agent in the same VM as a GemFire application is not generally recommended because it
+ * adds extra burden to an application VM and in the event that the application VM exits the
+ * administration information will no longer be available.
+ *
+ * @see AgentConfig
+ * @see AgentFactory
+ *
+ * @since GemFire 4.0
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface Agent {
+
+  /** Lookup name for RMIConnector when rmi-registry-enabled is true */
+  public static final String JNDI_NAME = "/jmxconnector";
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Returns the configuration object for this JMX Agent.
+   */
+  public AgentConfig getConfig();
+
+  /**
+   * Starts this JMX Agent and its associated adapters. This method does not
+   * {@linkplain #connectToSystem connect} to the distributed system.
+   */
+  public void start();
+
+  /**
+   * Returns the JMX <code>MBeanServer</code> with which GemFire MBeans are registered or
+   * <code>null</code> if this <code>Agent</code> is not started.
+   */
+  public MBeanServer getMBeanServer();
+
+  /**
+   * {@linkplain #disconnectFromSystem Disconnects} from the distributed system and stops this JMX
+   * Agent and all of its associated adapters.
+   */
+  public void stop();
+
+  /**
+   * Returns the <code>ObjectName</code> of the JMX management bean that represents this agent or
+   * <code>null</code> if this <code>Agent</code> has not been started.
+   */
+  public ObjectName getObjectName();
+
+  /**
+   * Returns whether or not this JMX <code>Agent</code> is currently providing information about a
+   * distributed system.
+   */
+  public boolean isConnected();
+
+  /**
+   * Connects to the distributed system described by this <code>Agent</code>'s configuration.
+   *
+   * @return The object name of the system that the <code>Agent</code> is now connected to.
+   */
+  public ObjectName connectToSystem() throws AdminException, MalformedObjectNameException;
+
+  /**
+   * Returns the <code>AdminDistributedSystem</code> that underlies this JMX <code>Agent</code> or
+   * <code>null</code> is this agent is not {@linkplain #isConnected connected}.
+   */
+  public AdminDistributedSystem getDistributedSystem();
+
+  /**
+   * Returns the object name of the JMX MBean that represents the distributed system administered by
+   * this <code>Agent</code> or <code>null</code> if this <code>Agent</code> has not
+   * {@linkplain #connectToSystem connected} to the distributed system.
+   */
+  public ObjectName manageDistributedSystem() throws MalformedObjectNameException;
+
+  /**
+   * Disconnects this agent from the distributed system and unregisters the management beans that
+   * provided information about it. However, this agent's adapters are not stopped and it is
+   * possible to reconfigure this <code>Agent</code> to connect to another distributed system.
+   */
+  public void disconnectFromSystem();
+
+  /**
+   * Saves the configuration for this <code>Agent</code> to the file specified by @link
+   * AgentConfig#getPropertyFile.
+   */
+  public void saveProperties();
+
+  /**
+   * Returns the <code>LogWriter</code> used for logging information.
+   */
+  public LogWriter getLogWriter();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/AgentConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/AgentConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/AgentConfig.java
new file mode 100644
index 0000000..3a130ae
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/AgentConfig.java
@@ -0,0 +1,844 @@
+/*
+ * 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.internal.admin.api.jmx;
+
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.distributed.internal.DistributionConfig;
+// import InetAddressUtil;
+
+/**
+ * A configuration object for a JMX administration {@linkplain Agent agent} that is hosted by a
+ * GemFire application VM. A file named {@link #DEFAULT_PROPERTY_FILE "agent.properties"} can be
+ * used to override the default values of <code>AgentConfig</code> attributes. The
+ * "gfAgentPropertyFile" {@linkplain System#getProperty(java.lang.String) system property} can be
+ * used to specify an agent properties file other than "agent.properties". System properties
+ * prefixed with {@linkplain #SYSTEM_PROPERTY_PREFIX "gemfire.agent."} can be used to override the
+ * values in the properties file. For instance "-Dgemfire.agent.http-port=8081" can be used to
+ * override the default port for the HTTP adapter. Configuration related to the distributed system
+ * that the JMX agent administers is inherited from and described in <code>AgentConfig</code>'s
+ * superinterface, {@link DistributedSystemConfig}.
+ *
+ * <P>
+ *
+ * An <code>AgentConfig</code> can be modified using a number of mutator methods until it is used to
+ * create an <code>Agent</code>. After that, attempts to modify most attributes in the
+ * <code>AgentConfig</code> will result in an {@link IllegalStateException} being thrown. If you
+ * wish to use the same <code>AgentConfig</code> to configure multiple <code>Agent</code>s, a copy
+ * of the <code>AgentConfig</code> object can be made by invoking its {@link #clone} method.
+ *
+ * <P>
+ *
+ * <B>JMX Administation Agent Configuration Properties</B>
+ *
+ * <dl>
+ * <a name="auto-connect">
+ * <dt>{@linkplain #AUTO_CONNECT_NAME auto-connect}</dt></a>
+ * <dd><U>Description</U>: whether or not a JMX agent will automatically connect to the distributed
+ * system it is configured to administer.</dd>
+ * <dd><U>{@linkplain #DEFAULT_AUTO_CONNECT Default}</U>: false</dd>
+ * </dl>
+ *
+ * <B>JMX Agent SSL Configuration Properties</B>
+ *
+ * <P>
+ *
+ * These parameters configure sockets that are created by the GemFire JMX Agent regardless of which
+ * adapters are enabled. These setting apply to all adapters. For example, if clients connect to the
+ * RMI adapter using SSL, then clients must also connect to the HTTP adapter using SSL (HTTPS). Note
+ * that these configuration attributes do <b>not</b> effect how the agent connects to the
+ * distributed system it administers, only how JMX clients connect to the agent.
+ *
+ * <dl>
+ * <a name="agent-ssl-enabled">
+ * <dt>{@linkplain #AGENT_SSL_ENABLED_NAME agent-ssl-enabled}</dt></a>
+ * <dd><U>Description</U>: whether or not connections to the JMX agent require SSL</dd>
+ * <dd><U>{@linkplain #DEFAULT_AGENT_SSL_ENABLED Default}</U>: false</dd>
+ * </dl>
+ * 
+ * <dl>
+ * <a name="agent-ssl-protocols">
+ * <dt>{@linkplain #AGENT_SSL_PROTOCOLS_NAME agent-ssl-protocols}</dt></a>
+ * <dd><U>Description</U>: the SSL protocols to be used when connecting to the JMX agent</dd>
+ * <dd><U>{@linkplain #DEFAULT_AGENT_SSL_PROTOCOLS Default}</U>: any</dd>
+ * </dl>
+ *
+ * <dl>
+ * <a name="agent-ssl-ciphers">
+ * <dt>{@linkplain #AGENT_SSL_CIPHERS_NAME agent-ssl-ciphers}</dt></a>
+ * <dd><U>Description</U>: the SSL ciphers to be used when connecting to the JMX agent</dd>
+ * <dd><U>{@linkplain #DEFAULT_AGENT_SSL_CIPHERS Default}</U>: any</dd>
+ * </dl>
+ *
+ * <dl>
+ * <a name="agent-ssl-require-authentication">
+ * <dt>{@linkplain #AGENT_SSL_REQUIRE_AUTHENTICATION_NAME agent-ssl-require-authentication}</dt></a>
+ * <dd><U>Description</U>: whether or not SSL connections to the RMI adapter require authentication
+ * </dd>
+ * <dd><U>{@linkplain #DEFAULT_AGENT_SSL_REQUIRE_AUTHENTICATION Default}</U>: true</dd>
+ * </dl>
+ *
+ * <dl>
+ * <a name="http-ssl-require-authentication">
+ * <dt>{@linkplain #HTTP_SSL_REQUIRE_AUTHENTICATION_NAME http-ssl-require-authentication}</dt></a>
+ * <dd><U>Description</U>: whether or not SSL connections to the HTTP adapter require authentication
+ * </dd>
+ * <dd><U>{@linkplain #DEFAULT_HTTP_SSL_REQUIRE_AUTHENTICATION Default}</U>: false</dd>
+ * </dl>
+ *
+ * <B>HTTP Adapter Configuration</B>
+ *
+ * <dl>
+ * <a name="http-enabled">
+ * <dt>{@linkplain #HTTP_ENABLED_NAME http-enabled}</dt></a>
+ * <dd><U>Description</U>: whether or not the HTTP adapter is enabled in the JMX agent.</dd>
+ * <dd><U>{@linkplain #DEFAULT_HTTP_ENABLED Default}</U>: true</dd>
+ * </dl>
+ * 
+ * <dl>
+ * <a name="http-port">
+ * <dt>{@linkplain #HTTP_PORT_NAME http-port}</dt></a>
+ * <dd><U>Description</U>: the port on which the HTTP adapter should listen for client connections.
+ * </dd>
+ * <dd><U>{@linkplain #DEFAULT_HTTP_PORT Default}</U>: 8080</dd>
+ * </dl>
+ *
+ * <dl>
+ * <a name="http-bind-address">
+ * <dt>{@linkplain #HTTP_BIND_ADDRESS_NAME http-bind-address}</dt></a>
+ * <dd><U>Description</U>: the machine name or IP address to which the HTTP listening socket should
+ * be bound. If this value is "localhost", then the socket will be bound to the loopback address
+ * (127.0.0.1) and the adapter will only be accessible via the URL
+ * <code>http://localhost:8080</code>.</dd>
+ * <dd><U>{@linkplain #DEFAULT_HTTP_BIND_ADDRESS Default}</U>: "" (all network addresses)</dd>
+ * </dl>
+ *
+ * <dl>
+ * <a name="http-authentication-enabled">
+ * <dt>{@linkplain #HTTP_AUTHENTICATION_ENABLED_NAME http-authentication-enabled}</dt></a>
+ * <dd><U>Description</U>: Whether or not connections to the HTTP adapter should be authenticated
+ * with a user name and password.</dd>
+ * <dd><U>{@linkplain #DEFAULT_HTTP_AUTHENTICATION_ENABLED Default}</U>: false</dd>
+ * </dl>
+ *
+ * <dl>
+ * <a name="http-authentication-user">
+ * <dt>{@linkplain #HTTP_AUTHENTICATION_USER_NAME http-authentication-user}</dt></a>
+ * <dd><U>Description</U>: the user name for authenticating secure communication.</dd>
+ * <dd><U>{@linkplain #DEFAULT_HTTP_AUTHENTICATION_USER Default}</U>: admin</dd>
+ * </dl>
+ *
+ * <dl>
+ * <a name="http-authentication-password">
+ * <dt>{@linkplain #HTTP_AUTHENTICATION_PASSWORD_NAME http-authentication-password}</dt></a>
+ * <dd><U>Description</U>: the password for authenticating secure communication.</dd>
+ * <dd><U>{@linkplain #DEFAULT_HTTP_AUTHENTICATION_PASSWORD Default}</U>: password</dd>
+ * </dl>
+ *
+ * <B>RMI Adapter Configuration Properties</B>
+ *
+ * <dl>
+ * <a name="rmi-enabled">
+ * <dt>{@linkplain #RMI_ENABLED_NAME rmi-enabled}</dt></a>
+ * <dd><U>Description</U>: whether or not the RMI JMX adapter is enabled</dd>
+ * <dd><U>{@linkplain #DEFAULT_RMI_ENABLED Default}</U>: true</dd>
+ * </dl>
+ *
+ * <dl>
+ * <a name="rmi-registry-enabled">
+ * <dt>{@linkplain #RMI_REGISTRY_ENABLED_NAME rmi-registry-enabled}</dt></a>
+ * <dd><U>Description</U>: whether or not the JMX agent should start an RMI registry. Alternatively,
+ * a registry outside of the JMX agent VM can be used.</dd>
+ * <dd><U>{@linkplain #DEFAULT_RMI_REGISTRY_ENABLED Default}</U>: true</dd>
+ * </dl>
+ *
+ * <dl>
+ * <a name="rmi-port">
+ * <dt>{@linkplain #RMI_PORT_NAME rmi-port}</dt></a>
+ * <dd><U>Description</U>: the port of the RMI registry in which the JMX Agent should bind remote
+ * objects.</dd>
+ * <dd><U>{@linkplain #DEFAULT_RMI_PORT Default}</U>: 1099</dd>
+ * </dl>
+ * 
+ * <dl>
+ * <a name="rmi-server-port">
+ * <dt>{@linkplain #RMI_PORT_NAME rmi-server-port}</dt></a>
+ * <dd><U>Description</U>: the port to be used by the RMI Server started by JMX Agent.</dd>
+ * <dd><U>{@linkplain #DEFAULT_RMI_SERVER_PORT Default}</U>: 0</dd>
+ * </dl>
+ *
+ * <dl>
+ * <a name="rmi-bind-address">
+ * <dt>{@linkplain #RMI_BIND_ADDRESS_NAME rmi-bind-address}</dt></a>
+ * <dd><U>Description</U>: the bind address on which the RMI registry binds its sockets.</dd>
+ * <dd><U>{@linkplain #DEFAULT_RMI_BIND_ADDRESS Default}</U>: "" (all network addresses)</dd>
+ * </dl>
+ *
+ * <B>AdventNet SNMP Adapter Configuration Properties</B>
+ *
+ * <dl>
+ * <a name="snmp-enabled">
+ * <dt>{@linkplain #SNMP_ENABLED_NAME snmp-enabled}</dt></a>
+ * <dd><U>Description</U>: whether or not the SNMP JMX adapter is enabled</dd>
+ * <dd><U>{@linkplain #DEFAULT_SNMP_ENABLED Default}</U>: false</dd>
+ * </dl>
+ * 
+ * <dl>
+ * <a name="snmp-bind-address">
+ * <dt>{@linkplain #SNMP_BIND_ADDRESS_NAME snmp-bind-address}</dt></a>
+ * <dd><U>Description</U>: the host name to which sockets used by the SNMP adapter should be bound.
+ * </dd>
+ * <dd><U>{@linkplain #DEFAULT_SNMP_BIND_ADDRESS Default}</U>: the name of the local machine (not
+ * <code>localhost</code>)</dd>
+ * </dl>
+ *
+ * <dl>
+ * <a name="snmp-directory">
+ * <dt>{@linkplain #SNMP_DIRECTORY_NAME snmp-directory}</dt></a>
+ * <dd><U>Description</U>: the deployment directory for AdventNet SNMP Adaptor</dd>
+ * <dd><U>{@linkplain #DEFAULT_SNMP_DIRECTORY Default}</U>: ""</dd>
+ * </dl>
+ * 
+ * <B>JMX Agent Email Notification Properties (for statistics alerts)</B>
+ * 
+ * <dl>
+ * <a name="email-notification-enabled">
+ * <dt>{@linkplain #EMAIL_NOTIFICATIONS_ENABLED_NAME email-notification-enabled}</dt></a>
+ * <dd><U>Description</U>: Whether or not email notifications are enabled for statistics alerts.
+ * </dd>
+ * <dd><U>{@linkplain #DEFAULT_EMAIL_NOTIFICATIONS_ENABLED Default}</U>: false</dd>
+ * </dl>
+ * 
+ * <dl>
+ * <a name="email-notification-from">
+ * <dt>{@linkplain #EMAIL_NOTIFICATIONS_FROM_NAME email-notification-from}</dt></a>
+ * <dd><U>Description</U>: Email address to be used to send email notifications.</dd>
+ * <dd><U>{@linkplain #DEFAULT_EMAIL_FROM Default}</U>: ""</dd>
+ * </dl>
+ * 
+ * <dl>
+ * <a name="email-notification-host">
+ * <dt>{@linkplain #EMAIL_NOTIFICATIONS_HOST_NAME email-notification-host}</dt></a>
+ * <dd><U>Description</U>: The host name of the mail server to be used for email communication.</dd>
+ * <dd><U>{@linkplain #DEFAULT_EMAIL_HOST Default}</U>: ""</dd>
+ * </dl>
+ * 
+ * <dl>
+ * <a name="email-notification-to">
+ * <dt>{@linkplain #EMAIL_NOTIFICATIONS_TO_LIST_NAME email-notification-to}</dt></a>
+ * <dd><U>Description</U>: Email address where the email notifications should be sent.</dd>
+ * <dd><U>{@linkplain #DEFAULT_EMAIL_TO_LIST Default}</U>: ""</dd>
+ * </dl>
+ * 
+ * <dl>
+ * <a name="state-save-file">
+ * <dt>{@linkplain #STATE_SAVE_FILE_NAME state-save-file}</dt></a>
+ * <dd><U>Description</U>: The name of the file to be used for saving agent state. The file is
+ * stored in the same directory in which the agent.properties file is located</dd>
+ * <dd><U>{@linkplain #DEFAULT_STATE_SAVE_FILE Default}</U>: ""</dd>
+ * </dl>
+ * 
+ *
+ * @since GemFire 4.0
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface AgentConfig extends DistributedSystemConfig {
+
+  /** The prefix for JMX Agent configuration system properties */
+  public static final String SYSTEM_PROPERTY_PREFIX = DistributionConfig.GEMFIRE_PREFIX + "agent.";
+
+  /** The default "propertyFile" value */
+  public static final String DEFAULT_PROPERTY_FILE = "agent.properties";
+
+  /** The default name for file that has "agent state saved serialized" */
+  public static final String DEFAULT_STATE_SAVE_FILE = "agent.ser";
+
+  /** The name of the "auto-connect" property */
+  public static final String AUTO_CONNECT_NAME = "auto-connect";
+
+  /** The default value of the "auto-connect" property */
+  public static final boolean DEFAULT_AUTO_CONNECT = true;
+
+  // -------------------------------------------------------------------------
+  // HttpAdaptor properties...
+  // -------------------------------------------------------------------------
+
+  /** The name of the "httpEnabled" property */
+  public static final String HTTP_ENABLED_NAME = "http-enabled";
+
+  /** The default value of the "httpEnabled" property */
+  public static final boolean DEFAULT_HTTP_ENABLED = true;
+
+  /** The name of the "httpBindAddress" property */
+  public static final String HTTP_BIND_ADDRESS_NAME = "http-bind-address";
+
+  /** The default value of the "httpBindAddress" property */
+  public static final String DEFAULT_HTTP_BIND_ADDRESS = "";
+
+  /** The name of the "httpPort" property */
+  public static final String HTTP_PORT_NAME = "http-port";
+
+  /** The default value of the "httpPort" property (8080) */
+  public static final int DEFAULT_HTTP_PORT = 8080;
+
+  /** The minimum httpPort (0) */
+  public static final int MIN_HTTP_PORT = 0;
+
+  /** The maximum httpPort (65535) */
+  public static final int MAX_HTTP_PORT = 65535;
+
+  /** The name of the "state-save-file-name" property */
+  public static final String STATE_SAVE_FILE_NAME = "state-save-file";
+
+  /** The name of the "http-authentication-enabled" property */
+  public static final String HTTP_AUTHENTICATION_ENABLED_NAME = "http-authentication-enabled";
+
+  /**
+   * The default value of the "http-authentication-enabled" property
+   */
+  public static final boolean DEFAULT_HTTP_AUTHENTICATION_ENABLED = false;
+
+  /** The name of the "http-authentication-user" property */
+  public static final String HTTP_AUTHENTICATION_USER_NAME = "http-authentication-user";
+
+  /** The default value of the "http-authentication-user" property */
+  public static final String DEFAULT_HTTP_AUTHENTICATION_USER = "admin";
+
+  /** The name of the "http-authentication-password" property */
+  public static final String HTTP_AUTHENTICATION_PASSWORD_NAME = "http-authentication-password";
+
+  /**
+   * The default value of the "http-authentication-password" property
+   */
+  public static final String DEFAULT_HTTP_AUTHENTICATION_PASSWORD = "password";
+
+  /** The name of the "email-notification-enabled" property */
+  public static final String EMAIL_NOTIFICATIONS_ENABLED_NAME = "email-notification-enabled";
+
+  /**
+   * The default value of the "email-notification-enabled" property
+   */
+  public static final boolean DEFAULT_EMAIL_NOTIFICATIONS_ENABLED = false;
+
+  /** The name of the "email-notification-from" property */
+  public static final String EMAIL_NOTIFICATIONS_FROM_NAME = "email-notification-from";
+
+  /**
+   * The default value of the "email-notification-from" property
+   */
+  public static final String DEFAULT_EMAIL_FROM = "";
+
+  /** The name of the "email-notification-host" property */
+  public static final String EMAIL_NOTIFICATIONS_HOST_NAME = "email-notification-host";
+
+  /**
+   * The default value of the "email-notification-host" property
+   */
+  public static final String DEFAULT_EMAIL_HOST = "";
+
+  /** The name of the "email-notification-to" property */
+  public static final String EMAIL_NOTIFICATIONS_TO_LIST_NAME = "email-notification-to";
+
+  /**
+   * The default value of the "email-notification-to" property
+   */
+  public static final String DEFAULT_EMAIL_TO_LIST = "";
+
+  // -------------------------------------------------------------------------
+  // RMIConnectorServer properties...
+  // -------------------------------------------------------------------------
+
+  /** The name of the "rmiEnabled" property */
+  public static final String RMI_ENABLED_NAME = "rmi-enabled";
+
+  /** The default value of the {@linkplain #RMI_ENABLED_NAME rmi-enabled} property */
+  public static final boolean DEFAULT_RMI_ENABLED = true;
+
+  /** The name of the "rmi-registry-enabled" property */
+  public static final String RMI_REGISTRY_ENABLED_NAME = "rmi-registry-enabled";
+
+  /**
+   * The default value of the {@linkplain #RMI_REGISTRY_ENABLED_NAME rmi-registry-enabled} property
+   */
+  public static final boolean DEFAULT_RMI_REGISTRY_ENABLED = true;
+
+  /** The name of the "rmiBindAddress" property */
+  public static final String RMI_BIND_ADDRESS_NAME = "rmi-bind-address";
+
+  /** The default value of the {@linkplain #RMI_BIND_ADDRESS_NAME rmi-bind-address} property */
+  public static final String DEFAULT_RMI_BIND_ADDRESS = "";
+
+  /** The name of the "rmiPort" property */
+  public static final String RMI_PORT_NAME = "rmi-port";
+
+  /** The default value of the {@linkplain #RMI_PORT_NAME rmi-port} property (1099) */
+  public static final int DEFAULT_RMI_PORT = 1099;
+
+  /**
+   * The name of the "rmi-server-port" property
+   * 
+   * @since GemFire 6.5
+   */
+  public static final String RMI_SERVER_PORT_NAME = "rmi-server-port";
+
+  /**
+   * The default value of the {@linkplain #RMI_SERVER_PORT_NAME rmi-server-port} property (0)
+   * 
+   * @since GemFire 6.5
+   */
+  public static final int DEFAULT_RMI_SERVER_PORT = 0;
+
+  /**
+   * The minimum value for {@linkplain #RMI_PORT_NAME rmi-port} or {@linkplain #RMI_SERVER_PORT_NAME
+   * rmi-server-port} (0)
+   */
+  public static final int MIN_RMI_PORT = 0;
+
+  /**
+   * The maximum value for {@linkplain #RMI_PORT_NAME rmi-port} or {@linkplain #RMI_SERVER_PORT_NAME
+   * rmi-server-port} (65535)
+   */
+  public static final int MAX_RMI_PORT = 65535;
+
+  // -------------------------------------------------------------------------
+  // AdventNetSNMPAdaptor properties...
+  // -------------------------------------------------------------------------
+
+  /** The name of the "snmpEnabled" property */
+  public static final String SNMP_ENABLED_NAME = "snmp-enabled";
+
+  /** The default value of the "snmpEnabled" property */
+  public static final boolean DEFAULT_SNMP_ENABLED = false;
+
+  /** The name of the "snmpBindAddress" property */
+  public static final String SNMP_BIND_ADDRESS_NAME = "snmp-bind-address";
+
+  /** The default value of the "snmpBindAddress" property */
+  public static final String DEFAULT_SNMP_BIND_ADDRESS = "";
+
+  /** The name of the "snmpDirectory" property */
+  public static final String SNMP_DIRECTORY_NAME = "snmp-directory";
+
+  /** The default value of the "snmpDirectory" property */
+  public static final String DEFAULT_SNMP_DIRECTORY = "";
+
+  // -------------------------------------------------------------------------
+  // JMX SSL properties...
+  // -------------------------------------------------------------------------
+
+  /** The name of the "agent-ssl-enabled" property */
+  public static final String AGENT_SSL_ENABLED_NAME = "agent-ssl-enabled";
+
+  /** The default value of the "agent-ssl-enabled" property */
+  public static final boolean DEFAULT_AGENT_SSL_ENABLED = false;
+
+  /** The name of the "agent-ssl-protocols" property */
+  public static final String AGENT_SSL_PROTOCOLS_NAME = "agent-ssl-protocols";
+
+  /** The default value of the "agent-ssl-protocols" property */
+  public static final String DEFAULT_AGENT_SSL_PROTOCOLS = "any";
+
+  /** The name of the "agent-ssl-ciphers" property */
+  public static final String AGENT_SSL_CIPHERS_NAME = "agent-ssl-ciphers";
+
+  /** The default value of the "agent-ssl-ciphers" property */
+  public static final String DEFAULT_AGENT_SSL_CIPHERS = "any";
+
+  /** The name of the "agent-ssl-require-authentication" property */
+  public static final String AGENT_SSL_REQUIRE_AUTHENTICATION_NAME =
+      "agent-ssl-require-authentication";
+
+  /**
+   * The default value of the "agent-ssl-require-authentication" property
+   */
+  public static final boolean DEFAULT_AGENT_SSL_REQUIRE_AUTHENTICATION = true;
+
+  /** The name of the "http-ssl-require-authentication" property */
+  public static final String HTTP_SSL_REQUIRE_AUTHENTICATION_NAME =
+      "http-ssl-require-authentication";
+
+  /**
+   * The default value of the "http-ssl-require-authentication" property
+   */
+  public static final boolean DEFAULT_HTTP_SSL_REQUIRE_AUTHENTICATION = false;
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Returns whether or not the JMX agent will automatically connect to the distributed system it
+   * administers.
+   *
+   * See <a href="#auto-connect">description</a> above.
+   */
+  public boolean getAutoConnect();
+
+  /**
+   * Sets whether or not the JMX agent will automatically connect to the distributed system it
+   * administers.
+   *
+   * See <a href="#auto-connect">description</a> above.
+   */
+  public void setAutoConnect(boolean autoConnect);
+
+  /**
+   * Returns whether or not the HTTP adapter is enabled.
+   *
+   * See <a href="#http-enabled">description</a> above.
+   */
+  public boolean isHttpEnabled();
+
+  /**
+   * Sets whether or not the HTTP adapter is enabled.
+   *
+   * See <a href="#http-enabled">description</a> above.
+   */
+  public void setHttpEnabled(boolean httpEnabled);
+
+  /**
+   * Returns the port of the HTTP adapter.
+   *
+   * See <a href="#http-port">description</a> above.
+   */
+  public int getHttpPort();
+
+  /**
+   * Sets the port of the HTTP adapter.
+   *
+   * See <a href="#http-port">description</a> above.
+   */
+  public void setHttpPort(int port);
+
+  /**
+   * Returns the bind address to which the HTTP adapter's listening socket is bound.
+   *
+   * See <a href="#http-bind-address">description</a> above.
+   */
+  public String getHttpBindAddress();
+
+  /**
+   * Sets the bind address to which the HTTP adapter's listening socket is bound.
+   *
+   * See <a href="#http-bind-address">description</a> above.
+   */
+  public void setHttpBindAddress(String address);
+
+  /**
+   * Returns whether or not the HTTP adapter authenticates connections.
+   *
+   * See <a href="#http-authentication-enabled">description</a> above.
+   */
+  public boolean isHttpAuthEnabled();
+
+  /**
+   * Sets whether or not the HTTP adapter authenticates connections.
+   *
+   * See <a href="#http-authentication-enabled">description</a> above.
+   */
+  public void setHttpAuthEnabled(boolean enabled);
+
+  /**
+   * Returns the user name for HTTP adapter authentication.
+   *
+   * See <a href="#http-authentication-user">description</a> above.
+   */
+  public String getHttpAuthUser();
+
+  /**
+   * Sets the user name for HTTP adapter authentication.
+   *
+   * See <a href="#http-authentication-user">description</a> above.
+   */
+  public void setHttpAuthUser(String user);
+
+  /**
+   * Returns the password for HTTP adapter authentication.
+   *
+   * See <a href="#http-authentication-password">description</a> above.
+   */
+  public String getHttpAuthPassword();
+
+  /**
+   * Sets the password for HTTP adapter authentication.
+   *
+   * See <a href="#http-authentication-password">description</a> above.
+   */
+  public void setHttpAuthPassword(String password);
+
+  /**
+   * Returns whether or not the RMI adapter is enabled.
+   *
+   * See <a href="#rmi-enabled">description</a> above.
+   */
+  public boolean isRmiEnabled();
+
+  /**
+   * Sets whether or not the RMI adapter is enabled.
+   *
+   * See <a href="#rmi-enabled">description</a> above.
+   */
+  public void setRmiEnabled(boolean rmiEnabled);
+
+  /**
+   * Returns whether or not the agent hosts an RMI registry.
+   *
+   * See <a href="#rmi-registry-enabled">description</a> above.
+   */
+  public boolean isRmiRegistryEnabled();
+
+  /**
+   * Sets whether or not the agent hosts an RMI registry.
+   *
+   * See <a href="#rmi-registry-enabled">description</a> above.
+   */
+  public void setRmiRegistryEnabled(boolean enabled);
+
+  /**
+   * Returns the port of the RMI adapter.
+   *
+   * See <a href="#rmi-port">description</a> above.
+   */
+  public int getRmiPort();
+
+  /**
+   * Sets the port of the RMI adapter.
+   *
+   * See <a href="#rmi-port">description</a> above.
+   */
+  public void setRmiPort(int port);
+
+  /**
+   * Returns the port of the RMI Connector Server.
+   *
+   * See <a href="#rmi-server-port">description</a> above.
+   * 
+   * @return the value set for rmi-server-port
+   * @since GemFire 6.5
+   */
+  public int getRmiServerPort();
+
+  /**
+   * Sets the port of the RMI Connector Server.
+   *
+   * See <a href="#rmi-server-port">description</a> above.
+   * 
+   * @param port rmi-server-port to set.
+   * @since GemFire 6.5
+   */
+  public void setRmiServerPort(int port);
+
+  /**
+   * Returns the bind address to which the RMI adapter's listening sockets are bound.
+   *
+   * See <a href="#rmi-bind-address">description</a> above.
+   */
+  public String getRmiBindAddress();
+
+  /**
+   * Sets the bind address to which the RMI adapter's listening sockets are bound.
+   *
+   * See <a href="#rmi-bind-address">description</a> above.
+   */
+  public void setRmiBindAddress(String address);
+
+  /**
+   * Returns whether or not the SNMP adapter is enabled.
+   *
+   * See <a href="#snmp-enabled">description</a> above.
+   */
+  public boolean isSnmpEnabled();
+
+  /**
+   * Sets whether or not the SNMP adapter is enabled.
+   *
+   * See <a href="#snmp-enabled">description</a> above.
+   */
+  public void setSnmpEnabled(boolean enabled);
+
+  /**
+   * Returns the bind address used with the SNMP adapter.
+   *
+   * See <a href="#snmp-bind-address">description</a> above.
+   */
+  public String getSnmpBindAddress();
+
+  /**
+   * Sets the bind address used with the SNMP adapter.
+   *
+   * See <a href="#snmp-bind-address">description</a> above.
+   */
+  public void setSnmpBindAddress(String address);
+
+  /**
+   * Returns the directory for the SNMP adapater.
+   *
+   * See <a href="#snmp-directory">description</a> above.
+   */
+  public String getSnmpDirectory();
+
+  /**
+   * Sets the directory for the SNMP adapater.
+   *
+   * See <a href="#snmp-directory">description</a> above.
+   */
+  public void setSnmpDirectory(String snmpDirectory);
+
+  /**
+   * Returns whether or not SSL is required for the JMX agent.
+   *
+   * See <a href="#agent-ssl-enabled">description</a> above.
+   */
+  public boolean isAgentSSLEnabled();
+
+  /**
+   * Sets whether or not SSL is required for the JMX agent.
+   *
+   * See <a href="#agent-ssl-enabled">description</a> above.
+   */
+  public void setAgentSSLEnabled(boolean enabled);
+
+  /**
+   * Returns the SSL protocols used when connecting to the JMX agent.
+   *
+   * See <a href="#agent-ssl-protocols">description</a> above.
+   */
+  public String getAgentSSLProtocols();
+
+  /**
+   * Sets the SSL protocols used when connecting to the JMX agent.
+   *
+   * See <a href="#agent-ssl-protocols">description</a> above.
+   */
+  public void setAgentSSLProtocols(String protocols);
+
+  /**
+   * Returns the SSL ciphers used when connecting to the JMX agent.
+   *
+   * See <a href="#agent-ssl-ciphers">description</a> above.
+   */
+  public String getAgentSSLCiphers();
+
+  /**
+   * Sets the SSL ciphers used when connecting to the JMX agent.
+   *
+   * See <a href="#agent-ssl-ciphers">description</a> above.
+   */
+  public void setAgentSSLCiphers(String ciphers);
+
+  /**
+   * Returns whether SSL authentication is used when connecting to the RMI connector.
+   *
+   * See <a href="#agent-ssl-require-authentication">description</a> above.
+   */
+  public boolean isAgentSSLRequireAuth();
+
+  /**
+   * Sets whether SSL authentication is used when connecting to the RMI connector.
+   *
+   * See <a href="#agent-ssl-require-authentication">description</a> above.
+   */
+  public void setAgentSSLRequireAuth(boolean require);
+
+  /**
+   * Returns whether SSL authentication is used when connecting to the HTTP connector.
+   *
+   * See <a href="#http-ssl-require-authentication">description</a> above.
+   */
+  public boolean isHttpSSLRequireAuth();
+
+  /**
+   * Sets whether SSL authentication is used when connecting to the HTTP connector.
+   *
+   * See <a href="#http-ssl-require-authentication">description</a> above.
+   */
+  public void setHttpSSLRequireAuth(boolean require);
+
+  /**
+   * Returns whether Emails for Notifications is enabled
+   *
+   * See <a href="#email-notification-enabled">description</a> above.
+   */
+  public boolean isEmailNotificationEnabled();
+
+  /**
+   * Sets whether Emails for Notifications is enabled
+   *
+   * See <a href="#email-notification-enabled">description</a> above.
+   */
+  public void setEmailNotificationEnabled(boolean enabled);
+
+  /**
+   * Returns the EmailID from whom notification emails are sent.
+   *
+   * See <a href="#email-notification-from">description</a> above.
+   */
+  public String getEmailNotificationFrom();
+
+  /**
+   * Sets the EmailID from whom notification emails are sent.
+   *
+   * See <a href="#email-notification-from">description</a> above.
+   */
+  public void setEmailNotificationFrom(String emailID);
+
+  /**
+   * Returns the Host Name using which notification emails are sent.
+   *
+   * See <a href="#email-notification-host">description</a> above.
+   */
+  public String getEmailNotificationHost();
+
+  /**
+   * Sets the Host Name from whom notification emails are sent.
+   *
+   * See <a href="#email-notification-host">description</a> above.
+   */
+  public void setEmailNotificationHost(String hostName);
+
+  /**
+   * Returns the comma separated EmailID list to whom notification emails are sent.
+   *
+   * See <a href="#email-notification-to">description</a> above.
+   */
+  public String getEmailNotificationToList();
+
+  /**
+   * Sets the EmailID from whom notification emails are sent as a comma separated list.
+   *
+   * See <a href="#email-notification-to">description</a> above.
+   */
+  public void setEmailNotificationToList(String emailIDs);
+
+  /**
+   * Returns the name of the file to be used for saving agent state
+   *
+   * See <a href="#state-save-file">description</a> above.
+   */
+  public String getStateSaveFile();
+
+  /**
+   * Sets the name of the file to be used for saving agent state
+   *
+   * See <a href="#state-save-file">description</a> above.
+   */
+  public void setStateSaveFile(String file);
+
+  /**
+   * Returns an <code>AgentConfig</code> with the same configuration as this
+   * <code>AgentConfig</code>.
+   */
+  public Object clone() throws CloneNotSupportedException;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/AgentFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/AgentFactory.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/AgentFactory.java
new file mode 100644
index 0000000..c82e0a0
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/AgentFactory.java
@@ -0,0 +1,47 @@
+/*
+ * 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.internal.admin.api.jmx;
+
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.jmx.impl.AgentConfigImpl;
+import org.apache.geode.internal.admin.api.jmx.impl.AgentImpl;
+
+/**
+ * A factory class that creates JMX administration entities.
+ *
+ * @since GemFire 4.0
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class AgentFactory {
+
+  /**
+   * Defines a "default" GemFire JMX administration agent configuration.
+   */
+  public static AgentConfig defineAgent() {
+    return new AgentConfigImpl();
+  }
+
+  /**
+   * Creates an unstarted GemFire JMX administration agent with the given configuration.
+   *
+   * @see Agent#start
+   */
+  public static Agent getAgent(AgentConfig config) throws AdminException {
+    return new AgentImpl((AgentConfigImpl) config);
+  }
+
+}


[11/50] [abbrv] incubator-geode git commit: GEODE-2024 Deadlock creating a new lock service Grantor

Posted by kl...@apache.org.
GEODE-2024 Deadlock creating a new lock service Grantor

This change-set causes the code in TXLockServiceImpl.release() to
perform periodic checks to see if grantor recovery is being performed.
If so it skips releaseTryLocks, which requires a recovered grantor to
function.  This is in line with the previous attempts to fix this
problem.  The recovery message that is trying to obtain the recovery
write-lock now sets the "recovering" state in TXLockServiceImpl prior
to attempting to get the lock so that it is set when
TXLockServiceImpl.release() checks its state.


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

Branch: refs/heads/feature/GEODE-288
Commit: f02ea36f2e3a440e8aa39815539f3aa2855ce124
Parents: 69a0877
Author: Bruce Schuchardt <bs...@pivotal.io>
Authored: Wed Oct 26 13:51:20 2016 -0700
Committer: Bruce Schuchardt <bs...@pivotal.io>
Committed: Wed Oct 26 13:53:00 2016 -0700

----------------------------------------------------------------------
 .../locks/DLockRecoverGrantorProcessor.java     |  16 +-
 .../internal/locks/DLockService.java            | 108 ++++++----
 .../internal/cache/locks/TXLockServiceImpl.java |  35 ++--
 .../locks/TXRecoverGrantorMessageProcessor.java |   8 +-
 .../cache/locks/TXLockServiceDUnitTest.java     | 210 ++++++++++++++-----
 5 files changed, 272 insertions(+), 105 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f02ea36f/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockRecoverGrantorProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockRecoverGrantorProcessor.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockRecoverGrantorProcessor.java
index 37fbfbe..2a48308 100755
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockRecoverGrantorProcessor.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockRecoverGrantorProcessor.java
@@ -91,7 +91,7 @@ public class DLockRecoverGrantorProcessor extends ReplyProcessor21 {
     // process msg and reply from this VM...
     if (msg.getSender() == null)
       msg.setSender(dm.getId());
-    msg.processMessage(dm);
+    msg.scheduleMessage(dm);
 
     // keep waiting even if interrupted
     try {
@@ -239,6 +239,20 @@ public class DLockRecoverGrantorProcessor extends ReplyProcessor21 {
       processMessage(dm);
     }
 
+    /**
+     * For unit testing we need to push the message through scheduleAction so that message observers
+     * are invoked
+     * 
+     * @param dm the distribution manager
+     */
+    protected void scheduleMessage(DM dm) {
+      if (dm instanceof DistributionManager) {
+        super.scheduleAction((DistributionManager) dm);
+      } else {
+        processMessage(dm);
+      }
+    }
+
     protected void processMessage(DM dm) {
       MessageProcessor processor = nullServiceProcessor;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f02ea36f/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java
index a859299..ca012d3 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java
@@ -15,8 +15,18 @@
 
 package org.apache.geode.distributed.internal.locks;
 
-import org.apache.geode.*;
-import org.apache.geode.distributed.*;
+import org.apache.geode.CancelCriterion;
+import org.apache.geode.CancelException;
+import org.apache.geode.InternalGemFireError;
+import org.apache.geode.InternalGemFireException;
+import org.apache.geode.StatisticsFactory;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.distributed.DistributedLockService;
+import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.distributed.DistributedSystemDisconnectedException;
+import org.apache.geode.distributed.LeaseExpiredException;
+import org.apache.geode.distributed.LockNotHeldException;
+import org.apache.geode.distributed.LockServiceDestroyedException;
 import org.apache.geode.distributed.internal.DM;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
@@ -39,8 +49,18 @@ import org.apache.logging.log4j.Logger;
 
 import java.io.DataInput;
 import java.io.DataOutput;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Callable;
 import java.util.concurrent.CancellationException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicInteger;
 
 /**
@@ -290,7 +310,7 @@ public class DLockService extends DistributedLockService {
         statStart = getStats().startGrantorWait();
         if (!ownLockGrantorFutureResult) {
           LockGrantorId lockGrantorIdRef =
-              waitForLockGrantorFutureResult(lockGrantorFutureResultRef);
+              waitForLockGrantorFutureResult(lockGrantorFutureResultRef, 0, TimeUnit.MILLISECONDS);
           if (lockGrantorIdRef != null) {
             return lockGrantorIdRef;
           } else {
@@ -366,7 +386,7 @@ public class DLockService extends DistributedLockService {
 
   /**
    * Creates a local {@link DLockGrantor}.
-   * 
+   *
    * if (!createLocalGrantor(xxx)) { theLockGrantorId = this.lockGrantorId; }
    * 
    * @param elder the elder that told us to be the grantor
@@ -727,15 +747,24 @@ public class DLockService extends DistributedLockService {
    * Returns lockGrantorId when lockGrantorFutureResultRef has been set by another thread.
    * 
    * @param lockGrantorFutureResultRef FutureResult to wait for
+   * @param timeToWait how many ms to wait, 0 = forever
+   * @param timeUnit the unit of measure for timeToWait
    * @return the LockGrantorId or null if FutureResult was cancelled
    */
-  private LockGrantorId waitForLockGrantorFutureResult(FutureResult lockGrantorFutureResultRef) {
+  private LockGrantorId waitForLockGrantorFutureResult(FutureResult lockGrantorFutureResultRef,
+      long timeToWait, final TimeUnit timeUnit) {
     LockGrantorId lockGrantorIdRef = null;
     while (lockGrantorIdRef == null) {
       boolean interrupted = Thread.interrupted();
       try {
         checkDestroyed();
-        lockGrantorIdRef = (LockGrantorId) lockGrantorFutureResultRef.get();
+        if (timeToWait == 0) {
+          lockGrantorIdRef = (LockGrantorId) lockGrantorFutureResultRef.get();
+        } else {
+          lockGrantorIdRef = (LockGrantorId) lockGrantorFutureResultRef.get(timeToWait, timeUnit);
+        }
+      } catch (TimeoutException e) {
+        break;
       } catch (InterruptedException e) {
         interrupted = true;
         this.dm.getCancelCriterion().checkCancelInProgress(e);
@@ -757,7 +786,14 @@ public class DLockService extends DistributedLockService {
     return lockGrantorIdRef;
   }
 
-  private void notLockGrantorId(LockGrantorId notLockGrantorId, boolean waitForGrantor) {
+  /**
+   * nulls out grantor to force call to elder
+   * 
+   * @param timeToWait how long to wait for a new grantor. -1 don't wait, 0 no time limit
+   * @param timeUnit the unit of measure of timeToWait
+   */
+  private void notLockGrantorId(LockGrantorId notLockGrantorId, long timeToWait,
+      final TimeUnit timeUnit) {
     if (notLockGrantorId.isLocal(getSerialNumber())) {
       if (logger.isTraceEnabled(LogMarker.DLS)) {
         logger.trace(LogMarker.DLS,
@@ -793,8 +829,8 @@ public class DLockService extends DistributedLockService {
 
       statStart = getStats().startGrantorWait();
       if (!ownLockGrantorFutureResult) {
-        if (waitForGrantor) { // fix for bug #43708
-          waitForLockGrantorFutureResult(lockGrantorFutureResultRef);
+        if (timeToWait >= 0) {
+          waitForLockGrantorFutureResult(lockGrantorFutureResultRef, timeToWait, timeUnit);
         }
         return;
       }
@@ -947,7 +983,7 @@ public class DLockService extends DistributedLockService {
           }
         }
         if (!ownLockGrantorFutureResult) {
-          waitForLockGrantorFutureResult(lockGrantorFutureResultRef);
+          waitForLockGrantorFutureResult(lockGrantorFutureResultRef, 0, TimeUnit.MILLISECONDS);
           continue;
         }
       }
@@ -1329,7 +1365,7 @@ public class DLockService extends DistributedLockService {
    *        will be ignored if the lock is currently held by another client.
    *
    * @param interruptible true if this lock request is interruptible
-   * 
+   *
    * @param disableAlerts true to disable logging alerts if the dlock is taking a long time to
    *        acquired.
    *
@@ -1408,7 +1444,6 @@ public class DLockService extends DistributedLockService {
                   LocalizedStrings.DLockService_DEBUG_LOCKINTERRUPTIBLY_HAS_GONE_HOT_AND_LOOPED_0_TIMES
                       .toLocalizedString(count);
 
-
               InternalGemFireError e = new InternalGemFireError(s);
               logger.error(LogMarker.DLS,
                   LocalizedMessage.create(
@@ -1516,7 +1551,6 @@ public class DLockService extends DistributedLockService {
             }
           } // else: non-reentrant or reentrant w/ non-infinite lease
 
-
           if (gotLock) {
             // if (processor != null) (cannot be null)
             { // TODO: can be null after restoring above optimization
@@ -1539,9 +1573,7 @@ public class DLockService extends DistributedLockService {
                       this.lockGrantorId);
                 }
                 continue;
-              }
-
-              else if (isDestroyed()) {
+              } else if (isDestroyed()) {
                 // race: dls was destroyed
                 if (isDebugEnabled_DLS) {
                   logger.trace(LogMarker.DLS,
@@ -1549,9 +1581,7 @@ public class DLockService extends DistributedLockService {
                       theLockGrantorId);
                 }
                 needToReleaseOrphanedGrant = true;
-              }
-
-              else {
+              } else {
                 safeExit = true;
                 synchronized (this.tokens) {
                   checkDestroyed();
@@ -1603,7 +1633,7 @@ public class DLockService extends DistributedLockService {
           // grantor replied NOT_GRANTOR or departed (getLock is false)
           else if (processor.repliedNotGrantor() || processor.hadNoResponse()) {
             safeExit = true;
-            notLockGrantorId(theLockGrantorId, true);
+            notLockGrantorId(theLockGrantorId, 0, TimeUnit.MILLISECONDS);
             // keepTrying is still true... loop back around
           } // grantor replied NOT_GRANTOR or departed
 
@@ -1912,7 +1942,7 @@ public class DLockService extends DistributedLockService {
             released = true;
           } finally {
             if (!released) {
-              notLockGrantorId(theLockGrantorId, true);
+              notLockGrantorId(theLockGrantorId, 0, TimeUnit.MILLISECONDS);
             }
           }
         } // while !released
@@ -1966,7 +1996,7 @@ public class DLockService extends DistributedLockService {
           // loop back around to get next lock grantor
         } finally {
           if (queryReply != null && queryReply.repliedNotGrantor()) {
-            notLockGrantorId(theLockGrantorId, true);
+            notLockGrantorId(theLockGrantorId, 0, TimeUnit.MILLISECONDS);
           }
         }
       } // while querying
@@ -2076,7 +2106,7 @@ public class DLockService extends DistributedLockService {
     return this.dlockStats;
   }
 
-  public void releaseTryLocks(DLockBatchId batchId, boolean onlyIfSameGrantor) {
+  public void releaseTryLocks(DLockBatchId batchId, Callable<Boolean> untilCondition) {
     final boolean isDebugEnabled_DLS = logger.isTraceEnabled(LogMarker.DLS);
     if (isDebugEnabled_DLS) {
       logger.trace(LogMarker.DLS, "[DLockService.releaseTryLocks] enter: {}", batchId);
@@ -2088,26 +2118,29 @@ public class DLockService extends DistributedLockService {
       boolean lockBatch = true;
       boolean released = false;
       while (!released) {
+        try {
+          boolean quit = untilCondition.call();
+          if (quit) {
+            return;
+          }
+        } catch (Exception e) {
+          throw new InternalGemFireException("unexpected exception", e);
+        }
         checkDestroyed();
         LockGrantorId theLockGrantorId = null;
 
-        if (onlyIfSameGrantor) { // this was a fix for bug #38763, from r19555
-          theLockGrantorId = batchId.getLockGrantorId();
-          synchronized (this.lockGrantorIdLock) {
-            if (!checkLockGrantorId(theLockGrantorId)) {
-              // the grantor is different so break and skip DLockReleaseProcessor
-              break;
-            }
+        theLockGrantorId = batchId.getLockGrantorId();
+        synchronized (this.lockGrantorIdLock) {
+          if (!checkLockGrantorId(theLockGrantorId)) {
+            // the grantor is different so break and skip DLockReleaseProcessor
+            break;
           }
-        } else {
-          theLockGrantorId = getLockGrantorId();
         }
 
         released =
             callReleaseProcessor(theLockGrantorId.getLockGrantorMember(), batchId, lockBatch, -1);
         if (!released) {
-          final boolean waitForGrantor = onlyIfSameGrantor; // fix for bug #43708
-          notLockGrantorId(theLockGrantorId, waitForGrantor);
+          notLockGrantorId(theLockGrantorId, 100, TimeUnit.MILLISECONDS);
         }
       }
     } finally {
@@ -2185,7 +2218,7 @@ public class DLockService extends DistributedLockService {
           // should have thrown LockServiceDestroyedException
           Assert.assertTrue(isDestroyed(), "Grantor reports service " + this + " is destroyed");
         } else if (processor.repliedNotGrantor() || processor.hadNoResponse()) {
-          notLockGrantorId(theLockGrantorId, true);
+          notLockGrantorId(theLockGrantorId, 0, TimeUnit.MILLISECONDS);
         } else {
           keyIfFailed[0] = processor.getKeyIfFailed();
           if (keyIfFailed[0] == null) {
@@ -2455,7 +2488,8 @@ public class DLockService extends DistributedLockService {
         if (theLockGrantorId != null && !theLockGrantorId.isLocal(getSerialNumber())) {
           if (!NonGrantorDestroyedProcessor.send(this.serviceName, theLockGrantorId, dm)) {
             // grantor responded NOT_GRANTOR
-            notLockGrantorId(theLockGrantorId, true); // nulls out grantor to force call to elder
+            notLockGrantorId(theLockGrantorId, 0, TimeUnit.MILLISECONDS); // nulls out grantor to
+                                                                          // force call to elder
             retry = true;
           }
         }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f02ea36f/geode-core/src/main/java/org/apache/geode/internal/cache/locks/TXLockServiceImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/locks/TXLockServiceImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/locks/TXLockServiceImpl.java
index f4ab02f..717d878 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/locks/TXLockServiceImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/locks/TXLockServiceImpl.java
@@ -15,13 +15,6 @@
 
 package org.apache.geode.internal.cache.locks;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.logging.log4j.Logger;
-
 import org.apache.geode.cache.CommitConflictException;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ReplyException;
@@ -32,6 +25,12 @@ import org.apache.geode.distributed.internal.membership.InternalDistributedMembe
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.util.concurrent.StoppableReentrantReadWriteLock;
+import org.apache.logging.log4j.Logger;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
 
 /** Provides clean separation of implementation from public facade */
 public class TXLockServiceImpl extends TXLockService {
@@ -50,13 +49,14 @@ public class TXLockServiceImpl extends TXLockService {
   /** Instance of dlock service to use */
   private DLockService dlock;
 
-  /** List of active txLockIds */
+  /**
+   * List of active txLockIds
+   */
   protected List txLockIdList = new ArrayList();
 
   /**
    * True if grantor recovery is in progress; used to keep <code>release</code> from waiting for
-   * grantor. TODO: this boolean can probably be removed... it was insufficient and new fixes for
-   * bug 38763 have the side effect of making this boolean obsolete (verify before removal!)
+   * grantor.
    */
   private volatile boolean recovering = false;
 
@@ -225,10 +225,11 @@ public class TXLockServiceImpl extends TXLockService {
             LocalizedStrings.TXLockServiceImpl_INVALID_TXLOCKID_NOT_FOUND_0
                 .toLocalizedString(txLockId));
       }
-      // only release w/ dlock if not in middle of recovery...
-      if (!this.recovering) {
-        this.dlock.releaseTryLocks(txLockId, true);
-      }
+
+      this.dlock.releaseTryLocks(txLockId, () -> {
+        return this.recovering;
+      });
+
       this.txLockIdList.remove(txLockId);
       releaseRecoveryReadLock();
     }
@@ -243,10 +244,14 @@ public class TXLockServiceImpl extends TXLockService {
   // Internal implementation methods
   // -------------------------------------------------------------------------
 
+  boolean isRecovering() {
+    return this.recovering;
+  }
+
   /** Delays grantor recovery replies until finished with locks */
   void acquireRecoveryWriteLock() throws InterruptedException {
-    this.recoveryLock.writeLock().lockInterruptibly();
     this.recovering = true;
+    this.recoveryLock.writeLock().lockInterruptibly();
   }
 
   void releaseRecoveryWriteLock() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f02ea36f/geode-core/src/main/java/org/apache/geode/internal/cache/locks/TXRecoverGrantorMessageProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/locks/TXRecoverGrantorMessageProcessor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/locks/TXRecoverGrantorMessageProcessor.java
old mode 100755
new mode 100644
index 77dec94..7ae2d2b
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/locks/TXRecoverGrantorMessageProcessor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/locks/TXRecoverGrantorMessageProcessor.java
@@ -15,10 +15,6 @@
 
 package org.apache.geode.internal.cache.locks;
 
-import java.util.concurrent.RejectedExecutionException;
-
-import org.apache.logging.log4j.Logger;
-
 import org.apache.geode.distributed.internal.DM;
 import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.distributed.internal.ReplyException;
@@ -30,11 +26,13 @@ import org.apache.geode.internal.cache.TXCommitMessage;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.logging.log4j.Logger;
+
+import java.util.concurrent.RejectedExecutionException;
 
 /**
  * Provides processing of DLockRecoverGrantorProcessor. Reply will not be sent until all locks are
  * released.
- *
  */
 public class TXRecoverGrantorMessageProcessor
     implements DLockRecoverGrantorProcessor.MessageProcessor {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f02ea36f/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
old mode 100755
new mode 100644
index fb16ea9..6a5eae8
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/locks/TXLockServiceDUnitTest.java
@@ -14,29 +14,25 @@
  */
 package org.apache.geode.internal.cache.locks;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static com.jayway.awaitility.Awaitility.await;
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
 
 import org.apache.geode.cache.CommitConflictException;
 import org.apache.geode.distributed.DistributedLockService;
 import org.apache.geode.distributed.DistributedSystem;
 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.DistributionMessageObserver;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ReplyProcessor21;
 import org.apache.geode.distributed.internal.locks.DLockRecoverGrantorProcessor;
+import org.apache.geode.distributed.internal.locks.DLockRecoverGrantorProcessor.DLockRecoverGrantorMessage;
 import org.apache.geode.distributed.internal.locks.DLockService;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.cache.TXRegionLockRequestImpl;
@@ -44,9 +40,19 @@ import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.Invoke;
 import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.SerializableRunnable;
-import org.apache.geode.test.dunit.ThreadUtils;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
 import org.apache.geode.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
 /**
  * This class tests distributed ownership via the DistributedLockService api.
@@ -75,22 +81,10 @@ public class TXLockServiceDUnitTest extends JUnit4DistributedTestCase {
    */
   @Override
   public final void postSetUp() throws Exception {
-    // Create a DistributedSystem in every VM
+    Invoke.invokeInEveryVM("connectDistributedSystem", () -> connectDistributedSystem());
     connectDistributedSystem();
-
-    for (int h = 0; h < Host.getHostCount(); h++) {
-      Host host = Host.getHost(h);
-
-      for (int v = 0; v < host.getVMCount(); v++) {
-        // host.getVM(v).invoke(() -> TXLockServiceDUnitTest.dumpStack());
-        host.getVM(v).invoke(TXLockServiceDUnitTest.class, "connectDistributedSystem", null);
-      }
-    }
   }
 
-  public static void dumpStack() {
-    org.apache.geode.internal.OSProcess.printStacks(0);
-  }
 
   @Override
   public final void preTearDown() throws Exception {
@@ -124,16 +118,13 @@ public class TXLockServiceDUnitTest extends JUnit4DistributedTestCase {
      */
   }
 
-  @Ignore("TODO: test is disabled")
   @Test
   public void testGetAndDestroyAgain() {
     testGetAndDestroy();
   }
 
-  @Ignore("TODO: test is disabled")
   @Test
   public void testTXRecoverGrantorMessageProcessor() throws Exception {
-    LogWriterUtils.getLogWriter().info("[testTXOriginatorRecoveryProcessor]");
     TXLockService.createDTLS();
     checkDLockRecoverGrantorMessageProcessor();
 
@@ -162,29 +153,158 @@ public class TXLockServiceDUnitTest extends JUnit4DistributedTestCase {
     msg.setProcessorId(testProc.getProcessorId());
     msg.setSender(dlock.getDistributionManager().getId());
 
-    Thread thread = new Thread(new Runnable() {
-      public void run() {
-        TXRecoverGrantorMessageProcessor proc =
-            (TXRecoverGrantorMessageProcessor) dlock.getDLockRecoverGrantorMessageProcessor();
-        proc.processDLockRecoverGrantorMessage(dlock.getDistributionManager(), msg);
-      }
+    Thread thread = new Thread(() -> {
+      TXRecoverGrantorMessageProcessor proc =
+          (TXRecoverGrantorMessageProcessor) dlock.getDLockRecoverGrantorMessageProcessor();
+      proc.processDLockRecoverGrantorMessage(dlock.getDistributionManager(), msg);
     });
+    thread.setName("TXLockServiceDUnitTest thread");
+    thread.setDaemon(true);
     thread.start();
 
-    // pause to allow thread to be blocked before we release the lock
-    sleep(999);
+    await("waiting for recovery message to block").atMost(999, TimeUnit.MILLISECONDS).until(() -> {
+      return ((TXLockServiceImpl) dtls).isRecovering();
+    });
 
-    // release txLock
     dtls.release(txLockId);
 
-    // check results to verify no locks were provided in reply
-    ThreadUtils.join(thread, 30 * 1000);
+    // check results to verify no locks were provided in the reply
+    await("waiting for thread to exit").atMost(30, TimeUnit.SECONDS).until(() -> {
+      return !thread.isAlive();
+    });
+
+    assertFalse(((TXLockServiceImpl) dtls).isRecovering());
+
     assertEquals("testTXRecoverGrantor_replyCode_PASS is false", true,
         testTXRecoverGrantor_replyCode_PASS);
     assertEquals("testTXRecoverGrantor_heldLocks_PASS is false", true,
         testTXRecoverGrantor_heldLocks_PASS);
   }
 
+
+  @Test
+  public void testTXGrantorMigration() throws Exception {
+    // first make sure some other VM is the grantor
+    Host.getHost(0).getVM(0).invoke("become lock grantor", () -> {
+      TXLockService.createDTLS();
+      TXLockService vm0dtls = TXLockService.getDTLS();
+      DLockService vm0dlock = ((TXLockServiceImpl) vm0dtls).getInternalDistributedLockService();
+      vm0dlock.becomeLockGrantor();
+    });
+
+    TXLockService.createDTLS();
+    checkDLockRecoverGrantorMessageProcessor();
+
+    /*
+     * call TXRecoverGrantorMessageProcessor.process directly to make sure that correct behavior
+     * occurs
+     */
+
+    // get txLock and hold it
+    final List regionLockReqs = new ArrayList();
+    regionLockReqs.add(new TXRegionLockRequestImpl("/testTXRecoverGrantorMessageProcessor2",
+        new HashSet(Arrays.asList(new String[] {"KEY-1", "KEY-2", "KEY-3", "KEY-4"}))));
+    TXLockService dtls = TXLockService.getDTLS();
+    TXLockId txLockId = dtls.txLock(regionLockReqs, Collections.EMPTY_SET);
+
+    final DLockService dlock = ((TXLockServiceImpl) dtls).getInternalDistributedLockService();
+
+    // GEODE-2024: now cause grantor migration while holding the recoveryReadLock.
+    // It will lock up in TXRecoverGrantorMessageProcessor until the recoveryReadLock
+    // is released. Demonstrate that dtls.release() does not block forever and releases the
+    // recoveryReadLock
+    // allowing grantor migration to finish
+
+    // create an observer that will block recovery messages from being processed
+    MessageObserver observer = new MessageObserver();
+    DistributionMessageObserver.setInstance(observer);
+
+    try {
+      System.out.println("starting thread to take over being lock grantor from vm0");
+
+      // become the grantor - this will block waiting for a reply to the message blocked by the
+      // observer
+      Thread thread = new Thread(() -> {
+        dlock.becomeLockGrantor();
+      });
+      thread.setName("TXLockServiceDUnitTest thread2");
+      thread.setDaemon(true);
+      thread.start();
+
+      await("waiting for recovery to begin").atMost(10, TimeUnit.SECONDS).until(() -> {
+        return observer.isPreventingProcessing();
+      });
+
+
+      // spawn a thread that will unblock message processing
+      // so that TXLockServiceImpl's "recovering" variable will be set
+      System.out.println("starting a thread to unblock recovery in 5 seconds");
+      Thread unblockThread = new Thread(() -> {
+        try {
+          Thread.sleep(5000);
+        } catch (InterruptedException e) {
+          throw new RuntimeException("sleep interrupted");
+        }
+        System.out.println("releasing block of recovery message processing");
+        observer.releasePreventionOfProcessing();
+      });
+      unblockThread.setName("TXLockServiceDUnitTest unblockThread");
+      unblockThread.setDaemon(true);
+      unblockThread.start();
+
+      // release txLock - this will block until unblockThread tells the observer
+      // that it can process its message. Then it should release the recovery read-lock
+      // allowing the grantor to finish recovery
+      System.out.println("releasing transaction locks, which should block for a bit");
+      dtls.release(txLockId);
+
+      await("waiting for recovery to finish").atMost(10, TimeUnit.SECONDS).until(() -> {
+        return !((TXLockServiceImpl) dtls).isRecovering();
+      });
+    } finally {
+      observer.releasePreventionOfProcessing();
+      DistributionMessageObserver.setInstance(null);
+    }
+  }
+
+  static class MessageObserver extends DistributionMessageObserver {
+    final boolean[] preventingMessageProcessing = new boolean[] {false};
+    final boolean[] preventMessageProcessing = new boolean[] {true};
+
+
+    public boolean isPreventingProcessing() {
+      synchronized (preventingMessageProcessing) {
+        return preventingMessageProcessing[0];
+      }
+    }
+
+    public void releasePreventionOfProcessing() {
+      synchronized (preventMessageProcessing) {
+        preventMessageProcessing[0] = false;
+      }
+    }
+
+    @Override
+    public void beforeProcessMessage(DistributionManager dm, DistributionMessage message) {
+      if (message instanceof DLockRecoverGrantorMessage) {
+        synchronized (preventingMessageProcessing) {
+          preventingMessageProcessing[0] = true;
+        }
+        synchronized (preventMessageProcessing) {
+          while (preventMessageProcessing[0]) {
+            try {
+              preventMessageProcessing.wait(50);
+            } catch (InterruptedException e) {
+              throw new RuntimeException("sleep interrupted");
+            }
+          }
+        }
+      }
+    }
+
+  }
+
+
   protected static volatile TXLockId testTXLock_TXLockId;
 
   @Test
@@ -384,7 +504,6 @@ public class TXLockServiceDUnitTest extends JUnit4DistributedTestCase {
     });
     Host.getHost(0).getVM(originatorVM).invoke(() -> disconnectFromDS());
 
-
     // grantor sends TXOriginatorRecoveryMessage...
     // TODO: verify processing of message? and have test sleep until finished
     sleep(200);
@@ -456,7 +575,7 @@ public class TXLockServiceDUnitTest extends JUnit4DistributedTestCase {
 
   /**
    * Creates a new DistributedLockService in a remote VM.
-   *
+   * 
    * @param name The name of the newly-created DistributedLockService. It is recommended that the
    *        name of the Region be the {@link #getUniqueName()} of the test, or at least derive from
    *        it.
@@ -594,9 +713,6 @@ public class TXLockServiceDUnitTest extends JUnit4DistributedTestCase {
 
   /**
    * Accessed via reflection. DO NOT REMOVE
-   * 
-   * @param key
-   * @return
    */
   protected static Boolean unlock_DTLS(Object key) {
     TXLockService dtls = TXLockService.getDTLS();


[04/50] [abbrv] incubator-geode git commit: Adding 1.0.0-incubating to the releases page

Posted by kl...@apache.org.
Adding 1.0.0-incubating to the releases page


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

Branch: refs/heads/feature/GEODE-288
Commit: 60f8a808096d7d8c7ca74ad6545d63f88a42e888
Parents: 06de527
Author: Swapnil Bawaskar <sb...@pivotal.io>
Authored: Tue Oct 25 14:38:50 2016 -0700
Committer: Swapnil Bawaskar <sb...@pivotal.io>
Committed: Tue Oct 25 14:38:50 2016 -0700

----------------------------------------------------------------------
 geode-site/website/content/releases/index.html | 51 +++++++++++++++++++++
 1 file changed, 51 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/60f8a808/geode-site/website/content/releases/index.html
----------------------------------------------------------------------
diff --git a/geode-site/website/content/releases/index.html b/geode-site/website/content/releases/index.html
index c5d4971..51e3096 100644
--- a/geode-site/website/content/releases/index.html
+++ b/geode-site/website/content/releases/index.html
@@ -34,6 +34,57 @@ under the License. -->
 				  </p>
       <!-- RELEASES -->
       <div class="container">
+        <!-- START OF 1.0 -->
+        <h3><span class="icon-flag-checkered"> 1.0.0-incubating</span></h3>
+        <!-- BINARY -->
+        <ul>
+            <span class="icon-cloud-download"> <strong>Binaries </strong>
+              [ <a href="http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip">ZIP</a>, <a href="https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip.sha256">SHA-256</a>,
+              <a href="https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.zip.asc">PGP</a> ] -
+              [<a href="http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz">TAR.GZ</a>, <a href="https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz.sha256">SHA-256</a>,
+              <a href="https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-1.0.0-incubating.tar.gz.asc">PGP</a> ]
+              </span>
+
+              <blockquote>Binary downloads are provided for the convenience of our users and are not official Apache Geode releases. </blockquote>
+            </li>
+        </ul>
+        <!-- SOURCE -->
+        <ul>
+            <span class="icon-cloud-download"> <strong>Source</strong>
+               [ <a href="http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip">ZIP</a>, <a href="https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip.sha256">SHA-256</a>,
+               <a href="https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.zip.asc">PGP</a>
+                ] -
+               [<a href="http://apache.org/dyn/closer.cgi/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz">TAR.GZ</a>, <a href="https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz.sha256">SHA-256</a>,
+               <a href="https://dist.apache.org/repos/dist/release/incubator/geode/1.0.0-incubating/apache-geode-src-1.0.0-incubating.tar.gz.asc">PGP</a>
+               ]
+             </span>
+            </li>
+        </ul>
+        <!-- DEPENDENCY MANAGERS -->
+        <div class="container">
+          <h4><span class="icon-archive"> Dependency Managers</span></h4>
+          <ul>
+              <li> <strong>Gradle</strong>
+                <pre class="prettyprint">
+  dependencies {
+      compile 'org.apache.geode:geode-core:1.0.0-incubating'
+  }</pre>
+                <!-- ><script src="https://gist.github.com/markito/b7796cafef4bd273bd07.js"></script>-->
+              </li>
+              <li> <strong>Maven</strong>
+                <pre class="prettyprint">
+  &lt;dependencies&gt;
+     &lt;dependency&gt;
+        &lt;groupId&gt;org.apache.geode&lt;/groupId&gt;
+        &lt;artifactId&gt;geode-core&lt;/artifactId&gt;
+        &lt;version&gt;1.0.0-incubating&lt;/version&gt;
+     &lt;/dependency&gt;
+  &lt;/dependencies&gt;</pre>
+              </li>
+          </ul>
+        </div>
+        <!-- END OF 1.0 -->
+
         <!-- START OF M3 -->
         <h3><span class="icon-flag-checkered"> 1.0.0-incubating.M3</span></h3>
         <!-- BINARY -->


[06/50] [abbrv] incubator-geode git commit: Removing old text about 1.0 GA release

Posted by kl...@apache.org.
Removing old text about 1.0 GA release


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

Branch: refs/heads/feature/GEODE-288
Commit: 1d9a4ed62faa6c7e8ca23491b1a8a20c701e508c
Parents: be2a404
Author: Swapnil Bawaskar <sb...@pivotal.io>
Authored: Tue Oct 25 15:17:25 2016 -0700
Committer: Swapnil Bawaskar <sb...@pivotal.io>
Committed: Tue Oct 25 15:18:00 2016 -0700

----------------------------------------------------------------------
 geode-site/website/content/releases/index.html | 6 ------
 1 file changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1d9a4ed6/geode-site/website/content/releases/index.html
----------------------------------------------------------------------
diff --git a/geode-site/website/content/releases/index.html b/geode-site/website/content/releases/index.html
index 51e3096..63f685e 100644
--- a/geode-site/website/content/releases/index.html
+++ b/geode-site/website/content/releases/index.html
@@ -238,12 +238,6 @@ under the License. -->
       </div>
       <!-- END OF RELEASE -->
       <hr/>
-      <div class="container done">
-        <h3><span class="icon-flag-checkered"> General Availability (GA) Releases - Geode 1.0.0</span></h3>
-        Coming soon.
-        <br/>
-      </div>
-      <hr/>
         <p>
 					Project releases are approved by vote of the Apache Geode Podling Project Management Committee (PPMC) and Apache Incubator (PMC). Support for a release is provided by project volunteers on the project <a href="http://geode.incubator.apache.org/community/#mailing-lists">mailing lists</a>. Bugs found in a release may be discussed on the list and reported through the <a href="https://issues.apache.org/jira/browse/GEODE">issue tracker</a>. The user mailing list and issue tracker are the only support options hosted by the Apache Geode project.
 				</p>


[34/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticAttributeInfo.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticAttributeInfo.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticAttributeInfo.java
deleted file mode 100755
index c257ad5..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticAttributeInfo.java
+++ /dev/null
@@ -1,71 +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.admin.jmx.internal;
-
-import org.apache.geode.admin.Statistic;
-import org.apache.geode.internal.Assert;
-
-import javax.management.Descriptor;
-import javax.management.modelmbean.DescriptorSupport;
-import javax.management.modelmbean.ModelMBeanAttributeInfo;
-
-/**
- * Subclass of AttributeInfo with {@link org.apache.geode.admin.Statistic} added for use as the
- * {@link javax.management.modelmbean.ModelMBeanAttributeInfo} descriptor's <i>targetObject</i>
- * value.
- *
- * @since GemFire 3.5
- *
- */
-class StatisticAttributeInfo extends org.apache.commons.modeler.AttributeInfo {
-  private static final long serialVersionUID = 28022387514935560L;
-
-  private Statistic stat;
-
-  public StatisticAttributeInfo() {
-    super();
-  }
-
-  public Statistic getStat() {
-    return this.stat;
-  }
-
-  public void setStat(Statistic stat) {
-    // System.out.println(">> stat = " + stat);
-    Assert.assertTrue(stat != null, "Attempting to set stat to null");
-    this.stat = stat;
-  }
-
-  @Override
-  public ModelMBeanAttributeInfo createAttributeInfo() {
-    Descriptor desc = new DescriptorSupport(new String[] {"name=" + this.displayName,
-        "descriptorType=attribute", "currencyTimeLimit=-1", // always stale
-        "displayName=" + this.displayName, "getMethod=getValue"});
-
-    Assert.assertTrue(this.stat != null, "Stat target object is null!");
-    desc.setField("targetObject", this.stat);
-
-    ModelMBeanAttributeInfo info = new ModelMBeanAttributeInfo(this.displayName, // name
-        this.type, // type
-        this.description, // description
-        this.readable, // isReadable
-        this.writeable, // isWritable
-        this.is, // isIs
-        desc);
-
-    return info;
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticResourceJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticResourceJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticResourceJmxImpl.java
deleted file mode 100755
index 4f46d5a..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatisticResourceJmxImpl.java
+++ /dev/null
@@ -1,344 +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.admin.jmx.internal;
-
-import javax.management.Notification;
-import javax.management.ObjectName;
-import javax.management.modelmbean.ModelMBean;
-import javax.naming.OperationNotSupportedException;
-
-import org.apache.commons.modeler.ManagedBean;
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.LogWriter;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.Statistic;
-import org.apache.geode.internal.admin.StatResource;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-
-/**
- * Provides MBean support for the monitoring of a statistic resource.
- *
- * @since GemFire 3.5
- *
- */
-public class StatisticResourceJmxImpl extends org.apache.geode.admin.internal.StatisticResourceImpl
-    implements javax.management.NotificationListener,
-    org.apache.geode.admin.jmx.internal.ManagedResource {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /**
-   * Interval in seconds between refreshes. Values less than one results in no refreshing .
-   */
-  private int refreshInterval = 0;
-
-  /** The JMX object name of this managed resource */
-  private ObjectName objectName;
-
-  /** A flag to indicate if time is inited. MBeanUtil lookup is costly */
-  private boolean timerInited = false;
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructor for the StatisticResource object
-   *
-   * @param statResource the admin StatResource to manage/monitor
-   * @param member the SystemMember owning this resource
-   * @exception org.apache.geode.admin.AdminException if unable to create this StatisticResource for
-   *            administration
-   */
-  public StatisticResourceJmxImpl(StatResource statResource, SystemMemberJmx member)
-      throws org.apache.geode.admin.AdminException {
-    super(statResource, member);
-    initializeMBean();
-  }
-
-  /** Create and register the MBean to manage this resource */
-  private void initializeMBean() throws org.apache.geode.admin.AdminException {
-    this.mbeanName = new StringBuffer("GemFire.Statistic:").append("source=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(this.member.getId())).append(",type=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(getType())).append(",name=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(getName())).append(",uid=")
-        .append(getUniqueId()).toString();
-
-    this.objectName =
-        MBeanUtil.createMBean(this, addDynamicAttributes(MBeanUtil.lookupManagedBean(this)));
-
-    // Refresh Interval
-    AdminDistributedSystemJmxImpl sysJmx =
-        (AdminDistributedSystemJmxImpl) this.member.getDistributedSystem();
-    if (sysJmx.getRefreshInterval() > 0)
-      this.refreshInterval = sysJmx.getRefreshInterval();
-  }
-
-  // -------------------------------------------------------------------------
-  // MBean attributes - accessors/mutators
-  // -------------------------------------------------------------------------
-
-  /**
-   * Gets the interval in seconds between statistics refreshes
-   *
-   * @return the current refresh interval in seconds
-   */
-  public int getRefreshInterval() {
-    return this.refreshInterval;
-  }
-
-  /**
-   * Sets interval in seconds between statistic refreshes; zero or less turns off auto refreshing.
-   * Manual refreshing has no effect on when the next scheduled refresh will occur.
-   *
-   * @param refreshInterval the new refresh interval in seconds
-   */
-  private void _setRefreshInterval(int refreshInterval) {
-    boolean isRegistered = MBeanUtil.isRefreshNotificationRegistered(this,
-        RefreshNotificationType.STATISTIC_RESOURCE_STATISTICS);
-
-    if (isRegistered && (getRefreshInterval() == refreshInterval))
-      return;
-
-    try {
-      MBeanUtil.registerRefreshNotification(this, // NotificationListener
-          getMBeanName(), // User Data as MBean Name
-          RefreshNotificationType.STATISTIC_RESOURCE_STATISTICS, refreshInterval); // int
-
-      this.refreshInterval = refreshInterval;
-      timerInited = true;
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e); // dead in water, print, and then ignore
-      this.refreshInterval = 0; // zero out to avoid more exceptions
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e); // dead in water, print, and then ignore
-      this.refreshInterval = 0; // zero out to avoid more exceptions
-    }
-  }
-
-  /**
-   * RefreshInterval is now set only through the AdminDistributedSystem property refreshInterval.
-   * Attempt to set refreshInterval on StatisticResourceJmx MBean would result in an
-   * OperationNotSupportedException Auto-refresh is enabled on demand when a call to getStatistics
-   * is made
-   * 
-   * @param refreshInterval the new refresh interval in seconds
-   * @deprecated since 6.0 use DistributedSystemConfig.refreshInterval instead
-   */
-  @Deprecated
-  public void setRefreshInterval(int refreshInterval) throws OperationNotSupportedException {
-    throw new OperationNotSupportedException(
-        LocalizedStrings.MANAGED_RESOURCE_REFRESH_INTERVAL_CANT_BE_SET_DIRECTLY
-            .toLocalizedString());
-  }
-
-  // -------------------------------------------------------------------------
-  // JMX Notification listener
-  // -------------------------------------------------------------------------
-
-  /**
-   * Handles notification to refresh. Reacts by refreshing the values of this SystemMember's
-   * ConfigurationParamaters. Any other notification is ignored. Given notification is handled only
-   * if there is any JMX client connected to the system.
-   * <p>
-   * TODO: investigate use of NotificationFilter instead of explicit check...
-   * 
-   * @param notification the JMX notification being received
-   * @param hb handback object is unused
-   */
-  public void handleNotification(Notification notification, Object hb) {
-    AdminDistributedSystemJmxImpl adminDSJmx =
-        (AdminDistributedSystemJmxImpl) this.member.getDistributedSystem();
-
-    String typeStatResourceStats = RefreshNotificationType.STATISTIC_RESOURCE_STATISTICS.getType();
-
-    if (typeStatResourceStats.equals(notification.getType())
-        && getMBeanName().equals(notification.getUserData())
-        && !adminDSJmx.isRmiClientCountZero()) {
-      try {
-        refresh();
-
-      } catch (org.apache.geode.admin.AdminException e) {
-        logger.warn(e.getMessage(), e);
-      } catch (org.apache.geode.admin.OperationCancelledException e) {
-        // underlying resource is no longer reachable by remote admin
-        logger.warn(e.getMessage(), e);
-        _setRefreshInterval(0);
-      } catch (CancelException e) {
-        // shutting down - okay to ignore
-      } catch (java.lang.RuntimeException e) {
-        logger.debug(e.getMessage(), e); // dead in water, print, and then ignore
-        _setRefreshInterval(0); // zero out to avoid more exceptions
-      } catch (VirtualMachineError err) {
-        SystemFailure.initiateFailure(err);
-        // If this ever returns, rethrow the error. We're poisoned
-        // now, so don't let this thread continue.
-        throw err;
-      } catch (java.lang.Error e) {
-        // Whenever you catch Error or Throwable, you must also
-        // catch VirtualMachineError (see above). However, there is
-        // _still_ a possibility that you are dealing with a cascading
-        // error condition, so you also need to check to see if the JVM
-        // is still usable:
-        SystemFailure.checkFailure();
-        logger.error(e.getMessage(), e); // dead in water, print, and then ignore
-        this.refreshInterval = 0; // zero out to avoid more exceptions
-      }
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // Create MBean attributes for each Statistic
-  // -------------------------------------------------------------------------
-
-  /**
-   * Add MBean attribute definitions for each Statistic.
-   *
-   * @param managed the mbean definition to add attributes to
-   * @return a new instance of ManagedBean copied from <code>managed</code> but with the new
-   *         attributes added
-   */
-  ManagedBean addDynamicAttributes(ManagedBean managed)
-      throws org.apache.geode.admin.AdminException {
-    if (managed == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.StatisticResourceJmxImpl_MANAGEDBEAN_IS_NULL.toLocalizedString());
-    }
-
-    refresh(); // to get the stats...
-
-    // need to create a new instance of ManagedBean to clean the "slate"...
-    ManagedBean newManagedBean = new DynamicManagedBean(managed);
-    for (int i = 0; i < this.statistics.length; i++) {
-      StatisticAttributeInfo attrInfo = new StatisticAttributeInfo();
-
-      attrInfo.setName(this.statistics[i].getName());
-      attrInfo.setDisplayName(this.statistics[i].getName());
-      attrInfo.setDescription(this.statistics[i].getDescription());
-      attrInfo.setType("java.lang.Number");
-
-      attrInfo.setIs(false);
-      attrInfo.setReadable(true);
-      attrInfo.setWriteable(false);
-
-      attrInfo.setStat(this.statistics[i]);
-
-      newManagedBean.addAttribute(attrInfo);
-    }
-    return newManagedBean;
-  }
-
-  public Statistic[] getStatistics() {
-    if (!timerInited) {
-      // 1st call to getStatistics would trigger
-      // the auto-refresh if an interval is set
-      if (this.refreshInterval > 0) {
-        this._setRefreshInterval(this.refreshInterval);
-      }
-    }
-
-    if (this.statistics == null) {
-      try {
-        this.refresh();
-      } catch (AdminException e) {
-        this.statistics = new Statistic[0];
-      }
-    }
-
-    return this.statistics;
-  }
-
-  // -------------------------------------------------------------------------
-  // ManagedResource implementation
-  // -------------------------------------------------------------------------
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.STATISTIC_RESOURCE;
-  }
-
-  public void cleanupResource() {
-    this.modelMBean = null;
-    this.member = null;
-    this.statistics = null;
-    this.statResource = null;
-  }
-
-  /**
-   * Checks equality of the given object with <code>this</code> based on the type (Class) and the
-   * MBean Name returned by <code>getMBeanName()</code> methods.
-   * 
-   * @param obj object to check equality with
-   * @return true if the given object is if the same type and its MBean Name is same as
-   *         <code>this</code> object's MBean Name, false otherwise
-   */
-  @Override
-  public boolean equals(Object obj) {
-    if (!(obj instanceof StatisticResourceJmxImpl)) {
-      return false;
-    }
-
-    StatisticResourceJmxImpl other = (StatisticResourceJmxImpl) obj;
-
-    return this.getMBeanName().equals(other.getMBeanName());
-  }
-
-  /**
-   * Returns hash code for <code>this</code> object which is based on the MBean Name generated.
-   * 
-   * @return hash code for <code>this</code> object
-   */
-  @Override
-  public int hashCode() {
-    return this.getMBeanName().hashCode();
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberBridgeServerJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberBridgeServerJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberBridgeServerJmxImpl.java
deleted file mode 100644
index 6206340..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberBridgeServerJmxImpl.java
+++ /dev/null
@@ -1,123 +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.admin.jmx.internal;
-
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.internal.SystemMemberBridgeServerImpl;
-import org.apache.geode.admin.internal.SystemMemberCacheImpl;
-import org.apache.geode.internal.admin.AdminBridgeServer;
-import org.apache.geode.internal.admin.GemFireVM;
-
-import javax.management.ObjectName;
-import javax.management.modelmbean.ModelMBean;
-
-/**
- * MBean representation of a {@link org.apache.geode.admin.SystemMemberBridgeServer}.
- *
- * @since GemFire 4.0
- */
-public class SystemMemberBridgeServerJmxImpl extends SystemMemberBridgeServerImpl
-    implements ManagedResource {
-
-  /** The object name of this managed resource */
-  private ObjectName objectName;
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  ////////////////////// Constructors //////////////////////
-
-  /**
-   * Creates a new <code>SystemMemberBridgeServerJmxImpl</code> that serves the contents of the
-   * given cache.
-   */
-  SystemMemberBridgeServerJmxImpl(SystemMemberCacheImpl cache, AdminBridgeServer bridgeInfo)
-      throws AdminException {
-
-    super(cache, bridgeInfo);
-    initializeMBean(cache);
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Creates and registers the MBean to manage this resource
-   */
-  private void initializeMBean(SystemMemberCacheImpl cache) throws AdminException {
-
-    GemFireVM vm = cache.getVM();
-    this.mbeanName = new StringBuffer("GemFire.Cache:").append("name=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(cache.getName())).append(",id=")
-        .append(this.getBridgeId()).append(",owner=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(vm.getId().toString()))
-        .append(",type=CacheServer").toString();
-
-    this.objectName = MBeanUtil.createMBean(this);
-  }
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.SYSTEM_MEMBER_CACHE_SERVER;
-  }
-
-  public void cleanupResource() {}
-
-  /**
-   * Checks equality of the given object with <code>this</code> based on the type (Class) and the
-   * MBean Name returned by <code>getMBeanName()</code> methods.
-   * 
-   * @param obj object to check equality with
-   * @return true if the given object is if the same type and its MBean Name is same as
-   *         <code>this</code> object's MBean Name, false otherwise
-   */
-  @Override
-  public boolean equals(Object obj) {
-    if (!(obj instanceof SystemMemberBridgeServerJmxImpl)) {
-      return false;
-    }
-
-    SystemMemberBridgeServerJmxImpl other = (SystemMemberBridgeServerJmxImpl) obj;
-
-    return this.getMBeanName().equals(other.getMBeanName());
-  }
-
-  /**
-   * Returns hash code for <code>this</code> object which is based on the MBean Name generated.
-   * 
-   * @return hash code for <code>this</code> object
-   */
-  @Override
-  public int hashCode() {
-    return this.getMBeanName().hashCode();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberCacheJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberCacheJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberCacheJmxImpl.java
deleted file mode 100644
index ebce869..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberCacheJmxImpl.java
+++ /dev/null
@@ -1,445 +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.admin.jmx.internal;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.management.modelmbean.ModelMBean;
-
-import org.apache.commons.modeler.ManagedBean;
-import org.apache.logging.log4j.Level;
-
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.SystemMemberCacheServer;
-import org.apache.geode.admin.SystemMemberRegion;
-import org.apache.geode.admin.internal.SystemMemberBridgeServerImpl;
-import org.apache.geode.cache.Region;
-import org.apache.geode.internal.admin.AdminBridgeServer;
-import org.apache.geode.internal.admin.GemFireVM;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.InternalLogWriter;
-
-/**
- * MBean representation of {@link org.apache.geode.admin.SystemMemberCache}.
- *
- * @since GemFire 3.5
- */
-public class SystemMemberCacheJmxImpl extends org.apache.geode.admin.internal.SystemMemberCacheImpl
-    implements org.apache.geode.admin.jmx.internal.ManagedResource {
-
-  /** The object name of this managed resource */
-  private ObjectName objectName;
-
-  /** collection to collect all the resources created for this member */
-  private Map<String, SystemMemberRegionJmxImpl> managedRegionResourcesMap =
-      new HashMap<String, SystemMemberRegionJmxImpl>();
-  private Map<Number, SystemMemberBridgeServerJmxImpl> managedCacheServerResourcesMap =
-      new HashMap<Number, SystemMemberBridgeServerJmxImpl>();
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs an instance of SystemMemberCacheJmxImpl.
-   *
-   * @param vm The vm owning the cache this object will manage
-   */
-  public SystemMemberCacheJmxImpl(GemFireVM vm) throws org.apache.geode.admin.AdminException {
-    super(vm);
-    initializeMBean();
-  }
-
-  /** Create and register the MBean to manage this resource */
-  private void initializeMBean() throws org.apache.geode.admin.AdminException {
-    this.mbeanName = new StringBuffer("GemFire.Cache:").append("name=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(getName())).append(",id=").append(getId())
-        .append(",owner=").append(MBeanUtil.makeCompliantMBeanNameProperty(vm.getId().toString()))
-        .append(",type=Cache").toString();
-
-    this.objectName =
-        MBeanUtil.createMBean(this, addDynamicAttributes(MBeanUtil.lookupManagedBean(this)));
-  }
-
-  // -------------------------------------------------------------------------
-  // Template methods overriden from superclass...
-  // -------------------------------------------------------------------------
-
-  /**
-   * Override createSystemMemberRegion by instantiating SystemMemberRegionJmxImpl. This instance is
-   * also added to the managedResources collection.
-   * 
-   * @param r reference to Region instance for which this JMX resource is to be created
-   * @return SystemMemberRegionJmxImpl - JMX Implementation of SystemMemberRegion
-   * @throws AdminException if constructing SystemMemberRegionJmxImpl instance fails
-   */
-  @Override
-  protected SystemMemberRegion createSystemMemberRegion(Region r)
-      throws org.apache.geode.admin.AdminException {
-    SystemMemberRegionJmxImpl managedSystemMemberRegion = null;
-    boolean needsRefresh = false;
-    synchronized (this.managedRegionResourcesMap) {
-      /*
-       * Ensuring that a single instance of System Member Region is created per Region.
-       */
-      SystemMemberRegionJmxImpl managedResource = managedRegionResourcesMap.get(r.getFullPath());
-      if (managedResource != null) {
-        managedSystemMemberRegion = managedResource;
-      } else {
-        managedSystemMemberRegion = new SystemMemberRegionJmxImpl(this, r);
-        managedRegionResourcesMap.put(r.getFullPath(), managedSystemMemberRegion);
-        needsRefresh = true;
-      }
-    }
-    if (needsRefresh) {
-      managedSystemMemberRegion.refresh();
-    }
-    return managedSystemMemberRegion;
-  }
-
-  /**
-   * Creates a SystemMemberBridgeServerJmxImpl instance. This instance is also added to the
-   * managedResources collection.
-   * 
-   * @param bridge reference to AdminBridgeServer for which this JMX resource is to be created
-   * @return SystemMemberBridgeServerJmxImpl - JMX Implementation of SystemMemberBridgeServerImpl
-   * @throws AdminException if constructing SystemMemberBridgeServerJmxImpl instance fails
-   */
-  @Override
-  protected SystemMemberBridgeServerImpl createSystemMemberBridgeServer(AdminBridgeServer bridge)
-      throws AdminException {
-    SystemMemberBridgeServerJmxImpl managedSystemMemberBridgeServer = null;
-    synchronized (this.managedCacheServerResourcesMap) {
-      /*
-       * Ensuring that a single instance of SystemMember BridgeServer is created per
-       * AdminBridgeServer.
-       */
-      SystemMemberBridgeServerJmxImpl managedCacheServerResource =
-          managedCacheServerResourcesMap.get(bridge.getId());
-      if (managedCacheServerResource != null) {
-        managedSystemMemberBridgeServer = managedCacheServerResource;
-      } else {
-        managedSystemMemberBridgeServer = new SystemMemberBridgeServerJmxImpl(this, bridge);
-        managedCacheServerResourcesMap.put(bridge.getId(), managedSystemMemberBridgeServer);
-      }
-    }
-    return managedSystemMemberBridgeServer;
-  }
-
-  // -------------------------------------------------------------------------
-  // Create MBean attributes for each Statistic
-  // -------------------------------------------------------------------------
-
-  /**
-   * Add MBean attribute definitions for each Statistic.
-   *
-   * @param managed the mbean definition to add attributes to
-   * @return a new instance of ManagedBean copied from <code>managed</code> but with the new
-   *         attributes added
-   */
-  ManagedBean addDynamicAttributes(ManagedBean managed)
-      throws org.apache.geode.admin.AdminException {
-    if (managed == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.SystemMemberCacheJmxImpl_MANAGEDBEAN_IS_NULL.toLocalizedString());
-    }
-
-    refresh(); // to get the stats...
-
-    // need to create a new instance of ManagedBean to clean the "slate"...
-    ManagedBean newManagedBean = new DynamicManagedBean(managed);
-    for (int i = 0; i < this.statistics.length; i++) {
-      StatisticAttributeInfo attrInfo = new StatisticAttributeInfo();
-
-      attrInfo.setName(this.statistics[i].getName());
-      attrInfo.setDisplayName(this.statistics[i].getName());
-      attrInfo.setDescription(this.statistics[i].getDescription());
-      attrInfo.setType("java.lang.Number");
-
-      attrInfo.setIs(false);
-      attrInfo.setReadable(true);
-      attrInfo.setWriteable(false);
-
-      attrInfo.setStat(this.statistics[i]);
-
-      newManagedBean.addAttribute(attrInfo);
-    }
-
-    return newManagedBean;
-  }
-
-  // -------------------------------------------------------------------------
-  // MBean Operations
-  // -------------------------------------------------------------------------
-
-  /**
-   * Returns the ObjectName of the Region for the specified path.
-   *
-   * @throws AdminException If no region with path <code>path</code> exists
-   */
-  public ObjectName manageRegion(String path) throws AdminException, MalformedObjectNameException {
-    try {
-      SystemMemberRegionJmxImpl region = null;
-
-      try {
-        region = (SystemMemberRegionJmxImpl) getRegion(path);
-
-      } catch (AdminException e) {
-        MBeanUtil.logStackTrace(Level.WARN, e);
-        throw e;
-      }
-
-      if (region == null) {
-        throw new AdminException(
-            LocalizedStrings.SystemMemberCacheJmxImpl_THIS_CACHE_DOES_NOT_CONTAIN_REGION_0
-                .toLocalizedString(path));
-
-      } else {
-        return ObjectName.getInstance(region.getMBeanName());
-      }
-    } catch (RuntimeException e) {
-      MBeanUtil.logStackTrace(Level.WARN, e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      MBeanUtil.logStackTrace(Level.ERROR, e);
-      throw e;
-    }
-  }
-
-  /**
-   * Creates a new cache server MBean and returns its <code>ObjectName</code>.
-   *
-   * @since GemFire 5.7
-   */
-  public ObjectName manageCacheServer() throws AdminException, MalformedObjectNameException {
-
-    try {
-      SystemMemberBridgeServerJmxImpl bridge = (SystemMemberBridgeServerJmxImpl) addCacheServer();
-      return ObjectName.getInstance(bridge.getMBeanName());
-    } catch (AdminException e) {
-      MBeanUtil.logStackTrace(Level.WARN, e);
-      throw e;
-    } catch (RuntimeException e) {
-      MBeanUtil.logStackTrace(Level.WARN, e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      MBeanUtil.logStackTrace(Level.ERROR, e);
-      throw e;
-    }
-  }
-
-  /**
-   * Returns the MBean <code>ObjectName</code>s for all cache servers that serve this cache to
-   * clients.
-   *
-   * @since GemFire 4.0
-   */
-  public ObjectName[] manageCacheServers() throws AdminException, MalformedObjectNameException {
-
-    try {
-      SystemMemberCacheServer[] bridges = getCacheServers();
-      ObjectName[] names = new ObjectName[bridges.length];
-      for (int i = 0; i < bridges.length; i++) {
-        SystemMemberBridgeServerJmxImpl bridge = (SystemMemberBridgeServerJmxImpl) bridges[i];
-        names[i] = ObjectName.getInstance(bridge.getMBeanName());
-      }
-
-      return names;
-    } catch (AdminException e) {
-      MBeanUtil.logStackTrace(Level.WARN, e);
-      throw e;
-    } catch (RuntimeException e) {
-      MBeanUtil.logStackTrace(Level.WARN, e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      MBeanUtil.logStackTrace(Level.ERROR, e);
-      throw e;
-    }
-  }
-
-  /**
-   * Returns the MBean <code>ObjectName</code>s for all bridge servers that serve this cache.
-   *
-   * @since GemFire 4.0
-   * @deprecated as of 5.7
-   */
-  @Deprecated
-  public ObjectName[] manageBridgeServers() throws AdminException, MalformedObjectNameException {
-    return manageCacheServers();
-  }
-
-  // -------------------------------------------------------------------------
-  // ManagedResource implementation
-  // -------------------------------------------------------------------------
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.SYSTEM_MEMBER_CACHE;
-  }
-
-
-  /**
-   * Un-registers all the statistics & cache managed resource created for this member. After
-   * un-registering the resource MBean instances, clears this.memberResources collection.
-   * 
-   * Creates ConfigurationParameterJmxImpl, StatisticResourceJmxImpl and SystemMemberCacheJmxImpl.
-   * But cleans up only StatisticResourceJmxImpl and SystemMemberCacheJmxImpl which are of type
-   * ManagedResource.
-   */
-  public void cleanupResource() {
-    synchronized (this.managedRegionResourcesMap) {
-      Collection<SystemMemberRegionJmxImpl> values = managedRegionResourcesMap.values();
-
-      for (SystemMemberRegionJmxImpl systemMemberRegionJmxImpl : values) {
-        MBeanUtil.unregisterMBean(systemMemberRegionJmxImpl);
-      }
-
-      this.managedRegionResourcesMap.clear();
-    }
-
-    synchronized (this.managedCacheServerResourcesMap) {
-      Collection<SystemMemberBridgeServerJmxImpl> values = managedCacheServerResourcesMap.values();
-
-      for (SystemMemberBridgeServerJmxImpl SystemMemberBridgeServerJmxImpl : values) {
-        MBeanUtil.unregisterMBean(SystemMemberBridgeServerJmxImpl);
-      }
-
-      this.managedCacheServerResourcesMap.clear();
-    }
-  }
-
-  /**
-   * Cleans up managed resources created for the region that was (created and) destroyed in a cache
-   * represented by this Managed Resource.
-   * 
-   * @param regionPath path of the region that got destroyed
-   * @return a managed resource related to this region path
-   */
-  public ManagedResource cleanupRegionResources(String regionPath) {
-    ManagedResource cleaned = null;
-
-    synchronized (this.managedRegionResourcesMap) {
-      Set<Entry<String, SystemMemberRegionJmxImpl>> entries = managedRegionResourcesMap.entrySet();
-      for (Iterator<Entry<String, SystemMemberRegionJmxImpl>> it = entries.iterator(); it
-          .hasNext();) {
-        Entry<String, SystemMemberRegionJmxImpl> entry = it.next();
-        SystemMemberRegionJmxImpl managedResource = entry.getValue();
-        ObjectName objName = managedResource.getObjectName();
-
-        String pathProp = objName.getKeyProperty("path");
-        if (pathProp != null && pathProp.equals(regionPath)) {
-          cleaned = managedResource;
-          it.remove();
-
-          break;
-        }
-      }
-    }
-
-    return cleaned;
-  }
-
-  /**
-   * Checks equality of the given object with <code>this</code> based on the type (Class) and the
-   * MBean Name returned by <code>getMBeanName()</code> methods.
-   * 
-   * @param obj object to check equality with
-   * @return true if the given object is if the same type and its MBean Name is same as
-   *         <code>this</code> object's MBean Name, false otherwise
-   */
-  @Override
-  public boolean equals(Object obj) {
-    if (!(obj instanceof SystemMemberCacheJmxImpl)) {
-      return false;
-    }
-
-    SystemMemberCacheJmxImpl other = (SystemMemberCacheJmxImpl) obj;
-
-    return this.getMBeanName().equals(other.getMBeanName());
-  }
-
-  /**
-   * Returns hash code for <code>this</code> object which is based on the MBean Name generated.
-   * 
-   * @return hash code for <code>this</code> object
-   */
-  @Override
-  public int hashCode() {
-    return this.getMBeanName().hashCode();
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmx.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmx.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmx.java
deleted file mode 100644
index 06b0be9..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmx.java
+++ /dev/null
@@ -1,459 +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.admin.jmx.internal;
-
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.*;
-import org.apache.geode.cache.Operation;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.admin.ClientMembershipMessage;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.commons.modeler.ManagedBean;
-import org.apache.logging.log4j.Logger;
-
-import javax.management.*;
-import javax.naming.OperationNotSupportedException;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Defines methods that all <code>SystemMember</code> MBeans should implement.
- *
- * @since GemFire 4.0
- */
-public interface SystemMemberJmx extends SystemMember, NotificationListener {
-  /**
-   * Notification type for indicating a cache got created on a member of this distributed system.
-   */
-  public static final String NOTIF_CACHE_CREATED =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.created";
-  /**
-   * Notification type for indicating a cache is closed on a member of this distributed system.
-   */
-  public static final String NOTIF_CACHE_CLOSED =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.closed";
-  /**
-   * Notification type for indicating a region is created in a cache on a member of this distributed
-   * system.
-   */
-  public static final String NOTIF_REGION_CREATED =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.region.created";
-  /**
-   * Notification type for indicating a region was removed from a cache on a member of this
-   * distributed system.
-   */
-  public static final String NOTIF_REGION_LOST =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.region.lost";
-
-  /** Notification type for indicating client joined */
-  public static final String NOTIF_CLIENT_JOINED =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.client.joined";
-
-  /** Notification type for indicating client left */
-  public static final String NOTIF_CLIENT_LEFT =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.client.left";
-
-  /** Notification type for indicating client crashed */
-  public static final String NOTIF_CLIENT_CRASHED =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.client.crashed";
-
-  /**
-   * Gets the interval in seconds between config refreshes
-   *
-   * @return the current refresh interval in seconds
-   */
-  public int getRefreshInterval();
-
-  /**
-   * RefreshInterval is now set only through the AdminDistributedSystem property refreshInterval.
-   * Attempt to set refreshInterval on SystemMemberJmx MBean would result in an
-   * OperationNotSupportedException Auto-refresh is enabled on demand when a call to refreshConfig
-   * is made
-   *
-   * @param refreshInterval the new refresh interval in seconds
-   * @deprecated since 6.0 use DistributedSystemConfig.refreshInterval instead
-   */
-  @Deprecated
-  public void setRefreshInterval(int refreshInterval) throws OperationNotSupportedException;
-
-  /**
-   * Sets the refresh interval field. Sets interval in seconds between config refreshes; zero or
-   * less turns off auto refreshing. Manual refreshing has no effect on when the next scheduled
-   * refresh will occur.
-   */
-  public void _setRefreshInterval(int refreshInterval);
-
-  /**
-   * Gets this member's cache.
-   *
-   * @return <code>ObjectName</code> for this member's cache
-   *
-   * @throws AdminException If this system member does not host a cache
-   */
-  public ObjectName manageCache() throws AdminException, MalformedObjectNameException;
-
-  /**
-   * Gets all active StatisticResources for this manager.
-   *
-   * @return array of ObjectName instances
-   */
-  public ObjectName[] manageStats() throws AdminException, MalformedObjectNameException;
-
-  /**
-   * Gets the active StatisticResources for this manager, based on the typeName as the key
-   *
-   * @return ObjectName of StatisticResourceJMX instance
-   */
-  public ObjectName[] manageStat(String statisticsTypeName)
-      throws AdminException, MalformedObjectNameException;
-
-  /**
-   * Handles notification to refresh. Reacts by refreshing the values of this GemFireManager's
-   * ConfigurationParamaters. Any other notification is ignored.
-   *
-   * @param notification the JMX notification being received
-   * @param hb handback object is unused
-   */
-  public void handleNotification(Notification notification, Object hb);
-
-  /**
-   * Add MBean attribute definitions for each ConfigurationParameter.
-   *
-   * @param managed the mbean definition to add attributes to
-   * @return a new instance of ManagedBean copied from <code>managed</code> but with the new
-   *         attributes added
-   */
-  public ManagedBean addDynamicAttributes(ManagedBean managed) throws AdminException;
-
-
-  /**
-   * Implementation should handle creation of cache by extracting the details from the given event
-   * object.
-   * 
-   * @param event event object corresponding to the creation of the cache
-   */
-  public void handleCacheCreate(SystemMemberCacheEvent event);
-
-  /**
-   * Implementation should handle closure of cache by extracting the details from the given event
-   * object.
-   * 
-   * @param event event object corresponding to the closure of the cache
-   */
-  public void handleCacheClose(SystemMemberCacheEvent event);
-
-  /**
-   * Implementation should handle creation of region by extracting the details from the given event
-   * object.
-   * 
-   * @param event event object corresponding to the creation of a region
-   */
-  public void handleRegionCreate(SystemMemberRegionEvent event);
-
-  /**
-   * Implementation should handle loss of region by extracting the details from the given event
-   * object.
-   * 
-   * @param event event object corresponding to the loss of a region
-   */
-  public void handleRegionLoss(SystemMemberRegionEvent event);
-
-  /**
-   * Implementation should handle client membership changes.
-   * 
-   * @param clientId id of the client for whom membership change happened
-   * @param eventType membership change type; one of {@link ClientMembershipMessage#JOINED},
-   *        {@link ClientMembershipMessage#LEFT}, {@link ClientMembershipMessage#CRASHED}
-   */
-  public void handleClientMembership(String clientId, int eventType);
-
-  ////////////////////// Inner Classess //////////////////////
-
-  /**
-   * A helper class that provides implementation of the <code>SystemMemberJmx</code> interface as
-   * static methods.
-   */
-  public static class Helper {
-    private static final Logger logger = LogService.getLogger();
-
-    private static AtomicInteger notificationSequenceNumber = new AtomicInteger();
-
-    public static int setAndReturnRefreshInterval(SystemMemberJmx member, int refreshInterval) {
-      int ret = refreshInterval;
-
-      try {
-        MBeanUtil.registerRefreshNotification(member, // NotificationListener
-            ((ManagedResource) member).getMBeanName(), // User Data
-            RefreshNotificationType.SYSTEM_MEMBER_CONFIG, refreshInterval); // int
-
-      } catch (RuntimeException e) {
-        logger.warn(e.getMessage(), e); // dead in water, print, and then ignore
-        ret = 0; // zero out to avoid more exceptions
-
-      } catch (VirtualMachineError err) {
-        SystemFailure.initiateFailure(err);
-        // If this ever returns, rethrow the error. We're poisoned
-        // now, so don't let this thread continue.
-        throw err;
-      } catch (Error e) {
-        // Whenever you catch Error or Throwable, you must also
-        // catch VirtualMachineError (see above). However, there is
-        // _still_ a possibility that you are dealing with a cascading
-        // error condition, so you also need to check to see if the JVM
-        // is still usable:
-        SystemFailure.checkFailure();
-        logger.error(e.getMessage(), e); // dead in water, print, and then ignore
-        ret = 0; // zero out to avoid more exceptions
-      }
-
-      return ret;
-    }
-
-    public static ObjectName manageCache(SystemMemberJmx member)
-        throws AdminException, MalformedObjectNameException {
-      boolean IthrewIt = false;
-      try {
-        SystemMemberCache cache = member.getCache();
-        if (cache == null) {
-          IthrewIt = true;
-          throw new AdminException(
-              LocalizedStrings.SystemMemberJmx_THIS_SYSTEM_MEMBER_DOES_NOT_HAVE_A_CACHE
-                  .toLocalizedString());
-        }
-        // Assert.assertTrue(cache != null); (cannot be null)
-        SystemMemberCacheJmxImpl cacheJmx = (SystemMemberCacheJmxImpl) cache;
-        return ObjectName.getInstance(cacheJmx.getMBeanName());
-      } catch (AdminException e) {
-        if (!IthrewIt) {
-          logger.warn(e.getMessage(), e);
-        }
-        throw e;
-      } catch (RuntimeException e) {
-        logger.warn(e.getMessage(), e);
-        throw e;
-      } catch (VirtualMachineError err) {
-        SystemFailure.initiateFailure(err);
-        // If this ever returns, rethrow the error. We're poisoned
-        // now, so don't let this thread continue.
-        throw err;
-      } catch (Error e) {
-        // Whenever you catch Error or Throwable, you must also
-        // catch VirtualMachineError (see above). However, there is
-        // _still_ a possibility that you are dealing with a cascading
-        // error condition, so you also need to check to see if the JVM
-        // is still usable:
-        SystemFailure.checkFailure();
-        logger.error(e.getMessage(), e);
-        throw e;
-      }
-    }
-
-    public static ObjectName[] manageStats(SystemMemberJmx member)
-        throws AdminException, MalformedObjectNameException {
-      try {
-        StatisticResource[] stats = member.getStats();
-        ObjectName[] onames = new ObjectName[stats.length];
-        for (int i = 0; i < stats.length; i++) {
-          StatisticResourceJmxImpl stat = (StatisticResourceJmxImpl) stats[i];
-          onames[i] = ObjectName.getInstance(stat.getMBeanName());
-        }
-        return onames;
-      } catch (AdminException e) {
-        logger.warn(e.getMessage(), e);
-        throw e;
-      } catch (RuntimeException e) {
-        logger.warn(e.getMessage(), e);
-        throw e;
-      } catch (VirtualMachineError err) {
-        SystemFailure.initiateFailure(err);
-        // If this ever returns, rethrow the error. We're poisoned
-        // now, so don't let this thread continue.
-        throw err;
-      } catch (Error e) {
-        // Whenever you catch Error or Throwable, you must also
-        // catch VirtualMachineError (see above). However, there is
-        // _still_ a possibility that you are dealing with a cascading
-        // error condition, so you also need to check to see if the JVM
-        // is still usable:
-        SystemFailure.checkFailure();
-        logger.error(e.getMessage(), e);
-        throw e;
-      }
-    }
-
-    public static ObjectName[] manageStat(SystemMemberJmx member, String statisticsTypeName)
-        throws AdminException, MalformedObjectNameException {
-      try {
-        StatisticResource[] stats = member.getStat(statisticsTypeName);
-        if (stats == null)
-          return null;
-        else {
-          ObjectName[] statNames = new ObjectName[stats.length];
-          for (int i = 0; i < stats.length; i++) {
-            StatisticResourceJmxImpl statJMX = (StatisticResourceJmxImpl) stats[i];
-            statNames[i] = ObjectName.getInstance(statJMX.getMBeanName());
-          }
-          return statNames;
-        }
-      } catch (AdminException e) {
-        logger.warn(e.getMessage(), e);
-        throw e;
-      } catch (RuntimeException e) {
-        logger.warn(e.getMessage(), e);
-        throw e;
-      } catch (Error e) {
-        logger.error(e.getMessage(), e);
-        throw e;
-      }
-    }
-
-    public static void handleNotification(SystemMemberJmx member, Notification notification,
-        Object hb) {
-      if (RefreshNotificationType.SYSTEM_MEMBER_CONFIG.getType().equals(notification.getType())
-          && ((ManagedResource) member).getMBeanName().equals(notification.getUserData())) {
-
-        try {
-          member.refreshConfig();
-
-        } catch (org.apache.geode.admin.AdminException e) {
-          logger.warn(e.getMessage(), e);
-        } catch (OperationCancelledException e) {
-          // underlying resource is no longer reachable by remote admin
-          logger.warn(e.getMessage(), e);
-          member._setRefreshInterval(0);
-
-        } catch (java.lang.RuntimeException e) {
-          logger.warn(e.getMessage(), e); // dead in water, print, and then ignore
-          member._setRefreshInterval(0); // zero out to avoid more exceptions
-
-        } catch (VirtualMachineError err) {
-          SystemFailure.initiateFailure(err);
-          // If this ever returns, rethrow the error. We're poisoned
-          // now, so don't let this thread continue.
-          throw err;
-        } catch (java.lang.Error e) {
-          // Whenever you catch Error or Throwable, you must also
-          // catch VirtualMachineError (see above). However, there is
-          // _still_ a possibility that you are dealing with a cascading
-          // error condition, so you also need to check to see if the JVM
-          // is still usable:
-          SystemFailure.checkFailure();
-          logger.error(e.getMessage(), e); // dead in water, print, and then ignore
-          member._setRefreshInterval(0); // zero out to avoid more exceptions
-        }
-      }
-    }
-
-    public static ManagedBean addDynamicAttributes(SystemMemberJmx member, ManagedBean managed)
-        throws AdminException {
-
-      if (managed == null) {
-        throw new IllegalArgumentException(
-            LocalizedStrings.SystemMemberJmx_MANAGEDBEAN_IS_NULL.toLocalizedString());
-      }
-
-      member.refreshConfig(); // to get the config parms...
-
-      // need to create a new instance of ManagedBean to clean the "slate"...
-      ManagedBean newManagedBean = new DynamicManagedBean(managed);
-      ConfigurationParameter[] params = member.getConfiguration();
-      for (int i = 0; i < params.length; i++) {
-        ConfigurationParameterJmxImpl parm = (ConfigurationParameterJmxImpl) params[i];
-        ConfigAttributeInfo attrInfo = new ConfigAttributeInfo(parm);
-
-        attrInfo.setName(parm.getName());
-        attrInfo.setDisplayName(parm.getName());
-        attrInfo.setDescription(parm.getDescription());
-        attrInfo.setType(parm.getJmxValueType().getName());
-
-        attrInfo.setIs(false);
-        attrInfo.setReadable(true);
-        attrInfo.setWriteable(parm.isModifiable());
-
-        newManagedBean.addAttribute(attrInfo);
-      }
-      return newManagedBean;
-    }
-
-    /**
-     * Returns the next notification sequence number.
-     * 
-     * @return the notificationSequenceNumber
-     */
-    /* default */static int getNextNotificationSequenceNumber() {
-      return notificationSequenceNumber.incrementAndGet();
-    }
-
-    /**
-     * Returns the cache event details extracted from the given SystemMemberCacheEvent
-     * 
-     * @param event SystemMemberCacheEvent instance
-     * @return the cache event details extracted from the given SystemMemberCacheEvent
-     */
-    /* default */static String getCacheEventDetails(SystemMemberCacheEvent event) {
-      String memberId = event.getMemberId();
-      Operation operation = event.getOperation();
-
-      return "CacheEvent[MemberId: " + memberId + ", operation: " + operation + "]";
-    }
-
-    /**
-     * Returns the region event details extracted from the given SystemMemberRegionEvent
-     * 
-     * @param event SystemMemberRegionEvent instance
-     * @return the cache event details extracted from the given SystemMemberRegionEvent
-     */
-    /* default */static String getRegionEventDetails(SystemMemberRegionEvent event) {
-      String memberId = event.getMemberId();
-      Operation operation = event.getOperation();
-
-      return "RegionEvent[MemberId: " + memberId + ", operation: " + operation + ", region:"
-          + event.getRegionPath() + "]";
-    }
-
-    /**
-     * Sends the given notification.
-     * 
-     * @param notif notification to send
-     * 
-     * @throws NullPointerException if resource or ModelMBean for resource is null
-     */
-    /* default */static void sendNotification(ManagedResource resource, Notification notif) {
-      try {
-        if (MBeanUtil.isRegistered(resource.getObjectName())) {
-          resource.getModelMBean().sendNotification(notif);
-          if (logger.isDebugEnabled()) {
-            logger.debug("Sent '{}' notification", notif.getType());
-          }
-        }
-      } catch (RuntimeOperationsException e) {
-        logger
-            .info(
-                LocalizedMessage.create(
-                    LocalizedStrings.SystemMemberJmx_FAILED_TO_SEND_0_NOTIFICATION_FOR_1,
-                    new Object[] {"'" + notif.getType() + "'", "'" + notif.getMessage() + "'"}),
-                e);
-      } catch (MBeanException e) {
-        logger
-            .info(
-                LocalizedMessage.create(
-                    LocalizedStrings.SystemMemberJmx_FAILED_TO_SEND_0_NOTIFICATION_FOR_1,
-                    new Object[] {"'" + notif.getType() + "'", "'" + notif.getMessage() + "'"}),
-                e);
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmxImpl.java
deleted file mode 100755
index 0241302..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberJmxImpl.java
+++ /dev/null
@@ -1,541 +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.admin.jmx.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.Notification;
-import javax.management.ObjectName;
-import javax.management.modelmbean.ModelMBean;
-import javax.naming.OperationNotSupportedException;
-
-import org.apache.commons.modeler.ManagedBean;
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.ConfigurationParameter;
-import org.apache.geode.admin.StatisticResource;
-import org.apache.geode.admin.SystemMemberCache;
-import org.apache.geode.admin.SystemMemberCacheEvent;
-import org.apache.geode.admin.SystemMemberRegionEvent;
-import org.apache.geode.admin.internal.ConfigurationParameterImpl;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.i18n.LogWriterI18n;
-import org.apache.geode.internal.admin.ApplicationVM;
-import org.apache.geode.internal.admin.ClientMembershipMessage;
-import org.apache.geode.internal.admin.GemFireVM;
-import org.apache.geode.internal.admin.StatResource;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-
-/**
- * Provides MBean support for managing a SystemMember application.
- * <p>
- * TODO: refactor to implement SystemMember and delegate to SystemMemberImpl. Wrap all delegate
- * calls w/ e.printStackTrace() since the HttpAdaptor devours them
- *
- * @since GemFire 3.5
- *
- */
-public class SystemMemberJmxImpl extends org.apache.geode.admin.internal.SystemMemberImpl
-    implements SystemMemberJmx, javax.management.NotificationListener,
-    org.apache.geode.admin.jmx.internal.ManagedResource {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /**
-   * Interval in seconds between refreshes. Value less than one results in no refreshing
-   */
-  private int refreshInterval = 0;
-
-  /** The JMX object name of this managed resource */
-  private ObjectName objectName;
-
-  /** Reference to the cache MBean representing a Cache in the Cache VM Member */
-  private SystemMemberCacheJmxImpl managedSystemMemberCache;
-
-  /** collection to collect all the resources created for this member */
-  private Map<StatResource, StatisticResourceJmxImpl> managedStatisticsResourcesMap =
-      new HashMap<StatResource, StatisticResourceJmxImpl>();
-
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs an instance of SystemMemberJmxImpl.
-   *
-   * @param system the distributed system this SystemMember is a member of
-   * @param application the internal admin application to delegate actual work
-   */
-  public SystemMemberJmxImpl(AdminDistributedSystemJmxImpl system, ApplicationVM application)
-      throws org.apache.geode.admin.AdminException {
-    super(system, application);
-    initializeMBean();
-  }
-
-  /**
-   * Constructs the instance of SystemMember using the corresponding InternalDistributedMember
-   * instance of a DS member for the given AdminDistributedSystem.
-   * 
-   * @param system Current AdminDistributedSystem instance
-   * @param member InternalDistributedMember instance for which a SystemMember instance is to be
-   *        constructed.
-   * @throws AdminException if construction of SystemMember fails
-   * 
-   * @since GemFire 6.5
-   */
-  protected SystemMemberJmxImpl(AdminDistributedSystemJmxImpl system,
-      InternalDistributedMember member) throws AdminException {
-    super(system, member);
-    initializeMBean();
-  }
-
-  /** Create and register the MBean to manage this resource */
-  private void initializeMBean() throws org.apache.geode.admin.AdminException {
-    // initialize Managed Resources for stats & cache first.
-    // initializeManagedResources();
-
-    this.mbeanName = new StringBuffer("GemFire.Member:id=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(getId())).append(",type=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(getType().getName())).toString();
-
-    this.objectName =
-        MBeanUtil.createMBean(this, addDynamicAttributes(MBeanUtil.lookupManagedBean(this)));
-
-    // Refresh Interval
-    AdminDistributedSystemJmxImpl sysJmx = (AdminDistributedSystemJmxImpl) system;
-    if (sysJmx.getRefreshInterval() > 0)
-      this.refreshInterval = sysJmx.getRefreshInterval();
-  }
-
-  // -------------------------------------------------------------------------
-  // MBean attributes - accessors/mutators
-  // -------------------------------------------------------------------------
-
-  /**
-   * Gets the interval in seconds between config refreshes
-   *
-   * @return the current refresh interval in seconds
-   */
-  public int getRefreshInterval() {
-    return this.refreshInterval;
-  }
-
-  /**
-   * RefreshInterval is now set only through the AdminDistributedSystem property refreshInterval.
-   * Attempt to set refreshInterval on SystemMemberJmx MBean would result in an
-   * OperationNotSupportedException Auto-refresh is enabled on demand when a call to refreshConfig
-   * is made
-   * 
-   * @param refreshInterval the new refresh interval in seconds
-   * @deprecated since 6.0 use DistributedSystemConfig.refreshInterval instead
-   */
-  @Deprecated
-  public void setRefreshInterval(int refreshInterval) throws OperationNotSupportedException {
-    throw new OperationNotSupportedException(
-        LocalizedStrings.MANAGED_RESOURCE_REFRESH_INTERVAL_CANT_BE_SET_DIRECTLY
-            .toLocalizedString());
-  }
-
-  /**
-   * Sets interval in seconds between member config refreshes; zero or less turns off auto
-   * refreshing. Manual refreshing has no effect on when the next scheduled refresh will occur.
-   * 
-   * @param refreshInterval the new refresh interval in seconds
-   */
-  public void _setRefreshInterval(int refreshInterval) {
-    boolean isRegistered = MBeanUtil.isRefreshNotificationRegistered(this,
-        RefreshNotificationType.SYSTEM_MEMBER_CONFIG);
-
-    if (isRegistered && (getRefreshInterval() == refreshInterval))
-      return;
-
-    this.refreshInterval = Helper.setAndReturnRefreshInterval(this, refreshInterval);
-  }
-
-  // -------------------------------------------------------------------------
-  // MBean Operations
-  // -------------------------------------------------------------------------
-
-  public void refreshConfig() throws org.apache.geode.admin.AdminException {
-    // 1st call to refreshConfig would trigger
-    // the auto-refresh if an interval is set
-    if (this.refreshInterval > 0) {
-      this._setRefreshInterval(this.refreshInterval);
-    }
-
-    super.refreshConfig();
-  }
-
-  /**
-   * Initializes Cache & Statistics managed resources.
-   * 
-   * @throws AdminException if initialization of managed resources fails
-   */
-  // private void initializeManagedResources() throws AdminException {
-  // try {
-  // manageCache();
-  // } catch (MalformedObjectNameException e) {
-  // throw new
-  // AdminException(LocalizedStrings.SystemMemberJmxImpl_EXCEPTION_OCCURRED_WHILE_INITIALIZING_0_MBEANS_FOR_1.toLocalizedString(
-  // new Object[] {"Cache", getId()}),
-  // e);
-  // } catch (AdminException ae) {
-  // if
-  // (LocalizedStrings.SystemMemberJmx_THIS_SYSTEM_MEMBER_DOES_NOT_HAVE_A_CACHE.toLocalizedString().equals(ae.getMessage()))
-  // {
-  // //ignore this exception for a cache-less peer
-  // } else {
-  // throw ae;
-  // }
-  // }
-  // try {
-  // manageStats();
-  // } catch (MalformedObjectNameException e) {
-  // throw new
-  // AdminException(LocalizedStrings.SystemMemberJmxImpl_EXCEPTION_OCCURRED_WHILE_INITIALIZING_0_MBEANS_FOR_1.toLocalizedString(
-  // new Object[] {"Statistics", getId()}),
-  // e);
-  // }
-  // }
-
-  /**
-   * Gets this member's cache.
-   *
-   * @return <code>ObjectName</code> for this member's cache
-   *
-   * @throws AdminException If this system member does not host a cache
-   */
-  public ObjectName manageCache() throws AdminException, MalformedObjectNameException {
-
-    return Helper.manageCache(this);
-  }
-
-  /**
-   * Gets all active StatisticResources for this manager.
-   *
-   * @return array of ObjectName instances
-   */
-  public ObjectName[] manageStats() throws AdminException, MalformedObjectNameException {
-
-    return Helper.manageStats(this);
-  }
-
-  /**
-   * Gets the active StatisticResources for this manager, based on the typeName as the key
-   *
-   * @return ObjectName of StatisticResourceJMX instance
-   */
-  public ObjectName[] manageStat(String statisticsTypeName)
-      throws AdminException, MalformedObjectNameException {
-
-    return Helper.manageStat(this, statisticsTypeName);
-  }
-
-  // -------------------------------------------------------------------------
-  // JMX Notification listener
-  // -------------------------------------------------------------------------
-
-  /**
-   * Handles notification to refresh. Reacts by refreshing the values of this SystemMember's
-   * ConfigurationParamaters. Any other notification is ignored. Given notification is handled only
-   * if there is any JMX client connected to the system.
-   * 
-   * @param notification the JMX notification being received
-   * @param hb handback object is unused
-   */
-  public void handleNotification(Notification notification, Object hb) {
-    AdminDistributedSystemJmxImpl systemJmx = (AdminDistributedSystemJmxImpl) this.system;
-
-    if (!systemJmx.isRmiClientCountZero()) {
-      Helper.handleNotification(this, notification, hb);
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // Template methods overriden from superclass...
-  // -------------------------------------------------------------------------
-
-  /**
-   * Template method for creating instance of ConfigurationParameter. Overridden to return
-   * ConfigurationParameterJmxImpl.
-   */
-  @Override
-  protected ConfigurationParameter createConfigurationParameter(String name, String description,
-      Object value, Class type, boolean userModifiable) {
-    return new ConfigurationParameterJmxImpl(name, description, value, type, userModifiable);
-  }
-
-  /**
-   * Override createStatisticResource by instantiating StatisticResourceJmxImpl if it was not
-   * created earlier otherwise returns the same instance.
-   * 
-   * @param stat StatResource reference for which this JMX resource is to be created
-   * @return StatisticResourceJmxImpl - JMX Implementation of StatisticResource
-   * @throws AdminException if constructing StatisticResourceJmxImpl instance fails
-   */
-  @Override
-  protected StatisticResource createStatisticResource(StatResource stat)
-      throws org.apache.geode.admin.AdminException {
-    StatisticResourceJmxImpl managedStatisticResource = null;
-
-    synchronized (this.managedStatisticsResourcesMap) {
-      /*
-       * Ensuring that a single instance of Statistic Resource is created per StatResource.
-       */
-      StatisticResourceJmxImpl statisticResourceJmxImpl = managedStatisticsResourcesMap.get(stat);
-      if (statisticResourceJmxImpl != null) {
-        managedStatisticResource = statisticResourceJmxImpl;
-      } else {
-        managedStatisticResource = new StatisticResourceJmxImpl(stat, this);
-        managedStatisticResource.getStatistics();// inits timer
-        managedStatisticsResourcesMap.put(stat, managedStatisticResource);
-      }
-    }
-    return managedStatisticResource;
-  }
-
-  /**
-   * Override createSystemMemberCache by instantiating SystemMemberCacheJmxImpl if it was not
-   * created earlier.
-   * 
-   * @param vm GemFireVM reference for which this JMX resource is to be created
-   * @return SystemMemberCacheJmxImpl - JMX Implementation of SystemMemberCache
-   * @throws AdminException if constructing SystemMemberCacheJmxImpl instance fails
-   */
-  @Override
-  protected SystemMemberCache createSystemMemberCache(GemFireVM vm)
-      throws org.apache.geode.admin.AdminException {
-    if (managedSystemMemberCache == null) {
-      managedSystemMemberCache = new SystemMemberCacheJmxImpl(vm);
-    }
-    return managedSystemMemberCache;
-  }
-
-  // -------------------------------------------------------------------------
-  // Create MBean attributes for each ConfigurationParameter
-  // -------------------------------------------------------------------------
-
-  /**
-   * Add MBean attribute definitions for each ConfigurationParameter.
-   *
-   * @param managed the mbean definition to add attributes to
-   * @return a new instance of ManagedBean copied from <code>managed</code> but with the new
-   *         attributes added
-   */
-  public ManagedBean addDynamicAttributes(ManagedBean managed) throws AdminException {
-
-    return Helper.addDynamicAttributes(this, managed);
-  }
-
-  // -------------------------------------------------------------------------
-  // ManagedResource implementation
-  // -------------------------------------------------------------------------
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.SYSTEM_MEMBER;
-  }
-
-  /**
-   * Un-registers all the statistics & cache managed resource created for this member. After
-   * un-registering the resource MBean instances, clears managedStatisticsResourcesMap collection.
-   */
-  public void cleanupResource() {
-    synchronized (this.managedStatisticsResourcesMap) {
-      ConfigurationParameter[] names = getConfiguration();
-      if (names != null) {
-        for (int i = 0; i < names.length; i++) {
-          ConfigurationParameter parm = names[i];
-          ((ConfigurationParameterImpl) parm).removeConfigurationParameterListener(this);
-        }
-      }
-      this.parms.clear();
-
-      Collection<StatisticResourceJmxImpl> statisticResources =
-          managedStatisticsResourcesMap.values();
-
-      for (StatisticResourceJmxImpl statisticResource : statisticResources) {
-        MBeanUtil.unregisterMBean(statisticResource);
-      }
-
-      this.managedStatisticsResourcesMap.clear();
-    }
-    MBeanUtil.unregisterMBean(managedSystemMemberCache);
-  }
-
-
-  /**
-   * Cleans up Managed Resources created for the client that was connected to the server represented
-   * by this class.
-   * 
-   * @param clientId id of the client to be removed
-   * @return List of ManagedResources associated with the client of given client id
-   */
-  /*
-   * This clean up is for the clients. The clients are started with a loner DM. Hence the clientId
-   * is not supposed to contain '/' as per InternalDistributedMember.toString().
-   */
-  public List<ManagedResource> cleanupBridgeClientResources(String clientId) {
-    List<ManagedResource> returnedResources = new ArrayList<ManagedResource>();
-
-    String compatibleId = "id_" + MBeanUtil.makeCompliantMBeanNameProperty(clientId);
-    synchronized (this.managedStatisticsResourcesMap) {
-      Set<Entry<StatResource, StatisticResourceJmxImpl>> entrySet =
-          this.managedStatisticsResourcesMap.entrySet();
-
-      for (Iterator<Entry<StatResource, StatisticResourceJmxImpl>> it = entrySet.iterator(); it
-          .hasNext();) {
-        Entry<StatResource, StatisticResourceJmxImpl> entry = it.next();
-        StatisticResourceJmxImpl resource = entry.getValue();
-        if (resource.getMBeanName().contains(compatibleId)) {
-          it.remove(); // remove matching entry
-          returnedResources.add(resource);
-        }
-      }
-    }
-    return returnedResources;
-  }
-
-  /**
-   * Implementation handles client membership changes.
-   * 
-   * @param clientId id of the client for whom membership change happened
-   * @param eventType membership change type; one of {@link ClientMembershipMessage#JOINED},
-   *        {@link ClientMembershipMessage#LEFT}, {@link ClientMembershipMessage#CRASHED}
-   */
-  public void handleClientMembership(String clientId, int eventType) {
-    String notifType = null;
-    List<ManagedResource> cleanedUp = null;
-
-    if (eventType == ClientMembershipMessage.LEFT) {
-      notifType = NOTIF_CLIENT_LEFT;
-      cleanedUp = cleanupBridgeClientResources(clientId);
-    } else if (eventType == ClientMembershipMessage.CRASHED) {
-      notifType = NOTIF_CLIENT_CRASHED;
-      cleanedUp = cleanupBridgeClientResources(clientId);
-    } else if (eventType == ClientMembershipMessage.JOINED) {
-      notifType = NOTIF_CLIENT_JOINED;
-    }
-
-    if (cleanedUp != null) {
-      for (ManagedResource resource : cleanedUp) {
-        MBeanUtil.unregisterMBean(resource);
-      }
-    }
-
-    Helper.sendNotification(this, new Notification(notifType, this.modelMBean,
-        Helper.getNextNotificationSequenceNumber(), clientId));
-  }
-
-  /**
-   * Implementation handles creation of cache by extracting the details from the given event object
-   * and sending the {@link SystemMemberJmx#NOTIF_CACHE_CREATED} notification to the connected JMX
-   * Clients.
-   * 
-   * @param event event object corresponding to the creation of the cache
-   */
-  public void handleCacheCreate(SystemMemberCacheEvent event) {
-    Helper.sendNotification(this, new Notification(NOTIF_CACHE_CREATED, this.modelMBean,
-        Helper.getNextNotificationSequenceNumber(), Helper.getCacheEventDetails(event)));
-  }
-
-  /**
-   * Implementation handles closure of cache by extracting the details from the given event object
-   * and sending the {@link SystemMemberJmx#NOTIF_CACHE_CLOSED} notification to the connected JMX
-   * Clients.
-   * 
-   * @param event event object corresponding to the closure of the cache
-   */
-  public void handleCacheClose(SystemMemberCacheEvent event) {
-    Helper.sendNotification(this, new Notification(NOTIF_CACHE_CLOSED, this.modelMBean,
-        Helper.getNextNotificationSequenceNumber(), Helper.getCacheEventDetails(event)));
-  }
-
-  /**
-   * Implementation handles creation of region by extracting the details from the given event object
-   * and sending the {@link SystemMemberJmx#NOTIF_REGION_CREATED} notification to the connected JMX
-   * Clients. Region Path is set as User Data in Notification.
-   * 
-   * @param event event object corresponding to the creation of a region
-   */
-  public void handleRegionCreate(SystemMemberRegionEvent event) {
-    Notification notification = new Notification(NOTIF_REGION_CREATED, this.modelMBean,
-        Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event));
-
-    notification.setUserData(event.getRegionPath());
-
-    Helper.sendNotification(this, notification);
-  }
-
-  /**
-   * Implementation should handle loss of region by extracting the details from the given event
-   * object and sending the {@link SystemMemberJmx#NOTIF_REGION_LOST} notification to the connected
-   * JMX Clients. Region Path is set as User Data in Notification. Additionally, it also clears the
-   * ManagedResources created for the region that is lost.
-   * 
-   * @param event event object corresponding to the loss of a region
-   */
-  public void handleRegionLoss(SystemMemberRegionEvent event) {
-    SystemMemberCacheJmxImpl cacheResource = this.managedSystemMemberCache;
-
-    if (cacheResource != null) {
-      ManagedResource cleanedUp = cacheResource.cleanupRegionResources(event.getRegionPath());
-
-      if (cleanedUp != null) {
-        MBeanUtil.unregisterMBean(cleanedUp);
-      }
-    }
-
-    Notification notification = new Notification(NOTIF_REGION_LOST, this.modelMBean,
-        Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event));
-
-    notification.setUserData(event.getRegionPath());
-
-    Helper.sendNotification(this, notification);
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberRegionJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberRegionJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberRegionJmxImpl.java
deleted file mode 100644
index cc5621e..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/SystemMemberRegionJmxImpl.java
+++ /dev/null
@@ -1,128 +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.admin.jmx.internal;
-
-import org.apache.geode.admin.internal.SystemMemberCacheImpl;
-import org.apache.geode.cache.Region;
-import org.apache.geode.internal.admin.GemFireVM;
-
-import javax.management.ObjectName;
-import javax.management.modelmbean.ModelMBean;
-
-/**
- * MBean representation of {@link org.apache.geode.admin.SystemMemberRegion}.
- *
- * @since GemFire 3.5
- */
-public class SystemMemberRegionJmxImpl
-    extends org.apache.geode.admin.internal.SystemMemberRegionImpl
-    implements org.apache.geode.admin.jmx.internal.ManagedResource {
-
-  /** The object name of this managed resource */
-  private ObjectName objectName;
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs an instance of SystemMemberRegionJmxImpl.
-   *
-   * @param cache the cache this region belongs to
-   * @param region internal region to delegate real work to
-   */
-  public SystemMemberRegionJmxImpl(SystemMemberCacheImpl cache, Region region)
-      throws org.apache.geode.admin.AdminException {
-    super(cache, region);
-    initializeMBean(cache);
-  }
-
-  /** Create and register the MBean to manage this resource */
-  private void initializeMBean(SystemMemberCacheImpl cache)
-      throws org.apache.geode.admin.AdminException {
-
-    GemFireVM vm = cache.getVM();
-    this.mbeanName = new StringBuffer("GemFire.Cache:").append("path=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(getFullPath())).append(",name=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(cache.getName())).append(",id=")
-        .append(cache.getId()).append(",owner=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(vm.getId().toString()))
-        .append(",type=Region").toString();
-
-    this.objectName = MBeanUtil.createMBean(this);
-  }
-
-  // -------------------------------------------------------------------------
-  // ManagedResource implementation
-  // -------------------------------------------------------------------------
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.SYSTEM_MEMBER_REGION;
-  }
-
-  public void cleanupResource() {}
-
-  /**
-   * Checks equality of the given object with <code>this</code> based on the type (Class) and the
-   * MBean Name returned by <code>getMBeanName()</code> methods.
-   * 
-   * @param obj object to check equality with
-   * @return true if the given object is if the same type and its MBean Name is same as
-   *         <code>this</code> object's MBean Name, false otherwise
-   */
-  @Override
-  public boolean equals(Object obj) {
-    if (!(obj instanceof SystemMemberRegionJmxImpl)) {
-      return false;
-    }
-
-    SystemMemberRegionJmxImpl other = (SystemMemberRegionJmxImpl) obj;
-
-    return this.getMBeanName().equals(other.getMBeanName());
-  }
-
-  /**
-   * Returns hash code for <code>this</code> object which is based on the MBean Name generated.
-   * 
-   * @return hash code for <code>this</code> object
-   */
-  @Override
-  public int hashCode() {
-    return this.getMBeanName().hashCode();
-  }
-}
-


[25/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedSystemMemberImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedSystemMemberImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedSystemMemberImpl.java
new file mode 100644
index 0000000..abc6d01
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedSystemMemberImpl.java
@@ -0,0 +1,258 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+import org.apache.geode.internal.admin.GemFireVM;
+
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+
+/**
+ * A <code>SystemMember</code> that is also managed (or manageable) by the admin API.
+ *
+ * This class must be public so that its methods can be invoked reflectively (for MBean operations)
+ * on instances of its subclasses.
+ *
+ * @since GemFire 4.0
+ */
+public abstract class ManagedSystemMemberImpl extends SystemMemberImpl
+    implements InternalManagedEntity {
+
+  /** Controller for starting and stopping local or remote managers */
+  protected ManagedEntityController controller;
+
+  /** The state of this managed entity (see bug 32455) */
+  private int state = UNKNOWN;
+
+  /** A lock that is obtained while this entity's state changes */
+  private final Object stateChange = new Object();
+
+  ////////////////////// Constructors //////////////////////
+
+  /**
+   * Creates a new <code>ManagedSystemMemberImpl</code> that represents an existing member of an
+   * <code>AdminDistributedSystem</code>.
+   */
+  protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, GemFireVM vm)
+      throws AdminException {
+
+    super(system, vm);
+    this.controller = system.getEntityController();
+  }
+
+  /**
+   * Creates a new <code>ManagedSystemMemberImpl</code> that represents a non-existing member with
+   * the given <code>ManagedEntityConfig</code> that has not yet been started.
+   */
+  protected ManagedSystemMemberImpl(AdminDistributedSystemImpl system, ManagedEntityConfig config)
+      throws AdminException {
+
+    super(system);
+    this.internalId = null;
+    this.id = getNewId();
+    this.host = config.getHost();
+    this.name = this.id;
+    this.controller = system.getEntityController();
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  public String getWorkingDirectory() {
+    return this.getEntityConfig().getWorkingDirectory();
+  }
+
+  public void setWorkingDirectory(String workingDirectory) {
+    this.getEntityConfig().setWorkingDirectory(workingDirectory);
+  }
+
+  public String getProductDirectory() {
+    return this.getEntityConfig().getProductDirectory();
+  }
+
+  public void setProductDirectory(String productDirectory) {
+    this.getEntityConfig().setProductDirectory(productDirectory);
+  }
+
+  @Override
+  public String getHost() {
+    return this.getEntityConfig().getHost();
+  }
+
+  public int setState(int state) {
+    if (this.stateChange == null) {
+      // The initial state is set in the constructor before
+      // stateChange is initialized.
+      int oldState = this.state;
+      this.state = state;
+      return oldState;
+
+    } else {
+      synchronized (this.stateChange) {
+        int oldState = this.state;
+        this.state = state;
+
+        this.stateChange.notifyAll();
+
+        return oldState;
+      }
+    }
+  }
+
+  /**
+   * Returns whether or not this managed system member needs to be stopped. If this member is
+   * stopped or is stopping, then it does not need to be stopped. Otherwise, it will atomically
+   * place this member in the {@link #STOPPING} state. See bug 32455.
+   */
+  protected boolean needToStop() {
+    synchronized (this.stateChange) {
+      if (this.state == STOPPED || this.state == STOPPING) {
+        return false;
+
+      } else {
+        setState(STOPPING);
+        return true;
+      }
+    }
+  }
+
+  /**
+   * Returns whether or not this managed system member needs to be started. If this member is
+   * started or is starting, then it does not need to be started. Otherwise, it will atomically
+   * place this member in the {@link #STARTING} state. See bug 32455.
+   */
+  protected boolean needToStart() {
+    synchronized (this.stateChange) {
+      if (this.state == RUNNING || this.state == STARTING) {
+        return false;
+
+      } else {
+        setState(STARTING);
+        return true;
+      }
+    }
+  }
+
+  /**
+   * Sets the state of this managed system member depending on whether or not <code>vm</code> is
+   * <code>null</code>.
+   */
+  @Override
+  void setGemFireVM(GemFireVM vm) throws AdminException {
+    super.setGemFireVM(vm);
+    if (vm != null) {
+      this.setState(RUNNING);
+
+    } else {
+      this.setState(STOPPED);
+    }
+  }
+
+  /**
+   * Waits until this system member's "state" is {@link #RUNNING}.
+   */
+  public boolean waitToStart(long timeout) throws InterruptedException {
+
+    if (Thread.interrupted())
+      throw new InterruptedException();
+
+    long start = System.currentTimeMillis();
+    while (System.currentTimeMillis() - start < timeout) {
+      synchronized (this.stateChange) {
+        if (this.state == RUNNING) {
+          break;
+
+        } else {
+          this.stateChange.wait(System.currentTimeMillis() - start);
+        }
+      }
+    }
+
+    synchronized (this.stateChange) {
+      return this.state == RUNNING;
+    }
+  }
+
+  /**
+   * Waits until this system member's "state" is {@link #STOPPED}.
+   */
+  public boolean waitToStop(long timeout) throws InterruptedException {
+
+    if (Thread.interrupted())
+      throw new InterruptedException();
+    long start = System.currentTimeMillis();
+    while (System.currentTimeMillis() - start < timeout) {
+      synchronized (this.stateChange) {
+        if (this.state == STOPPED) {
+          break;
+
+        } else {
+          this.stateChange.wait(System.currentTimeMillis() - start);
+        }
+      }
+    }
+
+    synchronized (this.stateChange) {
+      return this.state == STOPPED;
+    }
+  }
+
+  /**
+   * Appends configuration information to a <code>StringBuffer</code> that contains a command line.
+   * Handles certain configuration parameters specially.
+   */
+  protected void appendConfiguration(StringBuffer sb) {
+    ConfigurationParameter[] params = this.getConfiguration();
+    for (int i = 0; i < params.length; i++) {
+      ConfigurationParameter param = params[i];
+
+      if (!param.isModifiable()) {
+        continue;
+      }
+
+      String name = param.getName();
+      String value = param.getValueAsString();
+
+      if (value != null && !value.equals("")) {
+        if (name.equals(LOCATORS)) {
+          // Use the new locator syntax so that is plays nicely with
+          // rsh. See bug 32306.
+          String locator = value;
+          int firstBracket = locator.indexOf('[');
+          int lastBracket = locator.indexOf(']');
+
+          if (firstBracket > -1 && lastBracket > -1) {
+            String host = locator.substring(0, firstBracket);
+            String port = locator.substring(firstBracket + 1, lastBracket);
+            locator = host + ":" + port;
+          }
+
+          sb.append(" ");
+          sb.append(name);
+          sb.append("=");
+          sb.append(locator);
+
+        } else {
+          sb.append(" ");
+          sb.append(name);
+          sb.append("=");
+          sb.append(value);
+        }
+      }
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/MemberHealthConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/MemberHealthConfigImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/MemberHealthConfigImpl.java
new file mode 100644
index 0000000..2f2334d
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/MemberHealthConfigImpl.java
@@ -0,0 +1,95 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.MemberHealthConfig;
+
+// @todo Make this class (and all of its subclasses) {@link java.io.Externalizable} or
+// {@link org.apache.geode.DataSerializable}.
+/**
+ * The implementation of <code>MemberHealthConfig</code>
+ *
+ *
+ * @since GemFire 3.5
+ */
+public abstract class MemberHealthConfigImpl implements MemberHealthConfig, java.io.Serializable {
+
+  private static final long serialVersionUID = 3966032573073580490L;
+
+  /**
+   * The maximum process size (in megabytes) of a healthy member of the distributed system.
+   */
+  private long maxVMProcessSize = DEFAULT_MAX_VM_PROCESS_SIZE;
+
+  /**
+   * The maximum number of enqueued incoming or outgoing messages that a healthy member of a
+   * distributed system can have.
+   */
+  private long maxMessageQueueSize = DEFAULT_MAX_MESSAGE_QUEUE_SIZE;
+
+  /**
+   * The maximum number message replies that can timeout in a healthy member.
+   */
+  private long maxReplyTimeouts = DEFAULT_MAX_REPLY_TIMEOUTS;
+
+  /**
+   * The maximum multicast retransmit / multicast message count ratio
+   */
+  private double maxRetransmissionRatio = DEFAULT_MAX_RETRANSMISSION_RATIO;
+
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>MemberHealthConfigImpl</code> with the default configuration.
+   */
+  MemberHealthConfigImpl() {
+
+  }
+
+  ///////////////////// Instance Methods //////////////////////
+
+  public long getMaxVMProcessSize() {
+    return this.maxVMProcessSize;
+  }
+
+  public void setMaxVMProcessSize(long size) {
+    this.maxVMProcessSize = size;
+  }
+
+  public long getMaxMessageQueueSize() {
+    return this.maxMessageQueueSize;
+  }
+
+  public void setMaxMessageQueueSize(long maxMessageQueueSize) {
+    this.maxMessageQueueSize = maxMessageQueueSize;
+  }
+
+  public long getMaxReplyTimeouts() {
+    return this.maxReplyTimeouts;
+  }
+
+  public void setMaxReplyTimeouts(long maxReplyTimeouts) {
+    this.maxReplyTimeouts = maxReplyTimeouts;
+  }
+
+  public double getMaxRetransmissionRatio() {
+    return this.maxRetransmissionRatio;
+  }
+
+  public void setMaxRetransmissionRatio(double ratio) {
+    this.maxRetransmissionRatio = ratio;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/MemberHealthEvaluator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/MemberHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/MemberHealthEvaluator.java
new file mode 100644
index 0000000..11fc8f4
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/MemberHealthEvaluator.java
@@ -0,0 +1,248 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.distributed.internal.*;
+import org.apache.geode.internal.*;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.MemberHealthConfig;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.cache.CachePerfStats;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.statistics.GemFireStatSampler;
+import org.apache.geode.internal.statistics.platform.ProcessStats;
+
+import java.util.*;
+
+/**
+ * Contains the logic for evaluating the health of a GemFire distributed system member according to
+ * the thresholds provided in a {@link MemberHealthConfig}.
+ *
+ * @see VMStats
+ * @see ProcessStats
+ * @see DMStats
+ *
+ *
+ * @since GemFire 3.5
+ */
+/**
+ *
+ */
+class MemberHealthEvaluator extends AbstractHealthEvaluator {
+
+  /** The config from which we get the evaluation criteria */
+  private MemberHealthConfig config;
+
+  /** The description of the member being evaluated */
+  private String description;
+
+  // /** Statistics about this VM (may be null) */
+  // private VMStatsContract vmStats;
+
+  /** Statistics about this process (may be null) */
+  private ProcessStats processStats;
+
+  /** Statistics about the distribution manager */
+  private DMStats dmStats;
+
+  /** The previous value of the reply timeouts stat */
+  private long prevReplyTimeouts;
+
+  ////////////////////// Constructors //////////////////////
+
+  /**
+   * Creates a new <code>MemberHealthEvaluator</code>
+   */
+  MemberHealthEvaluator(GemFireHealthConfig config, DM dm) {
+    super(config, dm);
+
+    this.config = config;
+    InternalDistributedSystem system = dm.getSystem();
+
+    GemFireStatSampler sampler = system.getStatSampler();
+    if (sampler != null) {
+      // Sampling is enabled
+      // this.vmStats = sampler.getVMStats();
+      this.processStats = sampler.getProcessStats();
+    }
+
+    this.dmStats = dm.getStats();
+
+    StringBuffer sb = new StringBuffer();
+    sb.append("Application VM member ");
+    sb.append(dm.getId());
+    int pid = OSProcess.getId();
+    if (pid != 0) {
+      sb.append(" with pid ");
+      sb.append(pid);
+    }
+    this.description = sb.toString();
+  }
+
+  //////////////////// Instance Methods ////////////////////
+
+  @Override
+  protected String getDescription() {
+    return this.description;
+  }
+
+  /**
+   * Checks to make sure that the {@linkplain ProcessStats#getProcessSize VM's process size} is less
+   * than the {@linkplain MemberHealthConfig#getMaxVMProcessSize threshold}. If not, the status is
+   * "okay" health.
+   */
+  void checkVMProcessSize(List status) {
+    // There is no need to check isFirstEvaluation()
+    if (this.processStats == null) {
+      return;
+    }
+
+    long vmSize = this.processStats.getProcessSize();
+    long threshold = this.config.getMaxVMProcessSize();
+    if (vmSize > threshold) {
+      String s =
+          LocalizedStrings.MemberHealthEvaluator_THE_SIZE_OF_THIS_VM_0_MEGABYTES_EXCEEDS_THE_THRESHOLD_1_MEGABYTES
+              .toLocalizedString(new Object[] {Long.valueOf(vmSize), Long.valueOf(threshold)});
+      status.add(okayHealth(s));
+    }
+  }
+
+  /**
+   * Checks to make sure that the size of the distribution manager's
+   * {@linkplain DMStats#getOverflowQueueSize() overflow} message queue does not exceed the
+   * {@linkplain MemberHealthConfig#getMaxMessageQueueSize threshold}. If not, the status is "okay"
+   * health.
+   */
+  void checkMessageQueueSize(List status) {
+    long threshold = this.config.getMaxMessageQueueSize();
+    long overflowSize = this.dmStats.getOverflowQueueSize();
+    if (overflowSize > threshold) {
+      String s =
+          LocalizedStrings.MemberHealthEvaluator_THE_SIZE_OF_THE_OVERFLOW_QUEUE_0_EXCEEDS_THE_THRESHOLD_1
+              .toLocalizedString(
+                  new Object[] {Long.valueOf(overflowSize), Long.valueOf(threshold)});
+      status.add(okayHealth(s));
+    }
+  }
+
+  /**
+   * Checks to make sure that the number of {@linkplain DMStats#getReplyTimeouts reply timeouts}
+   * does not exceed the {@linkplain MemberHealthConfig#getMaxReplyTimeouts threshold}. If not, the
+   * status is "okay" health.
+   */
+  void checkReplyTimeouts(List status) {
+    if (isFirstEvaluation()) {
+      return;
+    }
+
+    long threshold = this.config.getMaxReplyTimeouts();
+    long deltaReplyTimeouts = this.dmStats.getReplyTimeouts() - prevReplyTimeouts;
+    if (deltaReplyTimeouts > threshold) {
+      String s =
+          LocalizedStrings.MemberHealthEvaluator_THE_NUMBER_OF_MESSAGE_REPLY_TIMEOUTS_0_EXCEEDS_THE_THRESHOLD_1
+              .toLocalizedString(
+                  new Object[] {Long.valueOf(deltaReplyTimeouts), Long.valueOf(threshold)});
+      status.add(okayHealth(s));
+    }
+  }
+
+  /**
+   * See if the multicast retransmission ratio is okay
+   */
+  void checkRetransmissionRatio(List status) {
+    double threshold = this.config.getMaxRetransmissionRatio();
+    int mcastMessages = this.dmStats.getMcastWrites();
+    if (mcastMessages > 100000) { // avoid initial state & int overflow
+      // the ratio we actually use here is (retransmit requests) / (mcast datagram writes)
+      // a single retransmit request may include multiple missed messages
+      double ratio =
+          (this.dmStats.getMcastRetransmits() * 1.0) / (this.dmStats.getMcastWrites() * 1.0);
+      if (ratio > threshold) {
+        String s = "The number of message retransmissions (" + ratio + ") exceeds the threshold ("
+            + threshold + ")";
+        status.add(okayHealth(s));
+      }
+    }
+  }
+
+  /**
+   * The function keeps updating the health of the cache based on roles required by the regions and
+   * their reliablity policies.
+   * 
+   */
+
+  void checkCacheRequiredRolesMeet(List status) {
+    // will have to call here okeyHealth() or poorHealth()
+    // GemFireCache cache = (GemFireCache)CacheFactory.getAnyInstance();
+
+    // CachePerfStats cPStats= null;
+    try {
+      GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+      CachePerfStats cPStats = null;
+      cPStats = cache.getCachePerfStats();
+
+      if (cPStats.getReliableRegionsMissingFullAccess() > 0) {
+        // health is okay.
+        int numRegions = cPStats.getReliableRegionsMissingFullAccess();
+        status.add(okayHealth(
+            LocalizedStrings.MemberHealthEvaluator_THERE_ARE_0_REGIONS_MISSING_REQUIRED_ROLES_BUT_ARE_CONFIGURED_FOR_FULL_ACCESS
+                .toLocalizedString(Integer.valueOf(numRegions))));
+      } else if (cPStats.getReliableRegionsMissingLimitedAccess() > 0) {
+        // health is poor
+        int numRegions = cPStats.getReliableRegionsMissingLimitedAccess();
+        status.add(poorHealth(
+            LocalizedStrings.MemberHealthEvaluator_THERE_ARE_0_REGIONS_MISSING_REQUIRED_ROLES_AND_CONFIGURED_WITH_LIMITED_ACCESS
+                .toLocalizedString(Integer.valueOf(numRegions))));
+      } else if (cPStats.getReliableRegionsMissingNoAccess() > 0) {
+        // health is poor
+        int numRegions = cPStats.getReliableRegionsMissingNoAccess();
+        status.add(poorHealth(
+            LocalizedStrings.MemberHealthEvaluator_THERE_ARE_0_REGIONS_MISSING_REQUIRED_ROLES_AND_CONFIGURED_WITHOUT_ACCESS
+                .toLocalizedString(Integer.valueOf(numRegions))));
+      } // else{
+        // health is good/okay
+        // status.add(okayHealth("All regions have there required roles meet"));
+        // }
+    } catch (CancelException ignore) {
+    }
+  }
+
+
+  /**
+   * Updates the previous values of statistics
+   */
+  private void updatePrevious() {
+    this.prevReplyTimeouts = this.dmStats.getReplyTimeouts();
+  }
+
+  @Override
+  protected void check(List status) {
+    checkVMProcessSize(status);
+    checkMessageQueueSize(status);
+    checkReplyTimeouts(status);
+    // will have to add another call to check for roles
+    // missing and reliablity attributed.
+    checkCacheRequiredRolesMeet(status);
+
+    updatePrevious();
+  }
+
+  @Override
+  void close() {
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/PrepareBackupRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/PrepareBackupRequest.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/PrepareBackupRequest.java
new file mode 100644
index 0000000..a394d50
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/PrepareBackupRequest.java
@@ -0,0 +1,133 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.cache.persistence.PersistentID;
+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.ReplyException;
+import org.apache.geode.internal.admin.remote.AdminFailureResponse;
+import org.apache.geode.internal.admin.remote.AdminMultipleReplyProcessor;
+import org.apache.geode.internal.admin.remote.AdminResponse;
+import org.apache.geode.internal.admin.remote.CliLegacyMessage;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.persistence.BackupManager;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+
+/**
+ * A request to from an admin VM to all non admin members to start a backup. In the prepare phase of
+ * the backup, the members will suspend bucket destroys to make sure buckets aren't missed during
+ * the backup.
+ * 
+ *
+ */
+public class PrepareBackupRequest extends CliLegacyMessage {
+  private static final Logger logger = LogService.getLogger();
+
+  public PrepareBackupRequest() {
+
+  }
+
+  public static Map<DistributedMember, Set<PersistentID>> send(DM dm, Set recipients) {
+    PrepareBackupRequest request = new PrepareBackupRequest();
+    request.setRecipients(recipients);
+
+    PrepareBackupReplyProcessor replyProcessor = new PrepareBackupReplyProcessor(dm, recipients);
+    request.msgId = replyProcessor.getProcessorId();
+    dm.putOutgoing(request);
+    try {
+      replyProcessor.waitForReplies();
+    } catch (ReplyException e) {
+      if (!(e.getCause() instanceof CancelException)) {
+        throw e;
+      }
+    } catch (InterruptedException e) {
+      e.printStackTrace();
+    }
+    AdminResponse response = request.createResponse((DistributionManager) dm);
+    response.setSender(dm.getDistributionManagerId());
+    replyProcessor.process(response);
+    return replyProcessor.results;
+  }
+
+  @Override
+  protected AdminResponse createResponse(DistributionManager dm) {
+    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+    HashSet<PersistentID> persistentIds;
+    if (cache == null) {
+      persistentIds = new HashSet<PersistentID>();
+    } else {
+      try {
+        BackupManager manager = cache.startBackup(getSender());
+        persistentIds = manager.prepareBackup();
+      } catch (IOException e) {
+        logger.error(
+            LocalizedMessage.create(LocalizedStrings.CliLegacyMessage_ERROR, this.getClass()), e);
+        return AdminFailureResponse.create(dm, getSender(), e);
+      }
+    }
+
+
+    return new PrepareBackupResponse(this.getSender(), persistentIds);
+  }
+
+  public int getDSFID() {
+    return PREPARE_BACKUP_REQUEST;
+  }
+
+  private static class PrepareBackupReplyProcessor extends AdminMultipleReplyProcessor {
+    Map<DistributedMember, Set<PersistentID>> results =
+        Collections.synchronizedMap(new HashMap<DistributedMember, Set<PersistentID>>());
+
+    public PrepareBackupReplyProcessor(DM dm, Collection initMembers) {
+      super(dm, initMembers);
+    }
+
+    @Override
+    protected boolean stopBecauseOfExceptions() {
+      return false;
+    }
+
+    @Override
+    protected void process(DistributionMessage msg, boolean warn) {
+      if (msg instanceof PrepareBackupResponse) {
+        final HashSet<PersistentID> persistentIds =
+            ((PrepareBackupResponse) msg).getPersistentIds();
+        if (persistentIds != null && !persistentIds.isEmpty()) {
+          results.put(msg.getSender(), persistentIds);
+        }
+      }
+      super.process(msg, warn);
+    }
+
+
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/PrepareBackupResponse.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/PrepareBackupResponse.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/PrepareBackupResponse.java
new file mode 100644
index 0000000..5e68179
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/PrepareBackupResponse.java
@@ -0,0 +1,80 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.HashSet;
+
+import org.apache.geode.DataSerializer;
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.admin.remote.AdminResponse;
+
+/**
+ * The response to the {@link PrepareBackupRequest}
+ * 
+ *
+ */
+public class PrepareBackupResponse extends AdminResponse {
+
+  private HashSet<PersistentID> persistentIds;
+
+  public PrepareBackupResponse() {
+    super();
+  }
+
+  public PrepareBackupResponse(InternalDistributedMember sender,
+      HashSet<PersistentID> persistentIds) {
+    this.setRecipient(sender);
+    this.persistentIds = persistentIds;
+  }
+
+  public HashSet<PersistentID> getPersistentIds() {
+    return persistentIds;
+  }
+
+  @Override
+  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
+    super.fromData(in);
+    persistentIds = DataSerializer.readHashSet(in);
+  }
+
+
+
+  @Override
+  public void toData(DataOutput out) throws IOException {
+    super.toData(out);
+    DataSerializer.writeHashSet(persistentIds, out);
+  }
+
+
+
+  @Override
+  protected Object clone() throws CloneNotSupportedException {
+    // TODO Auto-generated method stub
+    return super.clone();
+  }
+
+  public int getDSFID() {
+    return PREPARE_BACKUP_RESPONSE;
+  }
+
+  @Override
+  public String toString() {
+    return getClass().getName() + ": " + persistentIds;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/StatisticImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/StatisticImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/StatisticImpl.java
new file mode 100755
index 0000000..d9ce318
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/StatisticImpl.java
@@ -0,0 +1,93 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.Stat;
+import org.apache.geode.internal.admin.api.Statistic;
+
+/**
+ * Implementation of a single statistic in a <code>StatisticResource</code>
+ *
+ * @since GemFire 3.5
+ *
+ */
+public class StatisticImpl implements Statistic {
+
+  private static final long serialVersionUID = 3899296873901634399L;
+
+  private Stat internalStat;
+
+  protected StatisticImpl() {}
+
+  protected StatisticImpl(Stat internalStat) {
+    this.internalStat = internalStat;
+  }
+
+  /**
+   * @return the identifying name of this stat
+   */
+  public String getName() {
+    return this.internalStat.getName();
+  }
+
+  /**
+   * @return the value of this stat as a <code>java.lang.Number</code>
+   */
+  public Number getValue() {
+    return this.internalStat.getValue();
+  }
+
+  /**
+   * @return a display string for the unit of measurement (if any) this stat represents
+   */
+  public String getUnits() {
+    return this.internalStat.getUnits();
+  }
+
+  /**
+   * @return true if this stat represents a numeric value which always increases
+   */
+  public boolean isCounter() {
+    return this.internalStat.isCounter();
+  }
+
+  /**
+   * @return the full description of this stat
+   */
+  public String getDescription() {
+    return this.internalStat.getDescription();
+  }
+
+  /**
+   * Sets the internal stat which allows us to reuse the wrapper object and handle refreshes along
+   * with isWriteable set to false on the attribute.
+   */
+  protected void setStat(Stat internalStat) {
+    this.internalStat = internalStat;
+  }
+
+  /**
+   * Returns a string representation of the object.
+   * 
+   * @return a string representation of the object
+   */
+  @Override
+  public String toString() {
+    return getName();
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/StatisticResourceImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/StatisticResourceImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/StatisticResourceImpl.java
new file mode 100755
index 0000000..0470a88
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/StatisticResourceImpl.java
@@ -0,0 +1,177 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.StatisticResource;
+import org.apache.geode.internal.admin.api.SystemMember;
+import org.apache.geode.internal.admin.api.Statistic;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.admin.Stat;
+import org.apache.geode.internal.admin.StatResource;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+// import org.apache.geode.internal.admin.SystemMember;
+
+import java.util.ArrayList;
+// import java.util.Date;
+import java.util.List;
+
+/**
+ * Provides monitoring of a statistic resource.
+ *
+ * @since GemFire 3.5
+ */
+public class StatisticResourceImpl implements StatisticResource {
+
+  /** The underlying remote StatResource which this object delegates to */
+  protected StatResource statResource;
+  /** Displayable name of this statistic resource */
+  protected String name;
+  /** Description of this statistic resource */
+  protected String description;
+  /** Classification type of this statistic resource */
+  protected String type;
+  /** GemFire system member which owns this statistic resource */
+  protected SystemMember member;
+  /** The array of statistics in this resource */
+  protected Statistic[] statistics; // = new Statistic[0];
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs an instance of StatisticResourceImpl.
+   *
+   * @param statResource the admin StatResource to manage/monitor
+   * @param member the SystemMember owning this resource
+   * @exception AdminException if unable to create this StatisticResource for administration
+   */
+  public StatisticResourceImpl(StatResource statResource, SystemMember member)
+      throws AdminException {
+    this.statResource = statResource;
+    this.member = member;
+    this.name = this.statResource.getName();
+    this.description = this.statResource.getDescription();
+    this.type = this.statResource.getType();
+  }
+
+  // -------------------------------------------------------------------------
+  // Attributes accessors and mutators
+  // -------------------------------------------------------------------------
+
+  public String getName() {
+    return this.name;
+  }
+
+  public String getDescription() {
+    return this.description;
+  }
+
+  public String getType() {
+    return this.type;
+  }
+
+  public String getOwner() {
+    return this.member.toString();
+  }
+
+  public Statistic[] getStatistics() {
+    if (this.statistics == null) {
+      try {
+        refresh();
+      } catch (AdminException e) {
+        this.statistics = new Statistic[0];
+      }
+    }
+    return this.statistics;
+  }
+
+  public long getUniqueId() {
+    return this.statResource.getResourceUniqueID();
+  }
+
+  // -------------------------------------------------------------------------
+  // Operations
+  // -------------------------------------------------------------------------
+
+  public void refresh() throws AdminException {
+    Stat[] stats = null;
+    if (this.statResource != null) {
+      stats = this.statResource.getStats();
+    }
+    if (stats == null || stats.length < 1) {
+      throw new AdminException(
+          LocalizedStrings.StatisticResourceImpl_FAILED_TO_REFRESH_STATISTICS_0_FOR_1
+              .toLocalizedString(getType() + "-" + getName(), getOwner()));
+    }
+
+    if (this.statistics == null || this.statistics.length < 1) {
+      // define new statistics instances...
+      List statList = new ArrayList();
+      for (int i = 0; i < stats.length; i++) {
+        statList.add(createStatistic(stats[i]));
+      }
+      this.statistics = (Statistic[]) statList.toArray(new Statistic[0]);
+    } else {
+      // update the existing instances...
+      for (int i = 0; i < stats.length; i++) {
+        updateStatistic(stats[i]);
+      }
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // Non-public implementation methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Updates the value of the {@link Statistic} corresponding to the internal
+   * {@link org.apache.geode.internal.admin.Stat}
+   *
+   * @param stat the internal stat to use in updating the matching statistic
+   */
+  private void updateStatistic(Stat stat) {
+    for (int i = 0; i < this.statistics.length; i++) {
+      if (this.statistics[i].getName().equals(stat.getName())) {
+        ((StatisticImpl) this.statistics[i]).setStat(stat);
+        return;
+      }
+    }
+    Assert.assertTrue(false, "Unknown stat: " + stat.getName());
+  }
+
+  /**
+   * Creates a new {@link StatisticImpl} to represent the internal
+   * {@link org.apache.geode.internal.admin.Stat}
+   *
+   * @param stat the internal stat to wrap in a new statistic
+   */
+  protected Statistic createStatistic(Stat stat) {
+    return new StatisticImpl(stat);
+  }
+
+  /**
+   * Returns a string representation of the object.
+   * 
+   * @return a string representation of the object
+   */
+  @Override
+  public String toString() {
+    return getName();
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberBridgeServerImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberBridgeServerImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberBridgeServerImpl.java
new file mode 100644
index 0000000..fd3411a
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberBridgeServerImpl.java
@@ -0,0 +1,234 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.io.Serializable;
+
+import org.apache.geode.InternalGemFireException;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.SystemMemberBridgeServer;
+import org.apache.geode.internal.admin.api.SystemMemberCacheServer;
+import org.apache.geode.cache.server.ServerLoadProbe;
+import org.apache.geode.internal.admin.*;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+/**
+ * Implementation of an object used for managing cache servers.
+ *
+ * @since GemFire 4.0
+ */
+public class SystemMemberBridgeServerImpl
+    implements SystemMemberCacheServer, SystemMemberBridgeServer {
+
+  /** The VM in which the bridge server resides */
+  private final GemFireVM vm;
+
+  /** The cache server by this bridge server */
+  private CacheInfo cache;
+
+  /** Information about the bridge server */
+  private AdminBridgeServer bridgeInfo;
+
+  ///////////////////// Constructors /////////////////////
+
+  /**
+   * Creates a new <code>SystemMemberBridgeServerImpl</code> that administers the given bridge
+   * server in the given VM.
+   */
+  protected SystemMemberBridgeServerImpl(SystemMemberCacheImpl cache, AdminBridgeServer bridgeInfo)
+
+      throws AdminException {
+
+    this.vm = cache.getVM();
+    this.cache = cache.getCacheInfo();
+    this.bridgeInfo = bridgeInfo;
+  }
+
+  //////////////////// Instance Methods ////////////////////
+
+  /**
+   * Throws an <code>AdminException</code> if this bridge server is running.
+   */
+  private void checkRunning() throws AdminException {
+    if (this.isRunning()) {
+      throw new AdminException(
+          LocalizedStrings.SystemMemberBridgeServerImpl_CANNOT_CHANGE_THE_CONFIGURATION_OF_A_RUNNING_BRIDGE_SERVER
+              .toLocalizedString());
+    }
+  }
+
+  public int getPort() {
+    return this.bridgeInfo.getPort();
+  }
+
+  public void setPort(int port) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setPort(port);
+  }
+
+  public void start() throws AdminException {
+    this.vm.startBridgeServer(this.cache, this.bridgeInfo);
+  }
+
+  public boolean isRunning() {
+    return this.bridgeInfo.isRunning();
+  }
+
+  public void stop() throws AdminException {
+    this.vm.stopBridgeServer(this.cache, this.bridgeInfo);
+  }
+
+  /**
+   * Returns the VM-unique id of this bridge server
+   */
+  protected int getBridgeId() {
+    return this.bridgeInfo.getId();
+  }
+
+  public void refresh() {
+    try {
+      this.bridgeInfo = this.vm.getBridgeInfo(this.cache, this.bridgeInfo.getId());
+
+    } catch (AdminException ex) {
+      throw new InternalGemFireException(
+          LocalizedStrings.SystemMemberBridgeServerImpl_UNEXPECTED_EXCEPTION_WHILE_REFRESHING
+              .toLocalizedString(),
+          ex);
+    }
+  }
+
+  public String getBindAddress() {
+    return this.bridgeInfo.getBindAddress();
+  }
+
+  public void setBindAddress(String address) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setBindAddress(address);
+  }
+
+  public String getHostnameForClients() {
+    return this.bridgeInfo.getHostnameForClients();
+  }
+
+  public void setHostnameForClients(String name) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setHostnameForClients(name);
+  }
+
+  public void setNotifyBySubscription(boolean b) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setNotifyBySubscription(b);
+  }
+
+  public boolean getNotifyBySubscription() {
+    return this.bridgeInfo.getNotifyBySubscription();
+  }
+
+  public void setSocketBufferSize(int socketBufferSize) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setSocketBufferSize(socketBufferSize);
+  }
+
+  public int getSocketBufferSize() {
+    return this.bridgeInfo.getSocketBufferSize();
+  }
+
+  public void setTcpDelay(boolean setting) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setTcpNoDelay(setting);
+  }
+
+  public boolean getTcpDelay() {
+    return this.bridgeInfo.getTcpNoDelay();
+  }
+
+  public void setMaximumTimeBetweenPings(int maximumTimeBetweenPings) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setMaximumTimeBetweenPings(maximumTimeBetweenPings);
+  }
+
+  public int getMaximumTimeBetweenPings() {
+    return this.bridgeInfo.getMaximumTimeBetweenPings();
+  }
+
+  public int getMaxConnections() {
+    return this.bridgeInfo.getMaxConnections();
+  }
+
+  public void setMaxConnections(int maxCons) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setMaxConnections(maxCons);
+  }
+
+  public int getMaxThreads() {
+    return this.bridgeInfo.getMaxThreads();
+  }
+
+  public void setMaxThreads(int maxThreads) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setMaxThreads(maxThreads);
+  }
+
+  public int getMaximumMessageCount() {
+    return this.bridgeInfo.getMaximumMessageCount();
+  }
+
+  public void setMaximumMessageCount(int maxMessageCount) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setMaximumMessageCount(maxMessageCount);
+  }
+
+  public int getMessageTimeToLive() {
+    return this.bridgeInfo.getMessageTimeToLive();
+  }
+
+  public void setMessageTimeToLive(int messageTimeToLive) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setMessageTimeToLive(messageTimeToLive);
+  }
+
+  public void setGroups(String[] groups) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setGroups(groups);
+  }
+
+  public String[] getGroups() {
+    return this.bridgeInfo.getGroups();
+  }
+
+  public String getLoadProbe() {
+    return this.bridgeInfo.getLoadProbe().toString();
+  }
+
+  public void setLoadProbe(ServerLoadProbe loadProbe) throws AdminException {
+    checkRunning();
+    if (!(loadProbe instanceof Serializable)) {
+      throw new IllegalArgumentException(
+          "Load probe must be Serializable to be used with admin API");
+    }
+    this.bridgeInfo.setLoadProbe(loadProbe);
+  }
+
+  public long getLoadPollInterval() {
+    return this.bridgeInfo.getLoadPollInterval();
+  }
+
+  public void setLoadPollInterval(long loadPollInterval) throws AdminException {
+    checkRunning();
+    this.bridgeInfo.setLoadPollInterval(loadPollInterval);
+  }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheEventImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheEventImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheEventImpl.java
new file mode 100644
index 0000000..5f2e6bd
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheEventImpl.java
@@ -0,0 +1,55 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.cache.Operation;
+import org.apache.geode.internal.admin.api.SystemMemberCacheEvent;
+import org.apache.geode.internal.admin.api.SystemMemberCacheListener;
+
+/**
+ * An event that describes an operation on a cache. Instances of this are delivered to a
+ * {@link SystemMemberCacheListener} when a a cache is created or closed.
+ *
+ * @since GemFire 5.0
+ */
+public class SystemMemberCacheEventImpl extends SystemMembershipEventImpl
+    implements SystemMemberCacheEvent {
+
+  /** The operation done by this event */
+  private Operation op;
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>SystemMemberCacheEvent</code> for the member with the given id.
+   */
+  protected SystemMemberCacheEventImpl(DistributedMember id, Operation op) {
+    super(id);
+    this.op = op;
+  }
+
+  ///////////////////// Instance Methods /////////////////////
+
+  public Operation getOperation() {
+    return this.op;
+  }
+
+  @Override
+  public String toString() {
+    return super.toString() + " op=" + this.op;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheEventProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheEventProcessor.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheEventProcessor.java
new file mode 100644
index 0000000..605f172
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheEventProcessor.java
@@ -0,0 +1,146 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.DataSerializer;
+import org.apache.geode.internal.admin.api.SystemMemberCacheEvent;
+import org.apache.geode.internal.admin.api.SystemMemberCacheListener;
+import org.apache.geode.internal.admin.api.SystemMemberRegionEvent;
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.Operation;
+import org.apache.geode.cache.Region;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.distributed.internal.HighPriorityDistributionMessage;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.internal.logging.LogService;
+
+/**
+ * This class processes the message to be delivered to admin node. [This needs to be redesigned and
+ * reimplemented... see 32887]
+ * 
+ * @since GemFire 5.0
+ */
+public class SystemMemberCacheEventProcessor {
+  private static final Logger logger = LogService.getLogger();
+
+
+  /*
+   * Sends cache create/close message to Admin VMs
+   */
+  public static void send(Cache c, Operation op) {
+    send(c, null, op);
+  }
+
+  /*
+   * Sends region creation/destroy message to Admin VMs
+   */
+  public static void send(Cache c, Region region, Operation op) {
+    InternalDistributedSystem system = (InternalDistributedSystem) c.getDistributedSystem();
+    Set recps = system.getDistributionManager().getAdminMemberSet();
+    // @todo darrel: find out if any of these guys have region listeners
+    if (recps.isEmpty()) {
+      return;
+    }
+    SystemMemberCacheMessage msg = new SystemMemberCacheMessage();
+    if (region == null) {
+      msg.regionPath = null;
+    } else {
+      msg.regionPath = region.getFullPath();
+    }
+    msg.setRecipients(recps);
+    msg.op = op;
+    system.getDistributionManager().putOutgoing(msg);
+  }
+
+
+  public static final class SystemMemberCacheMessage extends HighPriorityDistributionMessage {
+    protected String regionPath;
+    protected Operation op;
+
+    @Override
+    protected void process(DistributionManager dm) {
+      AdminDistributedSystemImpl admin = AdminDistributedSystemImpl.getConnectedInstance();
+      if (admin == null) {
+        if (logger.isDebugEnabled()) {
+          logger.debug("Ignoring message because there is no admin distributed system present: {}",
+              this);
+        }
+        return; // probably shutting down or still connecting
+      }
+      List listeners = admin.getCacheListeners();
+      Iterator itr = listeners.iterator();
+      SystemMemberCacheListener listener = null;
+      while (itr.hasNext()) {
+        listener = (SystemMemberCacheListener) itr.next();
+        if (this.regionPath == null) {
+          SystemMemberCacheEvent event = new SystemMemberCacheEventImpl(getSender(), this.op);
+          if (this.op == Operation.CACHE_CREATE) {
+            listener.afterCacheCreate(event);
+          } else {
+            listener.afterCacheClose(event);
+          }
+        } else {
+          SystemMemberRegionEvent event =
+              new SystemMemberRegionEventImpl(getSender(), this.op, this.regionPath);
+          if (this.op.isRegionDestroy()) {
+            listener.afterRegionLoss(event);
+          } else {
+            listener.afterRegionCreate(event);
+          }
+        }
+      }
+    }
+
+    public int getDSFID() {
+      return ADMIN_CACHE_EVENT_MESSAGE;
+    }
+
+    @Override
+    public void fromData(DataInput in) throws IOException, ClassNotFoundException {
+      super.fromData(in);
+      this.regionPath = DataSerializer.readString(in);
+      this.op = Operation.fromOrdinal(in.readByte());
+    }
+
+    @Override
+    public void toData(DataOutput out) throws IOException {
+      super.toData(out);
+      DataSerializer.writeString(this.regionPath, out);
+      out.writeByte(this.op.ordinal);
+    }
+
+    @Override
+    public String toString() {
+      StringBuffer buff = new StringBuffer();
+      buff.append("SystemMemberCacheMessage (region='");
+      buff.append(this.regionPath);
+      buff.append("'; sender=");
+      buff.append(this.sender);
+      buff.append("; op=");
+      buff.append(this.op);
+      buff.append(")");
+      return buff.toString();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheImpl.java
new file mode 100644
index 0000000..c9615f6
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberCacheImpl.java
@@ -0,0 +1,310 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.cache.*;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.ObjIdMap;
+import org.apache.geode.internal.admin.*;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.CacheDoesNotExistException;
+import org.apache.geode.internal.admin.api.GemFireMemberStatus;
+import org.apache.geode.internal.admin.api.RegionSubRegionSnapshot;
+import org.apache.geode.internal.admin.api.Statistic;
+import org.apache.geode.internal.admin.api.SystemMemberBridgeServer;
+import org.apache.geode.internal.admin.api.SystemMemberCache;
+import org.apache.geode.internal.admin.api.SystemMemberCacheServer;
+import org.apache.geode.internal.admin.api.SystemMemberRegion;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+import java.util.*;
+
+/**
+ * View of a GemFire system member's cache.
+ *
+ * @since GemFire 3.5
+ */
+public class SystemMemberCacheImpl implements SystemMemberCache {
+  protected final GemFireVM vm;
+  protected CacheInfo info;
+  protected Statistic[] statistics;
+
+  /** Maps the id of a bridge server to its SystemMemberBridgeServer */
+  private ObjIdMap bridgeServers = new ObjIdMap();
+
+  // constructors
+  public SystemMemberCacheImpl(GemFireVM vm) throws CacheDoesNotExistException {
+    this.vm = vm;
+    this.info = vm.getCacheInfo();
+    if (this.info == null) {
+      throw new CacheDoesNotExistException(
+          LocalizedStrings.SystemMemberCacheImpl_THE_VM_0_DOES_NOT_CURRENTLY_HAVE_A_CACHE
+              .toLocalizedString(vm.getId()));
+    }
+    initStats();
+  }
+
+  // attributes
+  /**
+   * The name of the cache.
+   */
+  public String getName() {
+    String result = this.info.getName();
+    if (result == null || result.length() == 0) {
+      result = "default";
+    }
+    return result;
+  }
+
+  /**
+   * Value that uniquely identifies an instance of a cache for a given member.
+   */
+  public int getId() {
+    return this.info.getId();
+  }
+
+  public boolean isClosed() {
+    return this.info.isClosed();
+  }
+
+  public int getLockTimeout() {
+    return this.info.getLockTimeout();
+  }
+
+  public void setLockTimeout(int seconds) throws AdminException {
+    this.info = this.vm.setCacheLockTimeout(this.info, seconds);
+  }
+
+  public int getLockLease() {
+    return this.info.getLockLease();
+  }
+
+  public void setLockLease(int seconds) throws AdminException {
+    this.info = this.vm.setCacheLockLease(this.info, seconds);
+  }
+
+  public int getSearchTimeout() {
+    return this.info.getSearchTimeout();
+  }
+
+  public void setSearchTimeout(int seconds) throws AdminException {
+    this.info = this.vm.setCacheSearchTimeout(this.info, seconds);
+  }
+
+  public int getUpTime() {
+    return this.info.getUpTime();
+  }
+
+  public java.util.Set getRootRegionNames() {
+    Set set = this.info.getRootRegionNames();
+    if (set == null) {
+      set = Collections.EMPTY_SET;
+    }
+    return set;
+  }
+  // operations
+
+  public void refresh() {
+    if (!this.info.isClosed()) {
+      CacheInfo cur = vm.getCacheInfo();
+      if (cur == null || (this.info.getId() != cur.getId())) {
+        // it is a different instance of the cache. So set our version
+        // to closed
+        this.info.setClosed();
+      } else {
+        this.info = cur;
+        updateStats();
+      }
+    }
+  }
+
+  public GemFireMemberStatus getSnapshot() {
+    // System.out.println(">>>SystemMemberCacheJmxImpl::getSnapshot:pre::: " + this.vm);
+    GemFireMemberStatus stat = this.vm.getSnapshot();
+    // System.out.println(">>>SystemMemberCacheJmxImpl::getSnapshot:post::: " + stat);
+    return stat;
+  }
+
+  public RegionSubRegionSnapshot getRegionSnapshot() {
+    // System.out.println(">>>SystemMemberCacheJmxImpl::getRegionSnapshot:pre::: " + this.vm);
+    RegionSubRegionSnapshot snap = this.vm.getRegionSnapshot();
+    // System.out.println(">>>SystemMemberCacheJmxImpl::getRegionSnapshot:post::: " + snap);
+    return snap;
+  }
+
+  public Statistic[] getStatistics() {
+    return this.statistics;
+  }
+
+  public SystemMemberRegion getRegion(String path) throws AdminException {
+    Region r = this.vm.getRegion(this.info, path);
+    if (r == null) {
+      return null;
+    } else {
+      return createSystemMemberRegion(r);
+    }
+  }
+
+  public SystemMemberRegion createRegion(String name, RegionAttributes attrs)
+      throws AdminException {
+    Region r = this.vm.createVMRootRegion(this.info, name, attrs);
+    if (r == null) {
+      return null;
+
+    } else {
+      return createSystemMemberRegion(r);
+    }
+  }
+
+  public SystemMemberRegion createVMRegion(String name, RegionAttributes attrs)
+      throws AdminException {
+    return createRegion(name, attrs);
+  }
+
+
+  // internal methods
+  private void initStats() {
+    StatResource resource = this.info.getPerfStats();
+    if (resource == null) {
+      // See bug 31397
+      Assert.assertTrue(this.isClosed());
+      return;
+    }
+
+    Stat[] stats = resource.getStats();
+    if (stats == null || stats.length < 1) {
+      this.statistics = new Statistic[0];
+      return;
+    }
+
+    // define new statistics instances...
+    List statList = new ArrayList();
+    for (int i = 0; i < stats.length; i++) {
+      statList.add(createStatistic(stats[i]));
+    }
+    this.statistics = (Statistic[]) statList.toArray(new Statistic[statList.size()]);
+  }
+
+  private void updateStats() {
+    StatResource resource = this.info.getPerfStats();
+    if (resource == null) {
+      // See bug 31397
+      Assert.assertTrue(this.isClosed());
+      return;
+    }
+
+    Stat[] stats = resource.getStats();
+    if (stats == null || stats.length < 1) {
+      return;
+    }
+
+    for (int i = 0; i < stats.length; i++) {
+      updateStatistic(stats[i]);
+    }
+  }
+
+  private void updateStatistic(Stat stat) {
+    for (int i = 0; i < this.statistics.length; i++) {
+      if (this.statistics[i].getName().equals(stat.getName())) {
+        ((StatisticImpl) this.statistics[i]).setStat(stat);
+        return;
+      }
+    }
+    Assert.assertTrue(false, "Unknown stat: " + stat.getName());
+  }
+
+  /**
+   * Returns the <code>CacheInfo</code> that describes this cache. Note that this operation does not
+   * {@link #refresh} the <code>CacheInfo</code>.
+   */
+  public CacheInfo getCacheInfo() {
+    return this.info;
+  }
+
+  public GemFireVM getVM() {
+    return this.vm;
+  }
+
+  protected Statistic createStatistic(Stat stat) {
+    return new StatisticImpl(stat);
+  }
+
+  protected SystemMemberRegion createSystemMemberRegion(Region r) throws AdminException {
+    SystemMemberRegionImpl sysMemberRegion = new SystemMemberRegionImpl(this, r);
+    sysMemberRegion.refresh();
+    return sysMemberRegion;
+  }
+
+  public SystemMemberCacheServer addCacheServer() throws AdminException {
+
+    AdminBridgeServer bridge = this.vm.addCacheServer(this.info);
+    SystemMemberCacheServer admin = createSystemMemberBridgeServer(bridge);
+    bridgeServers.put(bridge.getId(), admin);
+    return admin;
+  }
+
+  private Collection getCacheServersCollection() throws AdminException {
+    Collection bridges = new ArrayList();
+
+    int[] bridgeIds = this.info.getBridgeServerIds();
+    for (int i = 0; i < bridgeIds.length; i++) {
+      int id = bridgeIds[i];
+      SystemMemberBridgeServer bridge = (SystemMemberBridgeServer) bridgeServers.get(id);
+      if (bridge == null) {
+        AdminBridgeServer info = this.vm.getBridgeInfo(this.info, id);
+        if (info != null) {
+          bridge = createSystemMemberBridgeServer(info);
+          bridgeServers.put(info.getId(), bridge);
+        }
+      }
+
+      if (bridge != null) {
+        bridges.add(bridge);
+      }
+    }
+    return bridges;
+  }
+
+  public SystemMemberCacheServer[] getCacheServers() throws AdminException {
+    Collection bridges = getCacheServersCollection();
+    SystemMemberCacheServer[] array = new SystemMemberCacheServer[bridges.size()];
+    return (SystemMemberCacheServer[]) bridges.toArray(array);
+  };
+
+  /**
+   * Creates a new instance of <Code>SystemMemberBridgeServer</code> with the given configuration.
+   */
+  protected SystemMemberBridgeServerImpl createSystemMemberBridgeServer(AdminBridgeServer bridge)
+      throws AdminException {
+
+    return new SystemMemberBridgeServerImpl(this, bridge);
+  }
+
+  public boolean isServer() throws AdminException {
+    return this.info.isServer();
+  }
+
+
+  /**
+   * Returns a string representation of the object.
+   * 
+   * @return a string representation of the object
+   */
+  @Override
+  public String toString() {
+    return getName();
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberImpl.java
new file mode 100755
index 0000000..f292994
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberImpl.java
@@ -0,0 +1,490 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.Role;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionConfigImpl;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.Config;
+import org.apache.geode.internal.ConfigSource;
+import org.apache.geode.internal.admin.GemFireVM;
+import org.apache.geode.internal.admin.StatResource;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.CacheDoesNotExistException;
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+import org.apache.geode.internal.admin.api.RuntimeAdminException;
+import org.apache.geode.internal.admin.api.StatisticResource;
+import org.apache.geode.internal.admin.api.SystemMember;
+import org.apache.geode.internal.admin.api.SystemMemberCache;
+import org.apache.geode.internal.admin.api.SystemMemberType;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.logging.log4j.Logger;
+
+import java.net.InetAddress;
+import java.util.*;
+
+/**
+ * Member of a GemFire system.
+ *
+ * @since GemFire 3.5
+ */
+public class SystemMemberImpl implements SystemMember, ConfigurationParameterListener {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /**
+   * Identifying name of this member. Note that by default this is the string form of internalId but
+   * the ManagedSystemMemberImpl subclass resets it to getNewId()
+   */
+  protected String id;
+
+  /** Unique internal id that the system impl identifies this member with */
+  protected InternalDistributedMember internalId;
+
+  /** The name of this system member */
+  protected String name;
+
+  /** Host name of the machine this member resides on */
+  protected String host;
+
+  /** The internal configuration this impl delegates to for runtime config */
+  // private Config config;
+
+  /**
+   * The configuration parameters for this member. Maps the name of the ConfigurationParameter to
+   * the ConfigurationParameter.
+   */
+  protected Map parms = new HashMap();
+
+  /** The {@link AdminDistributedSystem} this is a member of */
+  protected AdminDistributedSystem system;
+
+  /** Internal GemFire vm to delegate to */
+  private GemFireVM vm;
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs new <code>SystemMemberImpl</code> for a <code>ManagedEntity</code> that has yet to
+   * be started.
+   *
+   * @param system the distributed system this member belongs to
+   */
+  protected SystemMemberImpl(AdminDistributedSystem system) throws AdminException {
+
+    this.system = system;
+    refreshConfig(getDefaultConfig());
+  }
+
+  /**
+   * Constructs new <code>SystemMemberImpl</code> from the given <code>GemFireVM</code>. This
+   * constructor is invoked when we discover a new member of the distributed system.
+   *
+   * @param system the distributed system this member belongs to
+   * @param vm internal GemFire vm to delegate to
+   */
+  public SystemMemberImpl(AdminDistributedSystem system, GemFireVM vm) throws AdminException {
+
+    this(system);
+    setGemFireVM(vm);
+  }
+
+  /**
+   * Constructs the instance of SystemMember using the corresponding InternalDistributedMember
+   * instance of a DS member for the given AdminDistributedSystem.
+   * 
+   * @param system Current AdminDistributedSystem instance
+   * @param member InternalDistributedMember instance for which a SystemMember instance is to be
+   *        constructed.
+   * @throws AdminException if construction of SystemMember fails
+   * 
+   * @since GemFire 6.5
+   */
+  protected SystemMemberImpl(AdminDistributedSystem system, InternalDistributedMember member)
+      throws AdminException {
+    this(system);
+    updateByInternalDistributedMember(member);
+  }
+
+  // -------------------------------------------------------------------------
+  // Attribute accessors and mutators
+  // -------------------------------------------------------------------------
+
+  /**
+   * Returns a <code>Config</code> object with the appropriate default values for a newly-created
+   * system member.
+   */
+  protected Config getDefaultConfig() {
+    Properties props = new Properties();
+    return new DistributionConfigImpl(props);
+  }
+
+  public final AdminDistributedSystem getDistributedSystem() {
+    return this.system;
+  }
+
+  public final InternalDistributedMember getInternalId() {
+    return internalId;
+  }
+
+  public final String getId() {
+    return this.id;
+  }
+
+  public final String getName() {
+    return this.name;
+  }
+
+  public String getHost() {
+    return this.host;
+  }
+
+  public final InetAddress getHostAddress() {
+    return InetAddressUtil.toInetAddress(this.getHost());
+  }
+
+  // -------------------------------------------------------------------------
+  // Operations
+  // -------------------------------------------------------------------------
+
+  public final String getLog() {
+    String childTail = null;
+    String mainTail = null;
+    GemFireVM vm = getGemFireVM();
+    if (vm != null) {
+      String[] log = vm.getSystemLogs();
+      if (log != null && log.length > 0)
+        mainTail = log[0];
+      if (log != null && log.length > 1)
+        childTail = log[1];
+    }
+
+    if (childTail == null && mainTail == null) {
+      return LocalizedStrings.SystemMemberImpl_NO_LOG_FILE_CONFIGURED_LOG_MESSAGES_WILL_BE_DIRECTED_TO_STDOUT
+          .toLocalizedString();
+    } else {
+      StringBuffer result = new StringBuffer();
+      if (mainTail != null) {
+        result.append(mainTail);
+      }
+      if (childTail != null) {
+        result.append(
+            "\n" + LocalizedStrings.SystemMemberImpl_TAIL_OF_CHILD_LOG.toLocalizedString() + "\n");
+        result.append(childTail);
+      }
+      return result.toString();
+    }
+  }
+
+  public final java.util.Properties getLicense() {
+    GemFireVM vm = getGemFireVM();
+    if (vm == null)
+      return null;
+    return new Properties();
+  }
+
+  public final String getVersion() {
+    GemFireVM vm = getGemFireVM();
+    if (vm == null)
+      return null;
+    return vm.getVersionInfo();
+  }
+
+  public StatisticResource[] getStat(String statisticsTypeName) throws AdminException {
+    StatisticResource[] res = new StatisticResource[0];
+    if (this.vm != null) {
+      res = getStatsImpl(this.vm.getStats(statisticsTypeName));
+    }
+    return res.length == 0 ? null : res;
+  }
+
+  public StatisticResource[] getStats() throws AdminException {
+    StatisticResource[] statsImpl = new StatisticResource[0];
+    if (this.vm != null) {
+      statsImpl = getStatsImpl(this.vm.getStats(null));
+    }
+    return statsImpl;
+  }
+
+  public final boolean hasCache() {
+    GemFireVM member = getGemFireVM();
+    if (member == null) {
+      return false;
+
+    } else {
+      return member.getCacheInfo() != null;
+    }
+  }
+
+  public final SystemMemberCache getCache() throws AdminException {
+    GemFireVM vm = getGemFireVM(); // fix for bug 33505
+    if (vm == null)
+      return null;
+    try {
+      return createSystemMemberCache(vm);
+
+    } catch (CancelException ex) {
+      return null;
+
+    } catch (CacheDoesNotExistException ex) {
+      return null;
+    }
+  }
+
+  public void refreshConfig() throws AdminException {
+    GemFireVM vm = getGemFireVM();
+    if (vm == null)
+      return;
+    refreshConfig(vm.getConfig());
+  }
+
+  /**
+   * Sets the value of this system member's distribution-related configuration based on the given
+   * <code>Config</code> object.
+   */
+  public final void refreshConfig(Config config) throws AdminException {
+    if (config == null) {
+      throw new AdminException(
+          LocalizedStrings.SystemMemberImpl_FAILED_TO_REFRESH_CONFIGURATION_PARAMETERS_FOR_0
+              .toLocalizedString(new Object[] {getId()}));
+    }
+
+    String[] names = config.getAttributeNames();
+    if (names == null || names.length < 1) {
+      throw new AdminException(
+          LocalizedStrings.SystemMemberImpl_FAILED_TO_REFRESH_CONFIGURATION_PARAMETERS_FOR_0
+              .toLocalizedString(new Object[] {getId()}));
+    }
+
+    for (int i = 0; i < names.length; i++) {
+      String name = names[i];
+      Object value = config.getAttributeObject(name);
+      if (value != null) {
+        ConfigurationParameter parm = createConfigurationParameter(name, // name
+            config.getAttributeDescription(name), // description
+            value, // value
+            config.getAttributeType(name), // valueType
+            config.isAttributeModifiable(name)); // isModifiable
+        ((ConfigurationParameterImpl) parm).addConfigurationParameterListener(this);
+        this.parms.put(name, parm);
+      }
+    }
+  }
+
+  public final ConfigurationParameter[] getConfiguration() {
+    ConfigurationParameter[] array = new ConfigurationParameter[this.parms.size()];
+    this.parms.values().toArray(array);
+    return array;
+  }
+
+  public ConfigurationParameter[] setConfiguration(ConfigurationParameter[] parms)
+      throws AdminException {
+
+    for (int i = 0; i < parms.length; i++) {
+      ConfigurationParameter parm = parms[i];
+      this.parms.put(parm.getName(), parm);
+    }
+
+    GemFireVM vm = getGemFireVM();
+    if (vm != null) {
+      // update internal vm's config...
+      Config config = vm.getConfig();
+      for (int i = 0; i < parms.length; i++) {
+        config.setAttributeObject(parms[i].getName(), parms[i].getValue(), ConfigSource.runtime());
+      }
+      vm.setConfig(config);
+    }
+
+    return this.getConfiguration();
+  }
+
+  public SystemMemberType getType() {
+    return SystemMemberType.APPLICATION;
+  }
+
+  // -------------------------------------------------------------------------
+  // Listener callbacks
+  // -------------------------------------------------------------------------
+
+  // -- ConfigurationParameterListener ---
+  public void configurationParameterValueChanged(ConfigurationParameter parm) {
+    try {
+      setConfiguration(new ConfigurationParameter[] {parm});
+    } catch (AdminException e) {
+      // this shouldn't occur since this is a config listener method...
+      logger.warn(e.getMessage(), e);
+      throw new RuntimeAdminException(e);
+    } catch (java.lang.Exception e) {
+      logger.warn(e.getMessage(), e);
+    }
+    // catch (java.lang.RuntimeException e) {
+    // logWriter.warning(e);
+    // throw e;
+    // }
+    catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (java.lang.Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // Overridden method(s) from java.lang.Object
+  // -------------------------------------------------------------------------
+
+  @Override
+  public String toString() {
+    return getName();
+  }
+
+  // -------------------------------------------------------------------------
+  // Template methods with default behavior impl'ed. Override if needed.
+  // -------------------------------------------------------------------------
+
+  /**
+   * Returns the <code>GemFireVM</code> that underlies this <code>SystemMember</code>.
+   */
+  protected final GemFireVM getGemFireVM() {
+    return this.vm;
+  }
+
+  /**
+   * Sets the <code>GemFireVM</code> that underlies this <code>SystemMember</code>. This method is
+   * used when a member, such as a cache server, is started by the admin API.
+   */
+  void setGemFireVM(GemFireVM vm) throws AdminException {
+    this.vm = vm;
+    if (vm != null) {
+      this.internalId = vm.getId();
+      this.id = this.internalId.toString();
+      this.name = vm.getName();
+      this.host = InetAddressUtil.toString(vm.getHost());
+    } else {
+      this.internalId = null;
+      this.id = null;
+      // leave this.name set to what it is (how come?)
+      this.host = this.getHost();
+    }
+
+    if (DistributionConfig.DEFAULT_NAME.equals(this.name)) {
+      // Fix bug 32877
+      this.name = this.id;
+    }
+
+    if (vm != null) {
+      this.refreshConfig();
+    }
+  }
+
+  /**
+   * Updates this SystemMember instance using the corresponding InternalDistributedMember
+   * 
+   * @param member InternalDistributedMember instance to update this SystemMember
+   * 
+   * @since GemFire 6.5
+   */
+  private void updateByInternalDistributedMember(InternalDistributedMember member) {
+    if (member != null) {
+      this.internalId = member;
+      this.id = this.internalId.toString();
+      this.host = this.internalId.getHost();
+      this.name = this.internalId.getName();
+      if (this.name == null || DistributionConfig.DEFAULT_NAME.equals(this.name)) {
+        /*
+         * name could be null & referring to description of a fix for 32877
+         */
+        this.name = this.id;
+      }
+    }
+  }
+
+  /**
+   * Template method for creating {@link StatisticResource}.
+   *
+   * @param stat the internal stat resource to wrap with {@link StatisticResource}
+   * @return new impl instance of {@link StatisticResource}
+   */
+  protected StatisticResource createStatisticResource(StatResource stat) throws AdminException {
+    return new StatisticResourceImpl(stat, this);
+  }
+
+  /**
+   * Template method for creating {@link ConfigurationParameter}.
+   *
+   * @param name the name of this parameter which cannot change
+   * @param description full description to use
+   * @param value the value of this parameter
+   * @param type the class type of the value
+   * @param userModifiable true if this is modifiable; false if read-only
+   * @return new impl instance of {@link ConfigurationParameter}
+   */
+  protected ConfigurationParameter createConfigurationParameter(String name, String description,
+      Object value, Class type, boolean userModifiable) {
+    return new ConfigurationParameterImpl(name, description, value, type, userModifiable);
+  }
+
+  /**
+   * Template method for creating {@link SystemMemberCache}.
+   *
+   * @param vm the GemFire vm to retrieve cache info from
+   * @return new impl instance of {@link SystemMemberCache}
+   */
+  protected SystemMemberCache createSystemMemberCache(GemFireVM vm) throws AdminException {
+    return new SystemMemberCacheImpl(vm);
+  }
+
+  /** Wrap the internal stats with impls of {@link StatisticResource} */
+  protected StatisticResource[] getStatsImpl(StatResource[] stats) throws AdminException {
+    List statList = new ArrayList();
+    for (int i = 0; i < stats.length; i++) {
+      statList.add(createStatisticResource(stats[i]));
+    }
+    return (StatisticResource[]) statList.toArray(new StatisticResource[0]);
+  }
+
+  public String[] getRoles() {
+    Set roles = this.internalId.getRoles();
+    String[] roleNames = new String[roles.size()];
+    Iterator iter = roles.iterator();
+    for (int i = 0; i < roleNames.length; i++) {
+      Role role = (Role) iter.next();
+      roleNames[i] = role.getName();
+    }
+    return roleNames;
+  }
+
+  public DistributedMember getDistributedMember() {
+    return this.internalId;
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionEventImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionEventImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionEventImpl.java
new file mode 100644
index 0000000..c89100e
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/SystemMemberRegionEventImpl.java
@@ -0,0 +1,57 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.cache.Operation;
+import org.apache.geode.internal.admin.api.SystemMemberCacheListener;
+import org.apache.geode.internal.admin.api.SystemMemberRegionEvent;
+
+/**
+ * An event that describes an operation on a region. Instances of this are delivered to a
+ * {@link SystemMemberCacheListener} when a a region comes or goes.
+ *
+ * @since GemFire 5.0
+ */
+public class SystemMemberRegionEventImpl extends SystemMemberCacheEventImpl
+    implements SystemMemberRegionEvent {
+
+  /**
+   * The path of region created/destroyed
+   */
+  private final String regionPath;
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>SystemMemberRegionEvent</code> for the member with the given id.
+   */
+  protected SystemMemberRegionEventImpl(DistributedMember id, Operation op, String regionPath) {
+    super(id, op);
+    this.regionPath = regionPath;
+  }
+
+  ///////////////////// Instance Methods /////////////////////
+
+  public String getRegionPath() {
+    return this.regionPath;
+  }
+
+  @Override
+  public String toString() {
+    return super.toString() + " region=" + this.regionPath;
+  }
+
+}


[23/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java
new file mode 100755
index 0000000..7998091
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AdminDistributedSystemJmxImpl.java
@@ -0,0 +1,2289 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.geode.DataSerializer;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.CacheServer;
+import org.apache.geode.internal.admin.api.CacheServerConfig;
+import org.apache.geode.internal.admin.api.CacheVm;
+import org.apache.geode.internal.admin.api.CacheVmConfig;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.DistributionLocator;
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.SystemMember;
+import org.apache.geode.internal.admin.api.SystemMemberCacheEvent;
+import org.apache.geode.internal.admin.api.SystemMemberCacheListener;
+import org.apache.geode.internal.admin.api.SystemMemberRegionEvent;
+import org.apache.geode.internal.admin.api.SystemMemberType;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.impl.CacheServerConfigImpl;
+import org.apache.geode.internal.admin.api.impl.DistributionLocatorImpl;
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.admin.Alert;
+import org.apache.geode.internal.admin.*;
+import org.apache.geode.internal.admin.remote.UpdateAlertDefinitionMessage;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.InternalLogWriter;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.logging.log4j.Logger;
+
+import javax.management.*;
+import javax.management.modelmbean.ModelMBean;
+import javax.management.openmbean.*;
+import java.io.*;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * Provides MBean support for managing a GemFire distributed system.
+ * <p>
+ * TODO: refactor to implement DistributedSystem and delegate to instance of DistributedSystemImpl.
+ * Wrap all delegate calls w/ e.printStackTrace() since the HttpAdaptor devours them (what to do w/
+ * template methods then?)
+ *
+ * @since GemFire 3.5
+ */
+public class AdminDistributedSystemJmxImpl extends AdminDistributedSystemImpl
+    implements ManagedResource, DistributedSystemConfig, StatAlertsAggregator {
+
+  private static final Logger logger = LogService.getLogger();
+
+  private Properties mailProps;
+
+  // The file name where the StatAlertDefinitions would be serialized
+  private String statAlertDefnSerFile = System.getProperty("user.dir");
+
+  /**
+   * Simple counter incrementing on each notification. This this currently resets at every restart
+   * of Agent
+   */
+  private final AtomicInteger notificationSequenceNumber = new AtomicInteger();
+
+  /**
+   * Variable to indicate if there are no Rmi clients connected.
+   */
+  private volatile boolean isRmiClientCountZero;
+
+  /**
+   * Variable to indicate if Statistics Alert definitions could be persisted across runs/sessions.
+   */
+  private volatile boolean canPersistStatAlertDefs = true;
+
+  /** Cache Listener to listen to Cache & Region create/destroy events */
+  private CacheAndRegionListenerImpl cacheRegionListener;
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs new DistributedSystemJmxImpl and registers an MBean to represent it.
+   * 
+   * @param config configuration defining the JMX agent.
+   */
+  public AdminDistributedSystemJmxImpl(AgentConfigImpl config) throws AdminException {
+    super(config);
+    this.mbeanName = "GemFire:type=AdminDistributedSystem,id="
+        + MBeanUtil.makeCompliantMBeanNameProperty(getId());
+    this.objectName = MBeanUtil.createMBean(this);
+    isEmailNotificationEnabled = config.isEmailNotificationEnabled();
+    if (isEmailNotificationEnabled) {
+      initMailProps(config);
+    }
+    // Init file name for StatAlertDefns
+    initStateSaveFile(config);
+    Assert.assertTrue(this.objectName != null);
+
+    cacheRegionListener = new CacheAndRegionListenerImpl(this);
+  }
+
+  private void initMailProps(AgentConfigImpl config) {
+    mailProps = new Properties();
+    mailProps.put(MailManager.PROPERTY_MAIL_FROM, config.getEmailNotificationFrom());
+    mailProps.put(MailManager.PROPERTY_MAIL_HOST, config.getEmailNotificationHost());
+    mailProps.put(MailManager.PROPERTY_MAIL_TO_LIST, config.getEmailNotificationToList());
+  }
+
+  private void initStateSaveFile(AgentConfigImpl agentConfig) {
+    // Init file name for StatAlertDefns
+    AgentConfigImpl impl = (AgentConfigImpl) agentConfig;
+    File propFile = impl.getPropertyFile();
+
+    if (propFile != null) {
+      if (propFile.isDirectory()) {
+        statAlertDefnSerFile = propFile.getAbsolutePath();
+      } else if (propFile.getParentFile() != null) {
+        statAlertDefnSerFile = propFile.getParentFile().getAbsolutePath();
+      }
+    }
+
+    statAlertDefnSerFile = statAlertDefnSerFile + File.separator + agentConfig.getStateSaveFile();
+  }
+
+  // -------------------------------------------------------------------------
+  // MBean operations
+  // -------------------------------------------------------------------------
+
+  /**
+   * Registers the MBeans for monitoring the health of GemFire
+   *
+   * @see AdminDistributedSystemImpl#getGemFireHealth
+   */
+  public ObjectName monitorGemFireHealth() throws MalformedObjectNameException {
+    GemFireHealthJmxImpl health = (GemFireHealthJmxImpl) getGemFireHealth();
+    health.ensureMBeansAreRegistered();
+    return health.getObjectName();
+  }
+
+  /**
+   * Creates a new DistributionLocator for this system and registers an MBean for managing it.
+   * <p>
+   * If the Locator already exists, then this will simply register an MBean for it.
+   *
+   * @param host the host name or IP address of the locator
+   * @param port the port the locator service listens on
+   * @param workingDirectory directory path for the locator and its log
+   * @param productDirectory directory path to the GemFire product to use
+   */
+  public ObjectName createDistributionLocator(String host, int port, String workingDirectory,
+      String productDirectory) throws MalformedObjectNameException {
+    return createDistributionLocator(host, port, workingDirectory, productDirectory,
+        getRemoteCommand());
+  }
+
+  /**
+   * Creates a new DistributionLocator for this system and registers an MBean for managing it.
+   * <p>
+   * If the Locator already exists, then this will simply register an MBean for it.
+   *
+   * @param host the host name or IP address of the locator
+   * @param port the port the locator service listens on
+   * @param workingDirectory directory path for the locator and its log
+   * @param productDirectory directory path to the GemFire product to use
+   * @param remoteCommand formatted remote command to control remotely
+   */
+  public ObjectName createDistributionLocator(String host, int port, String workingDirectory,
+      String productDirectory, String remoteCommand) throws MalformedObjectNameException {
+    try {
+      DistributionLocatorJmxImpl locator = (DistributionLocatorJmxImpl) addDistributionLocator();
+
+      DistributionLocatorConfig config = locator.getConfig();
+      config.setHost(host);
+      config.setPort(port);
+      config.setWorkingDirectory(workingDirectory);
+      config.setProductDirectory(productDirectory);
+      config.setRemoteCommand(remoteCommand);
+
+      return new ObjectName(locator.getMBeanName());
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // Template methods overriden from superclass...
+  // -------------------------------------------------------------------------
+
+  /** Override createSystemMember by instantiating SystemMemberJmxImpl */
+  @Override
+  protected SystemMember createSystemMember(ApplicationVM app) throws AdminException {
+    return new SystemMemberJmxImpl(this, app);
+  }
+
+  /**
+   * Constructs & returns a SystemMember instance using the corresponding InternalDistributedMember
+   * object.
+   * 
+   * @param member InternalDistributedMember instance for which a SystemMember instance is to be
+   *        constructed.
+   * @return constructed SystemMember instance
+   * @throws AdminException if construction of SystemMember instance fails
+   *
+   * @since GemFire 6.5
+   */
+  protected SystemMember createSystemMember(InternalDistributedMember member)
+      throws AdminException {
+    return new SystemMemberJmxImpl(this, member);
+  }
+
+
+  @Override
+  protected CacheServer createCacheServer(ApplicationVM member) throws AdminException {
+
+    return new CacheServerJmxImpl(this, member);
+  }
+
+  @Override
+  protected CacheServer createCacheServer(CacheServerConfigImpl config) throws AdminException {
+
+    return new CacheServerJmxImpl(this, config);
+  }
+
+  /** Override createGemFireHealth by instantiating GemFireHealthJmxImpl */
+  @Override
+  protected GemFireHealth createGemFireHealth(GfManagerAgent system) throws AdminException {
+    if (system == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.AdminDistributedSystemJmxImpl_GFMANAGERAGENT_MUST_NOT_BE_NULL
+              .toLocalizedString());
+    }
+    return new GemFireHealthJmxImpl(system, this);
+  }
+
+  /** Template-method for creating a DistributionLocatorImpl instance. */
+  @Override
+  protected DistributionLocatorImpl createDistributionLocatorImpl(
+      DistributionLocatorConfig config) {
+    return new DistributionLocatorJmxImpl(config, this);
+  }
+
+  // -------------------------------------------------------------------------
+  // Internal Admin listeners and JMX Notifications
+  // -------------------------------------------------------------------------
+
+  /** Notification type for indicating system member joined */
+  public static final String NOTIF_MEMBER_JOINED =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.member.joined";
+  /** Notification type for indicating system member left */
+  public static final String NOTIF_MEMBER_LEFT =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.member.left";
+  /** Notification type for indicating system member crashed */
+  public static final String NOTIF_MEMBER_CRASHED =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.member.crashed";
+  /** Notification type for sending GemFire alerts as JMX notifications */
+  public static final String NOTIF_ALERT =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.alert";
+  /** Notification type for sending GemFire StatAlerts as JMX notifications */
+  public static final String NOTIF_STAT_ALERT =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.statalert";
+  /** Notification type for indicating abnormal disconnection from the distributed system */
+  public static final String NOTIF_ADMIN_SYSTEM_DISCONNECT =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.disconnect";
+
+
+  private static final String EML_SUBJ_PRFX_GFE_ALERT = "[GemFire Alert] ";
+  private static final String EML_SUBJ_PRFX_GFE_NOTFY = "[GemFire Notification] ";
+  private static final String EML_SUBJ_ITEM_GFE_DS = "Distributed System: ";
+
+  // --------- org.apache.geode.internal.admin.JoinLeaveListener ---------
+  /**
+   * Listener callback for when a member has joined this DistributedSystem.
+   * <p>
+   * React by creating an MBean for managing the SystemMember and then fire a Notification with the
+   * internal Id of the member VM.
+   *
+   * @param source the distributed system that fired nodeJoined
+   * @param joined the VM that joined
+   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeJoined
+   */
+  @Override
+  public void nodeJoined(GfManagerAgent source, GemFireVM joined) {
+    try {
+      super.nodeJoined(source, joined);
+
+      /*
+       * super.nodeJoined results in creation of a new SystemMember which registers itself as an
+       * MBean, so now we try to find it...
+       */
+      SystemMember member = findSystemMember(joined);
+
+      if (null == member) {
+        if (logger.isDebugEnabled()) {
+          logger.debug(
+              "AdminDistributedSystemJmxImpl.nodeJoined(), Could not find SystemMember for VM {}",
+              joined);
+        }
+        return;
+      }
+
+      try {
+        if (logger.isDebugEnabled()) {
+          logger.debug("Processing node joined for: {}", member);
+          logger.debug("RemoteGemFireVM.nodeJoined(), setting alerts manager *************");
+        }
+        setAlertsManager(joined);
+
+        this.modelMBean.sendNotification(
+            new Notification(NOTIF_MEMBER_JOINED, ((ManagedResource) member).getObjectName(), // Pass
+                                                                                              // the
+                                                                                              // ObjName
+                                                                                              // of
+                                                                                              // the
+                                                                                              // Source
+                                                                                              // Member
+                notificationSequenceNumber.addAndGet(1), joined.getId().toString()));
+
+        // String mess = "Gemfire AlertNotification: System Member Joined, System member Id: " +
+        // joined.getId().toString();
+        // sendEmail("Gemfire AlertNotification: Member Joined, ID: " + joined.getId().toString(),
+        // mess);
+        if (isEmailNotificationEnabled) {
+          String mess =
+              LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_JOINED_THE_DISTRIBUTED_SYSTEM_MEMBER_ID_0
+                  .toLocalizedString(new Object[] {joined.getId().toString()});
+          sendEmail(EML_SUBJ_PRFX_GFE_NOTFY + EML_SUBJ_ITEM_GFE_DS + getName() + " <"
+              + LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_JOINED.toLocalizedString()
+              + ">", mess);
+        }
+      } catch (javax.management.MBeanException e) {
+        logger.warn(e.getMessage(), e);
+      }
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  /**
+   * Listener callback for when a member has left this DistributedSystem.
+   * <p>
+   * React by removing the member's MBean. Also fire a Notification with the internal Id of the
+   * member VM.
+   *
+   * @param source the distributed system that fired nodeLeft
+   * @param left the VM that left
+   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeLeft
+   */
+  @Override
+  public void nodeLeft(GfManagerAgent source, GemFireVM left) {
+    try {
+      SystemMember member = findSystemMember(left, false);
+      super.nodeLeft(source, left);
+      if (logger.isDebugEnabled()) {
+        logger.debug("Processing node left for: {}", member);
+      }
+      try {
+        this.modelMBean.sendNotification(
+            new Notification(NOTIF_MEMBER_LEFT, ((ManagedResource) member).getObjectName(), // Pass
+                                                                                            // the
+                                                                                            // ObjName
+                                                                                            // of
+                                                                                            // the
+                                                                                            // Source
+                                                                                            // Member
+                notificationSequenceNumber.addAndGet(1), left.getId().toString()));
+
+        // String mess = "Gemfire AlertNotification: System Member Left the system, System member
+        // Id: " + left.getId().toString();
+        // sendEmail("Gemfire AlertNotification: Member Left, ID: " + left.getId().toString(),
+        // mess);
+        if (isEmailNotificationEnabled) {
+          String mess =
+              LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_LEFT_THE_DISTRIBUTED_SYSTEM_MEMBER_ID_0
+                  .toLocalizedString(new Object[] {left.getId().toString()});
+          sendEmail(EML_SUBJ_PRFX_GFE_NOTFY + EML_SUBJ_ITEM_GFE_DS + getName() + " <"
+              + LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_LEFT.toLocalizedString()
+              + ">", mess);
+        }
+      } catch (javax.management.MBeanException e) {
+        logger.warn(e.getMessage(), e);
+      }
+
+      SystemMemberType memberType = member.getType();
+      if (/* member != null && */ memberType.isApplication() || memberType.isCacheVm()) {
+        // automatically unregister the MBean...
+        MBeanUtil.unregisterMBean((ManagedResource) member);
+      }
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  /**
+   * Listener callback for when a member of this DistributedSystem has crashed.
+   * <p>
+   * Also fires a Notification with the internal Id of the member VM.
+   *
+   * @param source the distributed system that fired nodeCrashed
+   * @param crashed the VM that crashed
+   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeCrashed
+   */
+  @Override
+  public void nodeCrashed(GfManagerAgent source, GemFireVM crashed) {
+    try {
+      // SystemMember application has left...
+      SystemMember member = findSystemMember(crashed, false);
+      super.nodeCrashed(source, crashed);
+      if (logger.isDebugEnabled()) {
+        logger.debug("Processing node crash for: {}", member);
+      }
+
+      try {
+        this.modelMBean.sendNotification(
+            new Notification(NOTIF_MEMBER_CRASHED, ((ManagedResource) member).getObjectName(), // Pass
+                                                                                               // the
+                                                                                               // ObjName
+                                                                                               // of
+                                                                                               // the
+                                                                                               // Source
+                                                                                               // Member
+                notificationSequenceNumber.addAndGet(1), crashed.getId().toString()));
+
+        // String mess = "Gemfire AlertNotification: System Member Crashed, System member Id: " +
+        // crashed.getId().toString();
+        // sendEmail("Gemfire AlertNotification: Member Crashed, ID: " + crashed.getId().toString(),
+        // mess);
+        if (isEmailNotificationEnabled) {
+          String mess =
+              LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_CRASHED_IN_THE_DISTRIBUTED_SYSTEM_MEMBER_ID_0
+                  .toLocalizedString(new Object[] {crashed.getId().toString()});
+          sendEmail(EML_SUBJ_PRFX_GFE_ALERT + EML_SUBJ_ITEM_GFE_DS + getName() + " <"
+              + LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_CRASHED.toLocalizedString()
+              + ">", mess);
+        }
+      } catch (javax.management.MBeanException e) {
+        logger.warn(e.getMessage(), e);
+      }
+
+      SystemMemberType memberType = member.getType();
+      if (/* member != null && */ memberType.isApplication() || memberType.isCacheVm()) {
+        // automatically unregister the MBean...
+        MBeanUtil.unregisterMBean((ManagedResource) member);
+      }
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  // ----------- org.apache.geode.internal.admin.AlertListener -----------
+  /**
+   * Listener callback for when a SystemMember of this DistributedSystem has crashed.
+   * <p>
+   * Fires a Notification with the information from the alert.
+   *
+   * @param alert the gemfire alert to broadcast as a notification
+   * @see org.apache.geode.internal.admin.AlertListener#alert
+   */
+  @Override
+  public void alert(Alert alert) {
+    try {
+      super.alert(alert);
+      try {
+        String strAlert = alert.toString();
+        this.modelMBean.sendNotification(new Notification(NOTIF_ALERT, this.mbeanName,
+            notificationSequenceNumber.addAndGet(1), strAlert));
+
+        // String mess = "Gemfire AlertNotification: System Alert :" + alert.toString();
+        // sendEmail("Gemfire AlertNotification: System Alert", mess);
+        if (isEmailNotificationEnabled) {
+          String mess =
+              LocalizedStrings.AdminDistributedSystemJmxImpl_SYSTEM_ALERT_FROM_DISTRIBUTED_SYSTEM_0
+                  .toLocalizedString(strAlert);
+          sendEmail(EML_SUBJ_PRFX_GFE_ALERT + EML_SUBJ_ITEM_GFE_DS + getName() + " <System Alert>",
+              mess);
+        }
+      } catch (javax.management.MBeanException e) {
+        logger.warn(e.getMessage(), e);
+      }
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  @Override
+  public void onDisconnect(InternalDistributedSystem sys) {
+    if (logger.isDebugEnabled()) {
+      this.logger.debug("Calling AdminDistributedSystemJmxImpl#onDisconnect");
+    }
+    try {
+      super.onDisconnect(sys);
+
+      try {
+        this.modelMBean.sendNotification(new Notification(NOTIF_ADMIN_SYSTEM_DISCONNECT,
+            this.mbeanName, notificationSequenceNumber.addAndGet(1), null));
+      } catch (MBeanException e) {
+        logger.warn(e.getMessage(), e);
+      }
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+    if (logger.isDebugEnabled()) {
+      this.logger.debug("Completed AdminDistributedSystemJmxImpl#onDisconnect");
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // ManagedResource implementation
+  // -------------------------------------------------------------------------
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The remotable ObjectName that the MBean is registered under */
+  final private ObjectName objectName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.DISTRIBUTED_SYSTEM;
+  }
+
+  // -------------------------------------------------------------------------
+  // Error traps added to overridden methods...
+  // -------------------------------------------------------------------------
+
+  @Override
+  public boolean isRunning() {
+    try {
+      return super.isRunning();
+    } catch (java.lang.RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (java.lang.Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  @Override
+  public void start() throws AdminException {
+    try {
+      super.start();
+    } catch (java.lang.RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (java.lang.Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  @Override
+  public void stop() throws AdminException {
+    try {
+      super.stop();
+    } catch (java.lang.RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (java.lang.Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  @Override
+  public boolean waitToBeConnected(long timeout) throws InterruptedException {
+
+    if (Thread.interrupted())
+      throw new InterruptedException();
+    try {
+      return super.waitToBeConnected(timeout);
+    } catch (java.lang.RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (java.lang.Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  @Override
+  public String displayMergedLogs() {
+    try {
+      return super.displayMergedLogs();
+    } catch (java.lang.RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (java.lang.Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  public ObjectName manageDistributionLocator() throws MalformedObjectNameException {
+
+    try {
+      return new ObjectName(((ManagedResource) addDistributionLocator()).getMBeanName());
+    }
+    // catch (AdminException e) { logger.warn(e.getMessage(), e); throw e; }
+    catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  public ObjectName[] manageDistributionLocators() throws MalformedObjectNameException {
+    try {
+      DistributionLocator[] locs = getDistributionLocators();
+      ObjectName[] onames = new javax.management.ObjectName[locs.length];
+      for (int i = 0; i < locs.length; i++) {
+        DistributionLocatorJmxImpl loc = (DistributionLocatorJmxImpl) locs[i];
+        onames[i] = new ObjectName(loc.getMBeanName());
+      }
+      return onames;
+    }
+    // catch (AdminException e) { logger.warn(e.getMessage(), e); throw e; }
+    catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  /**
+   * @deprecated as of 5.7 use {@link #manageCacheVm} instead.
+   */
+  @Deprecated
+  public ObjectName manageCacheServer() throws AdminException, MalformedObjectNameException {
+    return manageCacheVm();
+  }
+
+  public ObjectName manageCacheVm() throws AdminException, MalformedObjectNameException {
+    try {
+      return new ObjectName(((ManagedResource) addCacheVm()).getMBeanName());
+    } catch (AdminException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.warn(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  /**
+   * @deprecated as of 5.7 use {@link #manageCacheVms} instead.
+   */
+  @Deprecated
+  public ObjectName[] manageCacheServers() throws AdminException, MalformedObjectNameException {
+    return manageCacheVms();
+  }
+
+  public ObjectName[] manageCacheVms() throws AdminException, MalformedObjectNameException {
+    try {
+      CacheVm[] mgrs = getCacheVms();
+      ObjectName[] onames = new javax.management.ObjectName[mgrs.length];
+      for (int i = 0; i < mgrs.length; i++) {
+        CacheServerJmxImpl mgr = (CacheServerJmxImpl) mgrs[i];
+        onames[i] = new ObjectName(mgr.getMBeanName());
+      }
+      return onames;
+    } catch (AdminException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  public ObjectName[] manageSystemMemberApplications()
+      throws AdminException, MalformedObjectNameException {
+    try {
+      SystemMember[] apps = getSystemMemberApplications();
+      ObjectName[] onames = new javax.management.ObjectName[apps.length];
+      for (int i = 0; i < apps.length; i++) {
+        SystemMemberJmxImpl app = (SystemMemberJmxImpl) apps[i];
+        onames[i] = new ObjectName(app.getMBeanName());
+      }
+      return onames;
+    } catch (AdminException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  /**
+   * Return the ObjectName for the SystemMemberMBean representing the specified distributed member
+   * or null if the member is not found.
+   *
+   * @param distributedMember the distributed member to manage
+   * @return the ObjectName for the SystemMemberMBean
+   */
+  public ObjectName manageSystemMember(DistributedMember distributedMember)
+      throws AdminException, MalformedObjectNameException {
+    try {
+      SystemMember member = lookupSystemMember(distributedMember);
+      if (member == null)
+        return null;
+      SystemMemberJmxImpl jmx = (SystemMemberJmxImpl) member;
+      ObjectName oname = new ObjectName(jmx.getMBeanName());
+      return oname;
+    } catch (AdminException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  @Override
+  public void connect(InternalLogWriter logWriter) {
+    try {
+      // LOG: passes the AdminDistributedSystemImpl LogWriterLogger into GfManagerAgentConfig
+      super.connect(logWriter);
+
+      // Load existing StatAlert Definitions
+      readAlertDefinitionsAsSerializedObjects();
+
+      /* Add Cache Listener to listen to Cache & Region create/destroy events */
+      if (logger.isDebugEnabled()) {
+        logger.debug("Adding CacheAndRegionListener .... ");
+      }
+      addCacheListener(cacheRegionListener);
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  @Override
+  public void disconnect() {
+    try {
+      super.disconnect();
+
+      // Save existing StatAlert Definitions
+      saveAlertDefinitionsAsSerializedObjects();
+
+      /* Remove Cache Listener to listen to Cache & Region create/destroy events */
+      if (logger.isDebugEnabled()) {
+        logger.debug("Removing CacheAndRegionListener .... ");
+      }
+      removeCacheListener(cacheRegionListener);
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, re-throw the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  public void cleanupResource() {
+    disconnect();
+  }
+
+  /**
+   * @return the isRmiClientCountZero
+   * @since GemFire 6.0
+   */
+  public boolean isRmiClientCountZero() {
+    return isRmiClientCountZero;
+  }
+
+  /**
+   * @param isRmiClientCountZero the isJmxClientCountZero to set
+   * @since GemFire 6.0
+   */
+  void setRmiClientCountZero(boolean isRmiClientCountZero) {
+    this.isRmiClientCountZero = isRmiClientCountZero;
+
+    if (isRmiClientCountZero) {
+      logger.info(
+          LocalizedStrings.AdminDistributedSystemJmxImpl_JMX_CLIENT_COUNT_HAS_DROPPED_TO_ZERO);
+    }
+  }
+
+
+  /////////////////////// Configuration ///////////////////////
+
+  public String getEntityConfigXMLFile() {
+    return this.getConfig().getEntityConfigXMLFile();
+  }
+
+  public void setEntityConfigXMLFile(String xmlFile) {
+    this.getConfig().setEntityConfigXMLFile(xmlFile);
+  }
+
+  public String getSystemId() {
+    return this.getConfig().getSystemId();
+  }
+
+  public void setSystemId(String systemId) {
+    this.getConfig().setSystemId(systemId);
+  }
+
+  @Override
+  public String getSystemName() {
+    return this.getConfig().getSystemName();
+  }
+
+  public void setSystemName(final String name) {
+    this.getConfig().setSystemName(name);
+  }
+
+  @Override
+  public boolean getDisableTcp() {
+    return this.getConfig().getDisableTcp();
+  }
+
+  public void setEnableNetworkPartitionDetection(boolean newValue) {
+    getConfig().setEnableNetworkPartitionDetection(newValue);
+  }
+
+  public boolean getEnableNetworkPartitionDetection() {
+    return getConfig().getEnableNetworkPartitionDetection();
+  }
+
+  public int getMemberTimeout() {
+    return getConfig().getMemberTimeout();
+  }
+
+  public void setMemberTimeout(int value) {
+    getConfig().setMemberTimeout(value);
+  }
+
+  @Override
+  public String getMcastAddress() {
+    return this.getConfig().getMcastAddress();
+  }
+
+  public void setMcastAddress(String mcastAddress) {
+    this.getConfig().setMcastAddress(mcastAddress);
+  }
+
+  @Override
+  public int getMcastPort() {
+    return this.getConfig().getMcastPort();
+  }
+
+  public void setMcastPort(int mcastPort) {
+    this.getConfig().setMcastPort(mcastPort);
+  }
+
+  public int getAckWaitThreshold() {
+    return getConfig().getAckWaitThreshold();
+  }
+
+  public void setAckWaitThreshold(int seconds) {
+    getConfig().setAckWaitThreshold(seconds);
+  }
+
+  public int getAckSevereAlertThreshold() {
+    return getConfig().getAckSevereAlertThreshold();
+  }
+
+  public void setAckSevereAlertThreshold(int seconds) {
+    getConfig().setAckSevereAlertThreshold(seconds);
+  }
+
+  @Override
+  public String getLocators() {
+    return this.getConfig().getLocators();
+  }
+
+  @Override
+  public void setLocators(String locators) {
+    this.getConfig().setLocators(locators);
+  }
+
+  /*
+   * Note that the getter & setter for membership port range are referred from the super class
+   * AdminDistributedSystemImpl
+   */
+
+  public String getBindAddress() {
+    return this.getConfig().getBindAddress();
+  }
+
+  public void setBindAddress(String bindAddress) {
+    this.getConfig().setBindAddress(bindAddress);
+  }
+
+  public String getServerBindAddress() {
+    return this.getConfig().getServerBindAddress();
+  }
+
+  public void setServerBindAddress(String bindAddress) {
+    this.getConfig().setServerBindAddress(bindAddress);
+  }
+
+  @Override
+  public String getRemoteCommand() {
+    return this.getConfig().getRemoteCommand();
+  }
+
+  @Override
+  public void setRemoteCommand(String command) {
+    this.getConfig().setRemoteCommand(command);
+  }
+
+  public boolean isSSLEnabled() {
+    return this.getConfig().isSSLEnabled();
+  }
+
+  public void setSSLEnabled(boolean enabled) {
+    this.getConfig().setSSLEnabled(enabled);
+  }
+
+  public String getSSLProtocols() {
+    return this.getConfig().getSSLProtocols();
+  }
+
+  public void setSSLProtocols(String protocols) {
+    this.getConfig().setSSLProtocols(protocols);
+  }
+
+  public String getSSLCiphers() {
+    return this.getConfig().getSSLCiphers();
+  }
+
+  public void setSSLCiphers(String ciphers) {
+    this.getConfig().setSSLCiphers(ciphers);
+  }
+
+  public boolean isSSLAuthenticationRequired() {
+    return this.getConfig().isSSLAuthenticationRequired();
+  }
+
+  public void setSSLAuthenticationRequired(boolean authRequired) {
+    this.getConfig().setSSLAuthenticationRequired(authRequired);
+  }
+
+  public Properties getSSLProperties() {
+    return this.getConfig().getSSLProperties();
+  }
+
+  public void setSSLProperties(Properties sslProperties) {
+    this.getConfig().setSSLProperties(sslProperties);
+  }
+
+  public void addSSLProperty(String key, String value) {
+    this.getConfig().addSSLProperty(key, value);
+  }
+
+  public void removeSSLProperty(String key) {
+    this.getConfig().removeSSLProperty(key);
+  }
+
+  public String getLogFile() {
+    return this.getConfig().getLogFile();
+  }
+
+  public void setLogFile(String logFile) {
+    this.getConfig().setLogFile(logFile);
+  }
+
+  public String getLogLevel() {
+    return this.getConfig().getLogLevel();
+  }
+
+  public void setLogLevel(String logLevel) {
+    this.getConfig().setLogLevel(logLevel);
+  }
+
+  public int getLogDiskSpaceLimit() {
+    return this.getConfig().getLogDiskSpaceLimit();
+  }
+
+  public void setLogDiskSpaceLimit(int limit) {
+    this.getConfig().setLogDiskSpaceLimit(limit);
+  }
+
+  public int getLogFileSizeLimit() {
+    return this.getConfig().getLogFileSizeLimit();
+  }
+
+  public void setLogFileSizeLimit(int limit) {
+    this.getConfig().setLogFileSizeLimit(limit);
+  }
+
+  public void setDisableTcp(boolean flag) {
+    this.getConfig().setDisableTcp(flag);
+  }
+
+  public int getRefreshInterval() {
+    return this.getConfig().getRefreshInterval();
+  }
+
+  /*
+   * The interval (in seconds) between auto-polling for updating AdminDistributedSystem constituents
+   * including SystemMember, SystemMemberCache and StatisticResource. This applies only to the
+   * default interval set when the resource is created. Changes to this interval will not get
+   * propagated to existing resources but will apply to all new resources
+   */
+  public void setRefreshInterval(int interval) {
+    this.getConfig().setRefreshInterval(interval);
+  }
+
+  public CacheServerConfig[] getCacheServerConfigs() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public CacheServerConfig createCacheServerConfig() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public void removeCacheServerConfig(CacheServerConfig config) {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public CacheVmConfig[] getCacheVmConfigs() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public CacheVmConfig createCacheVmConfig() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public void removeCacheVmConfig(CacheVmConfig config) {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public DistributionLocatorConfig[] getDistributionLocatorConfigs() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public DistributionLocatorConfig createDistributionLocatorConfig() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public void removeDistributionLocatorConfig(DistributionLocatorConfig config) {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public void addListener(ConfigListener listener) {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public void removeListener(ConfigListener listener) {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public void validate() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  @Override
+  public Object clone() throws CloneNotSupportedException {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+
+  private static final String[] PERSISTENT_ID_FIELDS = new String[] {"host", "directory", "uuid"};
+  private static final String[] PERSISTENT_ID_DESCRIPTIONS =
+      new String[] {"The host that was persisting the missing files",
+          "The directory where the files were persisted", "The unique id for the persistent files"};
+  private final CompositeType PERSISTENT_ID_TYPE;
+  private final TabularType PERSISTENT_ID_TABLE_TYPE;
+
+  {
+    try {
+      PERSISTENT_ID_TYPE = new CompositeType(PersistentID.class.getCanonicalName(),
+          "A single member's a set of persistent files for a region", PERSISTENT_ID_FIELDS,
+          PERSISTENT_ID_DESCRIPTIONS,
+          new OpenType[] {SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
+      PERSISTENT_ID_TABLE_TYPE = new TabularType("TABLE_" + PERSISTENT_ID_TYPE.getTypeName(),
+          "A table of persistent member ids", PERSISTENT_ID_TYPE, PERSISTENT_ID_FIELDS);
+    } catch (OpenDataException e) {
+      throw new ExceptionInInitializerError(e);
+    }
+  }
+
+  public TabularData getMissingPersistentMembersJMX() throws AdminException {
+
+    try {
+      Set<PersistentID> members = super.getMissingPersistentMembers();
+      TabularData results = new TabularDataSupport(PERSISTENT_ID_TABLE_TYPE);
+      int index = 0;
+      for (PersistentID id : members) {
+        CompositeData idData = new CompositeDataSupport(PERSISTENT_ID_TYPE, PERSISTENT_ID_FIELDS,
+            new Object[] {id.getHost().toString(), id.getDirectory(), id.getUUID().toString()});
+        results.put(idData);
+        index++;
+      }
+      return results;
+    } catch (OpenDataException e) {
+      logger.warn("Exception occurred while getting missing persistent members.", e);
+      throw new AdminException(e);
+    }
+  }
+
+  public void revokePersistentMember(String host, String directory)
+      throws AdminException, UnknownHostException {
+    super.revokePersistentMember(InetAddress.getByName(host), directory);
+  }
+
+  public void revokePersistentMember(String uuid) throws AdminException, UnknownHostException {
+    super.revokePersistentMember(UUID.fromString(uuid));
+  }
+
+  /* ********************************************************************* */
+  /* ************** Implementing StatAlertsAggregator interface ********** */
+  /* ********************************************************************* */
+
+  /* Map to store admin stat alert definitions */
+  private final Map ALERT_DEFINITIONS = new Hashtable();
+
+  /* Refresh interval for all stat alerts managers in seconds */
+  private int refreshIntervalForStatAlerts = 20;
+
+  /*
+   * This map contains list of stat alerts as a value for alert def ID as a key
+   */
+  private final HashMap alertsStore = new HashMap();
+
+  // TODO: yet to set the timer task
+  // private SystemTimer systemwideAlertNotificationScheduler = new SystemTimer();
+
+  private MailManager mailManager = null;
+  private final boolean isEmailNotificationEnabled;
+
+  /**
+   * Convenience method to retrieve admin stat alert definition.
+   * 
+   * @param alertDefinitionId id of a stat alert definition
+   * @return StatAlertDefinition reference to an instance of StatAlertDefinition
+   * @since GemFire 5.7
+   */
+  private StatAlertDefinition getAlertDefinition(int alertDefinitionId) {
+    synchronized (ALERT_DEFINITIONS) {
+      return (StatAlertDefinition) ALERT_DEFINITIONS.get(Integer.valueOf(alertDefinitionId));
+    }
+  }
+
+  /*
+   * private void setAlertDefinition(StatAlertDefinition alertDefinition) {
+   * ALERT_DEFINITIONS.put(Integer.valueOf(alertDefinition.getId()), alertDefinition); }
+   */
+
+  /**
+   * This method can be used to get an alert definition.
+   * 
+   * @param alertDefinition StatAlertDefinition to retrieve
+   * @return StatAlertDefinition
+   * @since GemFire 5.7
+   */
+  public StatAlertDefinition getAlertDefinition(StatAlertDefinition alertDefinition) {
+    return getAlertDefinition(alertDefinition.getId());
+  }
+
+  /**
+   * This method is used to write existing StatAlertDefinitions to a file
+   */
+  protected void readAlertDefinitionsAsSerializedObjects() {
+    StatAlertDefinition[] defns = new StatAlertDefinition[0];
+
+    File serFile = null;
+    FileInputStream foStr = null;
+    DataInputStream ooStr = null;
+
+    try {
+      serFile = new File(statAlertDefnSerFile);
+
+      if (!canWriteToFile(serFile)) {/* can not write a file */
+        canPersistStatAlertDefs = false;
+      }
+      if (!serFile.exists()) {/* file does not exist */
+        return;
+      }
+
+      if (logger.isDebugEnabled()) {
+        logger.debug(
+            "AdminDistributedSystemJmxImpl.readAlertDefinitionsAsSerializedObjects: File: {}",
+            serFile.getPath());
+      }
+
+      foStr = new FileInputStream(serFile);
+      ooStr = new DataInputStream(foStr);
+      defns = (StatAlertDefinition[]) DataSerializer.readObjectArray(ooStr);
+    } catch (ClassNotFoundException cnfEx) {
+      logger.error(LocalizedMessage.create(
+          LocalizedStrings.AdminDistributedSystem_ENCOUNTERED_A_0_WHILE_LOADING_STATALERTDEFINITIONS_1,
+          new Object[] {cnfEx.getClass().getName(), statAlertDefnSerFile}), cnfEx);
+      canPersistStatAlertDefs = false;
+    } catch (IOException ex) {
+      logger.error(LocalizedMessage.create(
+          LocalizedStrings.AdminDistributedSystem_ENCOUNTERED_A_0_WHILE_LOADING_STATALERTDEFINITIONS_1_LOADING_ABORTED,
+          new Object[] {ex.getClass().getName(), statAlertDefnSerFile}), ex);
+      canPersistStatAlertDefs = false;
+    } finally {
+      if (foStr != null) {
+        try {
+          foStr.close();
+        } catch (IOException ex) {
+          ;
+        }
+      }
+      if (ooStr != null) {
+        try {
+          ooStr.close();
+        } catch (IOException ex) {
+          ;
+        }
+      }
+    }
+
+    for (int i = 0; i < defns.length; i++) {
+      updateAlertDefinition(defns[i]);
+    }
+  }
+
+  /**
+   * This method is used to write existing StatAlertDefinitions to a file
+   */
+  public void saveAlertDefinitionsAsSerializedObjects() {
+    File serFile = null;
+    FileOutputStream foStr = null;
+    DataOutputStream ooStr = null;
+    try {
+      serFile = new File(statAlertDefnSerFile);
+
+
+      if (logger.isDebugEnabled()) {
+        logger.debug(
+            "AdminDistributedSystemJmxImpl.saveAlertDefinitionsAsSerializedObjects: File: {}",
+            serFile.getPath());
+      }
+
+      if (!canWriteToFile(serFile)) {
+        return;
+      }
+
+      foStr = new FileOutputStream(serFile);
+      ooStr = new DataOutputStream(foStr);
+
+      int numOfAlerts = 0;
+      StatAlertDefinition[] defs = null;
+
+      synchronized (ALERT_DEFINITIONS) {
+        numOfAlerts = ALERT_DEFINITIONS.size();
+        defs = new StatAlertDefinition[numOfAlerts];
+
+        int i = 0;
+        for (Iterator iter = ALERT_DEFINITIONS.keySet().iterator(); iter.hasNext();) {
+          Integer key = (Integer) iter.next();
+          StatAlertDefinition readDefn = (StatAlertDefinition) ALERT_DEFINITIONS.get(key);
+          defs[i] = readDefn;
+          i++;
+        }
+      }
+
+      DataSerializer.writeObjectArray(defs, ooStr);
+    } catch (IOException ex) {
+      logger.error(LocalizedMessage.create(
+          LocalizedStrings.AdminDistributedSystem_ENCOUNTERED_A_0_WHILE_SAVING_STATALERTDEFINITIONS_1,
+          new Object[] {ex.getClass().getName(), statAlertDefnSerFile}), ex);
+    } finally {
+      if (foStr != null)
+        try {
+          foStr.close();
+        } catch (IOException ex) {
+          ;
+        }
+      if (ooStr != null)
+        try {
+          ooStr.close();
+        } catch (IOException ex) {
+          ;
+        }
+    }
+  }
+
+  /**
+   * Checks if the given file is writable.
+   * 
+   * @param file file to check write permissions for
+   * @return true if file is writable, false otherwise
+   */
+  private boolean canWriteToFile(File file) {
+    boolean fileIsWritable = true;
+    // Fix for BUG40360 : When the user does not have write permissions for
+    // saving the stat-alert definitions, then appropriate warning message is
+    // logged and the operation is aborted. In case the file doesn't exist, then
+    // it attempts to create a file. If the attempt fails then it logs
+    // appropriate warning and the operation is aborted. File.canWrite check for
+    // a directory sometimes fails on Windows platform. Hence file creation is
+    // necessary.
+    if (file.exists()) {
+      if (!file.canWrite()) {
+        logger.warn(LocalizedMessage.create(
+            LocalizedStrings.AdminDistributedSystemJmxImpl_READONLY_STAT_ALERT_DEF_FILE_0,
+            new Object[] {file}));
+        fileIsWritable = false;
+      }
+    } else {
+      try {
+        file.createNewFile();
+      } catch (IOException e) {
+        logger.warn(LocalizedMessage.create(
+            LocalizedStrings.AdminDistributedSystemJmxImpl_FAILED_TO_CREATE_STAT_ALERT_DEF_FILE_0,
+            new Object[] {file}), e);
+        fileIsWritable = false;
+      } finally {
+        // Since we had created this file only for testing purpose, delete the
+        // same.
+        if ((file.exists() && !file.delete()) && logger.isDebugEnabled()) {
+          logger.debug("Could not delete file :'{}' which is created for checking permissions.",
+              file.getAbsolutePath());
+        }
+      }
+    }
+    return fileIsWritable;
+  }
+
+  /**
+   * This method can be used to update alert definition for the Stat mentioned. This method should
+   * update the collection maintained at the aggregator and should notify members for the newly
+   * added alert definitions. A new alert definition will be created if matching one not found.
+   * 
+   * @param alertDefinition alertDefinition to be updated
+   * @since GemFire 5.7
+   */
+  public void updateAlertDefinition(StatAlertDefinition alertDefinition) {
+    if (logger.isDebugEnabled()) {
+      logger.debug(
+          "Entered AdminDistributedSystemJmxImpl.updateAlertDefinition(StatAlertDefinition) *****");
+    }
+    /*
+     * What to update in the alert definition? There should be another argument or arguments in a
+     * map. 1. Need to update the list/map of alert definitions across members.
+     */
+    synchronized (ALERT_DEFINITIONS) {
+      ALERT_DEFINITIONS.put(Integer.valueOf(alertDefinition.getId()), alertDefinition);
+
+      if (logger.isDebugEnabled()) {
+        logger.debug(
+            "AdminDistributedSystemJmxImpl.updateAlertDefinition : alertDefinition :: id={} :: {}",
+            alertDefinition.getId(), alertDefinition.getStringRepresentation());
+      }
+
+      /* TODO: add code to retry on failure */
+      notifyMembersForAlertDefinitionChange(alertDefinition);
+    }
+    if (logger.isDebugEnabled()) {
+      logger.debug(
+          "Exiting AdminDistributedSystemJmxImpl.updateAlertDefinition(StatAlertDefinition) *****");
+    }
+  }
+
+  /**
+   * This method can be used to remove alert definition for the Stat mentioned. This method should
+   * update the collection maintained at the aggregator and should notify members for the newly
+   * added alert definitions.
+   * 
+   * @param defId id of the alert definition to be removed
+   * @since GemFire 5.7
+   */
+  public void removeAlertDefinition(Integer defId) {
+    if (logger.isDebugEnabled()) {
+      logger.debug("Entered AdminDistributedSystemJmxImpl.removeAlertDefinition id *****");
+    }
+    /*
+     * alert passed to be deleted from the list/map of alerts on JMX MBean & all Member MBeans
+     */
+    synchronized (ALERT_DEFINITIONS) {
+      StatAlertDefinition alertDefinition = (StatAlertDefinition) ALERT_DEFINITIONS.get(defId);
+      if (alertDefinition != null) {
+        ALERT_DEFINITIONS.remove(defId);
+        synchronized (alertsStore) {
+          alertsStore.remove(defId);
+        }
+        /* TODO: add code to retry on failure */
+        notifyMembersForAlertDefinitionRemoval(alertDefinition);
+      }
+    }
+    if (logger.isDebugEnabled()) {
+      logger.debug("Exiting AdminDistributedSystemJmxImpl.removeAlertDefinition() *****");
+    }
+  }
+
+  /**
+   * Convenience method to check whether an alert definition is created.
+   * 
+   * @param alertDefinition alert definition to check whether already created
+   * @return true if the alert definition is already created, false otherwise
+   * @since GemFire 5.7
+   */
+  public boolean isAlertDefinitionCreated(StatAlertDefinition alertDefinition) {
+    /*
+     * Need to maintain a map of stat against the StatAlertDefinitions. check in that map whether
+     * the alert definition is there for the given alert
+     * 
+     * TODO: optimize to use Map.containsKey - DONE
+     */
+    synchronized (ALERT_DEFINITIONS) {
+      return ALERT_DEFINITIONS.containsKey(Integer.valueOf(alertDefinition.getId()));
+    }
+  }
+
+  /**
+   * Returns the refresh interval for the Stats in seconds.
+   * 
+   * @return refresh interval for the Stats(in seconds)
+   * @since GemFire 5.7
+   */
+  public synchronized int getRefreshIntervalForStatAlerts() {
+    /*
+     * state to store the refresh interval set by the user/GFMon client
+     */
+    return refreshIntervalForStatAlerts;
+  }
+
+  /**
+   * This method is used to set the refresh interval for the Stats in seconds
+   * 
+   * @param refreshIntervalForStatAlerts refresh interval for the Stats(in seconds)
+   * @since GemFire 5.7
+   */
+  public synchronized void setRefreshIntervalForStatAlerts(int refreshIntervalForStatAlerts) {
+    /*
+     * change the state refresh interval here.
+     */
+    this.refreshIntervalForStatAlerts = refreshIntervalForStatAlerts;
+    notifyMembersForRefreshIntervalChange(this.refreshIntervalForStatAlerts * 1000l);
+  }
+
+  /**
+   * Returns whether Statistics Alert definitions could be persisted across runs/sessions
+   * 
+   * @return value of canPersistStatAlertDefs.
+   * @since GemFire 6.5
+   */
+  public boolean canPersistStatAlertDefs() {
+    return canPersistStatAlertDefs;
+  }
+
+  /**
+   * An intermediate method to notify all members for change in refresh interval.
+   * 
+   * @param newInterval refresh interval to be set for members(in milliseconds)
+   */
+  private void notifyMembersForRefreshIntervalChange(long newInterval) {
+    GfManagerAgent agent = getGfManagerAgent();
+    ApplicationVM[] VMs = agent.listApplications();
+    // TODO: is there any other way to get all VMs?
+
+    for (int i = 0; i < VMs.length; i++) {
+      VMs[i].setRefreshInterval(newInterval);
+    }
+  }
+
+  /**
+   * An intermediate method to notify all members for change in stat alert definition.
+   * 
+   * @param alertDef stat alert definition that got changed
+   */
+  private void notifyMembersForAlertDefinitionChange(StatAlertDefinition alertDef) {
+    if (logger.isDebugEnabled()) {
+      logger.debug(
+          "Entered AdminDistributedSystemJmxImpl.notifyMembersForAlertDefinitionChange(StatAlertDefinition) *****");
+    }
+    GfManagerAgent agent = getGfManagerAgent();
+    StatAlertDefinition[] alertDefs = new StatAlertDefinition[] {alertDef};
+    ApplicationVM[] VMs = agent.listApplications();
+
+    for (int i = 0; i < VMs.length; i++) {
+      VMs[i].updateAlertDefinitions(alertDefs,
+          UpdateAlertDefinitionMessage.UPDATE_ALERT_DEFINITION);
+    }
+
+    if (logger.isDebugEnabled()) {
+      logger.debug(
+          "Exiting AdminDistributedSystemJmxImpl.notifyMembersForAlertDefinitionChange(StatAlertDefinition) "
+              + VMs.length + " members notified.*****");
+    }
+  }
+
+  /**
+   * An intermediate method to notify all members for removal of stat alert definition.
+   * 
+   * @param alertDef stat alert definition to be removed
+   */
+  private void notifyMembersForAlertDefinitionRemoval(StatAlertDefinition alertDef) {
+    GfManagerAgent agent = getGfManagerAgent();
+    StatAlertDefinition[] alertDefs = new StatAlertDefinition[] {alertDef};
+    ApplicationVM[] VMs = agent.listApplications();
+
+    for (int i = 0; i < VMs.length; i++) {
+      VMs[i].updateAlertDefinitions(alertDefs,
+          UpdateAlertDefinitionMessage.REMOVE_ALERT_DEFINITION);
+    }
+  }
+
+  /**
+   * This method can be used to set the AlertsManager for the newly joined member VM.
+   * 
+   * @param memberVM Member VM to set AlertsManager for
+   * @since GemFire 5.7
+   */
+  public synchronized void setAlertsManager(GemFireVM memberVM) {
+    /*
+     * 1. Who'll call this method? Who gets notified when a member joins? I think that's
+     * AdminDistributedSystemJmxImpl.nodeCreated() 2. Is the argument GemFireVM correct? Need to
+     * modify this interface to add method to set an interface. Need to see how it can be passed to
+     * the RemoteGemFireVM implementation. Also need to check whetherother implementors (like
+     * DistributedSystemHealthMonitor) of GemFireVM even need to have the AlertsManager 3. Would the
+     * alerts manager be set by aggregator or a JMXAgent i.e. AdminDistributedSystemJmxImpl 4.
+     * Setting the list of available alert definitions & refresh interval at this moment only would
+     * be better/easier. 5. Need to know Alerts Manager creation/construction. Need to decide how
+     * the object would be set & sent across to the Agent VM.
+     */
+    if (logger.isDebugEnabled()) {
+      logger.debug("Entered AdminDistributedSystemJmxImpl.setAlertsManager(GemFireVM) *****");
+    }
+
+    // creating an array of stat alert definition objects
+    StatAlertDefinition[] alertDefs = new StatAlertDefinition[0];
+
+    Collection alertDefsCollection = null;
+    synchronized (ALERT_DEFINITIONS) {
+      alertDefsCollection = ALERT_DEFINITIONS.values();
+    }
+
+    alertDefs = (StatAlertDefinition[]) alertDefsCollection.toArray(alertDefs);
+
+    memberVM.setAlertsManager(alertDefs, getRefreshIntervalForStatAlerts() * 1000l, true);
+
+    if (logger.isDebugEnabled()) {
+      logger.debug("Exiting AdminDistributedSystemJmxImpl.setAlertsManager(GemFireVM) *****");
+    }
+  }
+
+  /**
+   * This method can be used to retrieve all available stat alert definitions. Returns empty array
+   * if there are no stat alert definitions defined.
+   * 
+   * @return An array of all available StatAlertDefinition objects
+   * @since GemFire 5.7
+   */
+  public StatAlertDefinition[] getAllStatAlertDefinitions() {
+    if (logger.isDebugEnabled()) {
+      logger.debug("Entered AdminDistributedSystemJmxImpl.getAllStatAlertDefinitions() *****");
+    }
+
+    Collection alertDefs = null;
+    synchronized (ALERT_DEFINITIONS) {
+      alertDefs = ALERT_DEFINITIONS.values();
+    }
+
+    StatAlertDefinition[] alertDefsArr = null;
+
+    if (alertDefs != null) {
+      alertDefsArr = new StatAlertDefinition[alertDefs.size()];
+      alertDefsArr = (StatAlertDefinition[]) alertDefs.toArray(alertDefsArr);
+    } else {
+      alertDefsArr = new StatAlertDefinition[0];
+    }
+
+    if (logger.isDebugEnabled()) {
+      logger.debug("Exiting AdminDistributedSystemJmxImpl.getAllStatAlertDefinitions() *****");
+    }
+
+    return alertDefsArr;
+  }
+
+
+  /**
+   * This method can be used to process the notifications sent by the member(s). Actual aggregation
+   * of stats can occur here. The array contains alert objects with alert def. ID & value.
+   * AlertHelper class can be used to retrieve the corresponding alert definition.
+   * 
+   * @param alerts array of Alert class(contains alert def. ID & value)
+   * @param remoteVM Remote Member VM that sent Stat Alerts for processing the notifications to the
+   *        clients
+   */
+  public void processNotifications(StatAlert[] alerts, GemFireVM remoteVM) {
+    if (logger.isDebugEnabled()) {
+      logger.debug(
+          "Entered AdminDistributedSystemJmxImpl.processNotifications(StatAlert[{}], GemFireVM) *************",
+          alerts.length);
+    }
+
+    /*
+     * Notifications can not be processed if the remote VM is not available. NOTE: Should this
+     * method get the required GemFireVM information instead of its reference so that even if the
+     * member leaves we still have the information collected earlier to process the notification?
+     */
+    if (remoteVM == null) {
+      if (logger.isDebugEnabled()) {
+        logger.debug("Could not process stat alert notifications as given GemFireVM is null.");
+      }
+      return;
+    }
+
+    /*
+     * 1. The implementation idea is yet not clear. 2. The StatAlert array would received directly
+     * or from a request object.
+     */
+    ArrayList notificationObjects = new ArrayList();
+
+    String memberId = remoteVM.getId().getId();
+
+    final boolean isSystemWide = false;
+
+    StatAlert alert = null;
+    Integer defId = null;
+    // Number[] values = null;
+    for (int i = 0; i < alerts.length; i++) {
+      alert = alerts[i];
+
+      // defId = Integer.valueOf(alert.getDefinitionId());
+      if (getAlertDefinition(alert.getDefinitionId()) == null)
+        continue; // Ignore any removed AlertDefns
+      // values = alert.getValues();
+
+      // StatAlertDefinition statAlertDef = (StatAlertDefinition)ALERT_DEFINITIONS.get(defId);
+
+      /*
+       * 1. check if it's system-wide. 2. if system-wide keep, it in a collection (that should get
+       * cleared on timeout). Process all alerts when notifications from all members are received.
+       * Need to check if the member leaves meanwhile.
+       * 
+       * 1. Check if function evaluation is required? 2. If it's not required, the notification
+       * should directly be sent to clients.
+       */
+
+      // if (statAlertDef.getFunctionId() != 0) {
+      /*
+       * StatAlert with alert definitions having functions assigned will get evaluated at manager
+       * side only.
+       * 
+       * Is combination of systemwide alerts with function valid? It should be & hence such
+       * evaluation should be skipped on manager side. Or is it to be evaluated at manager as well
+       * as aggragator?
+       */
+      // }
+
+      // TODO: is this object required? Or earlier canbe resused?
+      StatAlertNotification alertNotification = new StatAlertNotification(alert, memberId);
+
+      /*
+       * variable isSystemWide is created only for convienience, there should be an indication for
+       * the same in the alert definition. Currently there is no systemWide definition
+       * 
+       * Evaluating system wide alerts: 1. It'll take time for aggregator to gather alerts from all
+       * members. Member might keep joining & leaving in between. The member for whom the stat-alert
+       * value was taken might have left & new ones might have joined leave until all the
+       * calculations are complete. A disclaimer to be put that these are not exact values. 2. How
+       * would the aggregator know that it has received alerts from all the managers? Is the concept
+       * of system-wide alerts valid? System-wide stats might be!
+       * 
+       */
+      if (!isSystemWide) {
+        notificationObjects.add(alertNotification);
+        continue;
+      }
+      HashSet accumulatedAlertValues;
+      synchronized (alertsStore) {
+        accumulatedAlertValues = (HashSet) alertsStore.get(defId);
+
+        if (accumulatedAlertValues == null) {
+          accumulatedAlertValues = new HashSet();
+          alertsStore.put(defId, accumulatedAlertValues);
+        }
+      }
+      synchronized (accumulatedAlertValues) {
+        accumulatedAlertValues.add(alertNotification);
+      }
+    } // for ends
+
+    if (!notificationObjects.isEmpty()) {
+      /* TODO: should ths method send & forget or be fail-safe? */
+      sendNotifications(notificationObjects, getObjectName());
+    }
+
+    if (logger.isDebugEnabled()) {
+      logger.debug(
+          "Exiting AdminDistributedSystemJmxImpl.processNotifications(StatAlert[], GemFireVM) *************");
+    }
+  }
+
+  private byte[] convertNotificationsDataToByteArray(ArrayList notificationObjects) {
+    if (logger.isDebugEnabled()) {
+      logger.debug(
+          "AdminDistributedSystemJmxImpl#convertNotificationsDataToByteArray: {} notifications",
+          notificationObjects.size());
+    }
+
+    byte[] arr = null;
+
+    try {
+      ByteArrayOutputStream byteArrStr = new ByteArrayOutputStream();
+      DataOutputStream str = new DataOutputStream(byteArrStr);
+      DataSerializer.writeArrayList(notificationObjects, str);
+      str.flush();
+      arr = byteArrStr.toByteArray();
+    } catch (IOException ex) {
+      logger.warn(LocalizedMessage.create(
+          LocalizedStrings.AdminDistributedSystem_ENCOUNTERED_AN_IOEXCEPTION_0,
+          ex.getLocalizedMessage()));
+    }
+
+    return arr;
+  }
+
+  /**
+   * An intermediate method to send notifications to the clients.
+   * 
+   * @param notificationObjects list of StatAlertNotification objects
+   */
+  private void sendNotifications(ArrayList notificationObjects, ObjectName objName) {
+    try {
+      if (logger.isDebugEnabled()) {
+        logger.debug("AdminDistributedSystemJmxImpl#sendNotifications: sending {} notifications",
+            notificationObjects.size());
+      }
+
+      byte[] notifBytes = convertNotificationsDataToByteArray(notificationObjects);
+      if (notifBytes != null) {
+        Notification notif = new Notification(NOTIF_STAT_ALERT, objName, // Pass the
+                                                                         // StatNotifications
+            notificationSequenceNumber.addAndGet(1), "StatAlert Notifications");
+        notif.setUserData(notifBytes);
+        this.modelMBean.sendNotification(notif);
+      } // IOException handled and logged in convertNotificationsDataToByteArray
+
+      StringBuffer buf = new StringBuffer();
+      for (int i = 0; i < notificationObjects.size(); i++) {
+        StatAlertNotification not = (StatAlertNotification) notificationObjects.get(i);
+        buf.append(not.toString(getAlertDefinition(not.getDefinitionId())));
+      }
+      // sendEmail("Gemfire AlertNotification on Member:" + objName, buf.toString());
+      if (isEmailNotificationEnabled) {
+        String mess =
+            LocalizedStrings.AdminDistributedSystemJmxImpl_STATISTICS_ALERT_FROM_DISTRIBUTED_SYSTEM_MEMBER_0_STATISTICS_1
+                .toLocalizedString(new Object[] {objName.getCanonicalName(), buf.toString()});
+        sendEmail(EML_SUBJ_PRFX_GFE_ALERT + EML_SUBJ_ITEM_GFE_DS + getName() + " <"
+            + LocalizedStrings.AdminDistributedSystemJmxImpl_STATISTICS_ALERT_FOR_MEMBER
+                .toLocalizedString()
+            + ">", mess);
+      }
+    } catch (javax.management.MBeanException e) {
+      logger.error(e.getMessage(), e);
+    } catch (RuntimeException e) {
+      logger.error(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  /**
+   * Sends an email to the configured recipients using configured email server. The given message
+   * will be the email body. NOTE: the check whether email notfication is enabled or not should done
+   * using {@link #isEmailNotificationEnabled} before calling this method.
+   * 
+   * @param subject subject of the email
+   * @param message message body of the email
+   */
+  private void sendEmail(String subject, String message) {
+    if (mailManager == null) {
+      mailManager = new MailManager(mailProps);
+    }
+    this.mailManager.sendEmail(subject, message);
+  }
+
+  public void processSystemwideNotifications() {}
+
+  public String getId() {
+    String myId = super.getId();
+    return MBeanUtil.makeCompliantMBeanNameProperty(myId);
+  }
+
+  /**
+   * This method is used to process ClientMembership events sent for BridgeMembership by bridge
+   * servers to all admin members.
+   * 
+   * @param senderId id of the member that sent the ClientMembership changes for processing (could
+   *        be null)
+   * @param clientId id of a client for which the notification was sent
+   * @param clientHost host on which the client is/was running
+   * @param eventType denotes whether the client Joined/Left/Crashed should be one of
+   *        ClientMembershipMessage#JOINED, ClientMembershipMessage#LEFT,
+   *        ClientMembershipMessage#CRASHED
+   */
+  @Override
+  public void processClientMembership(String senderId, String clientId, String clientHost,
+      int eventType) {
+    logger.info(LocalizedMessage.create(
+        LocalizedStrings.AdminDistributedSystemJmxImpl_PROCESSING_CLIENT_MEMBERSHIP_EVENT_0_FROM_1_FOR_2_RUNNING_ON_3,
+        new String[] {ClientMembershipMessage.getEventTypeString(eventType), senderId, clientId,
+            clientHost}));
+    try {
+      SystemMemberJmx systemMemberJmx = null;
+      CacheVm[] cacheVms = getCacheVms();
+
+      for (CacheVm cacheVm : cacheVms) {
+        if (cacheVm.getId().equals(senderId) && cacheVm instanceof CacheServerJmxImpl) {
+          systemMemberJmx = (CacheServerJmxImpl) cacheVm;
+          break;
+        }
+      }
+
+      if (systemMemberJmx == null) {
+        SystemMember[] appVms = getSystemMemberApplications();
+
+        for (SystemMember appVm : appVms) {
+          if (appVm.getId().equals(senderId) && appVm instanceof SystemMemberJmxImpl) {
+            systemMemberJmx = (SystemMemberJmxImpl) appVm;
+            break;
+          }
+        }
+
+      }
+
+      if (systemMemberJmx != null) {
+        systemMemberJmx.handleClientMembership(clientId, eventType);
+      }
+    } catch (AdminException e) {
+      logger.error(LocalizedMessage.create(
+          LocalizedStrings.AdminDistributedSystemJmxImpl_FAILED_TO_PROCESS_CLIENT_MEMBERSHIP_FROM_0_FOR_1,
+          new Object[] {senderId, clientId}), e);
+      return;
+    } catch (RuntimeOperationsException e) {
+      logger.warn(e.getMessage(), e);// failed to send notification
+    }
+  }
+
+  public String getAlertLevelAsString() {
+    return super.getAlertLevelAsString();
+  }
+
+  public void setAlertLevelAsString(String level) {
+    String newLevel = level != null ? level.trim() : null;
+    try {
+      super.setAlertLevelAsString(newLevel);
+    } catch (IllegalArgumentException e) {
+      throw new RuntimeMBeanException(e, e.getMessage());
+    }
+  }
+
+  /**
+   * Finds the member as per details in the given event object and passes on this event for handling
+   * the cache creation.
+   * 
+   * @param event event object corresponding to the creation of the cache
+   */
+  public void handleCacheCreateEvent(SystemMemberCacheEvent event) {
+    String memberId = event.getMemberId();
+    SystemMemberJmx systemMemberJmx = (SystemMemberJmx) findCacheOrAppVmById(memberId);
+
+    if (systemMemberJmx != null) {
+      systemMemberJmx.handleCacheCreate(event);
+    }
+
+  }
+
+  /**
+   * Finds the member as per details in the given event object and passes on this event for handling
+   * the cache closure.
+   * 
+   * @param event event object corresponding to the closure of the cache
+   */
+  public void handleCacheCloseEvent(SystemMemberCacheEvent event) {
+    String memberId = event.getMemberId();
+    SystemMemberJmx systemMemberJmx = (SystemMemberJmx) findCacheOrAppVmById(memberId);
+
+    if (systemMemberJmx != null) {
+      systemMemberJmx.handleCacheClose(event);
+    }
+
+  }
+
+  /**
+   * Finds the member as per details in the given event object and passes on this event for handling
+   * the region creation.
+   * 
+   * @param event event object corresponding to the creation of a region
+   */
+  public void handleRegionCreateEvent(SystemMemberRegionEvent event) {
+    String memberId = event.getMemberId();
+    SystemMemberJmx systemMemberJmx = (SystemMemberJmx) findCacheOrAppVmById(memberId);
+
+    if (systemMemberJmx != null) {
+      systemMemberJmx.handleRegionCreate(event);
+    }
+  }
+
+  /**
+   * Finds the member as per details in the given event object and passes on this event for handling
+   * the region loss.
+   * 
+   * @param event event object corresponding to the loss of a region
+   */
+  public void handleRegionLossEvent(SystemMemberRegionEvent event) {
+    String memberId = event.getMemberId();
+    SystemMemberJmx systemMemberJmx = (SystemMemberJmx) findCacheOrAppVmById(memberId);
+
+    if (systemMemberJmx != null) {
+      systemMemberJmx.handleRegionLoss(event);
+    }
+  }
+
+  @Override
+  public void setDisableAutoReconnect(boolean newValue) {
+    getConfig().setDisableAutoReconnect(newValue);
+  }
+
+  @Override
+  public boolean getDisableAutoReconnect() {
+    return getConfig().getDisableAutoReconnect();
+  }
+
+}
+
+
+class ProcessSystemwideStatAlertsNotification extends TimerTask {
+  private StatAlertsAggregator aggregator;
+
+  ProcessSystemwideStatAlertsNotification(StatAlertsAggregator aggregator) {
+    this.aggregator = aggregator;
+  }
+
+  @Override
+  public void run() {
+    aggregator.processSystemwideNotifications();
+  }
+
+}
+
+
+/**
+ * Implementation of SystemMemberCacheListener used for listening to events:
+ * <ol>
+ * <li>Cache Created</li>
+ * <li>Cache Closed</li>
+ * <li>Region Created</li>
+ * <li>Region Loss</li>
+ * </ol>
+ * 
+ */
+class CacheAndRegionListenerImpl implements SystemMemberCacheListener {
+  private AdminDistributedSystemJmxImpl adminDS;
+
+  /**
+   * Csontructor to create CacheAndRegionListenerImpl
+   * 
+   * @param adminDSResource instance of AdminDistributedSystemJmxImpl
+   */
+  CacheAndRegionListenerImpl(AdminDistributedSystemJmxImpl adminDSResource) {
+    this.adminDS = adminDSResource;
+  }
+
+  /**
+   * See SystemMemberCacheListener#afterCacheClose(SystemMemberCacheEvent)
+   */
+  public void afterCacheClose(SystemMemberCacheEvent event) {
+    adminDS.handleCacheCloseEvent(event);
+  }
+
+  /**
+   * See SystemMemberCacheListener#afterCacheCreate(SystemMemberCacheEvent)
+   */
+  public void afterCacheCreate(SystemMemberCacheEvent event) {
+    adminDS.handleCacheCreateEvent(event);
+  }
+
+  /**
+   * See SystemMemberCacheListener#afterRegionCreate(SystemMemberCacheEvent)
+   */
+  public void afterRegionCreate(SystemMemberRegionEvent event) {
+    adminDS.handleRegionCreateEvent(event);
+  }
+
+  /**
+   * See SystemMemberCacheListener#afterRegionLoss(SystemMemberCacheEvent)
+   */
+  public void afterRegionLoss(SystemMemberRegionEvent event) {
+    adminDS.handleRegionLossEvent(event);
+  }
+}
+


[44/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java
deleted file mode 100644
index efeee66..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthImpl.java
+++ /dev/null
@@ -1,511 +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.admin.internal;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.admin.*;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-
-/**
- * Provides the implementation of the <code>GemFireHealth</code> administration API. This class is
- * responsible for {@linkplain GemFireVM#addHealthListener sending} the {@link GemFireHealthConfig}s
- * to the remote member VM in which the health is calcualted.
- *
- *
- * @since GemFire 3.5
- */
-public class GemFireHealthImpl implements GemFireHealth, JoinLeaveListener, HealthListener {
-
-  /** The distributed system whose health is being monitored */
-  private final GfManagerAgent agent;
-
-  /** The default configuration for checking GemFire health */
-  protected GemFireHealthConfig defaultConfig;
-
-  /**
-   * Maps the name of a host to its <code>GemFireHealthConfig</code>. Note that the mappings are
-   * created lazily.
-   */
-  private final Map hostConfigs;
-
-  /**
-   * Maps the name of a host to all of the members (<code>GemFireVM</code>s) that run on that host.
-   */
-  private final Map hostMembers;
-
-  /** The members that are known to be in {@link #OKAY_HEALTH}. */
-  private Collection okayHealth;
-
-  /** The members that are known to be in {@link #POOR_HEALTH}. */
-  private Collection poorHealth;
-
-  /** The overall health of GemFire */
-  private GemFireHealth.Health overallHealth;
-
-  /** Is this GemFireHealthImpl closed? */
-  private boolean isClosed;
-
-  /**
-   * The configuration specifying how the health of the distributed system should be computed.
-   */
-  protected volatile DistributedSystemHealthConfig dsHealthConfig;
-
-  /** Monitors the health of the entire distributed system */
-  private DistributedSystemHealthMonitor dsHealthMonitor = null;
-
-  /**
-   * The distributed system whose health is monitored by this <Code>GemFireHealth</code>.
-   */
-  private final AdminDistributedSystem system;
-
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>GemFireHealthImpl</code> that monitors the health of member of the given
-   * distributed system.
-   */
-  protected GemFireHealthImpl(GfManagerAgent agent, AdminDistributedSystem system) {
-    // agent.getDM().getLogger().info("Creating GemFireHealthImpl",
-    // new Exception("Stack trace"));
-
-    this.agent = agent;
-    this.system = system;
-
-    this.hostConfigs = new HashMap();
-    this.hostMembers = new HashMap();
-    this.okayHealth = new HashSet();
-    this.poorHealth = new HashSet();
-    this.overallHealth = GOOD_HEALTH;
-    this.isClosed = false;
-
-    GemFireVM[] apps = this.agent.listApplications();
-    for (int i = 0; i < apps.length; i++) {
-      GemFireVM member = apps[i];
-      this.noteNewMember(member);
-    }
-
-    agent.addJoinLeaveListener(this);
-    setDefaultGemFireHealthConfig(createGemFireHealthConfig(null));
-    setDistributedSystemHealthConfig(createDistributedSystemHealthConfig());
-  }
-
-  @Override
-  public String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.append("closed=" + isClosed);
-    sb.append("; hostMembers=" + hostMembers);
-    sb.append("; okayHealth=" + okayHealth);
-    sb.append("; poorHealth=" + poorHealth);
-    sb.append("; overallHealth=" + overallHealth);
-    sb.append("; diagnosis=" + getDiagnosis());
-    return sb.toString();
-  }
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Returns the <code>DistributedSystem</code> whose health this <code>GemFireHealth</code>
-   * monitors.
-   */
-  public AdminDistributedSystem getDistributedSystem() {
-    return this.system;
-  }
-
-  /**
-   * A "template factory" method for creating a <code>DistributedSystemHealthConfig</code>. It can
-   * be overridden by subclasses to produce instances of different
-   * <code>DistributedSystemHealthConfig</code> implementations.
-   */
-  protected DistributedSystemHealthConfig createDistributedSystemHealthConfig() {
-
-    return new DistributedSystemHealthConfigImpl();
-  }
-
-  /**
-   * A "template factory" method for creating a <code>GemFireHealthConfig</code>. It can be
-   * overridden by subclasses to produce instances of different <code>GemFireHealthConfig</code>
-   * implementations.
-   *
-   * @param hostName The host whose health we are configuring
-   */
-  protected GemFireHealthConfig createGemFireHealthConfig(String hostName) {
-
-    return new GemFireHealthConfigImpl(hostName);
-  }
-
-  /**
-   * Throws an {@link IllegalStateException} if this <code>GemFireHealthImpl</code> is closed.
-   */
-  private void checkClosed() {
-    if (this.isClosed) {
-      throw new IllegalStateException(
-          LocalizedStrings.GemFireHealthImpl_CANNOT_ACCESS_A_CLOSED_GEMFIREHEALTH_INSTANCE
-              .toLocalizedString());
-    }
-  }
-
-  /**
-   * Returns the overall health of GemFire. Note that this method does not contact any of the member
-   * VMs. Instead, it relies on the members to alert it of changes in its health via a
-   * {@link HealthListener}.
-   */
-  public GemFireHealth.Health getHealth() {
-    checkClosed();
-    return this.overallHealth;
-  }
-
-  /**
-   * Resets the overall health to be {@link #GOOD_HEALTH}. It also resets the health in the member
-   * VMs.
-   *
-   * @see GemFireVM#resetHealthStatus
-   */
-  public void resetHealth() {
-    checkClosed();
-
-    this.overallHealth = GOOD_HEALTH;
-    this.okayHealth.clear();
-    this.poorHealth.clear();
-
-    synchronized (this) {
-      for (Iterator iter = hostMembers.values().iterator(); iter.hasNext();) {
-        List members = (List) iter.next();
-        for (Iterator iter2 = members.iterator(); iter2.hasNext();) {
-          GemFireVM member = (GemFireVM) iter2.next();
-          member.resetHealthStatus();
-        }
-      }
-    }
-  }
-
-  /**
-   * Aggregates the diagnoses from all members of the distributed system.
-   */
-  public String getDiagnosis() {
-    checkClosed();
-
-    StringBuffer sb = new StringBuffer();
-
-    synchronized (this) {
-      for (Iterator iter = hostMembers.values().iterator(); iter.hasNext();) {
-        List members = (List) iter.next();
-        for (Iterator iter2 = members.iterator(); iter2.hasNext();) {
-          GemFireVM member = (GemFireVM) iter2.next();
-          String[] diagnoses = member.getHealthDiagnosis(this.overallHealth);
-          for (int i = 0; i < diagnoses.length; i++) {
-            sb.append(diagnoses[i]).append("\n");;
-          }
-        }
-      }
-    }
-
-    return sb.toString();
-  }
-
-  /**
-   * Starts a new {@link DistributedSystemHealthMonitor}
-   */
-  public void setDistributedSystemHealthConfig(DistributedSystemHealthConfig config) {
-    synchronized (this.hostConfigs) {
-      // If too many threads are changing the health config, then we
-      // will might get an OutOfMemoryError trying to start a new
-      // health monitor thread.
-
-      if (this.dsHealthMonitor != null) {
-        this.dsHealthMonitor.stop();
-      }
-
-      this.dsHealthConfig = config;
-
-      DistributedSystemHealthEvaluator eval =
-          new DistributedSystemHealthEvaluator(config, this.agent.getDM());
-      int interval = this.getDefaultGemFireHealthConfig().getHealthEvaluationInterval();
-      this.dsHealthMonitor = new DistributedSystemHealthMonitor(eval, this, interval);
-      this.dsHealthMonitor.start();
-    }
-  }
-
-  public DistributedSystemHealthConfig getDistributedSystemHealthConfig() {
-
-    checkClosed();
-    return this.dsHealthConfig;
-  }
-
-  public GemFireHealthConfig getDefaultGemFireHealthConfig() {
-    checkClosed();
-    return this.defaultConfig;
-  }
-
-  public void setDefaultGemFireHealthConfig(GemFireHealthConfig config) {
-    checkClosed();
-
-    if (config.getHostName() != null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.GemFireHealthImpl_THE_GEMFIREHEALTHCONFIG_FOR_FOR_0_CANNOT_SERVE_AS_THE_DEFAULT_HEALTH_CONFIG
-              .toLocalizedString(config.getHostName()));
-    }
-
-    this.defaultConfig = config;
-
-    synchronized (this) {
-      for (Iterator iter = this.hostMembers.entrySet().iterator(); iter.hasNext();) {
-        Map.Entry entry = (Map.Entry) iter.next();
-        InetAddress hostIpAddress = (InetAddress) entry.getKey();
-        List members = (List) entry.getValue();
-
-        GemFireHealthConfig hostConfig = (GemFireHealthConfig) hostConfigs.get(hostIpAddress);
-        if (hostConfig == null) {
-          hostConfig = config;
-        }
-
-        for (Iterator iter2 = members.iterator(); iter2.hasNext();) {
-          GemFireVM member = (GemFireVM) iter2.next();
-          Assert.assertTrue(member.getHost().equals(hostIpAddress));
-          member.addHealthListener(this, hostConfig);
-        }
-      }
-    }
-
-    // We only need to do this if the health monitoring interval has
-    // change. This is probably not the most efficient way of doing
-    // things.
-    if (this.dsHealthConfig != null) {
-      setDistributedSystemHealthConfig(this.dsHealthConfig);
-    }
-  }
-
-  /**
-   * Returns the GemFireHealthConfig object for the given host name.
-   * 
-   * @param hostName host name for which the GemFire Health Config is needed
-   * 
-   * @throws IllegalArgumentException if host with given name could not be found
-   */
-  public synchronized GemFireHealthConfig getGemFireHealthConfig(String hostName) {
-
-    checkClosed();
-
-    InetAddress hostIpAddress = null;
-    try {
-      hostIpAddress = InetAddress.getByName(hostName);
-    } catch (UnknownHostException e) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.GemFireHealthImpl_COULD_NOT_FIND_A_HOST_WITH_NAME_0
-              .toLocalizedString(hostName),
-          e);
-    }
-
-    GemFireHealthConfig config = (GemFireHealthConfig) this.hostConfigs.get(hostIpAddress);
-    if (config == null) {
-      config = createGemFireHealthConfig(hostName);
-      this.hostConfigs.put(hostIpAddress, config);
-    }
-
-    return config;
-  }
-
-  /**
-   * Sets the GemFireHealthConfig object for the given host name.
-   * 
-   * @param hostName host name for which the GemFire Health Config is needed
-   * @param config GemFireHealthConfig object to set
-   * 
-   * @throws IllegalArgumentException if (1) given host name & the host name in the given config do
-   *         not match OR (2) host with given name could not be found OR (3) there are no GemFire
-   *         components running on the given host
-   */
-  public void setGemFireHealthConfig(String hostName, GemFireHealthConfig config) {
-    checkClosed();
-
-    synchronized (this) {
-      String configHost = config.getHostName();
-      if (configHost == null || !configHost.equals(hostName)) {
-        StringBuffer sb = new StringBuffer();
-        sb.append("The GemFireHealthConfig configures ");
-        if (configHost == null) {
-          sb.append("the default host ");
-
-        } else {
-          sb.append("host \"");
-          sb.append(config.getHostName());
-          sb.append("\" ");
-        }
-        sb.append("not \"" + hostName + "\"");
-        throw new IllegalArgumentException(sb.toString());
-      }
-      InetAddress hostIpAddress = null;
-      try {
-        hostIpAddress = InetAddress.getByName(hostName);
-      } catch (UnknownHostException e) {
-        throw new IllegalArgumentException(
-            LocalizedStrings.GemFireHealthImpl_COULD_NOT_FIND_A_HOST_WITH_NAME_0
-                .toLocalizedString(hostName),
-            e);
-      }
-
-      List members = (List) this.hostMembers.get(hostIpAddress);
-      if (members == null || members.isEmpty()) {
-        throw new IllegalArgumentException(
-            LocalizedStrings.GemFireHealthImpl_THERE_ARE_NO_GEMFIRE_COMPONENTS_ON_HOST_0
-                .toLocalizedString(hostName));
-      }
-
-      for (Iterator iter = members.iterator(); iter.hasNext();) {
-        GemFireVM member = (GemFireVM) iter.next();
-        member.addHealthListener(this, config);
-      }
-    }
-  }
-
-  /**
-   * Tells the members of the distributed system that we are no longer interested in monitoring
-   * their health.
-   *
-   * @see GemFireVM#removeHealthListener
-   */
-  public void close() {
-    this.agent.removeJoinLeaveListener(this);
-
-    synchronized (this) {
-      if (this.isClosed) {
-        return;
-      }
-
-      this.isClosed = true;
-
-      if (this.dsHealthMonitor != null) {
-        this.dsHealthMonitor.stop();
-        this.dsHealthMonitor = null;
-      }
-
-      try {
-        for (Iterator iter = hostMembers.values().iterator(); iter.hasNext();) {
-          List members = (List) iter.next();
-          for (Iterator iter2 = members.iterator(); iter2.hasNext();) {
-            GemFireVM member = (GemFireVM) iter2.next();
-            member.removeHealthListener();
-          }
-        }
-      } catch (CancelException e) {
-        // if the DS is disconnected, stop trying to distribute to other members
-      }
-
-      hostConfigs.clear();
-      hostMembers.clear();
-      okayHealth.clear();
-      poorHealth.clear();
-    }
-  }
-
-  public boolean isClosed() {
-    return this.isClosed;
-  }
-
-  /**
-   * Makes note of the newly-joined member
-   */
-  private void noteNewMember(GemFireVM member) {
-    InetAddress hostIpAddress = member.getHost();
-    List members = (List) this.hostMembers.get(hostIpAddress);
-    if (members == null) {
-      members = new ArrayList();
-      this.hostMembers.put(hostIpAddress, members);
-    }
-    members.add(member);
-
-  }
-
-  public synchronized void nodeJoined(GfManagerAgent source, GemFireVM joined) {
-    noteNewMember(joined);
-
-    InetAddress hostIpAddress = joined.getHost();
-
-    GemFireHealthConfig config = (GemFireHealthConfig) this.hostConfigs.get(hostIpAddress);
-    if (config == null) {
-      config = this.getDefaultGemFireHealthConfig();
-    }
-    joined.addHealthListener(this, config);
-  }
-
-  /**
-   * Makes note of the newly-left member
-   */
-  public synchronized void nodeLeft(GfManagerAgent source, GemFireVM left) {
-    InetAddress hostIpAddress = left.getHost();
-    List members = (List) this.hostMembers.get(hostIpAddress);
-    if (members != null) {
-      members.remove(left);
-      if (members.isEmpty()) {
-        // No more members on the host
-        this.hostConfigs.remove(hostIpAddress);
-        this.hostMembers.remove(hostIpAddress);
-      }
-    }
-
-    this.okayHealth.remove(left);
-    this.poorHealth.remove(left);
-
-    reevaluateHealth();
-  }
-
-  /**
-   * Does the same thing as {@link #nodeLeft}
-   */
-  public void nodeCrashed(GfManagerAgent source, GemFireVM crashed) {
-    nodeLeft(source, crashed);
-  }
-
-  /**
-   * Re-evaluates the overall health of GemFire
-   */
-  private void reevaluateHealth() {
-    if (!this.poorHealth.isEmpty()) {
-      this.overallHealth = POOR_HEALTH;
-
-    } else if (!this.okayHealth.isEmpty()) {
-      this.overallHealth = OKAY_HEALTH;
-
-    } else {
-      this.overallHealth = GOOD_HEALTH;
-    }
-  }
-
-  public void healthChanged(GemFireVM member, GemFireHealth.Health status) {
-    if (status == GOOD_HEALTH) {
-      this.okayHealth.remove(member);
-      this.poorHealth.remove(member);
-
-    } else if (status == OKAY_HEALTH) {
-      this.okayHealth.add(member);
-      this.poorHealth.remove(member);
-
-    } else if (status == POOR_HEALTH) {
-      this.okayHealth.remove(member);
-      this.poorHealth.add(member);
-
-    } else {
-      Assert.assertTrue(false, "Unknown health code: " + status);
-    }
-
-    reevaluateHealth();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/InetAddressUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/InetAddressUtil.java b/geode-core/src/main/java/org/apache/geode/admin/internal/InetAddressUtil.java
deleted file mode 100755
index 17d1535..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/InetAddressUtil.java
+++ /dev/null
@@ -1,201 +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.admin.internal;
-
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.net.SocketException;
-import java.util.Enumeration;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.GemFireIOException;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-
-
-/**
- * Provides static utilities for manipulating, validating, and converting InetAddresses and host
- * strings.
- *
- * @since GemFire 3.5
- */
-@Deprecated
-public class InetAddressUtil {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /** InetAddress instance representing the local host */
-  public static final InetAddress LOCALHOST = createLocalHost();
-
-  public static final String LOOPBACK_ADDRESS =
-      SocketCreator.preferIPv6Addresses() ? "::1" : "127.0.0.1";
-
-  public static final InetAddress LOOPBACK = InetAddressUtil.toInetAddress(LOOPBACK_ADDRESS);
-
-  /** Disallows InetAddressUtil instantiation. */
-  private InetAddressUtil() {}
-
-  /**
-   * Returns a string version of InetAddress which can be converted back to an InetAddress later.
-   * Essentially any leading slash is trimmed.
-   *
-   * @param val the InetAddress or String to return a formatted string of
-   * @return string version the InetAddress minus any leading slash
-   */
-  public static String toString(Object val) {
-    if (val instanceof String) {
-      return trimLeadingSlash((String) val);
-
-    } else if (val instanceof InetAddress) {
-      return ((InetAddress) val).getHostAddress();
-
-    } else {
-      return trimLeadingSlash(val.toString());
-    }
-  }
-
-  /**
-   * Converts the string host to an instance of InetAddress. Returns null if the string is empty.
-   * Fails Assertion if the conversion would result in <code>java.lang.UnknownHostException</code>.
-   * <p>
-   * Any leading slashes on host will be ignored.
-   *
-   * @param host string version the InetAddress
-   * @return the host converted to InetAddress instance
-   */
-  public static InetAddress toInetAddress(String host) {
-    if (host == null || host.length() == 0) {
-      return null;
-    }
-    try {
-      if (host.indexOf("/") > -1) {
-        return InetAddress.getByName(host.substring(host.indexOf("/") + 1));
-      } else {
-        return InetAddress.getByName(host);
-      }
-    } catch (java.net.UnknownHostException e) {
-      logStackTrace(e);
-      Assert.assertTrue(false, "Failed to get InetAddress: " + host);
-      return null; // will never happen since the Assert will fail
-    }
-  }
-
-  /**
-   * Creates an InetAddress representing the local host. The checked exception
-   * <code>java.lang.UnknownHostException</code> is captured and results in an Assertion failure
-   * instead.
-   *
-   * @return InetAddress instance representing the local host
-   */
-  public static InetAddress createLocalHost() {
-    try {
-      return SocketCreator.getLocalHost();
-    } catch (java.net.UnknownHostException e) {
-      logStackTrace(e);
-      Assert.assertTrue(false, "Failed to get local host");
-      return null; // will never happen
-    }
-  }
-
-  /**
-   * Validates the host by making sure it can successfully be used to get an instance of
-   * InetAddress. If the host string is null, empty or would result in
-   * <code>java.lang.UnknownHostException</code> then null is returned.
-   * <p>
-   * Any leading slashes on host will be ignored.
-   *
-   * @param host string version the InetAddress
-   * @return the host converted to InetAddress instance
-   */
-  public static String validateHost(String host) {
-    if (host == null || host.length() == 0) {
-      return null;
-    }
-    try {
-      InetAddress.getByName(trimLeadingSlash(host));
-      return host;
-    } catch (java.net.UnknownHostException e) {
-      logStackTrace(e);
-      return null;
-    }
-  }
-
-  /** Returns true if host matches the LOCALHOST. */
-  public static boolean isLocalHost(Object host) {
-    if (host instanceof InetAddress) {
-      if (LOCALHOST.equals(host)) {
-        return true;
-      } else {
-        // InetAddress hostAddr = (InetAddress)host;
-        try {
-          Enumeration en = NetworkInterface.getNetworkInterfaces();
-          while (en.hasMoreElements()) {
-            NetworkInterface i = (NetworkInterface) en.nextElement();
-            for (Enumeration en2 = i.getInetAddresses(); en2.hasMoreElements();) {
-              InetAddress addr = (InetAddress) en2.nextElement();
-              if (host.equals(addr)) {
-                return true;
-              }
-            }
-          }
-          return false;
-        } catch (SocketException e) {
-          throw new GemFireIOException(
-              LocalizedStrings.InetAddressUtil_UNABLE_TO_QUERY_NETWORK_INTERFACE
-                  .toLocalizedString(),
-              e);
-        }
-      }
-    } else {
-      return isLocalHost(InetAddressUtil.toInetAddress(host.toString()));
-    }
-  }
-
-  /** Returns true if host matches the LOOPBACK (127.0.0.1). */
-  public static boolean isLoopback(Object host) {
-    if (host instanceof InetAddress) {
-      return LOOPBACK.equals(host);
-    } else {
-      return isLoopback(InetAddressUtil.toInetAddress(host.toString()));
-    }
-  }
-
-  /** Returns a version of the value after removing any leading slashes */
-  private static String trimLeadingSlash(String value) {
-    if (value == null)
-      return "";
-    while (value.indexOf("/") > -1) {
-      value = value.substring(value.indexOf("/") + 1);
-    }
-    return value;
-  }
-
-  /**
-   * Logs the stack trace for the given Throwable if logger is initialized else prints the stack
-   * trace using System.out. If logged the logs are logged at WARNING level.
-   * 
-   * @param throwable Throwable to log stack trace for
-   */
-  private static void logStackTrace(Throwable throwable) {
-    AdminDistributedSystemImpl adminDS = AdminDistributedSystemImpl.getConnectedInstance();
-
-    logger.warn(throwable.getMessage(), throwable);
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/InternalManagedEntity.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/InternalManagedEntity.java b/geode-core/src/main/java/org/apache/geode/admin/internal/InternalManagedEntity.java
deleted file mode 100644
index 6211aea..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/InternalManagedEntity.java
+++ /dev/null
@@ -1,96 +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.admin.internal;
-
-import org.apache.geode.admin.AdminDistributedSystem;
-import org.apache.geode.admin.ManagedEntity;
-import org.apache.geode.admin.ManagedEntityConfig;
-
-/**
- * Provides internal-only functionality that is expected of all <code>ManagedEntity<code>s. This
- * functionality is used by the {@link ManagedEntityController} to manage the entity.
- *
- * @since GemFire 4.0
- */
-public interface InternalManagedEntity extends ManagedEntity {
-
-  /** The state of a managed entity is unknown. */
-  public static final int UNKNOWN = 10;
-
-  /** A managed entity is stopped */
-  public static final int STOPPED = 11;
-
-  /** A managed entity is stopping (being stopped) */
-  public static final int STOPPING = 12;
-
-  /** A managed entity is starting */
-  public static final int STARTING = 13;
-
-  /** A managed entity is running (is started) */
-  public static final int RUNNING = 14;
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Returns the <code>ManagedEntityConfig</code> for this <code>ManagedEntity</code>.
-   */
-  public ManagedEntityConfig getEntityConfig();
-
-  /**
-   * Returns a brief description (such as "locator") of this managed entity.
-   */
-  public String getEntityType();
-
-  /**
-   * Returns the (local) command to execute in order to start this managed entity. The command
-   * includes the full path to the executable (include <code>$GEMFIRE/bin</code>) and any
-   * command-line arguments. It does not take the {@linkplain ManagedEntityConfig#getRemoteCommand
-   * remote command} into account.
-   */
-  public String getStartCommand();
-
-  /**
-   * Returns the (local) command to execute in order to stop this managed entity.
-   */
-  public String getStopCommand();
-
-  /**
-   * Returns the (local) command to execute in order to determine whether or not this managed entity
-   * is runing.
-   */
-  public String getIsRunningCommand();
-
-  /**
-   * Returns a descriptive, one-word, unique id for a newly-created <code>ManagedEntity</code>. This
-   * ensures that we do not have collisions in the ids of entities.
-   */
-  public String getNewId();
-
-  /**
-   * Returns the distributed system to which this managed entity belongs.
-   */
-  public AdminDistributedSystem getDistributedSystem();
-
-  /**
-   * Sets the state of this managed entity and informs threads that are waiting for a state change.
-   * See bug 32455.
-   *
-   * @return The previous state of this managed entity.
-   *
-   * @see #RUNNING
-   */
-  public int setState(int state);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/LogCollator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/LogCollator.java b/geode-core/src/main/java/org/apache/geode/admin/internal/LogCollator.java
deleted file mode 100755
index 83aa440..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/LogCollator.java
+++ /dev/null
@@ -1,121 +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.admin.internal;
-
-import org.apache.geode.internal.admin.GfManagerAgent;
-import org.apache.geode.internal.admin.GemFireVM;
-import org.apache.geode.internal.admin.ApplicationVM;
-import org.apache.geode.internal.logging.MergeLogFiles;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
-
-public class LogCollator {
-
-  private GfManagerAgent system;
-  private List logTails;
-
-  public LogCollator() {}
-
-  public String collateLogs(GfManagerAgent system) {
-    try {
-      if (system == null) {
-        return "";
-      }
-      this.system = system;
-      this.logTails = new ArrayList();
-      gatherActiveLogs();
-      gatherInactiveLogs();
-      return mergeLogs();
-    } finally {
-      this.system = null;
-      this.logTails = null;
-    }
-  }
-
-  // -------------------------------------------------------------------------
-
-  private String mergeLogs() {
-    // combine logs...
-    InputStream[] logFiles = new InputStream[this.logTails.size()];
-    String[] logFileNames = new String[logFiles.length];
-    for (int i = 0; i < this.logTails.size(); i++) {
-      Loglet loglet = (Loglet) this.logTails.get(i);
-      logFiles[i] = new ByteArrayInputStream(loglet.tail.getBytes());
-      logFileNames[i] = loglet.name;
-    }
-
-    // delegate to MergeLogFiles...
-    StringWriter writer = new StringWriter();
-    PrintWriter mergedLog = new PrintWriter(writer);
-    if (!MergeLogFiles.mergeLogFiles(logFiles, logFileNames, mergedLog)) {
-      return writer.toString();
-    } else {
-      return "";
-    }
-  }
-
-  private void gatherActiveLogs() {
-    ApplicationVM[] runningsApps = this.system.listApplications();
-    for (int i = 0; i < runningsApps.length; i++) {
-      addLogFrom(runningsApps[i]);
-    }
-  }
-
-  private void gatherInactiveLogs() {
-    /*
-     * not yet supported.... if (useStopped) { LogViewHelper helper = new LogViewHelper(); for
-     * (Iterator iter = stoppedNodes.iterator(); iter.hasNext(); ) { Object adminEntity =
-     * iter.next(); helper.setAdminEntity(adminEntity); try { if (helper.logViewAvailable()) {
-     * String[] logs = helper.getSystemLogs(); addTail(allTails, logs, adminEntity.toString()); } }
-     * catch (Exception e) { Service.getService().reportSystemError(e); } } }
-     */
-  }
-
-  private void addLogFrom(GemFireVM vm) {
-    String name = null;
-    name = vm.toString();
-    String[] logs = vm.getSystemLogs();
-    addTail(name, logs);
-  }
-
-  private void addTail(String logName, String[] logs) {
-    if (logs.length > 0) {
-      String tail = (logs.length > 1) ? logs[1] : logs[0];
-      this.logTails.add(new Loglet(logName, tail));
-    }
-  }
-
-  /*
-   * public void setUseStoppedManagers(boolean useStopped) { this.useStopped = useStopped; }
-   */
-
-  private static class Loglet {
-    String name;
-    String tail;
-
-    Loglet(String name, String tail) {
-      this.name = name;
-      this.tail = tail;
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigImpl.java
deleted file mode 100644
index fc41e5f..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigImpl.java
+++ /dev/null
@@ -1,256 +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.admin.internal;
-
-// import org.apache.geode.admin.DistributedSystemConfig;
-// import org.apache.geode.admin.ManagedEntity;
-import org.apache.geode.admin.ManagedEntityConfig;
-import org.apache.geode.internal.admin.GemFireVM;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.GemFireVersion;
-import org.apache.geode.internal.net.SocketCreator;
-
-import java.io.File;
-import java.net.*;
-
-/**
- * The abstract superclass of objects that configure a managed entity such as a GemFire cache server
- * or a distribution locator. It contains configuration state and behavior common to all managed
- * entities.
- *
- * @since GemFire 4.0
- */
-public abstract class ManagedEntityConfigImpl implements ManagedEntityConfig {
-
-  /** The name of the host on which the managed entity runs */
-  private String host;
-
-  /** Directory in which the locator runs */
-  private String workingDirectory;
-
-  /** The directory in which GemFire is installed */
-  private String productDirectory;
-
-  /** Command used to launch locator on remote machine */
-  private String remoteCommand;
-
-  /**
-   * The managed entity configured by this object.
-   *
-   * @see #isReadOnly
-   */
-  private InternalManagedEntity entity = null;
-
-  ///////////////////// Static Methods /////////////////////
-
-  /**
-   * Returns the {@linkplain InetAddress#getCanonicalHostName canonical name} of the local machine.
-   */
-  protected static String getLocalHostName() {
-    try {
-      return SocketCreator.getLocalHost().getCanonicalHostName();
-
-    } catch (UnknownHostException ex) {
-      IllegalStateException ex2 = new IllegalStateException(
-          LocalizedStrings.ManagedEntityConfigImpl_COULD_NOT_DETERMINE_LOCALHOST
-              .toLocalizedString());
-      ex2.initCause(ex);
-      throw ex2;
-    }
-  }
-
-  /**
-   * Returns the current working directory for this VM.
-   */
-  private static File getCurrentWorkingDirectory() {
-    File cwd = new File(System.getProperty("user.dir"));
-    return cwd.getAbsoluteFile();
-  }
-
-  /**
-   * Returns the location of the GemFire product installation. This is determined by finding the
-   * location of the gemfire jar and working backwards.
-   */
-  private static File getGemFireInstallation() {
-    URL url = GemFireVersion.getJarURL();
-    if (url == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.ManagedEntityConfigImpl_COULD_NOT_FIND_GEMFIREJAR.toLocalizedString());
-    }
-
-    File gemfireJar = new File(url.getPath());
-    File lib = gemfireJar.getParentFile();
-    File product = lib.getParentFile();
-
-    return product;
-  }
-
-  ////////////////////// Constructors //////////////////////
-
-  /**
-   * Creates a <code>ManagedEntityConfigImpl</code> with the default configuration.
-   */
-  protected ManagedEntityConfigImpl() {
-    this.host = getLocalHostName();
-    this.workingDirectory = getCurrentWorkingDirectory().getAbsolutePath();
-    this.productDirectory = getGemFireInstallation().getAbsolutePath();
-    this.remoteCommand = null; // Delegate to AdminDistributedSystem
-  }
-
-  /**
-   * Creates a new <code>ManagedEntityConfigImpl</code> based on the configuration of a running
-   * <code>GemFireVM</code>
-   */
-  protected ManagedEntityConfigImpl(GemFireVM vm) {
-    this.host = SocketCreator.getHostName(vm.getHost());
-    this.workingDirectory = vm.getWorkingDirectory().getAbsolutePath();
-    this.productDirectory = vm.getGemFireDir().getAbsolutePath();
-    this.remoteCommand = null;
-  }
-
-  /**
-   * A copy constructor that creates a new <code>ManagedEntityConfigImpl</code> with the same
-   * configuration as another <code>ManagedEntityConfig</code>.
-   */
-  protected ManagedEntityConfigImpl(ManagedEntityConfig other) {
-    this.host = other.getHost();
-    this.workingDirectory = other.getWorkingDirectory();
-    this.productDirectory = other.getProductDirectory();
-    this.remoteCommand = other.getRemoteCommand();
-  }
-
-  //////////////////// Instance Methods ////////////////////
-
-  /**
-   * Checks to see if this config object is "read only". If it is, then an
-   * {@link IllegalStateException} is thrown. It should be called by every setter method.
-   *
-   * @see #isReadOnly
-   */
-  public void checkReadOnly() {
-    if (this.isReadOnly()) {
-      throw new IllegalStateException(
-          LocalizedStrings.ManagedEntityConfigImpl_THIS_CONFIGURATION_CANNOT_BE_MODIFIED_WHILE_ITS_MANAGED_ENTITY_IS_RUNNING
-              .toLocalizedString());
-    }
-  }
-
-  /**
-   * Returns whether or not this <code>ManagedEntityConfigImpl</code> is read-only (can be
-   * modified).
-   */
-  protected boolean isReadOnly() {
-    return this.entity != null && this.entity.isRunning();
-  }
-
-  /**
-   * Sets the entity that is configured by this config object. Once the entity is running, the
-   * config object cannot be modified.
-   *
-   * @see #checkReadOnly
-   */
-  public void setManagedEntity(InternalManagedEntity entity) {
-    this.entity = entity;
-  }
-
-  /**
-   * Notifies any configuration listeners that this configuration has changed.
-   */
-  protected abstract void configChanged();
-
-  public String getHost() {
-    return this.host;
-  }
-
-  public void setHost(String host) {
-    checkReadOnly();
-    this.host = host;
-    configChanged();
-  }
-
-  public String getWorkingDirectory() {
-    String dir = this.workingDirectory;
-    return dir;
-  }
-
-  public void setWorkingDirectory(String workingDirectory) {
-    checkReadOnly();
-    this.workingDirectory = workingDirectory;
-    configChanged();
-  }
-
-  public String getProductDirectory() {
-    return this.productDirectory;
-  }
-
-  public void setProductDirectory(String productDirectory) {
-    checkReadOnly();
-    this.productDirectory = productDirectory;
-    configChanged();
-  }
-
-  public String getRemoteCommand() {
-    return this.remoteCommand;
-  }
-
-  public void setRemoteCommand(String remoteCommand) {
-    checkReadOnly();
-    this.remoteCommand = remoteCommand;
-    configChanged();
-  }
-
-  /**
-   * Validates this configuration.
-   *
-   * @throws IllegalStateException If this config is not valid
-   */
-  public void validate() {
-    if (InetAddressUtil.validateHost(this.host) == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.ManagedEntityConfigImpl_INVALID_HOST_0.toLocalizedString(this.host));
-    }
-  }
-
-  @Override
-  public Object clone() throws CloneNotSupportedException {
-    // Since all fields are immutable objects, no deep cloning is
-    // necessary.
-    ManagedEntityConfigImpl clone = (ManagedEntityConfigImpl) super.clone();
-    clone.entity = null;
-    return clone;
-  }
-
-  @Override
-  public String toString() {
-    String className = this.getClass().getName();
-    int index = className.lastIndexOf('.');
-    className = className.substring(index + 1);
-
-    StringBuffer sb = new StringBuffer();
-    sb.append(className);
-
-    sb.append(" host=");
-    sb.append(this.getHost());
-    sb.append(" workingDirectory=");
-    sb.append(this.getWorkingDirectory());
-    sb.append(" productDirectory=");
-    sb.append(this.getProductDirectory());
-    sb.append(" remoteCommand=\"");
-    sb.append(this.getRemoteCommand());
-    sb.append("\"");
-
-    return sb.toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXml.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXml.java b/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXml.java
deleted file mode 100644
index 4e5198e..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXml.java
+++ /dev/null
@@ -1,169 +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.admin.internal;
-
-import org.apache.geode.distributed.ConfigurationProperties;
-import org.apache.geode.internal.ClassPathLoader;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.xml.sax.*;
-
-import java.io.InputStream;
-
-/**
- * The abstract superclass of classes that convert XML into a
- * {@link org.apache.geode.admin.DistributedSystemConfig} and vice versa. It provides helper methods
- * and constants.
- *
- * @since GemFire 4.0
- */
-abstract class ManagedEntityConfigXml implements EntityResolver, ErrorHandler {
-
-  /** The location of the DTD file */
-  protected static final String DTD_LOCATION = "/org/apache/geode/admin/doc-files/ds5_0.dtd";
-
-  /** The URL for the DTD */
-  protected static final String SYSTEM_ID = "http://www.gemstone.com/dtd/ds5_0.dtd";
-
-  /** The public ID for the DTD */
-  protected static final String PUBLIC_ID =
-      "-//GemStone Systems, Inc.//GemFire Distributed System 5.0//EN";
-
-  /** The name of the <code>distributed-system</code> element. */
-  public static final String DISTRIBUTED_SYSTEM = "distributed-system";
-
-  /** The name of the <code>id</code> attribute. */
-  public static final String ID = "id";
-
-  /** The name of the <code>disable-tcp</code> attribute. */
-  public static final String DISABLE_TCP = "disable-tcp";
-
-  /** The name of the <code>remote-command</code> element. */
-  public static final String REMOTE_COMMAND = "remote-command";
-
-  /** The name of the <code>locators</code> element. */
-  public static final String LOCATORS = ConfigurationProperties.LOCATORS;
-
-  /** The name of the <code>ssl</code> element. */
-  public static final String SSL = "ssl";
-
-  /** The name of the <code>cache-server</code> element */
-  public static final String CACHE_SERVER = "cache-server";
-
-  /** The name of the <code>multicast</code> element */
-  public static final String MULTICAST = "multicast";
-
-  /** The name of the <code>locator</code> element */
-  public static final String LOCATOR = "locator";
-
-  /** The name of the <code>port</code> attribute */
-  public static final String PORT = "port";
-
-  /** The name of the <code>address</code> attribute */
-  public static final String ADDRESS = "address";
-
-  /** The name of the <code>host</code> element. */
-  public static final String HOST = "host";
-
-  /** The name of the <code>working-directory</code> element */
-  public static final String WORKING_DIRECTORY = "working-directory";
-
-  /** The name of the <code>product-directory</code> element */
-  public static final String PRODUCT_DIRECTORY = "product-directory";
-
-  /** The name of the <code>protocols</code> element */
-  public static final String PROTOCOLS = "protocols";
-
-  /** The name of the <code>ciphers</code> element */
-  public static final String CIPHERS = "ciphers";
-
-  /** The name of the <code>property</code> element */
-  public static final String PROPERTY = "property";
-
-  /** Name of the <code>authentication-required</code> attribute */
-  public static final String AUTHENTICATION_REQUIRED = "authentication-required";
-
-  /** The name of the <code>key</code> element */
-  public static final String KEY = "key";
-
-  /** The name of the <code>value</code> element */
-  public static final String VALUE = "value";
-
-  /** The name of the <code>classpath</code> element */
-  public static final String CLASSPATH = "classpath";
-
-  /////////////////////// Instance Methods ///////////////////////
-
-  /**
-   * Given a public id, attempt to resolve it to a DTD. Returns an <code>InputSoure</code> for the
-   * DTD.
-   */
-  public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
-
-    if (publicId == null || systemId == null) {
-      throw new SAXException(LocalizedStrings.ManagedEntityConfigXml_PUBLIC_ID_0_SYSTEM_ID_1
-          .toLocalizedString(new Object[] {publicId, systemId}));
-    }
-
-    // Figure out the location for the publicId.
-    String location = DTD_LOCATION;
-
-    InputSource result;
-    // if (location != null) (cannot be null)
-    {
-      InputStream stream = ClassPathLoader.getLatest().getResourceAsStream(getClass(), location);
-      if (stream != null) {
-        result = new InputSource(stream);
-      } else {
-        throw new SAXNotRecognizedException(
-            LocalizedStrings.ManagedEntityConfigXml_DTD_NOT_FOUND_0.toLocalizedString(location));
-      }
-
-      // } else {
-      // throw new
-      // SAXNotRecognizedException(LocalizedStrings.ManagedEntityConfigXml_COULD_NOT_FIND_DTD_FOR_0_1.toLocalizedString(new
-      // Object[] {publicId, systemId}));
-    }
-
-    return result;
-  }
-
-  /**
-   * Warnings are ignored
-   */
-  public void warning(SAXParseException ex) throws SAXException {
-
-  }
-
-  /**
-   * Throws a {@link org.apache.geode.cache.CacheXmlException}
-   */
-  public void error(SAXParseException ex) throws SAXException {
-    IllegalArgumentException ex2 = new IllegalArgumentException(
-        LocalizedStrings.ManagedEntityConfigXml_ERROR_WHILE_PARSING_XML.toLocalizedString());
-    ex2.initCause(ex);
-    throw ex2;
-  }
-
-  /**
-   * Throws a {@link org.apache.geode.cache.CacheXmlException}
-   */
-  public void fatalError(SAXParseException ex) throws SAXException {
-    IllegalArgumentException ex2 = new IllegalArgumentException(
-        LocalizedStrings.ManagedEntityConfigXml_FATAL_ERROR_WHILE_PARSING_XML.toLocalizedString());
-    ex2.initCause(ex);
-    throw ex2;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXmlGenerator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXmlGenerator.java b/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXmlGenerator.java
deleted file mode 100644
index 80732cc..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXmlGenerator.java
+++ /dev/null
@@ -1,364 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import javax.xml.transform.*;
-// import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamResult;
-import org.xml.sax.*;
-// import org.xml.sax.ext.*;
-import org.xml.sax.helpers.AttributesImpl;
-import java.io.*;
-import java.util.*;
-
-/**
- * Generates XML data that represents the managed entities in an
- * <code>AdminDistributedSystem</code>. This class is used mainly for testing.
- *
- * @since GemFire 4.0
- */
-public class ManagedEntityConfigXmlGenerator extends ManagedEntityConfigXml implements XMLReader {
-
-  /** An empty <code>Attributes</code> */
-  private static Attributes EMPTY = new AttributesImpl();
-
-  ///////////////////////// Instance Fields ////////////////////////
-
-  /**
-   * The <code>AdminDistributedSystem</code> for which we are generating XML
-   */
-  private AdminDistributedSystem system;
-
-  /** The content handler to which SAX events are generated */
-  private ContentHandler handler;
-
-  ///////////////////////// Static Methods ////////////////////////
-
-  /**
-   * Generates an XML representation of all of the managed entities in the given
-   * <code>AdminDistributedSystem</code>.
-   */
-  public static void generate(AdminDistributedSystem system, PrintWriter pw) {
-    (new ManagedEntityConfigXmlGenerator(system)).generate(pw);
-  }
-
-  ///////////////////////// Constructors //////////////////////////
-
-  /**
-   * Creates a new generator for the given <code>AdminDistributedSystem</code>.
-   */
-  private ManagedEntityConfigXmlGenerator(AdminDistributedSystem system) {
-    this.system = system;
-  }
-
-  /////////////////////// Instance Methods ///////////////////////
-
-  /**
-   * Generates XML and writes it to the given <code>PrintWriter</code>
-   */
-  private void generate(PrintWriter pw) {
-    // Use JAXP's transformation API to turn SAX events into pretty
-    // XML text
-    try {
-      Source src = new SAXSource(this, new InputSource());
-      Result res = new StreamResult(pw);
-
-      TransformerFactory xFactory = TransformerFactory.newInstance();
-      Transformer xform = xFactory.newTransformer();
-      xform.setOutputProperty(OutputKeys.METHOD, "xml");
-      xform.setOutputProperty(OutputKeys.INDENT, "yes");
-      xform.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, SYSTEM_ID);
-      xform.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, PUBLIC_ID);
-      xform.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
-      xform.transform(src, res);
-      pw.flush();
-
-    } catch (Exception ex) {
-      RuntimeException ex2 = new RuntimeException(
-          LocalizedStrings.ManagedEntityConfigXmlGenerator_EXCEPTION_THROWN_WHILE_GENERATING_XML
-              .toLocalizedString());
-      ex2.initCause(ex);
-      throw ex2;
-    }
-  }
-
-  /**
-   * Called by the transformer to parse the "input source". We ignore the input source and, instead,
-   * generate SAX events to the {@link #setContentHandler ContentHandler}.
-   */
-  public void parse(InputSource input) throws SAXException {
-    Assert.assertTrue(this.handler != null);
-
-    handler.startDocument();
-
-    AttributesImpl atts = new AttributesImpl();
-
-    atts.addAttribute("", "", ID, "", String.valueOf(this.system.getConfig().getSystemId()));
-
-    handler.startElement("", DISTRIBUTED_SYSTEM, DISTRIBUTED_SYSTEM, atts);
-
-    // Add generation methods here
-    try {
-      generateRemoteCommand();
-      generateDiscovery();
-      generateSSL();
-      generateCacheServers();
-
-    } catch (AdminException ex) {
-      throw new SAXException(
-          LocalizedStrings.ManagedEntityConfigXmlGenerator_AN_ADMINEXCEPTION_WAS_THROWN_WHILE_GENERATING_XML
-              .toLocalizedString(),
-          ex);
-    }
-
-    handler.endElement("", DISTRIBUTED_SYSTEM, DISTRIBUTED_SYSTEM);
-    handler.endDocument();
-  }
-
-  /**
-   * Generates XML for the remote command
-   */
-  private void generateRemoteCommand() throws SAXException {
-    String remoteCommand = this.system.getRemoteCommand();
-
-    handler.startElement("", REMOTE_COMMAND, REMOTE_COMMAND, EMPTY);
-
-    handler.characters(remoteCommand.toCharArray(), 0, remoteCommand.length());
-
-    handler.endElement("", REMOTE_COMMAND, REMOTE_COMMAND);
-  }
-
-  /**
-   * Generates XML for locators in the distributed system
-   */
-  private void generateDiscovery() throws SAXException {
-    handler.startElement("", LOCATORS, LOCATORS, EMPTY);
-
-    generateLocators();
-
-    handler.endElement("", LOCATORS, LOCATORS);
-  }
-
-  /**
-   * Generates XML for the distributed system's locators
-   */
-  private void generateLocators() throws SAXException {
-    DistributionLocator[] locators = this.system.getDistributionLocators();
-    for (int i = 0; i < locators.length; i++) {
-      generateLocator(locators[i].getConfig());
-    }
-  }
-
-  /**
-   * Generates XML for a locator
-   */
-  private void generateLocator(DistributionLocatorConfig config) throws SAXException {
-
-    AttributesImpl atts = new AttributesImpl();
-    atts.addAttribute("", "", PORT, "", String.valueOf(config.getPort()));
-
-    handler.startElement("", LOCATOR, LOCATOR, atts);
-
-    generateEntityConfig(config);
-
-    handler.endElement("", LOCATOR, LOCATOR);
-  }
-
-  /**
-   * Generates XML for attributes common to all managed entities.
-   */
-  private void generateEntityConfig(ManagedEntityConfig config) throws SAXException {
-
-    String host = config.getHost();
-    if (host != null) {
-      handler.startElement("", HOST, HOST, EMPTY);
-      handler.characters(host.toCharArray(), 0, host.length());
-      handler.endElement("", HOST, HOST);
-    }
-
-    String remoteCommand = config.getRemoteCommand();
-    if (remoteCommand != null) {
-      handler.startElement("", REMOTE_COMMAND, REMOTE_COMMAND, EMPTY);
-      handler.characters(remoteCommand.toCharArray(), 0, remoteCommand.length());
-      handler.endElement("", REMOTE_COMMAND, REMOTE_COMMAND);
-    }
-
-    String workingDirectory = config.getWorkingDirectory();
-    if (workingDirectory != null) {
-      handler.startElement("", WORKING_DIRECTORY, WORKING_DIRECTORY, EMPTY);
-      handler.characters(workingDirectory.toCharArray(), 0, workingDirectory.length());
-      handler.endElement("", WORKING_DIRECTORY, WORKING_DIRECTORY);
-    }
-
-    String productDirectory = config.getProductDirectory();
-    if (productDirectory != null) {
-      handler.startElement("", PRODUCT_DIRECTORY, PRODUCT_DIRECTORY, EMPTY);
-      handler.characters(productDirectory.toCharArray(), 0, productDirectory.length());
-      handler.endElement("", PRODUCT_DIRECTORY, PRODUCT_DIRECTORY);
-    }
-  }
-
-  /**
-   * Generates XML for the SSL configuration of the distributed system.
-   */
-  private void generateSSL() throws SAXException {
-    DistributedSystemConfig config = this.system.getConfig();
-
-    boolean sslEnabled = config.isSSLEnabled();
-    if (!sslEnabled) {
-      return;
-    }
-
-    AttributesImpl atts = new AttributesImpl();
-    atts.addAttribute("", "", AUTHENTICATION_REQUIRED, "",
-        String.valueOf(config.isSSLAuthenticationRequired()));
-
-    handler.startElement("", SSL, SSL, atts);
-
-    String protocols = config.getSSLProtocols();
-    if (protocols != null) {
-      handler.startElement("", PROTOCOLS, PROTOCOLS, EMPTY);
-      handler.characters(protocols.toCharArray(), 0, protocols.length());
-      handler.endElement("", PROTOCOLS, PROTOCOLS);
-    }
-
-    String ciphers = config.getSSLCiphers();
-    if (ciphers != null) {
-      handler.startElement("", CIPHERS, CIPHERS, EMPTY);
-      handler.characters(ciphers.toCharArray(), 0, ciphers.length());
-      handler.endElement("", CIPHERS, CIPHERS);
-    }
-
-    Properties sslProps = config.getSSLProperties();
-    for (Iterator iter = sslProps.entrySet().iterator(); iter.hasNext();) {
-      Map.Entry entry = (Map.Entry) iter.next();
-      String key = (String) entry.getKey();
-      String value = (String) entry.getValue();
-
-      handler.startElement("", PROPERTY, PROPERTY, EMPTY);
-
-      handler.startElement("", KEY, KEY, EMPTY);
-      handler.characters(key.toCharArray(), 0, key.length());
-      handler.endElement("", KEY, KEY);
-
-      handler.startElement("", VALUE, VALUE, EMPTY);
-      handler.characters(value.toCharArray(), 0, value.length());
-      handler.endElement("", VALUE, VALUE);
-
-      handler.endElement("", PROPERTY, PROPERTY);
-    }
-
-    handler.endElement("", SSL, SSL);
-  }
-
-  /**
-   * Generates an XML representation of the <code>CacheServer</code>s in the distributed system.
-   */
-  private void generateCacheServers() throws SAXException, AdminException {
-
-    CacheServer[] servers = this.system.getCacheServers();
-    for (int i = 0; i < servers.length; i++) {
-      generateCacheServer(servers[i].getConfig());
-    }
-  }
-
-  /**
-   * Generates an XML representation of a <code>CacheServerConfig</code>.
-   */
-  private void generateCacheServer(CacheServerConfig config) throws SAXException {
-
-    handler.startElement("", CACHE_SERVER, CACHE_SERVER, EMPTY);
-
-    generateEntityConfig(config);
-
-    String classpath = config.getClassPath();
-    if (classpath != null) {
-      handler.startElement("", CLASSPATH, CLASSPATH, EMPTY);
-      handler.characters(classpath.toCharArray(), 0, classpath.length());
-      handler.endElement("", CLASSPATH, CLASSPATH);
-    }
-
-    handler.endElement("", CACHE_SERVER, CACHE_SERVER);
-  }
-
-  /**
-   * Keep track of the content handler for use during {@link #parse(String)}.
-   */
-  public void setContentHandler(ContentHandler handler) {
-    this.handler = handler;
-  }
-
-  public ContentHandler getContentHandler() {
-    return this.handler;
-  }
-
-  public ErrorHandler getErrorHandler() {
-    return this;
-  }
-
-  ////////// Inherited methods that don't do anything //////////
-
-  public boolean getFeature(String name)
-      throws SAXNotRecognizedException, SAXNotSupportedException {
-    return false;
-  }
-
-  public void setFeature(String name, boolean value)
-      throws SAXNotRecognizedException, SAXNotSupportedException {
-
-  }
-
-  public Object getProperty(String name)
-      throws SAXNotRecognizedException, SAXNotSupportedException {
-
-    return null;
-  }
-
-  public void setProperty(String name, Object value)
-      throws SAXNotRecognizedException, SAXNotSupportedException {
-
-  }
-
-  public void setEntityResolver(EntityResolver resolver) {
-
-  }
-
-  public EntityResolver getEntityResolver() {
-    return this;
-  }
-
-  public void setDTDHandler(DTDHandler handler) {
-
-  }
-
-  public DTDHandler getDTDHandler() {
-    return null;
-  }
-
-  public void setErrorHandler(ErrorHandler handler) {
-
-  }
-
-  public void parse(String systemId) throws IOException, SAXException {
-
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXmlParser.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXmlParser.java b/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXmlParser.java
deleted file mode 100644
index 29b81f4..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityConfigXmlParser.java
+++ /dev/null
@@ -1,587 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import org.xml.sax.*;
-import org.xml.sax.helpers.DefaultHandler;
-import java.io.*;
-import java.util.*;
-
-/**
- * Parses an XML file and configures a {@link DistributedSystemConfig} from it.
- *
- * @since GemFire 4.0
- */
-public class ManagedEntityConfigXmlParser extends ManagedEntityConfigXml implements ContentHandler {
-
-  /** The <code>DistributedSystemConfig</code> to be configured */
-  private DistributedSystemConfig config;
-
-  /** The stack of intermediate values used while parsing */
-  private Stack stack = new Stack();
-
-  ////////////////////// Static Methods //////////////////////
-
-  /**
-   * Parses XML data and from it configures a <code>DistributedSystemConfig</code>.
-   *
-   * @throws AdminXmlException If an error is encountered while parsing the XML
-   */
-  public static void parse(InputStream is, DistributedSystemConfig config) {
-    ManagedEntityConfigXmlParser handler = new ManagedEntityConfigXmlParser();
-    handler.config = config;
-
-    try {
-      SAXParserFactory factory = SAXParserFactory.newInstance();
-      factory.setValidating(true);
-      SAXParser parser = factory.newSAXParser();
-      parser.parse(is, new DefaultHandlerDelegate(handler));
-
-    } catch (Exception ex) {
-      if (ex instanceof AdminXmlException) {
-        throw (AdminXmlException) ex;
-
-      } else if (ex.getCause() instanceof AdminXmlException) {
-        throw (AdminXmlException) ex.getCause();
-
-      } else if (ex instanceof SAXException) {
-        // Silly JDK 1.4.2 XML parser wraps RunTime exceptions in a
-        // SAXException. Pshaw!
-
-        SAXException sax = (SAXException) ex;
-        Exception cause = sax.getException();
-        if (cause instanceof AdminXmlException) {
-          throw (AdminXmlException) cause;
-        }
-      }
-
-      throw new AdminXmlException(
-          LocalizedStrings.ManagedEntityConfigXmlParser_WHILE_PARSING_XML.toLocalizedString(), ex);
-    }
-  }
-
-  /**
-   * Helper method for parsing an integer
-   *
-   * @throws org.apache.geode.cache.CacheXmlException If <code>s</code> is a malformed integer
-   */
-  private static int parseInt(String s) {
-    try {
-      return Integer.parseInt(s);
-
-    } catch (NumberFormatException ex) {
-      throw new AdminXmlException(
-          LocalizedStrings.ManagedEntityConfigXmlParser_MALFORMED_INTEGER_0.toLocalizedString(s),
-          ex);
-    }
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  // if (this.system.isMcastEnabled()) {
-  // generateMulticast();
-  // }
-
-  public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
-      throws SAXException {
-
-    if (qName.equals(DISTRIBUTED_SYSTEM)) {
-      startDistributedSystem(atts);
-
-    } else if (qName.equals(REMOTE_COMMAND)) {
-      startRemoteCommand(atts);
-
-    } else if (qName.equals(LOCATORS)) {
-      startLocators(atts);
-
-    } else if (qName.equals(MULTICAST)) {
-      startMulticast(atts);
-
-    } else if (qName.equals(LOCATOR)) {
-      startLocator(atts);
-
-    } else if (qName.equals(HOST)) {
-      startHost(atts);
-
-    } else if (qName.equals(WORKING_DIRECTORY)) {
-      startWorkingDirectory(atts);
-
-    } else if (qName.equals(PRODUCT_DIRECTORY)) {
-      startProductDirectory(atts);
-
-    } else if (qName.equals(SSL)) {
-      startSSL(atts);
-
-    } else if (qName.equals(PROTOCOLS)) {
-      startProtocols(atts);
-
-    } else if (qName.equals(CIPHERS)) {
-      startCiphers(atts);
-
-    } else if (qName.equals(PROPERTY)) {
-      startProperty(atts);
-
-    } else if (qName.equals(KEY)) {
-      startKey(atts);
-
-    } else if (qName.equals(VALUE)) {
-      startValue(atts);
-
-    } else if (qName.equals(CACHE_SERVER)) {
-      startCacheServer(atts);
-
-    } else if (qName.equals(CLASSPATH)) {
-      startClassPath(atts);
-
-    } else {
-      throw new AdminXmlException(
-          LocalizedStrings.ManagedEntityConfigXmlParser_UNKNOWN_XML_ELEMENT_0
-              .toLocalizedString(qName));
-    }
-  }
-
-  public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
-
-    if (qName.equals(DISTRIBUTED_SYSTEM)) {
-      endDistributedSystem();
-
-    } else if (qName.equals(REMOTE_COMMAND)) {
-      endRemoteCommand();
-
-    } else if (qName.equals(LOCATORS)) {
-      endLocators();
-
-    } else if (qName.equals(MULTICAST)) {
-      endMulticast();
-
-    } else if (qName.equals(LOCATOR)) {
-      endLocator();
-
-    } else if (qName.equals(HOST)) {
-      endHost();
-
-    } else if (qName.equals(WORKING_DIRECTORY)) {
-      endWorkingDirectory();
-
-    } else if (qName.equals(PRODUCT_DIRECTORY)) {
-      endProductDirectory();
-
-    } else if (qName.equals(SSL)) {
-      endSSL();
-
-    } else if (qName.equals(PROTOCOLS)) {
-      endProtocols();
-
-    } else if (qName.equals(CIPHERS)) {
-      endCiphers();
-
-    } else if (qName.equals(PROPERTY)) {
-      endProperty();
-
-    } else if (qName.equals(KEY)) {
-      endKey();
-
-    } else if (qName.equals(VALUE)) {
-      endValue();
-
-    } else if (qName.equals(CACHE_SERVER)) {
-      endCacheServer();
-
-    } else if (qName.equals(CLASSPATH)) {
-      endClassPath();
-
-    } else {
-      throw new AdminXmlException(
-          LocalizedStrings.ManagedEntityConfigXmlParser_UNKNOWN_XML_ELEMENT_0
-              .toLocalizedString(qName));
-    }
-  }
-
-  /**
-   * When a <code>distributed-system</code> element is encountered, we push the
-   * <code>DistributedSystemConfig</code> on the stack.
-   */
-  private void startDistributedSystem(Attributes atts) {
-    Assert.assertTrue(stack.isEmpty());
-
-    String id = atts.getValue(ID);
-    if (id != null) {
-      this.config.setSystemId(id);
-    }
-
-    String disable_tcp = atts.getValue(DISABLE_TCP);
-    if (disable_tcp != null) {
-      this.config.setDisableTcp(DISABLE_TCP.equalsIgnoreCase("true"));
-    }
-
-    stack.push(this.config);
-  }
-
-  /**
-   * When a <code>distributed-system</code> element is finished
-   */
-  private void endDistributedSystem() {
-
-  }
-
-  /**
-   * When a <code>multicast</code> is first encountered, get the
-   * <code>DistributedSystemConfig</code> off of the top of the stack and set its multicast config
-   * appropriately.
-   */
-  private void startMulticast(Attributes atts) {
-    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
-
-    String port = atts.getValue(PORT);
-    config.setMcastPort(parseInt(port));
-
-    String address = atts.getValue(ADDRESS);
-    if (address != null) {
-      config.setMcastAddress(address);
-    }
-  }
-
-  private void endMulticast() {
-
-  }
-
-  /**
-   * Starts a <code>remote-command</code> element. The item on top of the stack may be a
-   * <code>DistributedSystemConfig</code> or it might be a <code>ManagedEntityConfig</code>.
-   */
-  private void startRemoteCommand(Attributes atts) {
-
-  }
-
-  /**
-   * Ends a <code>remote-command</code> element. Pop the command off the top of the stack and set it
-   * on the <code>DistributedSystemConfig</code> or it might be a <code>ManagedEntityConfig</code>
-   * on top of the stack.
-   */
-  private void endRemoteCommand() {
-    String remoteCommand = popString();
-    Object top = stack.peek();
-    Assert.assertTrue(top != null);
-
-    if (top instanceof DistributedSystemConfig) {
-      ((DistributedSystemConfig) top).setRemoteCommand(remoteCommand);
-
-    } else if (top instanceof ManagedEntityConfig) {
-      ((ManagedEntityConfig) top).setRemoteCommand(remoteCommand);
-
-    } else {
-      String s = "Did not expect a " + top.getClass().getName() + " on top of the stack";
-      Assert.assertTrue(false, s);
-    }
-  }
-
-  private void startLocators(Attributes atts) {
-
-  }
-
-  private void endLocators() {
-
-  }
-
-  private void startLocator(Attributes atts) {
-    String port = atts.getValue(PORT);
-
-    DistributedSystemConfig system = (DistributedSystemConfig) stack.peek();
-    system.setMcastPort(0);
-
-    DistributionLocatorConfig config = system.createDistributionLocatorConfig();
-
-    config.setPort(parseInt(port));
-
-    stack.push(config);
-  }
-
-  private void endLocator() {
-    Object o = stack.pop();
-    Assert.assertTrue(o instanceof DistributionLocatorConfig);
-  }
-
-  private void startHost(Attributes atts) {
-
-  }
-
-  /**
-   * We assume that there is a <code>ManagedEntityConfig</code> on top of the stack.
-   */
-  private void endHost() {
-    String host = popString();
-    ManagedEntityConfig config = (ManagedEntityConfig) stack.peek();
-    config.setHost(host);
-  }
-
-  private void startWorkingDirectory(Attributes atts) {
-
-  }
-
-  private void endWorkingDirectory() {
-    String workingDirectory = popString();
-    ManagedEntityConfig config = (ManagedEntityConfig) stack.peek();
-    config.setWorkingDirectory(workingDirectory);
-  }
-
-  private void startProductDirectory(Attributes atts) {
-
-  }
-
-  private void endProductDirectory() {
-    String productDirectory = popString();
-    ManagedEntityConfig config = (ManagedEntityConfig) stack.peek();
-    config.setProductDirectory(productDirectory);
-  }
-
-  private void startSSL(Attributes atts) {
-    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
-    config.setSSLEnabled(true);
-
-    String authenticationRequired = atts.getValue(AUTHENTICATION_REQUIRED);
-    config.setSSLAuthenticationRequired(Boolean.valueOf(authenticationRequired).booleanValue());
-  }
-
-  private void endSSL() {
-
-  }
-
-  private void startProtocols(Attributes atts) {
-
-  }
-
-  private void endProtocols() {
-    String protocols = popString();
-    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
-    config.setSSLProtocols(protocols);
-  }
-
-  private void startCiphers(Attributes atts) {
-
-  }
-
-  private void endCiphers() {
-    String ciphers = popString();
-    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
-    config.setSSLCiphers(ciphers);
-  }
-
-  private void startProperty(Attributes atts) {
-
-  }
-
-  private void endProperty() {
-    String value = popString();
-    String key = popString();
-    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
-    config.addSSLProperty(key, value);
-  }
-
-  private void startKey(Attributes atts) {
-
-  }
-
-  private void endKey() {
-    String key = popString();
-    stack.push(key);
-  }
-
-  private void startValue(Attributes atts) {
-
-  }
-
-  private void endValue() {
-    String value = popString();
-    stack.push(value);
-  }
-
-  private void startCacheServer(Attributes atts) {
-    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
-    CacheServerConfig server = config.createCacheServerConfig();
-    stack.push(server);
-  }
-
-  private void endCacheServer() {
-    /* CacheServerConfig server = (CacheServerConfig) */ stack.pop();
-  }
-
-  private void startClassPath(Attributes atts) {
-
-  }
-
-  private void endClassPath() {
-    String classpath = popString();
-    CacheServerConfig server = (CacheServerConfig) stack.peek();
-    server.setClassPath(classpath);
-  }
-
-  /**
-   * Pops a <code>String</code> off of the stack.
-   */
-  private String popString() {
-    Object o = stack.pop();
-
-    if (o instanceof StringBuffer) {
-      StringBuffer sb = (StringBuffer) o;
-      return sb.toString();
-
-    } else {
-      return (String) o;
-    }
-  }
-
-  /**
-   * Long strings in XML files may generate multiple <code>characters</code> callbacks. Coalesce
-   * multiple callbacks into one big string by using a <code>StringBuffer</code>. See bug 32122.
-   */
-  public void characters(char[] ch, int start, int length) throws SAXException {
-
-    Object top = stack.peek();
-
-    StringBuffer sb;
-    if (top instanceof StringBuffer) {
-      sb = (StringBuffer) top;
-
-    } else {
-      sb = new StringBuffer();
-      stack.push(sb);
-    }
-
-    sb.append(ch, start, length);
-  }
-
-  ////////// Inherited methods that don't do anything //////////
-
-  public void setDocumentLocator(Locator locator) {}
-
-  public void startDocument() throws SAXException {}
-
-  public void endDocument() throws SAXException {}
-
-  public void startPrefixMapping(String prefix, String uri) throws SAXException {}
-
-  public void endPrefixMapping(String prefix) throws SAXException {}
-
-  public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {}
-
-  public void processingInstruction(String target, String data) throws SAXException {}
-
-  public void skippedEntity(String name) throws SAXException {}
-
-  /////////////////////// Inner Classes ///////////////////////
-
-  /**
-   * Class that delegates all of the methods of a {@link DefaultHandler} to a
-   * {@link ManagedEntityConfigXmlParser} that implements all of the methods of
-   * <code>DefaultHandler</code>, but <B>is not</B> a <code>DefaultHandler</code>.
-   */
-  static class DefaultHandlerDelegate extends DefaultHandler {
-    /**
-     * The <code>ManagedEntityConfigXmlParser</code> that does the real work
-     */
-    private ManagedEntityConfigXmlParser handler;
-
-    /**
-     * Creates a new <code>DefaultHandlerDelegate</code> that delegates to the given
-     * <code>ManagedEntityConfigXmlParser</code>.
-     */
-    public DefaultHandlerDelegate(ManagedEntityConfigXmlParser handler) {
-      this.handler = handler;
-    }
-
-    @Override
-    public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
-      return handler.resolveEntity(publicId, systemId);
-    }
-
-    @Override
-    public void setDocumentLocator(Locator locator) {
-      handler.setDocumentLocator(locator);
-    }
-
-    @Override
-    public void startDocument() throws SAXException {
-      handler.startDocument();
-    }
-
-    @Override
-    public void endDocument() throws SAXException {
-      handler.endDocument();
-    }
-
-    @Override
-    public void startPrefixMapping(String prefix, String uri) throws SAXException {
-      handler.startPrefixMapping(prefix, uri);
-    }
-
-    @Override
-    public void endPrefixMapping(String prefix) throws SAXException {
-      handler.endPrefixMapping(prefix);
-    }
-
-    @Override
-    public void startElement(String uri, String localName, String qName, Attributes attributes)
-        throws SAXException {
-      handler.startElement(uri, localName, qName, attributes);
-    }
-
-    @Override
-    public void endElement(String uri, String localName, String qName) throws SAXException {
-      handler.endElement(uri, localName, qName);
-    }
-
-    @Override
-    public void characters(char[] ch, int start, int length) throws SAXException {
-      handler.characters(ch, start, length);
-    }
-
-    @Override
-    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
-      handler.ignorableWhitespace(ch, start, length);
-    }
-
-    @Override
-    public void processingInstruction(String target, String data) throws SAXException {
-      handler.processingInstruction(target, data);
-    }
-
-    @Override
-    public void skippedEntity(String name) throws SAXException {
-      handler.skippedEntity(name);
-    }
-
-    @Override
-    public void warning(SAXParseException e) throws SAXException {
-      handler.warning(e);
-    }
-
-    @Override
-    public void error(SAXParseException e) throws SAXException {
-      handler.error(e);
-    }
-
-    @Override
-    public void fatalError(SAXParseException e) throws SAXException {
-      handler.fatalError(e);
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityController.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityController.java b/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityController.java
deleted file mode 100644
index 77a3998..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityController.java
+++ /dev/null
@@ -1,66 +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.admin.internal;
-
-import org.apache.geode.admin.DistributedSystemConfig;
-import org.apache.geode.admin.ManagedEntity;
-import org.apache.geode.admin.ManagedEntityConfig;
-
-/**
- * Defines the actual administration (starting, stopping, etc.) of GemFire {@link ManagedEntity}s.
- * 
- */
-interface ManagedEntityController {
-  /**
-   * Starts a managed entity.
-   */
-  public void start(final InternalManagedEntity entity);
-
-  /**
-   * Stops a managed entity.
-   */
-  public void stop(final InternalManagedEntity entity);
-
-  /**
-   * Returns whether or not a managed entity is running
-   */
-  public boolean isRunning(InternalManagedEntity entity);
-
-  /**
-   * Returns the contents of a locator's log file. Other APIs are used to get the log file of
-   * managed entities that are also system members.
-   */
-  public String getLog(DistributionLocatorImpl locator);
-
-  /**
-   * Returns the full path to the executable in <code>$GEMFIRE/bin</code> taking into account the
-   * {@linkplain ManagedEntityConfig#getProductDirectory product directory} and the platform's file
-   * separator.
-   *
-   * <P>
-   *
-   * Note: we should probably do a better job of determine whether or not the machine on which the
-   * entity runs is Windows or Linux.
-   *
-   * @param executable The name of the executable that resides in <code>$GEMFIRE/bin</code>.
-   */
-  public String getProductExecutable(InternalManagedEntity entity, String executable);
-
-  /**
-   * Builds optional SSL command-line arguments. Returns null if SSL is not enabled for the
-   * distributed system.
-   */
-  public String buildSSLArguments(DistributedSystemConfig config);
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityControllerFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityControllerFactory.java b/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityControllerFactory.java
deleted file mode 100755
index faa67c5..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedEntityControllerFactory.java
+++ /dev/null
@@ -1,63 +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.admin.internal;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.admin.AdminDistributedSystem;
-import org.apache.geode.admin.ManagedEntity;
-import org.apache.geode.internal.ClassPathLoader;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LogMarker;
-
-/**
- * Creates ManagedEntityController for administration (starting, stopping, etc.) of GemFire
- * {@link ManagedEntity}s.
- * 
- */
-public class ManagedEntityControllerFactory {
-
-  private static final Logger logger = LogService.getLogger();
-
-  private static final String ENABLED_MANAGED_ENTITY_CONTROLLER_CLASS_NAME =
-      "org.apache.geode.admin.internal.EnabledManagedEntityController";
-
-  static ManagedEntityController createManagedEntityController(
-      final AdminDistributedSystem system) {
-    if (isEnabledManagedEntityController()) {
-      logger.info(LogMarker.CONFIG,
-          "Local and remote OS command invocations are enabled for the Admin API.");
-      return createEnabledManagedEntityController(system);
-    } else {
-      logger.info(LogMarker.CONFIG,
-          "Local and remote OS command invocations are disabled for the Admin API.");
-      return new DisabledManagedEntityController();
-    }
-  }
-
-  public static boolean isEnabledManagedEntityController() {
-    try {
-      ClassPathLoader.getLatest().forName(ENABLED_MANAGED_ENTITY_CONTROLLER_CLASS_NAME);
-      return true;
-    } catch (ClassNotFoundException e) {
-      return false;
-    }
-  }
-
-  private static ManagedEntityController createEnabledManagedEntityController(
-      final AdminDistributedSystem system) {
-    return new EnabledManagedEntityController(system);
-  }
-}


[08/50] [abbrv] incubator-geode git commit: GEODE-2036 Fix documentation typo

Posted by kl...@apache.org.
GEODE-2036 Fix documentation typo

Removed an old documentation reference to GemFire.


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

Branch: refs/heads/feature/GEODE-288
Commit: f6b534d024fa692eb6b68d215db9d7d33af86ac3
Parents: ee0666a
Author: Karen Miller <km...@pivotal.io>
Authored: Wed Oct 26 09:36:58 2016 -0700
Committer: Karen Miller <km...@pivotal.io>
Committed: Wed Oct 26 09:43:54 2016 -0700

----------------------------------------------------------------------
 geode-docs/getting_started/querying_quick_reference.html.md.erb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f6b534d0/geode-docs/getting_started/querying_quick_reference.html.md.erb
----------------------------------------------------------------------
diff --git a/geode-docs/getting_started/querying_quick_reference.html.md.erb b/geode-docs/getting_started/querying_quick_reference.html.md.erb
index 7c684d9..5a117d2 100644
--- a/geode-docs/getting_started/querying_quick_reference.html.md.erb
+++ b/geode-docs/getting_started/querying_quick_reference.html.md.erb
@@ -583,7 +583,7 @@ QueryService qs = cache.getQueryService();
  qs.createKeyIndex("myKeyIndex", "id", "exampleRegion");
 ```
 
-For more information on using this API, see the [GemFire JavaDocs](/releases/latest/javadoc/index.html).
+For more information on using this API, see the [JavaDocs](/releases/latest/javadoc/index.html).
 
 **Sample XML**
 


[33/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/package.html
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/package.html b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/package.html
deleted file mode 100755
index bc2b2f2..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/package.html
+++ /dev/null
@@ -1,166 +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.
--->
-<HTML>
-<BODY>
-
-<P>Contains the implementation of the external JMX APIs from
-<a href="{@docRoot}/org/apache/geode/admin/jmx/package-summary.html#package_description">org.apache.geode.admin.jmx</a>.</P>
-
-<H2>JMX Support in GemFire</H2>
-
-Our goal was to provide JMX administrative support in GemFire.  The design was influenced by these important factors:
-<p>
-<ul>
-<li/>1) Requirement to not impact performance of the product
-<li/>2) Desire to introduce JMX without altering the existing product or the management console
-<li/>3) Similar functionality already existed in the console and the internal.admin pkg which the console uses
-<li/>4) Requirement to also introduce a simple and usable Admin API which or may not be related to JMX
-</ul>
-
-From a functional stand point, the JMX support was supposed to provide most of the same administrative and operational monitoring that the console already provides.  In some cases we limited the functionality due to security concerns and in others because it was hard to express the features as JMX beans.  The JMX Agent also provides some functionality (such as Health monitoring) that is not currently in the console.
-<p>
-The Agent communicates with the distributed system using the same distribution manager {@link org.apache.geode.distributed.internal.DistributionManager} as the console uses and thus has the same requirements that determine what distributed system it can manage.  Although the Console currently supports managing multiple distributed systems, we decided that a given Agent should only be able to manage a single system.  We have not tested the use of more than one Agent for the same system, however nothing currently prohibits this.
-<p>
-We decided to develop a simple public Admin API which in essence wraps the internal.admin API that the Console currently uses extensively.  The Admin API also contains implementations of new functionality not in internal.admin.  Our JMX support is an extension to this Admin API.  In an overly simplified view, the GemFire JMX MBeans are ModelMBeans that manage instances of the Admin API objects housed in the Agent's MBeanServer.
-<p>
-The selected architecture consists of a Daemon Agent, which exists in a separate VM that GemFire does not depend on.  This Agent hosts an MBeanServer, instances of any and all MBeans registered for managing a GemFire distributed system, and server connectors/adaptors that various types of clients can connect to.
-<p>
-The two server connectors we selected are the HttpAdaptor and the RMI Connector.  The HttpAdaptor provides an HTML user interface of all MBeans in the MBeanServer.  Although this generic UI is not as rich as an RMI client (or the GemFire Console) could be, it provides a functional and easy to use UI with no development required.  The JMX Remote specification details the standard connectors.  Although the HttpAdaptor is not required by this Sun spec. it is included in some form with all JMX implementations that I investigated.  It should be noted that our JMX Agent currently starts up the HttpAdaptor, but not the RMI Connector.  The latter is deferred as later work since some form of client must be developed for testing.  Further research may also uncover a generic, configurable open-source RMI client for JMX.  The GemFire Console could in theory be reworked as an RMI Connector client, but this is not currently planned.
-<p>
-Two open-source JMX implementations made it to our final review for consideration: <a href="http://www.xmojo.org">XMOJO</a> and <a href="http://www.mx4j.org">MX4J</a>.  The decision to go with MX4J was based mainly on our perceptions of MX4J being more active and widespread in use.  Additionally, XMOJO is associated with <a href="http://www.adventnet.com/">AdventNet</a> which produces commercial products.  This made MX4J seem more true to open-source and safer from corporate tampering.
-<p>
-ModelMBeans are very dynamic and capable of managing aggregate resources.  Use of a ModelMBean entails specifying meta-data to an instance of javax.management.modelmbean.RequiredModelMBean.  This meta-data identifies the manageble resource(s) which can consist of a single object, or many objects, including those in one VM or in any number of distributed VMs.  We decided to subclass classes in the Admin API in order to massage them a little and make them easier to use as a managed resource by the ModelMBean.  For example, org.apache.geode.admin.GemFireManager represents a type of member in a GemFire system which manages shared memory.  When an MBean is registered for managing the GemFireManager, the JMX Agent instantiates a "JMX friendlier" subclass: org.apache.geode.admin.jmx.internal.GemFireMangerJmxImpl.  Comparison of this class with the non-JMX super class org.apache.geode.admin.internal.GemFireManagerImpl will illustrate what "JMX friendly" means better than trying to explain i
 t here...
-<p>
-One standard approach to defining a ModelMBean is to programmatically
-build the necessary meta-data.  The folks on the Tomcat approach
-developed a better solution... an XML definition file which Jakarta
-Commons-Modeler parses to create the meta-data objects required to
-definie the ModelMBean.  We currently have our XML descriptor file at
-org.apache.geode.admin.jmx.mbeans-descriptors.xml.
-Commons-Modeler can be found at <A href="http://jakarta.apache.org/commons/modeler">http://jakarta.apache.org/commons/modeler/</A>
-<p>
-Here's a quick run-down of the Admin and JMX pkgs in GemFire...
-<p>
-<b>org.apache.geode.admin</b>
-<ul>
-<li/>interfaces describing GemFire entities and resources for managing or monitoring
-</ul>
-<p>
-<b>org.apache.geode.admin.internal</b>
-<ul>
-<li/>implementations of the admin pkg which could be used to managing GemFire
-<li/>recommendation is to create one set on non-JMX unit tests for these and then wrap that unit test within another test that is specific to its use in JMX
-</ul>
-<p>
-<b>org.apache.geode.admin.jmx</b>
-<ul>
-<li/>Commons-Modeler descriptor file mbeans-descriptors.xml
-<li/>AgentMBean - non-required interface that simply represents a public documentation of what the Agent does
-<li/>VersionMBean and Version - unused (but functional) examples of a standard MBean (other MBeans as defined in mbeans-descriptors.xml also provide version info)
-</ul>
-<p>
-<b>org.apache.geode.admin.jmx.internal</b>
-<ul>
-<li/>subclasses of org.apache.geode.admin.internal classes that use JMX services, implement ManagedResource, register ModelMBeans to manage themselves, and other JMX related details
-<li/>ManagedResource - simple interface we use to create a more uniform approach in using JMX
-<li/>Agent - application with main, registers HttpAdaptor, acts as a factory to DistributedSystemJmxImpl (which is the entry point to using JMX with a GemFire system)
-<li/>AgentConfig - configuration for Agent that reads/writes to a properties file
-<li/>MBeanUtil - utility class with static methods for defining MBeans, registering for timer-based refresh notifications, and lots of other JMX stuff
-<li/>StatisticAttributeInfo and ConfigAttributeInfo - these are the results of refactoring common code from some of the JmxImpl classes that required runtime dynamic (ie, not known at design time) MBean attributes
-<li/>SpecManagedBean - subclass of part of Commons-Modeler, this class acts as a workaround for a bug in Commons-Modeler (I hope to remove this after working with Jakarta-Commons to correct the bug)
-<li/>AgentPrintStream - this is a hack workaround for suppressing warnings from Xalan that derive from a purported incompatibility between the XSLT sheets in MX4J and the version of Xalan in JDK1.4.2 - experts with Xalan recommend upgrading to the very latest version of Xalan which is not currently desired for GemFire
-</ul>
-<p>
-<h3>Some caveats, workarounds, and GemFire bugs to be aware of:</h3>
-<p>
-1) MX4J uses XSLT style sheets that are intended to work with the latest version of Xalan.  JDK1.4.2 bundles an older version of Xalan which generates warnings.
-<p>
-2) MX4J's implementation of javax.management.modelmbean.RequiredModelMBean contains a bug such that any return type defined as an array of some object results in it attempting to Class.forName the class name with the "[]" still in the name of the class.  Our current workaround is to return java.lang.Object where we'd like to return an array of some non-primitive type.  I hope to look at this closer and work with MX4J to correct it (unless that latest code base at MX4J already has a fix).
-<p>
-3) Our MBeans currently have some return types of Admin interfaces and GemFire MBean types.  This is not recommended.  The correct approach is to return javax.management.ObjectName or an array of ObjectName so that remotability is not broken.  We have a bug filed to correct this in GemFire.
-<p>
-4) Commons-Modeler provides a simple, incomplete implementation of ModelMBean called org.apache.commons.modeler.BaseModelMBean. We decided to use the standard RequiredModelMBean which all JMX implementations are required to supply.  The JMX spec details several "managed resource types" that a ModelMBean can support.  ObjectReference is the type that both MX4J's RequiredModelMBean and Modeler's BaseModelMBean support.  However, MX4J is more strict in it's interpretation of the spec which spells it out as "ObjectReference".  Modeler's BaseModelMBean performs no enforcement and simply assumes it is managing type ObjectReference.  Modeler has a bug in org.apache.commons.modeler.ManagedBean because it specifies "objectReference" which is the incorrect case in comparison to the specification.  I intend to work with the Jakarta-Commons folks to change this to comply with the spec.  The Modeler will use BaseModelMBean by default even though it is actually depending on a JMX implementation s
 uch as MX4J or XMOJO.  org.apache.geode.admin.jmx.internal.MBeanUtil tells Modeler to use RequiredModelMBean instead and also uses org.apache.geode.admin.jmx.internal.SpecManagedBean as a workaround to the whole "objectReference" issue.  You could feasibly use org.apache.commons.modeler.BaseModelMBean or RequiredModelMBean.
-<p>
-
-<h3>Capabilities currently supported in GemFire via JMX:</h3>
-<ul>
-<li/>1) View overall system and its settings and start/stop all members
-<li/>2) View all managers and applications
-<li/>3) View and modify config (includes optional use of JMX Timer service to auto-refresh)
-<li/>4) View any statistics (includes optional use of JMX Timer service to auto-refresh)
-<li/>5) View member's cache and its statistics
-<li/>6) View a cache's region and its attributes, statistics, but not the data
-<li/>7) Health monitoring (ask David W. for more info... I haven't had a chance to look at this yet)
-<li/>8) Create, start, and stop managers
-</ul>
-<p>
-<h3>TODO:</h3>
-<ul>
-<li/>1) Creation and control of Locators
-<li/>2) Enable the RMI Connector and build tests
-<li/>3) Bind Address support (bug 30898)
-<li/>4) SSL Configuration support
-<li/>5) JMX Connector security
-<li/>6) more thorough automated tests!!
-<li/>7) Documentation of use w/ built-in Connectors (RMI and HTTP)
-<li/>8) Documentation of use w/ AdventNet SNMP Adaptor
-<li/>9) Documentation of use w/ selected commercial management products
-<li/>10) Determine high-availability requirements if any (mentioned by Jags)
-</ul>
-See also <a href="#deferred_ops">deferred backlog from Hardening/Operations sprint</a>
-<p>
-It's very easy to use the JMX Monitor service to monitor an MBean's attribute and fire JMX Notifications.  Statistics and Config Parameters are "MBean attributes".
-
-<p>
-<h3>Using Third Party Management Consoles/Tools</h3>
-There is information on <a href="http://www.adventnet.com/">AdventNet's website</a> detailing the use of their <a href="http://www.adventnet.com/products/snmpadaptor/index.html">SNMP Adaptor</a> to enable connectivity to <a href="http://www.openview.hp.com/">HP OpenView</a>, <a href="http://www.ibm.com/software/tivoli/">IBM Tivoli</a>, <a href="http://www3.ca.com/solutions/solution.asp?id=315">CA Unicenter</a>, and other SNMP managers.
-<p>
-Aside from using AdventNet's SNMP Adaptor, HPOpenView is the first I've seen of the big players offering what appears to be a way to plug our JMX support into their product for management of GemFire.  I haven't had a chance to look at it yet.  Most likely their <a href="http://www.openview.hp.com/products/spi/">SPI</a> supports writing a small amount of glue code to have their console become an RMI client to our JMX VM (which is essentially an MBeanServer "server" that hosts our MBeans).  I think it's unlikely that such vendors would want to support hosting of third party MBeans and the classpath/versioning headaches involved in that.  The JMX Remote specification really is meant to cover how such console's would perform the remote connections to custom MBeans in external VMs/products.  It is likely that the other management tool vendors such as Tivoli have a similar SPI available or in the works.
-<p>
-See HP Dev Resource Central's page on <a href="http://devresource.hp.com/jmx.htm">JMX</a> for info and links on using JMX to integrate with HP OpenView.  You can also sign up for <a href="http://www.hpdev.com/.docs/pg/5">HP Developer News</a>
-<p>
-<h3><a name="deferred_ops">Deferred Backlog from Hardening/Operations Sprint</a></h3>
-Note: some of these tasks may no longer be worded properly or even needed...
-<ul>
-<li/>Provide a consolidated view of all cache Regions via JMX
-<li/>Send an alert upon system failure, communication failure, etc.
-<li/>Monitor cache system failures, comm failures, loader failures, etc via JMX
-<li/>Detect/handle stuck shared memory locks via JMX
-<li/>Provide a "combination view" (distributed system-wide) of certain statistics via JMX
-<li/>Integrate with Tivoli and produce a document
-<li/>Test managing caches via JMX with a large number of Regions, Entries, etc.
-<li/>Create XDoclet module to auto-generate mbeans-descriptors.xml (Note: we're using JavaDoc 1.4.2 which is incompatible with XDoclet; Sun intends to restore compatibility in the next version of JavaDoc)
-<li/>Investigate AdventNet's JMX administration console
-<li/>View percentage of VM memory used by a Cache via JMX
-<li/>Investigate modifying the GemFire Console to use JMX
-<li/>Investigate providing secure management via JMX
-<li/>Document security usage for JMX management
-<li/>Investigate managing GemFire via BMC Patrol
-<li/>Investigate managing GemFire via HP OpenView
-<li/>Investigate managing GemFire via UniCenter
-<li/>Submit fix to Jakrta Commons-Modeler for ObjectReference fix in ManagedBean
-<li/>Submit fix to MX4J for classload error in RequiredModelMBean
-<li/>Enable the RMI Connector (currently commented out in Agent)
-<li/>Create tests for RMI Connector
-<li/>Document and JavaDoc usage of the RMI Connector
-<li/>Add support to MBeanUtil to determine which MBeanServer the Agent is in
-<li/>Correlate information from GemFire MBeans with MBeans from other products
-<li/>Test deploying GemFire MBeans into other products' MBean containers
-</ul>
-
-</BODY>
-</HTML>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/package.html
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/package.html b/geode-core/src/main/java/org/apache/geode/admin/jmx/package.html
deleted file mode 100755
index acbefa8..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/package.html
+++ /dev/null
@@ -1,28 +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.
--->
-<HTML>
-<BODY>
-
-<P>Provides administrative access to a GemFire distributed system via
-the Java Management Extensions (JMX).</P>
-
-<P>Click <A href="doc-files/mbeans-descriptions.html">here</A> for a
-description of the attributes, operations, and notifications of the
-GemFire JMX MBeans.</P>
-
-</BODY>
-</HTML>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/package.html
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/package.html b/geode-core/src/main/java/org/apache/geode/admin/package.html
deleted file mode 100644
index 29ce994..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/package.html
+++ /dev/null
@@ -1,78 +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.
--->
-<HTML>
-<BODY>
-
-<P>Provides an API for administering various GemFire components such
-as a GemFire distributed
-system, and processes that host GemFire Caches.</P>
-
-<H3>Administration of a GemFire Distributed System</H3>
-
-The Admin API provides interfaces for administrative control, 
-monitoring, and custom management of a GemFire system.
-<P>
-The {@link org.apache.geode.admin.AdminDistributedSystemFactory}
-is the starting point.  It creates an instance of
-<code>AdminDistributedSystem</code> that administers the distributed
-system to which a VM is {@linkplain
-org.apache.geode.distributed.DistributedSystem connected}.
-<P>
-<pre><code>
-DistributedSystem connection = DistributedSystem.connect(new Properties());
-AdminDistributedSystem system = 
-    AdminDistributedSystemFactory.getDistributedSystem(connection);
-system.connect(new File("admin.log"), "info");
-</code></pre>
-<P>
-This {@link org.apache.geode.admin.AdminDistributedSystem}
-interface exposes methods for such tasks as connecting to the system,
-merging system logs, getting administrative interfaces to 
-applications that host GemFire Caches.
-
-<H3>Monitoring the Health of GemFire</H3>
-
-<P>The {@link org.apache.geode.admin.GemFireHealth} interface
-allows the overall health of GemFire to be monitored.
-<code>GemFireHealth</code> monitors the behavior the members of a
-distributed system namely 
-application VMs that may host {@link org.apache.geode.cache.Cache
-cache} instances.  There are three levels of health: {@linkplain
-org.apache.geode.admin.GemFireHealth#GOOD_HEALTH good health} that
-indicates that all GemFire components are behaving reasonably,
-{@linkplain org.apache.geode.admin.GemFireHealth#OKAY_HEALTH okay
-health} that indicates that one or more GemFire components is slightly
-unhealthy and may need some attention, and {@linkplain
-org.apache.geode.admin.GemFireHealth#POOR_HEALTH poor health} that
-indicates that a GemFire component is unhealthy and needs immediate
-attention.</P>
-
-<P>Because each GemFire application has its own definition of what it
-means to be "healthy", the metrics that are used to determine health
-are configurable.  {@link
-org.apache.geode.admin.GemFireHealthConfig} provides methods for
-configuring how the health of {@linkplain
-org.apache.geode.admin.DistributedSystemHealthConfig the
-distributed system},
-{@linkplain org.apache.geode.admin.CacheHealthConfig members that
-host Cache instances}, and {@linkplain
-org.apache.geode.admin.MemberHealthConfig individual members} of
-the distributed system.  <code>GemFireHealthConfig</code> also allows
-you to configure how often GemFire's health is evaluated.</P>
-
-</BODY>
-</HTML>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/cache/Cache.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/Cache.java b/geode-core/src/main/java/org/apache/geode/cache/Cache.java
index bc4aa19..2c37ace 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/Cache.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/Cache.java
@@ -33,6 +33,7 @@ import org.apache.geode.cache.wan.GatewaySenderFactory;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.i18n.LogWriterI18n;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
 
 
 /**
@@ -277,8 +278,8 @@ public interface Cache extends GemFireCache {
   /**
    * Sets whether or not this <code>Cache</code> resides in a long-running "cache server" VM. A
    * cache server may be an application VM or may be a stand-along VM launched using
-   * {@linkplain org.apache.geode.admin.AdminDistributedSystem#addCacheServer administration API} or
-   * the <code>cacheserver</code> command line utility.
+   * {@linkplain AdminDistributedSystem#addCacheServer administration API} or the
+   * <code>cacheserver</code> command line utility.
    *
    * @since GemFire 4.0
    */

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java b/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
index 9bf7234..3856b61 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/persistence/ConflictingPersistentDataException.java
@@ -15,7 +15,6 @@
 package org.apache.geode.cache.persistence;
 
 import org.apache.geode.GemFireException;
-import org.apache.geode.admin.AdminDistributedSystem;
 
 /**
  * Thrown when a member with persistence is recovering, and it discovers that the data it has on

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/cache/persistence/PersistentID.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/persistence/PersistentID.java b/geode-core/src/main/java/org/apache/geode/cache/persistence/PersistentID.java
index 7cfbc82..e06709c 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/persistence/PersistentID.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/persistence/PersistentID.java
@@ -18,7 +18,7 @@ import java.net.InetAddress;
 import java.util.UUID;
 
 import org.apache.geode.DataSerializable;
-import org.apache.geode.admin.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
 import org.apache.geode.cache.DataPolicy;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/cache/persistence/RevokedPersistentDataException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/persistence/RevokedPersistentDataException.java b/geode-core/src/main/java/org/apache/geode/cache/persistence/RevokedPersistentDataException.java
index b0ce8d4..489962e 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/persistence/RevokedPersistentDataException.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/persistence/RevokedPersistentDataException.java
@@ -15,7 +15,7 @@
 package org.apache.geode.cache.persistence;
 
 import org.apache.geode.GemFireException;
-import org.apache.geode.admin.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
 
 /**
  * Thrown when a member with persistence is recovering, and it discovers that other members in the

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/distributed/DistributedSystem.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/DistributedSystem.java b/geode-core/src/main/java/org/apache/geode/distributed/DistributedSystem.java
index 20c948f..41f17ae 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/DistributedSystem.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/DistributedSystem.java
@@ -27,10 +27,12 @@ import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.Assert;
 import org.apache.geode.internal.ClassPathLoader;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminDistributedSystemFactory;
+import org.apache.geode.internal.admin.api.SystemMembershipEvent;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.tcp.ConnectionTable;
 import org.apache.geode.internal.util.IOUtils;
-import org.apache.geode.security.GemFireSecurityException;
 
 import java.io.File;
 import java.net.InetAddress;
@@ -46,8 +48,8 @@ import static org.apache.geode.distributed.ConfigurationProperties.*;
  * invoking the {@link #connect} method with a configuration as described
  * <a href="#configuration">below</a>. A <code>DistributedSystem</code> is used when calling
  * {@link org.apache.geode.cache.CacheFactory#create}. This class should not be confused with the
- * {@link org.apache.geode.admin.AdminDistributedSystem AdminDistributedSystem} interface that is
- * used for administering a distributed system.
+ * {@link AdminDistributedSystem AdminDistributedSystem} interface that is used for administering a
+ * distributed system.
  *
  * <P>
  *
@@ -136,8 +138,7 @@ public abstract class DistributedSystem implements StatisticsFactory {
    *         values will be considered <code>false</code> -- an exception will not be thrown.
    * @throws IllegalStateException If a <code>DistributedSystem</code> with a different
    *         configuration has already been created in this VM or if this VM is
-   *         {@link org.apache.geode.admin.AdminDistributedSystem administering} a distributed
-   *         system.
+   *         {@link AdminDistributedSystem administering} a distributed system.
    * @throws org.apache.geode.GemFireIOException Problems while reading configuration properties
    *         file or while opening the log file.
    * @throws org.apache.geode.GemFireConfigException The distribution transport is not configured
@@ -309,7 +310,7 @@ public abstract class DistributedSystem implements StatisticsFactory {
   }
 
   /**
-   * see {@link org.apache.geode.admin.AdminDistributedSystemFactory}
+   * see {@link AdminDistributedSystemFactory}
    * 
    * @since GemFire 5.7
    */
@@ -324,28 +325,6 @@ public abstract class DistributedSystem implements StatisticsFactory {
     }
   }
 
-  // /**
-  // * Connects to a GemFire distributed system with a configuration
-  // * supplemented by the given properties.
-  // *
-  // * @param config
-  // * The <a href="#configuration">configuration properties</a>
-  // * used when connecting to the distributed system
-  // * @param callback
-  // * A user-specified object that is delivered with the {@link
-  // * org.apache.geode.admin.SystemMembershipEvent}
-  // * triggered by connecting.
-  // *
-  // * @see #connect(Properties)
-  // * @see org.apache.geode.admin.SystemMembershipListener#memberJoined
-  // *
-  // * @since GemFire 4.0
-  // */
-  // public static DistributedSystem connect(Properties config,
-  // Object callback) {
-  // throw new UnsupportedOperationException("Not implemented yet");
-  // }
-
   ////////////////////// Constructors //////////////////////
 
   /**
@@ -433,7 +412,7 @@ public abstract class DistributedSystem implements StatisticsFactory {
   /**
    * Returns a string that uniquely identifies this connection to the distributed system.
    *
-   * @see org.apache.geode.admin.SystemMembershipEvent#getMemberId
+   * @see SystemMembershipEvent#getMemberId
    *
    * @since GemFire 4.0
    * @deprecated as of GemFire 5.0, use {@link #getDistributedMember} instead

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionManager.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionManager.java
index 872016b..27f4e71 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionManager.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionManager.java
@@ -15,7 +15,7 @@
 package org.apache.geode.distributed.internal;
 
 import org.apache.geode.*;
-import org.apache.geode.admin.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.DistributedSystemDisconnectedException;
 import org.apache.geode.distributed.Locator;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/distributed/internal/HealthMonitor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/HealthMonitor.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/HealthMonitor.java
index 531dfaa..fa7b7a2 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/HealthMonitor.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/HealthMonitor.java
@@ -15,7 +15,7 @@
 
 package org.apache.geode.distributed.internal;
 
-import org.apache.geode.admin.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealth;
 
 /**
  * Represents a thread that monitor the health of the vm it lives in.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/distributed/internal/HealthMonitorImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/HealthMonitorImpl.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/HealthMonitorImpl.java
index 370d893..b5d2fba 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/HealthMonitorImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/HealthMonitorImpl.java
@@ -17,9 +17,9 @@ package org.apache.geode.distributed.internal;
 
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.admin.GemFireHealth;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.admin.internal.GemFireHealthEvaluator;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.impl.GemFireHealthEvaluator;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.admin.remote.HealthListenerMessage;
 import org.apache.geode.internal.i18n.LocalizedStrings;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index 800512d..7be2db8 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -52,7 +52,7 @@ import org.apache.geode.StatisticsType;
 import org.apache.geode.StatisticsTypeFactory;
 import org.apache.geode.SystemConnectException;
 import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.AlertLevel;
+import org.apache.geode.internal.admin.api.AlertLevel;
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.execute.internal.FunctionServiceManager;
@@ -73,6 +73,7 @@ import org.apache.geode.internal.DSFIDFactory;
 import org.apache.geode.internal.InternalDataSerializer;
 import org.apache.geode.internal.InternalInstantiator;
 import org.apache.geode.internal.SystemTimer;
+import org.apache.geode.internal.admin.api.AdminDistributedSystemFactory;
 import org.apache.geode.internal.admin.remote.DistributionLocatorId;
 import org.apache.geode.internal.cache.CacheConfig;
 import org.apache.geode.internal.cache.CacheServerImpl;
@@ -2964,7 +2965,7 @@ public class InternalDistributedSystem extends DistributedSystem
   }
 
   /**
-   * see {@link org.apache.geode.admin.AdminDistributedSystemFactory}
+   * see {@link AdminDistributedSystemFactory}
    * 
    * @since GemFire 5.7
    */

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java b/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java
index e13a2ad..f0bbd6d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java
@@ -23,20 +23,19 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
-import java.io.NotSerializableException;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 
 import org.apache.geode.DataSerializer;
 import org.apache.geode.InternalGemFireError;
-import org.apache.geode.admin.internal.FinishBackupRequest;
-import org.apache.geode.admin.internal.FinishBackupResponse;
-import org.apache.geode.admin.internal.FlushToDiskRequest;
-import org.apache.geode.admin.internal.FlushToDiskResponse;
-import org.apache.geode.admin.internal.PrepareBackupRequest;
-import org.apache.geode.admin.internal.PrepareBackupResponse;
-import org.apache.geode.admin.internal.SystemMemberCacheEventProcessor;
-import org.apache.geode.admin.jmx.internal.StatAlertNotification;
+import org.apache.geode.internal.admin.api.impl.FinishBackupRequest;
+import org.apache.geode.internal.admin.api.impl.FinishBackupResponse;
+import org.apache.geode.internal.admin.api.impl.FlushToDiskRequest;
+import org.apache.geode.internal.admin.api.impl.FlushToDiskResponse;
+import org.apache.geode.internal.admin.api.impl.PrepareBackupRequest;
+import org.apache.geode.internal.admin.api.impl.PrepareBackupResponse;
+import org.apache.geode.internal.admin.api.impl.SystemMemberCacheEventProcessor;
+import org.apache.geode.internal.admin.api.jmx.impl.StatAlertNotification;
 import org.apache.geode.cache.InterestResultPolicy;
 import org.apache.geode.cache.client.internal.CacheServerLoadMessage;
 import org.apache.geode.cache.client.internal.locator.ClientConnectionRequest;
@@ -76,7 +75,6 @@ import org.apache.geode.cache.query.internal.types.StructTypeImpl;
 import org.apache.geode.distributed.internal.DistributionAdvisor;
 import org.apache.geode.distributed.internal.HighPriorityAckedMessage;
 import org.apache.geode.distributed.internal.ReplyMessage;
-import org.apache.geode.distributed.internal.ReplyProcessor21;
 import org.apache.geode.distributed.internal.SerialAckedMessage;
 import org.apache.geode.distributed.internal.ShutdownMessage;
 import org.apache.geode.distributed.internal.StartupMessage;
@@ -397,7 +395,6 @@ import org.apache.geode.internal.cache.wan.parallel.ParallelQueueBatchRemovalMes
 import org.apache.geode.internal.cache.wan.parallel.ParallelQueueBatchRemovalMessage.BatchRemovalReplyMessage;
 import org.apache.geode.internal.cache.wan.parallel.ParallelQueueRemovalMessage;
 import org.apache.geode.internal.cache.wan.serial.BatchDestroyOperation;
-import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.management.internal.JmxManagerAdvisor.JmxManagerProfile;
 import org.apache.geode.management.internal.JmxManagerAdvisor.JmxManagerProfileMessage;
 import org.apache.geode.management.internal.JmxManagerLocatorRequest;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/MigrationServer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/MigrationServer.java b/geode-core/src/main/java/org/apache/geode/internal/MigrationServer.java
index 3cb3e61..feea5da 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/MigrationServer.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/MigrationServer.java
@@ -16,7 +16,7 @@ package org.apache.geode.internal;
 
 import static org.apache.geode.distributed.ConfigurationProperties.*;
 
-import org.apache.geode.admin.internal.InetAddressUtil;
+import org.apache.geode.internal.admin.api.impl.InetAddressUtil;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.Region;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/SystemAdmin.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/SystemAdmin.java b/geode-core/src/main/java/org/apache/geode/internal/SystemAdmin.java
index bdb635e..e67481e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/SystemAdmin.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/SystemAdmin.java
@@ -17,9 +17,9 @@ package org.apache.geode.internal;
 import static org.apache.geode.distributed.ConfigurationProperties.*;
 
 import org.apache.geode.*;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.BackupStatus;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.BackupStatus;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
 import org.apache.geode.cache.persistence.PersistentID;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.internal.*;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/ClientMembershipMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/ClientMembershipMessage.java b/geode-core/src/main/java/org/apache/geode/internal/admin/ClientMembershipMessage.java
index fce209a..172b4a7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/ClientMembershipMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/ClientMembershipMessage.java
@@ -19,7 +19,7 @@ import java.io.DataOutput;
 import java.io.IOException;
 
 import org.apache.geode.DataSerializer;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
 import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.distributed.internal.PooledDistributionMessage;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/GemFireVM.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/GemFireVM.java b/geode-core/src/main/java/org/apache/geode/internal/admin/GemFireVM.java
index cce0d0a..152cd77 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/GemFireVM.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/GemFireVM.java
@@ -15,16 +15,11 @@
 
 package org.apache.geode.internal.admin;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.GemFireHealth;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.admin.GemFireMemberStatus;
-import org.apache.geode.admin.RegionSubRegionSnapshot;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.GemFireMemberStatus;
+import org.apache.geode.internal.admin.api.RegionSubRegionSnapshot;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
@@ -154,17 +149,17 @@ public interface GemFireVM {
   public Config getConfig();
 
   /**
-   * Returns the runtime {@link org.apache.geode.admin.GemFireMemberStatus} from the vm The idea is
-   * this snapshot is similar to stats that represent the current state of a running VM. However,
-   * this is a bit higher level than a stat
+   * Returns the runtime {@link GemFireMemberStatus} from the vm The idea is this snapshot is
+   * similar to stats that represent the current state of a running VM. However, this is a bit
+   * higher level than a stat
    * 
    * @since GemFire 5.7
    */
   public GemFireMemberStatus getSnapshot();
 
   /**
-   * Returns the runtime {@link org.apache.geode.admin.RegionSubRegionSnapshot} from the vm The idea
-   * is this snapshot is quickly salvageable to present a cache's region's info
+   * Returns the runtime {@link RegionSubRegionSnapshot} from the vm The idea is this snapshot is
+   * quickly salvageable to present a cache's region's info
    * 
    * @since GemFire 5.7
    */

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/HealthListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/HealthListener.java b/geode-core/src/main/java/org/apache/geode/internal/admin/HealthListener.java
index 48d5020..2d8c4f4 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/HealthListener.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/HealthListener.java
@@ -15,12 +15,13 @@
 
 package org.apache.geode.internal.admin;
 
-import org.apache.geode.admin.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
 
 /**
  * Interface for those who want to be alerted of a change in a GemFireVM's health.
  *
- * @see org.apache.geode.admin.GemFireHealthConfig
+ * @see GemFireHealthConfig
  *
  * @since GemFire 3.5
  */

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/StatAlertsManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/StatAlertsManager.java b/geode-core/src/main/java/org/apache/geode/internal/admin/StatAlertsManager.java
index fecb952..48de7e6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/StatAlertsManager.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/StatAlertsManager.java
@@ -29,7 +29,7 @@ import org.apache.geode.CancelException;
 import org.apache.geode.StatisticDescriptor;
 import org.apache.geode.Statistics;
 import org.apache.geode.StatisticsType;
-import org.apache.geode.admin.jmx.internal.StatAlertsAggregator;
+import org.apache.geode.internal.admin.api.jmx.impl.StatAlertsAggregator;
 import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.SystemTimer;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminConfig.java
new file mode 100755
index 0000000..c6bd385
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminConfig.java
@@ -0,0 +1,148 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Date;
+
+
+/**
+ * AdminConfig loads/stores the member information list. The list contains all of the members being
+ * monitored.
+ *
+ * Config must be of the format:
+ * <p>
+ * <li>Name=What you want displayed as a name for the instance
+ * <li>Type=SERVER|CLIENT
+ * <li>Host=A valid hostname or IP Address where the instance is running
+ * <li>Port=The port you are using to open the monitor port for the instance
+ * 
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class AdminConfig {
+  // Name, Type, Host, Port
+  public static Entry[] loadConfig(File file) throws IOException {
+
+    // Place all lines into stack
+    ArrayList entryList = new ArrayList();
+    FileReader reader = null;
+    BufferedReader fileReader = null;
+    try {
+      reader = new FileReader(file);
+      fileReader = new BufferedReader(reader);
+      // Read the first line.
+      String line = fileReader.readLine();
+
+      while (line != null) {
+        line = line.trim();
+
+        // Replace tabs with spaces
+        line = line.replace('\t', ' ');
+
+        // Skip all empty and comment lines
+        if (line.length() != 0 && line.startsWith("#") == false) {
+          try {
+            entryList.add(new Entry(line));
+          } catch (Exception ex) {
+            // ignore - drop any lines that are not valid
+          }
+        }
+        line = fileReader.readLine();
+      }
+    } finally {
+      if (fileReader != null) {
+        fileReader.close();
+      }
+      if (reader != null) {
+        reader.close();
+      }
+    }
+
+    return (Entry[]) entryList.toArray(new Entry[0]);
+  }
+
+  public static void storeConfig(File file, AdminConfig.Entry entries[]) throws IOException {
+    FileOutputStream fos = null;
+    PrintStream ps = null;
+    try {
+      fos = new FileOutputStream(file);
+      ps = new PrintStream(fos);
+
+      // Header
+      ps.print("#");
+      ps.println(
+          LocalizedStrings.AdminConfig_THIS_FILE_IS_GENERATED_BY_ADMINCONSOLE_EDIT_AS_YOU_WISH_BUT_IT_WILL_BE_OVERWRITTEN_IF_IT_IS_MODIFIED_IN_ADMINCONSOLE
+              .toLocalizedString());
+      ps.println("#");
+      ps.println(LocalizedStrings.AdminConfig_MODIFIED_0.toLocalizedString(new Date()));
+      ps.println("#");
+      ps.println("# Name, Type, Host, Port");
+      ps.println("#");
+      int len = entries.length;
+      for (int i = 0; i < len; i++) {
+        ps.println(entries[i].toString());
+      }
+      ps.flush();
+    } finally {
+      if (ps != null) {
+        ps.close();
+      }
+      if (fos != null) {
+        fos.close();
+      }
+    }
+  }
+
+
+  public static class Entry {
+    public String name;
+    public String type;
+    public String host;
+    public int port;
+
+    public Entry(String line) {
+      // Split
+      String split[] = line.split(",");
+
+      // Convert line to parameters
+      name = split[0].trim();
+      type = split[1].trim();
+      host = split[2].trim();
+      port = Integer.parseInt(split[3]);
+    }
+
+    public Entry(String name, String type, String host, int port) {
+      this.name = name;
+      this.type = type;
+      this.host = host;
+      this.port = port;
+    }
+
+    @Override // GemStoneAddition
+    public String toString() {
+      return name + "," + type + "," + host + "," + port;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminDistributedSystem.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminDistributedSystem.java
new file mode 100755
index 0000000..5190de1
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminDistributedSystem.java
@@ -0,0 +1,433 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.cache.DataPolicy;
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedMember;
+
+import java.io.File;
+import java.net.InetAddress;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+/**
+ * Administrative interface for managing an entire GemFire distributed system. This interface should
+ * not be confused with {@link org.apache.geode.distributed.DistributedSystem DistributedSystem}
+ * that represents a connection to a GemFire distributed system.
+ *
+ * @see AdminDistributedSystemFactory
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface AdminDistributedSystem {
+
+  /**
+   * Retrieves the unique id for this system.
+   */
+  public String getId();
+
+  /**
+   * Retrieves display friendly name for this system. If this administrative VM defined an optional
+   * name for its connection to the distributed system, that name will be returned. Otherwise the
+   * returned value will be {@link AdminDistributedSystem#getId}.
+   */
+  public String getName();
+
+  /**
+   * Retrieves the remote command and formatting this system should use to access and/or manipulate
+   * resources on remote machines.
+   */
+  public String getRemoteCommand();
+
+  /**
+   * Sets the remote command and formatting this system should use to access and/or manipulate
+   * resources on remote machines.
+   */
+  public void setRemoteCommand(String remoteCommand);
+
+  /**
+   * Sets the lowest level of alert that should be delivered to the {@link AlertListener}s
+   * registered on this <code>AdminDistributedSystem</code>. The default level is
+   * {@link AlertLevel#WARNING}.
+   */
+  public void setAlertLevel(AlertLevel level);
+
+  /**
+   * Returns the lowest level of alerts that should be delivered to the {@link AlertListener}s
+   * registered on this <code>AdminDistributedSystem</code>.
+   *
+   * @see #setAlertLevel
+   */
+  public AlertLevel getAlertLevel();
+
+  /**
+   * Sets the lowest level of alert that should be delivered to the {@link AlertListener}s
+   * registered on this <code>AdminDistributedSystem</code>. The default level is
+   * {@link AlertLevel#WARNING}.
+   */
+  public void setAlertLevelAsString(String level);
+
+  /**
+   * Returns the lowest level of alerts that should be delivered to the {@link AlertListener}s
+   * registered on this <code>AdminDistributedSystem</code>.
+   *
+   * @see #setAlertLevelAsString
+   */
+  public String getAlertLevelAsString();
+
+  /**
+   * Registers an <code>AlertListener</code> that will receive all alerts that are at or above the
+   * {@linkplain #setAlertLevel alert level}.
+   */
+  public void addAlertListener(AlertListener listener);
+
+  /**
+   * Unregisters an <code>AlertListener</code>
+   */
+  public void removeAlertListener(AlertListener listener);
+
+  /**
+   * Retrieves the multicast address in use by this system.
+   */
+  public String getMcastAddress();
+
+  /**
+   * Retrieves the multicast port in use by this system.
+   */
+  public int getMcastPort();
+
+  /**
+   * Retrieves comma-delimited list locators to be used if multi-cast port is zero. Format of each
+   * locators must be host[port].
+   */
+  public String getLocators();
+
+  /**
+   * Returns true if this system has enabled the use of multicast for communications
+   */
+  public boolean isMcastEnabled();
+
+  /**
+   * Returns true if any members of this system are currently running.
+   */
+  public boolean isRunning();
+
+  /**
+   * Returns <code>true</code> if this is currently connected to the system.
+   */
+  public boolean isConnected();
+
+  /**
+   * Starts all managed entities that are not currently running.
+   *
+   * @throws AdminException If a problem is encountered while starting the managed entities.
+   */
+  public void start() throws AdminException;
+
+  /**
+   * Stops all managed entities that are currently running.
+   *
+   * @throws AdminException If a problem is encountered while starting the managed entities.
+   */
+  public void stop() throws AdminException;
+
+  /**
+   * Merges and returns all system logs as a single formatted log.
+   */
+  public String displayMergedLogs();
+
+  /**
+   * Retrieves the license information for this installation of GemFire.
+   *
+   * @deprecated Removed licensing in 8.0.
+   */
+  public java.util.Properties getLicense();
+
+  /**
+   * Creates a new <code>DistributionLocator</code> that is ready to
+   * {@linkplain DistributionLocator#getConfig configure} and {@linkplain #start start}.
+   *
+   * <P>
+   *
+   * It is presumed that the newly-added locator is used to discover members of the distributed
+   * system. That is, the host/port of the new locator is appended to the {@link #getLocators
+   * locators} attribute of this <code>AdminDistributedSystem</code>.
+   */
+  public DistributionLocator addDistributionLocator();
+
+  /**
+   * Returns array of <code>DistributionLocator</code>s administered by this
+   * <code>AdminDistributedSystem</code>.
+   */
+  public DistributionLocator[] getDistributionLocators();
+
+  /**
+   * Retrieves SystemMember instances for every application that is running and currently connection
+   * to this system. Note that this list does not include dedicated {@linkplain #getCacheVms cache
+   * server vms}.
+   */
+  public SystemMember[] getSystemMemberApplications() throws AdminException;
+
+  /**
+   * Display in readable format the latest Alert in this distributed system.
+   */
+  public String getLatestAlert();
+
+  /**
+   * Returns an object for monitoring the health of GemFire.
+   */
+  public GemFireHealth getGemFireHealth();
+
+  /**
+   * Connects to the distributed system. This method will return immediately after spawning a
+   * background thread that connects to the distributed system. As a result, a
+   * <code>AdminDistributedSystem</code> can be "connected" to before any members of the system have
+   * been started or have been seen. The {@link #waitToBeConnected} method will wait for the
+   * connection to be made.
+   *
+   * @see #isConnected
+   * @see #isRunning
+   * @see #waitToBeConnected
+   */
+  public void connect();
+
+  /**
+   * Wait for up to a given number of milliseconds for the connection to the distributed system to
+   * be made.
+   *
+   * @param timeout The number of milliseconds to wait for the connection to to be made.
+   *
+   * @return Whether or not the connection was made. <code>false</code>, if the method times out
+   *
+   * @throws InterruptedException If the thread invoking this method is interrupted while waiting.
+   * @throws IllegalStateException If {@link #connect} has not yet been called.
+   */
+  public boolean waitToBeConnected(long timeout) throws InterruptedException;
+
+  /**
+   * Disconnects from the distributed system.
+   */
+  public void disconnect();
+
+  /** Returns this system's configuration . */
+  public DistributedSystemConfig getConfig();
+
+  /**
+   * Registers a listener that receives callbacks when a member joins or leaves the distributed
+   * system.
+   */
+  public void addMembershipListener(SystemMembershipListener listener);
+
+  /**
+   * Unregisters a membership listener
+   *
+   * @see #addMembershipListener
+   */
+  public void removeMembershipListener(SystemMembershipListener listener);
+
+  /**
+   * Registers a cache event listener. Does nothing if the listener is already registered. The
+   * listeners are called in the order they are registered.
+   * 
+   * @param listener the listener to register.
+   * @since GemFire 5.0
+   */
+  public void addCacheListener(SystemMemberCacheListener listener);
+
+  /**
+   * Unregisters a cache listener. Does nothing if the listener is not registered.
+   * 
+   * @param listener the listener to unregister.
+   * @since GemFire 5.0
+   */
+  public void removeCacheListener(SystemMemberCacheListener listener);
+
+  /**
+   * Creates a new cache server that is ready to {@linkplain CacheServerConfig configure} and
+   * {@linkplain #start start}.
+   *
+   * @since GemFire 4.0
+   * @deprecated as of 5.7 use {@link #addCacheVm} instead.
+   */
+  @Deprecated
+  public CacheServer addCacheServer() throws AdminException;
+
+  /**
+   * Returns all of the dedicated cache server members of the distributed system. Because they are
+   * not managed entities, application VMs that host a server cache are not included in the array.
+   *
+   * @since GemFire 4.0
+   * @deprecated as of 5.7 use {@link #getCacheVms} instead.
+   */
+  @Deprecated
+  public CacheServer[] getCacheServers() throws AdminException;
+
+  /**
+   * Returns all the cache server members of the distributed system which are hosting a client queue
+   * for the particular durable-client having the given durableClientId
+   * 
+   * @param durableClientId - durable-id of the client
+   * @return array of CacheServer(s) having the queue for the durable client
+   * @throws AdminException
+   *
+   * @since GemFire 5.6
+   */
+  public CacheServer[] getCacheServers(String durableClientId) throws AdminException;
+
+  /**
+   * Creates a new cache vm that is ready to {@linkplain CacheVmConfig configure} and
+   * {@linkplain #start start}.
+   *
+   * @since GemFire 5.7
+   */
+  public CacheVm addCacheVm() throws AdminException;
+
+  /**
+   * Returns all of the dedicated cache server vm members of the distributed system. Because they
+   * are not managed entities, application VMs that host a server cache are not included in the
+   * array.
+   *
+   * @since GemFire 5.7
+   */
+  public CacheVm[] getCacheVms() throws AdminException;
+
+  /**
+   * Returns the administrative SystemMember specified by the
+   * {@link org.apache.geode.distributed.DistributedMember}.
+   *
+   * @param distributedMember the distributed member to lookup
+   * @return administrative SystemMember for that distributed member
+   * @since GemFire 5.0
+   */
+  public SystemMember lookupSystemMember(DistributedMember distributedMember) throws AdminException;
+
+  /**
+   * Indicate to the distributed system that persistent files have been lost. When a member recovers
+   * from a set of persistent files, it will wait for other members that were also persisting the
+   * same region to start up. If the persistent files for those other members were lost, this method
+   * can be used to tell the remaining members to stop waiting for the lost data.
+   * 
+   * @param host The host of the member whose files were lost.
+   * @param directory The directory where those files resided.
+   * @since GemFire 6.5
+   * @deprecated use {@link #revokePersistentMember(UUID)} instead
+   */
+  public void revokePersistentMember(InetAddress host, String directory) throws AdminException;
+
+  /**
+   * Indicate to the distributed system that persistent files have been lost. When a member recovers
+   * from a set of persistent files, it will wait for other members that were also persisting the
+   * same region to start up. If the persistent files for those other members were lost, this method
+   * can be used to tell the remaining members to stop waiting for the lost data.
+   * 
+   * @param diskStoreID The unique id of the disk store which you are revoking. The unique id can be
+   *        discovered from {@link #getMissingPersistentMembers()}
+   * 
+   * @since GemFire 7.0
+   */
+  public void revokePersistentMember(UUID diskStoreID) throws AdminException;
+
+  /**
+   * Retrieve the set of persistent files that the existing members are waiting for. See
+   * {@link AdminDistributedSystem#revokePersistentMember(InetAddress, String)}
+   * 
+   * @return The persistent members that were known to the existing persistent members, when the
+   *         existing members were last online.
+   * @throws AdminException
+   * @since GemFire 6.5
+   * 
+   */
+  public Set<PersistentID> getMissingPersistentMembers() throws AdminException;
+
+  /**
+   * Shuts down all the members of the distributed system with a cache that the admin member is
+   * connected to, excluding the stand-alone locators. Calling this method will ensure that regions
+   * with the {@link DataPolicy#PERSISTENT_PARTITION} to be shutdown in a way which allows for a
+   * faster recovery when the members are restarted.
+   * 
+   * Killing individual members can lead to inconsistencies in the members persistent data, which
+   * gemfire repairs on startup. Calling shutDownAllMembers makes sure that the persistent files are
+   * consistent on shutdown, which makes recovery faster.
+   * 
+   * This is equivalent to calling shutDownAllMembers(0);
+   * 
+   * @return The set of members that were shutdown
+   * @since GemFire 6.5
+   */
+  public Set<DistributedMember> shutDownAllMembers() throws AdminException;
+
+  /**
+   * Shuts down all the members of the distributed system with a cache that the admin member is
+   * connected to, excluding the stand-alone locators. Calling this method will ensure that regions
+   * with the {@link DataPolicy#PERSISTENT_PARTITION} to be shutdown in a way which allows for a
+   * faster recovery when the members are restarted.
+   * 
+   * Killing individual members can lead to inconsistencies in the members persistent data, which
+   * gemfire repairs on startup. Calling shutDownAllMembers makes sure that the persistent files are
+   * consistent on shutdown, which makes recovery faster.
+   * 
+   * @param timeout The amount of time to wait (in milliseconds) for the shutdown all to complete.
+   * @return The set of members that were shutdown, or null if the timeout is exceeded.
+   * 
+   * @since GemFire 6.5
+   */
+  public Set<DistributedMember> shutDownAllMembers(long timeout) throws AdminException;
+
+  /**
+   * Backup the persistent files for all of the members of the distributed system that the admin
+   * member is connected to.
+   * 
+   * @param targetDir The directory where each member's backup should be placed.
+   * 
+   * @return The status of the backup, which includes the set of members that were backed up and the
+   *         set of members that were known to be offline at the time of backup.
+   * @since GemFire 6.5
+   */
+  public BackupStatus backupAllMembers(File targetDir) throws AdminException;
+
+  /**
+   * Incrementally backup the persistent files for all of the members of the distributed system that
+   * the admin member is connected to. Only new operation log files since the previous backup will
+   * be copied during this backup. The generated restore script will reference and copy operation
+   * log files from the previous backup.
+   * 
+   * @param targetDir The directory where each member's backup should be placed.
+   * @param baselineDir The directory of a previous backup. If this parameter is null or the
+   *        directory does not exist (on a member by member basis) a full backup will be performed
+   *        for the member.
+   * 
+   * @return The status of the backup, which includes the set of members that were backed up and the
+   *         set of members that were known to be offline at the time of backup.
+   * @since GemFire 6.5
+   */
+  public BackupStatus backupAllMembers(File targetDir, File baselineDir) throws AdminException;
+
+  /**
+   * Compact the persistent files for all of the members of the distributed system that the admin
+   * member connected to.
+   * 
+   * This is equivalent to calling {DiskStore#forceCompaction} on all members.
+   * 
+   * @return The set of members that compacted their disk stores.
+   * @since GemFire 6.5
+   */
+  public Map<DistributedMember, Set<PersistentID>> compactAllDiskStores() throws AdminException;
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminDistributedSystemFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminDistributedSystemFactory.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminDistributedSystemFactory.java
new file mode 100755
index 0000000..b4ae72c
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminDistributedSystemFactory.java
@@ -0,0 +1,148 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.impl.DistributedSystemConfigImpl;
+import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionConfigImpl;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.i18n.LogWriterI18n;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LocalLogWriter;
+
+import java.util.Properties;
+
+/**
+ * Factory for creating GemFire administration entities.
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class AdminDistributedSystemFactory {
+
+  /**
+   * Sets the address this VM should bind to when connecting to the distributed system. This
+   * involves a system property, so using this option will limit all connections to distributed
+   * systems to this one network interface.
+   * <p>
+   * Using a null or empty bindAddress will clear the usage of this option and connections to
+   * distributed systems will return to using all available network interfaces.
+   * <p>
+   * This method always throws UnsupportedOperationException because it is now deprecated and is
+   * unsafe to use. Please use {@link DistributedSystemConfig#setBindAddress} instead.
+   *
+   * @param bindAddress machine name or IP address to bind to
+   * @throws UnsupportedOperationException because of deprecation
+   * @deprecated Use {@link DistributedSystemConfig#setBindAddress} instead.
+   */
+  @Deprecated
+  public static void bindToAddress(String bindAddress) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.AdminDistributedSystemFactory_PLEASE_USE_DISTRIBUTEDSYSTEMCONFIGSETBINDADDRESS_INSTEAD
+            .toLocalizedString());
+  }
+
+  /**
+   * Defines a "default" distributed system configuration based on VM system properties and the
+   * content of <code>gemfire.properties</code>. The
+   * {@linkplain DistributedSystemConfig#DEFAULT_REMOTE_COMMAND} default remote command is used.
+   *
+   * @see DistributedSystem#connect
+   */
+  public static DistributedSystemConfig defineDistributedSystem() {
+    DistributionConfig dc = new DistributionConfigImpl(new Properties());
+
+    String remoteCommand = DistributedSystemConfig.DEFAULT_REMOTE_COMMAND;
+    return new DistributedSystemConfigImpl(dc, remoteCommand);
+  }
+
+  /**
+   * Call this method with a value of <code>true</code> to dedicate the VM to GemFire administration
+   * only. Default is <code>false</code>.
+   * <p>
+   * This method <em>must</em> be called before calling {@link AdminDistributedSystem#connect}. It
+   * <em>must</em> also be called before {@link DistributedSystem#connect} is when creating a
+   * colocated distributed system.
+   * <p>
+   * Once it has been enabled be careful to only use GemFire APIs from the
+   * <code>org.apache.geode.internal.admin</code> package. In particular do not create a
+   * {@link org.apache.geode.cache.Cache} or a normal {@link DistributedSystem}.
+   * 
+   * @param adminOnly <code>true</code> if this VM should be limited to administration APIs;
+   *        <code>false</code> if this VM should allow all GemFire APIs.
+   * @throws IllegalStateException if a {@link DistributedSystem} or {@link AdminDistributedSystem}
+   *         connection already exists.
+   * 
+   * @since GemFire 5.7
+   */
+  public static void setEnableAdministrationOnly(boolean adminOnly) {
+    InternalDistributedSystem.setEnableAdministrationOnly(adminOnly);
+  }
+
+  /**
+   * Defines a distributed system configuration for administering the distributed system to which
+   * this VM is currently connected. The <code>DistributedSystem</code> is used to configure the
+   * discovery mechanism (multicast or locators), bind address, SSL attributes, as well as the
+   * logger of the <code>DistributedSystemConfig</code>. Note that the distributed system will not
+   * be able to be administered until the {@link AdminDistributedSystem#connect connect} method is
+   * invoked.
+   *
+   * @param system A connection to the distributed system
+   * @param remoteCommand The shell command that is used to launch processes that run on remote
+   *        machines. If <code>null</code>, then the
+   *        {@linkplain DistributedSystemConfig#DEFAULT_REMOTE_COMMAND default} will be used.
+   *
+   * @since GemFire 4.0
+   */
+  public static DistributedSystemConfig defineDistributedSystem(DistributedSystem system,
+      String remoteCommand) throws AdminException {
+
+    InternalDistributedSystem internal = (InternalDistributedSystem) system;
+    if (remoteCommand == null) {
+      remoteCommand = DistributedSystemConfig.DEFAULT_REMOTE_COMMAND;
+    }
+
+    DistributedSystemConfigImpl impl =
+        new DistributedSystemConfigImpl(internal.getConfig(), remoteCommand);
+    return impl;
+  }
+
+  /**
+   * Returns the distributed system for administrative monitoring and managing. You must then call
+   * {@link AdminDistributedSystem#connect} before interacting with the actual system.
+   *
+   * @param config configuration definition of the system to administer
+   * @return administrative interface for a distributed system
+   */
+  public static AdminDistributedSystem getDistributedSystem(DistributedSystemConfig config) {
+    return new AdminDistributedSystemImpl((DistributedSystemConfigImpl) config);
+  }
+
+  /**
+   * Returns a default GemFire LogWriterI18n for logging. This LogWriterI18n will log to standard
+   * out.
+   *
+   * @return a GemFire LogWriterI18n for logging
+   */
+  public static LogWriterI18n getLogWriter() {
+    return new LocalLogWriter(DistributionConfig.DEFAULT_LOG_LEVEL);
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminException.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminException.java
new file mode 100755
index 0000000..6244733
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminException.java
@@ -0,0 +1,81 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.GemFireCheckedException;
+
+/**
+ * An <code>AdminException</code> is thrown when administration or monitoring of GemFire fails.
+ *
+ * @since GemFire 3.5
+ *
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class AdminException extends GemFireCheckedException {
+  private static final long serialVersionUID = 879398950879472021L;
+
+  /**
+   * Constructs a new exception with <code>null</code> as its detail message. The cause is not
+   * initialized, and may subsequently be initialized by a call to {@link Throwable#initCause}.
+   */
+  public AdminException() {
+    super();
+  }
+
+  /**
+   * Constructs a new exception with the specified detail message. The cause is not initialized, and
+   * may subsequently be initialized by a call to {@link Throwable#initCause}.
+   *
+   * @param message the detail message. The detail message is saved for later retrieval by the
+   *        {@link #getMessage()} method.
+   */
+  public AdminException(String message) {
+    super(message);
+  }
+
+  /**
+   * Constructs a new exception with the specified detail message and cause.
+   * <p>
+   * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically
+   * incorporated in this exception's detail message.
+   *
+   * @param message the detail message (which is saved for later retrieval by the
+   *        {@link #getMessage()} method).
+   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
+   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
+   *        unknown.)
+   */
+  public AdminException(String message, Throwable cause) {
+    super(message, cause);
+  }
+
+  /**
+   * Constructs a new exception with the specified cause. The detail message will be
+   * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail
+   * message of <tt>cause</tt>). This constructor is useful for exceptions that are little more than
+   * wrappers for other throwables (for example, {@link java.security.PrivilegedActionException}).
+   *
+   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
+   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
+   *        unknown.)
+   */
+  public AdminException(Throwable cause) {
+    super(cause);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminXmlException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminXmlException.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminXmlException.java
new file mode 100644
index 0000000..0536946
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AdminXmlException.java
@@ -0,0 +1,44 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * Thrown when a problem is encountered while working with admin-related XML data.
+ *
+ * @see DistributedSystemConfig#getEntityConfigXMLFile
+ *
+ * @since GemFire 4.0
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class AdminXmlException extends RuntimeAdminException {
+  private static final long serialVersionUID = -6848726449157550169L;
+
+  /**
+   * Creates a new <code>AdminXmlException</code> with the given descriptive message.
+   */
+  public AdminXmlException(String s) {
+    super(s);
+  }
+
+  /**
+   * Creates a new <code>AdminXmlException</code> with the given descriptive message and cause.
+   */
+  public AdminXmlException(String s, Throwable cause) {
+    super(s, cause);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/Alert.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/Alert.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/Alert.java
new file mode 100755
index 0000000..e3fa0b3
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/Alert.java
@@ -0,0 +1,53 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * An administration alert that is issued by a member of a GemFire distributed system. It is similar
+ * to a {@linkplain org.apache.geode.i18n.LogWriterI18n log message}.
+ *
+ * @see AlertListener
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface Alert {
+
+  /** The level at which this alert is issued */
+  public AlertLevel getLevel();
+
+  /**
+   * The member of the distributed system that issued the alert, or null if the issuer is no longer
+   * a member of the distributed system.
+   */
+  public SystemMember getSystemMember();
+
+  /**
+   * The name of the {@linkplain org.apache.geode.distributed.DistributedSystem#getName distributed
+   * system}) through which the alert was issued.
+   */
+  public String getConnectionName();
+
+  /** The id of the source of the alert (such as a thread in a VM) */
+  public String getSourceId();
+
+  /** The alert's message */
+  public String getMessage();
+
+  /** The time at which the alert was issued */
+  public java.util.Date getDate();
+
+}


[21/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentImpl.java
new file mode 100644
index 0000000..6dbf134
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentImpl.java
@@ -0,0 +1,1624 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.rmi.server.RMIClientSocketFactory;
+import java.rmi.server.RMIServerSocketFactory;
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.Notification;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+import javax.management.OperationsException;
+import javax.management.ReflectionException;
+import javax.management.modelmbean.ModelMBean;
+import javax.management.remote.JMXConnectionNotification;
+import javax.management.remote.JMXConnectorServer;
+import javax.management.remote.JMXConnectorServerFactory;
+import javax.management.remote.JMXServiceURL;
+import javax.management.remote.rmi.RMIConnectorServer;
+import javax.rmi.ssl.SslRMIClientSocketFactory;
+
+import mx4j.tools.adaptor.http.HttpAdaptor;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.GemFireException;
+import org.apache.geode.GemFireIOException;
+import org.apache.geode.LogWriter;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.jmx.Agent;
+import org.apache.geode.internal.admin.api.jmx.AgentConfig;
+import org.apache.geode.internal.admin.api.jmx.AgentFactory;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.i18n.StringId;
+import org.apache.geode.internal.Banner;
+import org.apache.geode.internal.GemFireVersion;
+import org.apache.geode.internal.admin.remote.TailLogResponse;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.InternalLogWriter;
+import org.apache.geode.internal.logging.LogConfig;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.LogWriterFactory;
+import org.apache.geode.internal.logging.LoggingThreadGroup;
+import org.apache.geode.internal.logging.log4j.AlertAppender;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.geode.internal.logging.log4j.LogMarker;
+import org.apache.geode.internal.logging.log4j.LogWriterAppender;
+import org.apache.geode.internal.logging.log4j.LogWriterAppenders;
+
+/**
+ * The GemFire JMX Agent provides the ability to administrate one GemFire distributed system via
+ * JMX.
+ *
+ * @since GemFire 3.5
+ */
+public class AgentImpl implements Agent, ManagedResource {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /**
+   * MX4J HttpAdaptor only supports "basic" as an authentication method. Enabling HttpAdaptor
+   * authentication ({@link AgentConfig#HTTP_AUTHENTICATION_ENABLED_NAME}) causes the browser to
+   * require a login with username ({@link AgentConfig#HTTP_AUTHENTICATION_USER_NAME}) and password
+   * ({@link AgentConfig#HTTP_AUTHENTICATION_PASSWORD_NAME}).
+   */
+  private static final String MX4J_HTTPADAPTOR_BASIC_AUTHENTICATION = "basic";
+
+  /** JMX Service URL template for JMX/RMI Connector Server */
+  private static final String JMX_SERVICE_URL = "service:jmx:rmi://{0}:{1}/jndi/rmi://{2}:{3}{4}";
+
+  /**
+   * Set third-party logging configration: MX4J, Jakarta Commons-Logging.
+   */
+  static {
+    checkDebug();
+    String commonsLog = System.getProperty("org.apache.commons.logging.log");
+    if (commonsLog == null || commonsLog.length() == 0) {
+      System.setProperty("org.apache.commons.logging.log",
+          "org.apache.commons.logging.impl.SimpleLog");
+    }
+  }
+
+  /** Enables mx4j tracing if Agent debugging is enabled. */
+  private static void checkDebug() {
+    try {
+      if (Boolean.getBoolean("gfAgentDebug")) {
+        mx4j.log.Log.setDefaultPriority(mx4j.log.Logger.TRACE); // .DEBUG
+      }
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Throwable t) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      /* ignore */
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // Member variables
+  // -------------------------------------------------------------------------
+
+  /** This Agent's log writer */
+  private LogWriterAppender logWriterAppender;
+  private InternalLogWriter logWriter;
+
+  /** This Agent's JMX http adaptor from MX4J */
+  private HttpAdaptor httpAdaptor;
+
+  /** This Agent's RMI Connector Server from MX4J */
+  private JMXConnectorServer rmiConnector;
+
+  /** The name of the MBean manages this resource */
+  private final String mbeanName;
+
+  /** The ObjectName of the MBean that manages this resource */
+  private final ObjectName objectName;
+
+  /** The actual ModelMBean that manages this resource */
+  private ModelMBean modelMBean;
+
+  /** The configuration for this Agent */
+  private final AgentConfigImpl agentConfig;
+
+  /**
+   * The <code>AdminDistributedSystem</code> this Agent is currently connected to or
+   * <code>null</code>
+   */
+  private AdminDistributedSystem system;
+
+  /** The agent's configuration file */
+  private String propertyFile;
+
+  /**
+   * A lock object to guard the Connect and Disconnect calls being made on the agent for connections
+   * to the DS
+   **/
+  private Object CONN_SYNC = new Object();
+
+  protected MemberInfoWithStatsMBean memberInfoWithStatsMBean;
+
+  private MBeanServer mBeanServer;
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs a new Agent using the specified configuration.
+   *
+   * @param agentConfig instance of configuration for Agent
+   * @throws AdminException TODO-javadocs
+   * @throws IllegalArgumentException if agentConfig is null
+   */
+  public AgentImpl(AgentConfigImpl agentConfig) throws AdminException, IllegalArgumentException {
+    addShutdownHook();
+    if (agentConfig == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.AgentImpl_AGENTCONFIG_MUST_NOT_BE_NULL.toLocalizedString());
+    }
+    this.agentConfig = (AgentConfigImpl) agentConfig;
+    this.mbeanName = MBEAN_NAME_PREFIX + MBeanUtil.makeCompliantMBeanNameProperty("Agent");
+
+    try {
+      this.objectName = new ObjectName(this.mbeanName);
+    } catch (MalformedObjectNameException ex) {
+      String s = LocalizedStrings.AgentImpl_WHILE_CREATING_OBJECTNAME_0
+          .toLocalizedString(new Object[] {this.mbeanName});
+      throw new AdminException(s, ex);
+    }
+
+    this.propertyFile = this.agentConfig.getPropertyFile().getAbsolutePath();
+
+    // bind address only affects how the Agent VM connects to the system...
+    // It should be set only once in the agent lifecycle
+    this.agentConfig.setBindAddress(getBindAddress());
+
+    // LOG: create LogWriterAppender and LogWriterLogger
+    initLogWriter();
+
+    mBeanServer = MBeanUtil.start();
+
+    MBeanUtil.createMBean(this);
+
+    initializeHelperMbean();
+  }
+
+  private void initializeHelperMbean() {
+    try {
+      memberInfoWithStatsMBean = new MemberInfoWithStatsMBean(this);
+
+      MBeanServer mbs = getMBeanServer();
+      mbs.registerMBean(memberInfoWithStatsMBean, memberInfoWithStatsMBean.getObjectName());
+      /*
+       * We are not re-throwing these exceptions as failure create/register the GemFireTypesWrapper
+       * will not stop the Agent from working. But we are logging it as it could be an indication of
+       * some problem. Also not creating Localized String for the exception.
+       */
+    } catch (OperationsException e) {
+      logger.info(LocalizedMessage
+          .create(LocalizedStrings.AgentImpl_FAILED_TO_INITIALIZE_MEMBERINFOWITHSTATSMBEAN), e);
+    } catch (MBeanRegistrationException e) {
+      logger.info(LocalizedMessage
+          .create(LocalizedStrings.AgentImpl_FAILED_TO_INITIALIZE_MEMBERINFOWITHSTATSMBEAN), e);
+    } catch (AdminException e) {
+      logger.info(LocalizedMessage
+          .create(LocalizedStrings.AgentImpl_FAILED_TO_INITIALIZE_MEMBERINFOWITHSTATSMBEAN), e);
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // Public operations
+  // -------------------------------------------------------------------------
+
+  public AgentConfig getConfig() {
+    return this.agentConfig;
+  }
+
+  public AdminDistributedSystem getDistributedSystem() {
+    return this.system;
+  }
+
+  /**
+   * Persists the current Agent configuration to its property file.
+   *
+   * @throws GemFireIOException if unable to persist the configuration to props
+   * @see #getPropertyFile
+   */
+  public void saveProperties() {
+    throw new GemFireIOException("saveProperties is no longer supported for security reasons");
+  }
+
+  /**
+   * Starts the jmx agent
+   */
+  public void start() {
+    checkDebug();
+
+    this.agentConfig.validate();
+
+    if (mBeanServer == null) {
+      mBeanServer = MBeanUtil.start();
+    }
+
+    try {
+      startHttpAdaptor();
+    } catch (StartupException e) {
+      AlertAppender.getInstance().shuttingDown();
+      LogWriterAppenders.stop(LogWriterAppenders.Identifier.MAIN);
+      LogWriterAppenders.destroy(LogWriterAppenders.Identifier.MAIN);
+      throw e;
+    }
+
+    try {
+      startRMIConnectorServer();
+    } catch (StartupException e) {
+      stopHttpAdaptor();
+      AlertAppender.getInstance().shuttingDown();
+      LogWriterAppenders.stop(LogWriterAppenders.Identifier.MAIN);
+      LogWriterAppenders.destroy(LogWriterAppenders.Identifier.MAIN);
+      throw e;
+    }
+
+    try {
+      startSnmpAdaptor();
+    } catch (StartupException e) {
+      stopRMIConnectorServer();
+      stopHttpAdaptor();
+      AlertAppender.getInstance().shuttingDown();
+      LogWriterAppenders.stop(LogWriterAppenders.Identifier.MAIN);
+      LogWriterAppenders.destroy(LogWriterAppenders.Identifier.MAIN);
+      throw e;
+    }
+
+    if (this.agentConfig.getAutoConnect()) {
+      try {
+        connectToSystem();
+        /*
+         * Call Agent.stop() if connectToSystem() fails. This should clean up agent-DS connection &
+         * stop all the HTTP/RMI/SNMP adapters started earlier.
+         */
+      } catch (AdminException ex) {
+        logger.error(LocalizedMessage.create(LocalizedStrings.AgentImpl_AUTO_CONNECT_FAILED__0,
+            ex.getMessage()));
+        this.stop();
+        throw new StartupException(ex);
+      } catch (MalformedObjectNameException ex) {
+        StringId autoConnectFailed = LocalizedStrings.AgentImpl_AUTO_CONNECT_FAILED__0;
+        logger.error(LocalizedMessage.create(autoConnectFailed, ex.getMessage()));
+        this.stop();
+        throw new StartupException(new AdminException(
+            autoConnectFailed.toLocalizedString(new Object[] {ex.getMessage()}), ex));
+      }
+    } // getAutoConnect
+
+    logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_GEMFIRE_JMX_AGENT_IS_RUNNING));
+    LogWriterAppenders.startupComplete(LogWriterAppenders.Identifier.MAIN);
+
+    if (memberInfoWithStatsMBean == null) {
+      initializeHelperMbean();
+    }
+  }
+
+  /**
+   * Deregisters everything this Agent registered and releases the MBeanServer.
+   */
+  public void stop() {
+    try {
+      logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_STOPPING_JMX_AGENT));
+      AlertAppender.getInstance().shuttingDown();
+      LogWriterAppenders.stop(LogWriterAppenders.Identifier.MAIN);
+
+      // stop the GemFire Distributed System
+      stopDistributedSystem();
+
+      // stop all JMX Adaptors and Connectors...
+      stopHttpAdaptor();
+      stopRMIConnectorServer();
+      memberInfoWithStatsMBean = null;
+      stopSnmpAdaptor();
+
+      // release the MBeanServer for cleanup...
+      MBeanUtil.stop();
+      mBeanServer = null;
+
+      // remove the register shutdown hook which disconnects the Agent from the Distributed System
+      // upon JVM shutdown
+      removeShutdownHook();
+
+      logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_AGENT_HAS_STOPPED));
+    } finally {
+      LogWriterAppenders.destroy(LogWriterAppenders.Identifier.MAIN);
+      LoggingThreadGroup.cleanUpThreadGroups(); // bug35388 - logwriters accumulate, causing mem
+                                                // leak
+    }
+
+  }
+
+  private void stopDistributedSystem() {
+    // disconnect from the distributed system...
+    try {
+      disconnectFromSystem();
+    } catch (Exception e) {
+      // disconnectFromSystem already prints any Exceptions
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also catch VirtualMachineError (see above).
+      // However, there is _still_ a possibility that you are dealing with a cascading error
+      // condition,
+      // so you also need to check to see if the JVM is still usable:
+      SystemFailure.checkFailure();
+    }
+  }
+
+  public ObjectName manageDistributedSystem() throws MalformedObjectNameException {
+    synchronized (CONN_SYNC) {
+      if (isConnected()) {
+        return ((AdminDistributedSystemJmxImpl) this.system).getObjectName();
+      }
+      return null;
+    }
+  }
+
+  /**
+   * Connects to the DistributedSystem currently described by this Agent's attributes for
+   * administration and monitoring.
+   *
+   * @return the object name of the system that the Agent is now connected to
+   */
+  @edu.umd.cs.findbugs.annotations.SuppressWarnings(
+      value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD",
+      justification = "This is only a style warning.")
+  public ObjectName connectToSystem() throws AdminException, MalformedObjectNameException {
+    synchronized (CONN_SYNC) {
+      try {
+        if (isConnected()) {
+          return ((AdminDistributedSystemJmxImpl) this.system).getObjectName();
+        }
+
+        DistributionManager.isDedicatedAdminVM = true;
+
+        AdminDistributedSystemJmxImpl systemJmx = (AdminDistributedSystemJmxImpl) this.system;
+        if (systemJmx == null) {
+          systemJmx = (AdminDistributedSystemJmxImpl) createDistributedSystem(this.agentConfig);
+          this.system = systemJmx;
+        }
+        systemJmx.connect(this.logWriter);
+
+        return new ObjectName(systemJmx.getMBeanName());
+      } catch (AdminException e) {
+        logger.warn(e.getMessage(), e);
+        throw e;
+      } catch (RuntimeException e) {
+        logger.warn(e.getMessage(), e);
+        throw e;
+      } catch (VirtualMachineError err) {
+        SystemFailure.initiateFailure(err);
+        // If this ever returns, rethrow the error. We're poisoned
+        // now, so don't let this thread continue.
+        throw err;
+      } catch (Error e) {
+        // Whenever you catch Error or Throwable, you must also
+        // catch VirtualMachineError (see above). However, there is
+        // _still_ a possibility that you are dealing with a cascading
+        // error condition, so you also need to check to see if the JVM
+        // is still usable:
+        SystemFailure.checkFailure();
+        logger.error(e.getMessage(), e);
+        throw e;
+      }
+    }
+  }
+
+  /**
+   * Disconnects from the current DistributedSystem (if connected to one).
+   */
+  @edu.umd.cs.findbugs.annotations.SuppressWarnings(
+      value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD",
+      justification = "This is only a style warning.")
+  public void disconnectFromSystem() {
+    synchronized (CONN_SYNC) {
+      try {
+        if (this.system == null || !this.system.isConnected()) {
+          return;
+        }
+        ((AdminDistributedSystemJmxImpl) this.system).disconnect();
+        // this.system = null;
+      } catch (RuntimeException e) {
+        logger.warn(e.getMessage(), e);
+        throw e;
+      } catch (VirtualMachineError err) {
+        SystemFailure.initiateFailure(err);
+        // If this ever returns, rethrow the error. We're poisoned
+        // now, so don't let this thread continue.
+        throw err;
+      } catch (Error e) {
+        // Whenever you catch Error or Throwable, you must also
+        // catch VirtualMachineError (see above). However, there is
+        // _still_ a possibility that you are dealing with a cascading
+        // error condition, so you also need to check to see if the JVM
+        // is still usable:
+        SystemFailure.checkFailure();
+        logger.warn(e.getMessage(), e);
+        throw e;
+      } finally {
+        DistributionManager.isDedicatedAdminVM = false;
+      }
+    }
+  }
+
+  /**
+   * Retrieves a displayable snapshot of this Agent's log.
+   *
+   * @return snapshot of the current log
+   */
+  public String getLog() {
+    String childTail = tailFile(this.logWriterAppender.getChildLogFile());
+    String mainTail = tailFile(new File(this.agentConfig.getLogFile()));
+    if (childTail == null && mainTail == null) {
+      return LocalizedStrings.AgentImpl_NO_LOG_FILE_CONFIGURED_LOG_MESSAGES_WILL_BE_DIRECTED_TO_STDOUT
+          .toLocalizedString();
+    } else {
+      StringBuffer result = new StringBuffer();
+      if (mainTail != null) {
+        result.append(mainTail);
+      }
+      if (childTail != null) {
+        result
+            .append("\n" + LocalizedStrings.AgentImpl_TAIL_OF_CHILD_LOG.toLocalizedString() + "\n");
+        result.append(childTail);
+      }
+      return result.toString();
+    }
+  }
+
+  /**
+   * Retrieves display-friendly GemFire version information.
+   */
+  public String getVersion() {
+    return GemFireVersion.asString();
+  }
+
+  // -------------------------------------------------------------------------
+  // Public attribute accessors/mutators
+  // -------------------------------------------------------------------------
+
+  /** Returns true if this Agent is currently connected to a system. */
+  public boolean isConnected() {
+    boolean result = false;
+    synchronized (CONN_SYNC) {
+      result = ((this.system != null) && this.system.isConnected());
+    }
+    return result;
+  }
+
+  /**
+   * Gets the agent's property file. This is the file it will use when saving its configuration. It
+   * was also used when the agent started to initialize its configuration.
+   * 
+   * @return the agent's property file
+   */
+  public String getPropertyFile() {
+    return this.propertyFile;
+  }
+
+  /**
+   * Sets the agent's property file.
+   *
+   * @param value the name of the file to save the agent properties in.
+   * @throws IllegalArgumentException if the specified file is a directory.
+   * @throws IllegalArgumentException if the specified file's parent is not an existing directory.
+   */
+  public void setPropertyFile(String value) {
+    File f = (new File(value)).getAbsoluteFile();
+    if (f.isDirectory()) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.AgentImpl_THE_FILE_0_IS_A_DIRECTORY.toLocalizedString(f));
+    }
+    File parent = f.getParentFile();
+    if (parent != null) {
+      if (!parent.isDirectory()) {
+        throw new IllegalArgumentException(
+            LocalizedStrings.AgentImpl_THE_DIRECTORY_0_DOES_NOT_EXIST.toLocalizedString(parent));
+      }
+    }
+    this.propertyFile = f.getPath();
+  }
+
+  /**
+   * Gets the mcastAddress of the distributed system that this Agent is managing.
+   *
+   * @return The mcastAddress value
+   */
+  public String getMcastAddress() {
+    return this.agentConfig.getMcastAddress();
+  }
+
+  /**
+   * Sets the mcastAddress of the distributed system that this Agent is managing.
+   *
+   * @param mcastAddress The new mcastAddress value
+   */
+  public void setMcastAddress(String mcastAddress) {
+    this.agentConfig.setMcastAddress(mcastAddress);
+  }
+
+  /**
+   * Gets the mcastPort of the distributed system that this Agent is managing.
+   *
+   * @return The mcastPort value
+   */
+  public int getMcastPort() {
+    return this.agentConfig.getMcastPort();
+  }
+
+  /**
+   * Sets the mcastPort of the distributed system that this Agent is managing.
+   *
+   * @param mcastPort The new mcastPort value
+   */
+  public void setMcastPort(int mcastPort) {
+    this.agentConfig.setMcastPort(mcastPort);
+  }
+
+  /**
+   * Gets the locators of the distributed system that this Agent is managing.
+   * <p>
+   * Format is a comma-delimited list of "host[port]" entries.
+   *
+   * @return The locators value
+   */
+  public String getLocators() {
+    return this.agentConfig.getLocators();
+  }
+
+  /**
+   * Sets the locators of the distributed system that this Agent is managing.
+   * <p>
+   * Format is a comma-delimited list of "host[port]" entries.
+   *
+   * @param locators The new locators value
+   */
+  public void setLocators(String locators) {
+    this.agentConfig.setLocators(locators);
+  }
+
+  /**
+   * Gets the membership UDP port range in the distributed system that this Agent is monitoring.
+   * <p>
+   * This range is given as two numbers separated by a minus sign like "min-max"
+   *
+   * @return membership UDP port range
+   */
+  public String getMembershipPortRange() {
+    return this.agentConfig.getMembershipPortRange();
+  }
+
+  /**
+   * Sets the membership UDP port range in the distributed system that this Agent is monitoring.
+   * <p>
+   * This range is given as two numbers separated by a minus sign like "min-max"
+   *
+   * @param membershipPortRange membership UDP port range
+   */
+  public void setMembershipPortRange(String membershipPortRange) {
+    this.agentConfig.setMembershipPortRange(membershipPortRange);
+  }
+
+  /**
+   * Gets the bindAddress of the distributed system that this Agent is managing.
+   *
+   * @return The bindAddress value
+   */
+  public String getBindAddress() {
+    return this.agentConfig.getBindAddress();
+  }
+
+  /**
+   * Sets the bindAddress of the distributed system that this Agent is managing.
+   *
+   * @param bindAddress The new bindAddress value
+   */
+  public void setBindAddress(String bindAddress) {
+    this.agentConfig.setBindAddress(bindAddress);
+  }
+
+  /**
+   * Retrieves the command that the DistributedSystem will use to perform remote manipulation of
+   * config files and log files.
+   *
+   * @return the remote command for DistributedSystem
+   */
+  public String getRemoteCommand() {
+    return this.agentConfig.getRemoteCommand();
+  }
+
+  /**
+   * Sets the command that the DistributedSystem will use to perform remote manipulation of config
+   * files and log files.
+   *
+   * @param remoteCommand the remote command for DistributedSystem
+   */
+  public void setRemoteCommand(String remoteCommand) {
+    this.agentConfig.setRemoteCommand(remoteCommand);
+  }
+
+  /** Returns the system identity for the DistributedSystem */
+  public String getSystemId() {
+    return this.agentConfig.getSystemId();
+  }
+
+  /** Sets the system identity for the DistributedSystem */
+  public void setSystemId(String systemId) {
+    this.agentConfig.setSystemId(systemId);
+  }
+
+  /**
+   * Gets the logFileSizeLimit in megabytes of this Agent. Zero indicates no limit.
+   *
+   * @return The logFileSizeLimit value
+   */
+  public int getLogFileSizeLimit() {
+    return this.agentConfig.getLogFileSizeLimit();
+  }
+
+  /**
+   * Sets the logFileSizeLimit in megabytes of this Agent. Zero indicates no limit.
+   *
+   * @param logFileSizeLimit The new logFileSizeLimit value
+   */
+  public void setLogFileSizeLimit(int logFileSizeLimit) {
+    this.agentConfig.setLogFileSizeLimit(logFileSizeLimit);
+    LogWriterAppenders.configChanged(LogWriterAppenders.Identifier.MAIN);
+  }
+
+  /**
+   * Gets the logDiskSpaceLimit in megabytes of this Agent. Zero indicates no limit.
+   *
+   * @return The logDiskSpaceLimit value
+   */
+  public int getLogDiskSpaceLimit() {
+    return this.agentConfig.getLogDiskSpaceLimit();
+  }
+
+  /**
+   * Sets the logDiskSpaceLimit in megabytes of this Agent. Zero indicates no limit.
+   *
+   * @param logDiskSpaceLimit The new logDiskSpaceLimit value
+   */
+  public void setLogDiskSpaceLimit(int logDiskSpaceLimit) {
+    this.agentConfig.setLogDiskSpaceLimit(logDiskSpaceLimit);
+    LogWriterAppenders.configChanged(LogWriterAppenders.Identifier.MAIN);
+  }
+
+  /**
+   * Gets the logFile name for this Agent to log to.
+   *
+   * @return The logFile value
+   */
+  public String getLogFile() {
+    return this.agentConfig.getLogFile();
+  }
+
+  /**
+   * Sets the logFile name for this Agent to log to.
+   *
+   * @param logFile The new logFile value
+   */
+  public void setLogFile(String logFile) {
+    this.agentConfig.setLogFile(logFile);
+    LogWriterAppenders.configChanged(LogWriterAppenders.Identifier.MAIN);
+  }
+
+  /**
+   * Gets the logLevel of this Agent.
+   *
+   * @return The logLevel value
+   */
+  public String getLogLevel() {
+    return this.agentConfig.getLogLevel();
+  }
+
+  /**
+   * Sets the logLevel of this Agent.
+   *
+   * @param logLevel The new logLevel value
+   */
+  public void setLogLevel(String logLevel) {
+    this.agentConfig.setLogLevel(logLevel);
+    LogWriterAppenders.configChanged(LogWriterAppenders.Identifier.MAIN);
+  }
+
+  /** Returns true if the Agent is set to auto connect to a system. */
+  public boolean getAutoConnect() {
+    return this.agentConfig.getAutoConnect();
+  }
+
+  /** Returns true if the Agent is set to auto connect to a system. */
+  public boolean isAutoConnect() {
+    return this.agentConfig.getAutoConnect();
+  }
+
+  /** Sets or unsets the option to auto connect to a system. */
+  public void setAutoConnect(boolean v) {
+    this.agentConfig.setAutoConnect(v);
+  }
+
+  /**
+   * Returns the address (URL) on which the RMI connector server runs or <code>null</code> if the
+   * RMI connector server has not been started. This method is used primarily for testing purposes.
+   *
+   * @see JMXConnectorServer#getAddress()
+   */
+  public JMXServiceURL getRMIAddress() {
+    if (this.rmiConnector != null) {
+      return this.rmiConnector.getAddress();
+
+    } else {
+      return null;
+    }
+  }
+
+  /**
+   * Gets the configuration for this Agent.
+   *
+   * @return the configuration for this Agent
+   */
+  protected AgentConfig getAgentConfig() {
+    return this.agentConfig;
+  }
+
+  // -------------------------------------------------------------------------
+  // Internal implementation methods
+  // -------------------------------------------------------------------------
+
+  /** Returns the tail of the system log specified by <code>File</code>. */
+  private String tailFile(File f) {
+    try {
+      return TailLogResponse.tailSystemLog(f);
+    } catch (IOException ex) {
+      return LocalizedStrings.AgentImpl_COULD_NOT_TAIL_0_BECAUSE_1
+          .toLocalizedString(new Object[] {f, ex});
+    }
+  }
+
+  /**
+   * Returns the active MBeanServer which has any GemFire MBeans registered.
+   *
+   * @return the GemFire mbeanServer
+   */
+  public MBeanServer getMBeanServer() {
+    return mBeanServer;
+  }
+
+  // /**
+  // * Returns the active modeler Registry which has been initialized with all
+  // * the ModelMBean descriptors needed for GemFire MBeans.
+  // *
+  // * @return the modeler registry
+  // */
+  // private Registry getRegistry() {
+  // return MBeanUtil.getRegistry();
+  // }
+
+  /**
+   * Gets the current instance of LogWriter for logging
+   *
+   * @return the logWriter
+   */
+  public LogWriter getLogWriter() {
+    return this.logWriter;
+  }
+
+  private final Thread shutdownHook =
+      new Thread(LoggingThreadGroup.createThreadGroup("Shutdown"), "Shutdown") {
+        @Override
+        public void run() {
+          disconnectFromSystem();
+        }
+      };
+
+  /**
+   * Adds a ShutdownHook to the Agent for cleaning up any resources
+   */
+  private void addShutdownHook() {
+    if (!Boolean.getBoolean(
+        org.apache.geode.distributed.internal.InternalDistributedSystem.DISABLE_SHUTDOWN_HOOK_PROPERTY)) {
+      Runtime.getRuntime().addShutdownHook(shutdownHook);
+    }
+  }
+
+  private void removeShutdownHook() {
+    if (!Boolean.getBoolean(
+        org.apache.geode.distributed.internal.InternalDistributedSystem.DISABLE_SHUTDOWN_HOOK_PROPERTY)) {
+      Runtime.getRuntime().removeShutdownHook(shutdownHook);
+    }
+  }
+
+  /**
+   * Creates a LogWriterI18n for this Agent to use in logging.
+   */
+  @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE",
+      justification = "Return value for file delete is not important here.")
+  private void initLogWriter() throws AdminException {
+    final LogConfig logConfig = this.agentConfig.createLogConfig();
+
+    // LOG: create logWriterAppender here
+    this.logWriterAppender = LogWriterAppenders
+        .getOrCreateAppender(LogWriterAppenders.Identifier.MAIN, false, logConfig, false);
+
+    // LOG: look in AgentConfigImpl for existing LogWriter to use
+    InternalLogWriter existingLogWriter = this.agentConfig.getInternalLogWriter();
+    if (existingLogWriter != null) {
+      this.logWriter = existingLogWriter;
+    } else {
+      // LOG: create LogWriterLogger
+      this.logWriter = LogWriterFactory.createLogWriterLogger(false, false, logConfig, false);
+      // LOG: changed statement from config to info
+      this.logWriter.info(Banner.getString(null));
+      // Set this log writer in AgentConfigImpl
+      this.agentConfig.setInternalLogWriter(this.logWriter);
+    }
+
+    // LOG: create logWriter here
+    this.logWriter = LogWriterFactory.createLogWriterLogger(false, false, logConfig, false);
+
+    // Set this log writer in AgentConfig
+    this.agentConfig.setInternalLogWriter(this.logWriter);
+
+    // Print Banner information
+    logger.info(Banner.getString(this.agentConfig.getOriginalArgs()));
+
+    // LOG:CONFIG: changed next three statements from config to info
+    logger.info(LogMarker.CONFIG, LocalizedStrings.AgentImpl_AGENT_CONFIG_PROPERTY_FILE_NAME_0
+        .toLocalizedString(AgentConfigImpl.retrievePropertyFile()));
+    logger.info(LogMarker.CONFIG, this.agentConfig.getPropertyFileDescription());
+    logger.info(LogMarker.CONFIG, this.agentConfig.toPropertiesAsString());
+  }
+
+  /**
+   * Stops the HttpAdaptor and its XsltProcessor. Unregisters the associated MBeans.
+   */
+  private void stopHttpAdaptor() {
+    if (!this.agentConfig.isHttpEnabled())
+      return;
+
+    // stop the adaptor...
+    try {
+      this.httpAdaptor.stop();
+    } catch (Exception e) {
+      logger.warn(e.getMessage(), e);
+    }
+
+    try {
+      MBeanUtil.unregisterMBean(getHttpAdaptorName());
+      MBeanUtil.unregisterMBean(getXsltProcessorName());
+    } catch (MalformedObjectNameException e) {
+      logger.warn(e.getMessage(), e);
+    }
+  }
+
+  /** Stops the RMIConnectorServer and unregisters its MBean. */
+  private void stopRMIConnectorServer() {
+    if (!this.agentConfig.isRmiEnabled())
+      return;
+
+    // stop the RMI Connector server...
+    try {
+      this.rmiConnector.stop();
+    } catch (Exception e) {
+      logger.warn(e.getMessage(), e);
+    }
+
+    try {
+      ObjectName rmiRegistryNamingName = getRMIRegistryNamingName();
+      if (this.agentConfig.isRmiRegistryEnabled()
+          && mBeanServer.isRegistered(rmiRegistryNamingName)) {
+        String[] empty = new String[0];
+        mBeanServer.invoke(rmiRegistryNamingName, "stop", empty, empty);
+        MBeanUtil.unregisterMBean(rmiRegistryNamingName);
+      }
+    } catch (MalformedObjectNameException e) {
+      logger.warn(e.getMessage(), e);
+    } catch (InstanceNotFoundException e) {
+      logger.warn(e.getMessage(), e);
+    } catch (ReflectionException e) {
+      logger.warn(e.getMessage(), e);
+    } catch (MBeanException e) {
+      logger.warn(e.getMessage(), e);
+    }
+
+    try {
+      ObjectName rmiConnectorServerName = getRMIConnectorServerName();
+      if (mBeanServer.isRegistered(rmiConnectorServerName)) {
+        MBeanUtil.unregisterMBean(rmiConnectorServerName);
+      }
+    } catch (MalformedObjectNameException e) {
+      logger.warn(e.getMessage(), e);
+    }
+  }
+
+  /** Stops the SnmpAdaptor and unregisters its MBean. */
+  private void stopSnmpAdaptor() {
+    if (!this.agentConfig.isSnmpEnabled())
+      return;
+
+    // stop the SnmpAdaptor...
+    try {
+      getMBeanServer().invoke(getSnmpAdaptorName(), "unbind", new Object[0], new String[0]);
+    } catch (Exception e) {
+      logger.warn(e.getMessage(), e);
+    }
+
+    try {
+      MBeanUtil.unregisterMBean(getSnmpAdaptorName());
+    } catch (MalformedObjectNameException e) {
+      logger.warn(e.getMessage(), e);
+    }
+  }
+
+  /** Returns the JMX ObjectName for the RMI registry Naming MBean. */
+  private ObjectName getRMIRegistryNamingName()
+      throws javax.management.MalformedObjectNameException {
+    return ObjectName.getInstance("naming:type=rmiregistry");
+  }
+
+  /** Returns the JMX ObjectName for the HttpAdaptor. */
+  private ObjectName getHttpAdaptorName() throws javax.management.MalformedObjectNameException {
+    return new ObjectName("Server:name=HttpAdaptor");
+  }
+
+  /** Returns the JMX ObjectName for the RMIConnectorServer. */
+  private ObjectName getRMIConnectorServerName()
+      throws javax.management.MalformedObjectNameException {
+    return new ObjectName("connectors:protocol=rmi");
+  }
+
+  /** Returns the JMX ObjectName for the SnmpAdaptor. */
+  private ObjectName getSnmpAdaptorName() throws javax.management.MalformedObjectNameException {
+    return new ObjectName("Adaptors:protocol=SNMP");
+  }
+
+  /** Returns the JMX ObjectName for the HttpAdaptor's XsltProcessor. */
+  private ObjectName getXsltProcessorName() throws javax.management.MalformedObjectNameException {
+    return new ObjectName("Server:name=XSLTProcessor");
+  }
+
+  // -------------------------------------------------------------------------
+  // Factory method for creating DistributedSystem
+  // -------------------------------------------------------------------------
+
+  /**
+   * Creates and connects to a <code>DistributedSystem</code>.
+   *
+   * @param config
+   */
+  private AdminDistributedSystem createDistributedSystem(AgentConfigImpl config)
+      throws AdminException {
+    return new AdminDistributedSystemJmxImpl(config);
+  }
+
+  // -------------------------------------------------------------------------
+  // Agent main
+  // -------------------------------------------------------------------------
+
+  /**
+   * Command-line main for running the GemFire Management Agent.
+   * <p>
+   * Accepts command-line arguments matching the options in {@link AgentConfig} and
+   * {@link DistributedSystemConfig}.
+   * <p>
+   * <code>AgentConfig</code> will convert -Jarguments to System properties.
+   */
+  public static void main(String[] args) {
+    SystemFailure.loadEmergencyClasses();
+
+    AgentConfigImpl ac;
+    try {
+      ac = new AgentConfigImpl(args);
+    } catch (RuntimeException ex) {
+      System.err
+          .println(LocalizedStrings.AgentImpl_FAILED_READING_CONFIGURATION_0.toLocalizedString(ex));
+      System.exit(1);
+      return;
+    }
+
+    try {
+      Agent agent = AgentFactory.getAgent(ac);
+      agent.start();
+
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Throwable t) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      t.printStackTrace();
+      System.exit(1);
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // MX4J Connectors/Adaptors
+  // -------------------------------------------------------------------------
+
+  private void createRMIRegistry() throws Exception {
+    if (!this.agentConfig.isRmiRegistryEnabled()) {
+      return;
+    }
+    MBeanServer mbs = getMBeanServer();
+    String host = this.agentConfig.getRmiBindAddress();
+    int port = this.agentConfig.getRmiPort();
+
+    /*
+     * Register and start the rmi-registry naming MBean, which is needed by JSR 160
+     * RMIConnectorServer
+     */
+    ObjectName registryName = getRMIRegistryNamingName();
+    try {
+      RMIRegistryService registryNamingService = null;
+      if (host != null && !("".equals(host.trim()))) {
+        registryNamingService = new RMIRegistryService(host, port);
+      } else {
+        registryNamingService = new RMIRegistryService(port);
+      }
+      mbs.registerMBean(registryNamingService, registryName);
+    } catch (javax.management.InstanceAlreadyExistsException e) {
+      logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_0__IS_ALREADY_REGISTERED,
+          registryName));
+    }
+    mbs.invoke(registryName, "start", null, null);
+  }
+
+  /**
+   * Defines and starts the JMX RMIConnector and service.
+   * <p>
+   * If {@link AgentConfig#isRmiEnabled} returns false, then this adaptor will not be started.
+   */
+  private void startRMIConnectorServer() {
+    if (!this.agentConfig.isRmiEnabled())
+      return;
+
+    String rmiBindAddress = this.agentConfig.getRmiBindAddress();
+
+    // Set RMI Stubs to use the given RMI Bind Address
+    // Default bindAddress is "", if none is set - ignore if not set
+    // If java.rmi.server.hostname property is specified then
+    // that override is not changed
+    String rmiStubServerNameKey = "java.rmi.server.hostname";
+    String overrideHostName = System.getProperty(rmiStubServerNameKey);
+    if ((overrideHostName == null || overrideHostName.trim().length() == 0)
+        && (rmiBindAddress != null && rmiBindAddress.trim().length() != 0)) {
+      System.setProperty(rmiStubServerNameKey, rmiBindAddress);
+      logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_SETTING_0,
+          new StringBuilder(rmiStubServerNameKey).append(" = ").append(rmiBindAddress)));
+    }
+
+    try {
+      createRMIRegistry();
+      ObjectName objName = getRMIConnectorServerName();
+
+      // make sure this adaptor is not already registered...
+      if (getMBeanServer().isRegistered(objName)) {
+        // dunno how we got here...
+        logger.info(LocalizedMessage.create(
+            LocalizedStrings.AgentImpl_RMICONNECTORSERVER_ALREADY_REGISTERED_AS__0, objName));
+        return;
+      }
+
+      /*
+       * url defined as: service:jmx:protocol:sap where 1. protocol: rmi 2. sap is:
+       * [host[:port]][url-path] where host: rmi-binding-address port: rmi-server-port url-path:
+       * /jndi/rmi://<rmi-binding-address>:<rmi-port><JNDI_NAME>
+       */
+      String urlString = null;
+      String connectorServerHost = "";
+      int connectorServerPort = this.agentConfig.getRmiServerPort();
+      String rmiRegistryHost = "";
+      int rmiRegistryPort = this.agentConfig.getRmiPort();
+
+      // Set registryHost to localhost if not specified
+      // RMI stubs would use a default IP if namingHost is left empty
+      if (rmiBindAddress == null || rmiBindAddress.trim().length() == 0) {
+        connectorServerHost = "localhost";
+        rmiRegistryHost = "";
+      } else {
+        connectorServerHost = applyRFC2732(rmiBindAddress);
+        rmiRegistryHost = connectorServerHost;
+      }
+
+      urlString = MessageFormat.format(AgentImpl.JMX_SERVICE_URL, connectorServerHost,
+          String.valueOf(connectorServerPort), rmiRegistryHost, String.valueOf(rmiRegistryPort),
+          JNDI_NAME);
+
+      logger.debug("JMX Service URL string is : \"{}\"", urlString);
+
+      // The address of the connector
+      JMXServiceURL url = new JMXServiceURL(urlString);
+
+      Map<String, Object> env = new HashMap<String, Object>();
+      // env.put(Context.INITIAL_CONTEXT_FACTORY,
+      // "com.sun.jndi.rmi.registry.RegistryContextFactory");
+      // env.put(Context.PROVIDER_URL, "rmi://localhost:1099");
+
+      RMIServerSocketFactory ssf = new MX4JServerSocketFactory(this.agentConfig.isAgentSSLEnabled(), // true,
+          this.agentConfig.isAgentSSLRequireAuth(), // true,
+          this.agentConfig.getAgentSSLProtocols(), // "any",
+          this.agentConfig.getAgentSSLCiphers(), // "any",
+          this.agentConfig.getRmiBindAddress(), 10, // backlog
+          this.agentConfig.getGfSecurityProperties());
+      env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, ssf);
+
+      if (this.agentConfig.isAgentSSLEnabled()) {
+        RMIClientSocketFactory csf = new SslRMIClientSocketFactory();
+        env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
+      }
+
+      MBeanServer mbs = null; // will be set by registering w/ mbeanServer
+      this.rmiConnector = JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
+
+      // for cleanup
+      this.rmiConnector.addNotificationListener(new ConnectionNotificationAdapter(),
+          new ConnectionNotificationFilterImpl(), this);
+
+      // Register the JMXConnectorServer in the MBeanServer
+      getMBeanServer().registerMBean(this.rmiConnector, objName);
+
+      // Start the JMXConnectorServer
+      this.rmiConnector.start();
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Throwable t) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(LocalizedStrings.AgentImpl_FAILED_TO_START_RMICONNECTORSERVER, t);
+      throw new StartupException(
+          LocalizedStrings.AgentImpl_FAILED_TO_START_RMI_SERVICE.toLocalizedString(), t);
+    }
+  }
+
+  /**
+   * Starts the optional third-party AdventNet SNMP Adaptor.
+   * <p>
+   * If {@link AgentConfig#isSnmpEnabled} returns false, then this adaptor will not be started.
+   */
+  private void startSnmpAdaptor() {
+    if (!this.agentConfig.isSnmpEnabled())
+      return;
+    try {
+      ObjectName objName = getSnmpAdaptorName();
+
+      // make sure this adaptor is not already registered...
+      if (getMBeanServer().isRegistered(objName)) {
+        // dunno how we got here...
+        logger.info(LocalizedMessage
+            .create(LocalizedStrings.AgentImpl_SNMPADAPTOR_ALREADY_REGISTERED_AS__0, objName));
+        return;
+      }
+
+      String className = "com.adventnet.adaptors.snmp.snmpsupport.SmartSnmpAdaptor";
+      String snmpDir = this.agentConfig.getSnmpDirectory();
+      // ex:/merry2/users/klund/agent
+
+      // validate the directory...
+      if (snmpDir == null || snmpDir.length() == 0) {
+        throw new IllegalArgumentException(
+            LocalizedStrings.AgentImpl_SNMPDIRECTORY_MUST_BE_SPECIFIED_BECAUSE_SNMP_IS_ENABLED
+                .toLocalizedString());
+      }
+      File root = new File(snmpDir);
+      if (!root.exists()) {
+        throw new IllegalArgumentException(
+            LocalizedStrings.AgentImpl_SNMPDIRECTORY_DOES_NOT_EXIST.toLocalizedString());
+      }
+
+      // create the adaptor...
+      String[] sigs = new String[] {"java.lang.String"};
+      Object[] args = new Object[] {snmpDir};
+
+      String bindAddress = this.agentConfig.getSnmpBindAddress();
+      if (bindAddress != null && bindAddress.length() > 0) {
+        sigs = new String[] {"java.lang.String", sigs[0]};
+        args = new Object[] {bindAddress, args[0]};
+      }
+
+      // go...
+      getMBeanServer().createMBean(className, objName, args, sigs);
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Throwable t) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(LocalizedMessage
+          .create(LocalizedStrings.AgentImpl_FAILED_TO_START_SNMPADAPTOR__0, t.getMessage()));
+      throw new StartupException(LocalizedStrings.AgentImpl_FAILED_TO_START_SNMPADAPTOR__0
+          .toLocalizedString(t.getMessage()), t);
+    }
+  }
+
+  /**
+   * Defines and starts the JMX Http Adaptor service from MX4J.
+   * <p>
+   * If {@link AgentConfig#isHttpEnabled} returns false, then this adaptor will not be started.
+   */
+  private void startHttpAdaptor() {
+    if (!this.agentConfig.isHttpEnabled())
+      return;
+    try {
+      ObjectName objName = getHttpAdaptorName();
+
+      // make sure this adaptor is not already registered...
+      if (getMBeanServer().isRegistered(objName)) {
+        // dunno how we got here...
+        logger.info(LocalizedMessage
+            .create(LocalizedStrings.AgentImpl_HTTPADAPTOR_ALREADY_REGISTERED_AS__0, objName));
+        return;
+      }
+
+      this.httpAdaptor = new HttpAdaptor();
+
+      // validate and set host and port values...
+      if (this.agentConfig.getHttpPort() > 0) {
+        this.httpAdaptor.setPort(this.agentConfig.getHttpPort());
+        logger.info(LogMarker.CONFIG,
+            LocalizedMessage.create(LocalizedStrings.AgentImpl_HTTP_ADAPTOR_LISTENING_ON_PORT__0,
+                this.agentConfig.getHttpPort()));
+      } else {
+        logger.error(LocalizedMessage.create(LocalizedStrings.AgentImpl_INCORRECT_PORT_VALUE__0,
+            this.agentConfig.getHttpPort()));
+      }
+
+      if (this.agentConfig.getHttpBindAddress() != null) {
+        String host = this.agentConfig.getHttpBindAddress();
+        logger.info(LogMarker.CONFIG, LocalizedMessage
+            .create(LocalizedStrings.AgentImpl_HTTP_ADAPTOR_LISTENING_ON_ADDRESS__0, host));
+        this.httpAdaptor.setHost(host);
+      } else {
+        logger.error(LocalizedMessage.create(LocalizedStrings.AgentImpl_INCORRECT_NULL_HOSTNAME));
+      }
+
+      // SSL support...
+      MX4JServerSocketFactory socketFactory =
+          new MX4JServerSocketFactory(this.agentConfig.isAgentSSLEnabled(),
+              this.agentConfig.isHttpSSLRequireAuth(), this.agentConfig.getAgentSSLProtocols(),
+              this.agentConfig.getAgentSSLCiphers(), this.agentConfig.getGfSecurityProperties());
+      this.httpAdaptor.setSocketFactory(socketFactory);
+
+      // authentication (user login) support...
+      if (this.agentConfig.isHttpAuthEnabled()) {
+        // this pops up a login dialog from the browser...
+        this.httpAdaptor.setAuthenticationMethod(MX4J_HTTPADAPTOR_BASIC_AUTHENTICATION); // only
+                                                                                         // basic
+                                                                                         // works
+
+        this.httpAdaptor.addAuthorization(this.agentConfig.getHttpAuthUser(),
+            this.agentConfig.getHttpAuthPassword());
+      }
+
+      // add the XsltProcessor...
+      this.httpAdaptor.setProcessorName(createXsltProcessor());
+
+      // register the HttpAdaptor and snap on the XsltProcessor...
+      getMBeanServer().registerMBean(this.httpAdaptor, objName);
+      this.httpAdaptor.start();
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Throwable t) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(LocalizedMessage
+          .create(LocalizedStrings.AgentImpl_FAILED_TO_START_HTTPADAPTOR__0, t.getMessage()));
+      throw new StartupException(LocalizedStrings.AgentImpl_FAILED_TO_START_HTTPADAPTOR__0
+          .toLocalizedString(t.getMessage()), t);
+    }
+  }
+
+  /**
+   * Defines and starts the Xslt Processor helper service for the Http Adaptor.
+   */
+  private ObjectName createXsltProcessor() throws javax.management.JMException {
+    ObjectName objName = getXsltProcessorName();
+
+    // make sure this mbean is not already registered...
+    if (getMBeanServer().isRegistered(objName)) {
+      // dunno how we got here...
+      logger.info(LocalizedMessage
+          .create(LocalizedStrings.AgentImpl_XSLTPROCESSOR_ALREADY_REGISTERED_AS__0, objName));
+      return objName;
+    }
+
+    getMBeanServer().registerMBean(new mx4j.tools.adaptor.http.XSLTProcessor(), objName);
+    return objName;
+  }
+
+  // -------------------------------------------------------------------------
+  // Private support methods...
+  // -------------------------------------------------------------------------
+
+  // /** Not used anymore but seems moderately useful... */
+  // private String[] parseSSLCiphers(String ciphers) {
+  // List list = new ArrayList();
+  // StringTokenizer st = new StringTokenizer(ciphers);
+  // while (st.hasMoreTokens()) {
+  // list.add(st.nextToken());
+  // }
+  // return (String[]) list.toArray(new String[list.size()]);
+  // }
+
+  // -------------------------------------------------------------------------
+  // SSL configuration for GemFire
+  // -------------------------------------------------------------------------
+  public boolean isSSLEnabled() {
+    return this.agentConfig.isSSLEnabled();
+  }
+
+  public void setSSLEnabled(boolean enabled) {
+    this.agentConfig.setSSLEnabled(enabled);
+  }
+
+  public String getSSLProtocols() {
+    return this.agentConfig.getSSLProtocols();
+  }
+
+  public void setSSLProtocols(String protocols) {
+    this.agentConfig.setSSLProtocols(protocols);
+  }
+
+  public String getSSLCiphers() {
+    return this.agentConfig.getSSLCiphers();
+  }
+
+  public void setSSLCiphers(String ciphers) {
+    this.agentConfig.setSSLCiphers(ciphers);
+  }
+
+  public boolean isSSLAuthenticationRequired() {
+    return this.agentConfig.isSSLAuthenticationRequired();
+  }
+
+  public void setSSLAuthenticationRequired(boolean authRequired) {
+    this.agentConfig.setSSLAuthenticationRequired(authRequired);
+  }
+
+  public Properties getSSLProperties() {
+    return this.agentConfig.getSSLProperties();
+  }
+
+  public void setSSLProperties(Properties sslProperties) {
+    this.agentConfig.setSSLProperties(sslProperties);
+  }
+
+  public void addSSLProperty(String key, String value) {
+    this.agentConfig.addSSLProperty(key, value);
+  }
+
+  public void removeSSLProperty(String key) {
+    this.agentConfig.removeSSLProperty(key);
+  }
+
+  // -------------------------------------------------------------------------
+  // ManagedResource implementation
+  // -------------------------------------------------------------------------
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.AGENT;
+  }
+
+  public void cleanupResource() {}
+
+  static class StartupException extends GemFireException {
+    private static final long serialVersionUID = 6614145962199330348L;
+
+    StartupException(Throwable cause) {
+      super(cause);
+    }
+
+    StartupException(String reason, Throwable cause) {
+      super(reason, cause);
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // Other Support methods
+  // -------------------------------------------------------------------------
+  /**
+   * Checks the no. of active RMI clients and updates a flag in the Admin Distributed System.
+   *
+   * @see AdminDistributedSystemJmxImpl#setRmiClientCountZero(boolean)
+   * @since GemFire 6.0
+   */
+  void updateRmiClientsCount() {
+    int noOfClientsConnected = 0;
+
+    String[] connectionIds = this.rmiConnector.getConnectionIds();
+
+    if (connectionIds != null) {
+      noOfClientsConnected = connectionIds.length;
+    }
+
+    logger.info("No. of RMI clients connected :: {}", noOfClientsConnected);
+
+    AdminDistributedSystemJmxImpl adminDSJmx = (AdminDistributedSystemJmxImpl) this.system;
+
+    adminDSJmx.setRmiClientCountZero(noOfClientsConnected == 0);
+  }
+
+  @Override
+  public String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.append("AgentImpl[");
+    sb.append("config=" + agentConfig.toProperties().toString());
+    // sb.append("; adaptor=" + httpAdaptor.toString());
+    sb.append("; mbeanName=" + mbeanName);
+    sb.append("; modelMBean=" + modelMBean);
+    sb.append("; objectName=" + objectName);
+    sb.append("; propertyFile=" + propertyFile);
+    sb.append(": rmiConnector=" + rmiConnector);
+    // sb.append("; system=" + system);)
+    sb.append("]");
+    return sb.toString();
+  }
+
+  /**
+   * Process the String form of a hostname to make it comply with Jmx URL restrictions. Namely wrap
+   * IPv6 literal address with "[", "]"
+   * 
+   * @param hostname the name to safeguard.
+   * @return a string representation suitable for use in a Jmx connection URL
+   */
+  private static String applyRFC2732(String hostname) {
+    if (hostname.indexOf(":") != -1) {
+      // Assuming an IPv6 literal because of the ':'
+      return "[" + hostname + "]";
+    }
+    return hostname;
+  }
+}
+
+
+/**
+ * Adapter class for NotificationListener that listens to notifications of type
+ * javax.management.remote.JMXConnectionNotification
+ *
+ * @since GemFire 6.0
+ */
+class ConnectionNotificationAdapter implements NotificationListener {
+  private static final Logger logger = LogService.getLogger();
+
+  /**
+   * If the handback object passed is an AgentImpl, updates the JMX client count
+   *
+   * @param notification JMXConnectionNotification for change in client connection status
+   * @param handback An opaque object which helps the listener to associate information regarding
+   *        the MBean emitter. This object is passed to the MBean during the addListener call and
+   *        resent, without modification, to the listener. The MBean object should not use or modify
+   *        the object. (NOTE: copied from javax.management.NotificationListener)
+   */
+  @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "BC_UNCONFIRMED_CAST",
+      justification = "Only JMXConnectionNotification instances are used.")
+  public void handleNotification(Notification notification, Object handback) {
+    if (handback instanceof AgentImpl) {
+      AgentImpl agent = (AgentImpl) handback;
+
+      JMXConnectionNotification jmxNotifn = (JMXConnectionNotification) notification;
+
+      if (logger.isDebugEnabled()) {
+        logger.debug("Connection notification for connection id : '{}'",
+            jmxNotifn.getConnectionId());
+      }
+
+      agent.updateRmiClientsCount();
+    }
+  }
+}
+
+
+/**
+ * Filters out the notifications of the type JMXConnectionNotification.OPENED,
+ * JMXConnectionNotification.CLOSED and JMXConnectionNotification.FAILED.
+ *
+ * @since GemFire 6.0
+ */
+class ConnectionNotificationFilterImpl implements NotificationFilter {
+
+  /**
+   * Default serialVersionUID
+   */
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * Invoked before sending the specified notification to the listener. Returns whether the given
+   * notification is to be sent to the listener.
+   *
+   * @param notification The notification to be sent.
+   * @return true if the notification has to be sent to the listener, false otherwise.
+   */
+  public boolean isNotificationEnabled(Notification notification) {
+    boolean isThisNotificationEnabled = false;
+    if (notification.getType().equals(JMXConnectionNotification.OPENED)
+        || notification.getType().equals(JMXConnectionNotification.CLOSED)
+        || notification.getType().equals(JMXConnectionNotification.FAILED)) {
+      isThisNotificationEnabled = true;
+    }
+    return isThisNotificationEnabled;
+  }
+}
+


[47/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
deleted file mode 100755
index 59fce55..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java
+++ /dev/null
@@ -1,2400 +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.admin.internal;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.*;
-import org.apache.geode.admin.Alert;
-import org.apache.geode.admin.AlertListener;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.FutureCancelledException;
-import org.apache.geode.distributed.internal.*;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.Banner;
-import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.admin.remote.*;
-import org.apache.geode.internal.cache.persistence.PersistentMemberPattern;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.InternalLogWriter;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.LogWriterFactory;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.geode.internal.logging.log4j.LogMarker;
-import org.apache.geode.internal.logging.log4j.LogWriterAppender;
-import org.apache.geode.internal.logging.log4j.LogWriterAppenders;
-import org.apache.geode.internal.util.concurrent.FutureResult;
-import org.apache.logging.log4j.Logger;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.concurrent.*;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-/**
- * Represents a GemFire distributed system for remote administration/management.
- *
- * @since GemFire 3.5
- */
-public class AdminDistributedSystemImpl implements org.apache.geode.admin.AdminDistributedSystem,
-    org.apache.geode.internal.admin.JoinLeaveListener,
-    org.apache.geode.internal.admin.AlertListener,
-    org.apache.geode.distributed.internal.InternalDistributedSystem.DisconnectListener {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /** String identity of this distributed system */
-  private String id;
-
-  /** Latest alert broadcast by any system members */
-  private Alert latestAlert;
-
-  // -------------------------------------------------------------------------
-
-  /** Internal admin agent to delegate low-level work to */
-  private volatile GfManagerAgent gfManagerAgent;
-
-  /** Monitors the health of this distributed system */
-  private GemFireHealth health;
-
-  /** Set of non-Manager members in this system */
-  private final Set applicationSet = new HashSet();
-
-  /** Set of DistributionLocators for this system */
-  private final Set locatorSet = new HashSet();
-
-  /** Set of dedicated CacheServer members in this system */
-  private final Set cacheServerSet = new HashSet();
-
-  /** Configuration defining this distributed system */
-  private final DistributedSystemConfigImpl config;
-
-  /** Controller for starting and stopping managed entities */
-  private ManagedEntityController controller;
-
-  /** Log file collator for gathering and merging system member logs */
-  private LogCollator logCollator = new LogCollator();
-
-  /**
-   * The level above which alerts will be delivered to the alert listeners
-   */
-  private AlertLevel alertLevel = AlertLevel.WARNING;
-
-  /** The alert listeners registered on this distributed system. */
-  private volatile Set<AlertListener> alertListeners = Collections.emptySet();
-  private final Object alertLock = new Object();
-
-  private LogWriterAppender logWriterAppender;
-
-  private InternalLogWriter logWriter;
-
-  /** The membership listeners registered on this distributed system */
-  private volatile Set membershipListeners = Collections.EMPTY_SET;
-  private final Object membershipLock = new Object();
-
-  /* The region listeners registered on this distributed system */
-  // for feature requests #32887
-  private volatile List cacheListeners = Collections.EMPTY_LIST;
-  private final Object cacheListLock = new Object();
-
-  /**
-   * reference to AdminDistributedSystemImpl instance for feature requests #32887.
-   * <p>
-   * Guarded by {@link #CONNECTION_SYNC}.
-   * <p>
-   * TODO: reimplement this change and SystemMemberCacheEventProcessor to avoid using this static.
-   * SystemMemberCacheEvents should only be sent to Admin VMs that express interest.
-   * <p>
-   * This is volatile to allow SystemFailure to deliver fatal poison-pill to thisAdminDS without
-   * waiting on synchronization.
-   * 
-   * @guarded.By CONNECTION_SYNC
-   */
-  private static volatile AdminDistributedSystemImpl thisAdminDS;
-
-  /**
-   * Provides synchronization for {@link #connect()} and {@link #disconnect()}. {@link #thisAdminDS}
-   * is also now protected by CONNECTION_SYNC and has its lifecycle properly tied to
-   * connect/disconnect.
-   */
-  private static final Object CONNECTION_SYNC = new Object();
-
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs new DistributedSystemImpl with the given configuration.
-   *
-   * @param config configuration defining this distributed system
-   */
-  public AdminDistributedSystemImpl(DistributedSystemConfigImpl config) {
-
-    // init from config...
-    this.config = config;
-
-    String systemId = this.config.getSystemId();
-    if (systemId != null && systemId.length() > 0) {
-      this.id = systemId;
-
-    }
-    if (this.getLocators() != null && this.getLocators().length() > 0) {
-      this.id = this.getLocators();
-
-    } else {
-      this.id = new StringBuffer(this.getMcastAddress()).append("[").append(this.getMcastPort())
-          .append("]").toString();
-    }
-
-    // LOG: create LogWriterAppender unless one already exists
-    this.logWriterAppender = LogWriterAppenders.getOrCreateAppender(
-        LogWriterAppenders.Identifier.MAIN, false, this.config.createLogConfig(), false);
-
-    // LOG: look in DistributedSystemConfigImpl for existing LogWriter to use
-    InternalLogWriter existingLogWriter = this.config.getInternalLogWriter();
-    if (existingLogWriter != null) {
-      this.logWriter = existingLogWriter;
-    } else {
-      // LOG: create LogWriterLogger
-      this.logWriter = LogWriterFactory.createLogWriterLogger(false, false,
-          this.config.createLogConfig(), false);
-      if (!Boolean.getBoolean(InternalLocator.INHIBIT_DM_BANNER)) {
-        // LOG: changed statement from config to info
-        this.logWriter.info(Banner.getString(null));
-      } else {
-        logger.debug("skipping banner - " + InternalLocator.INHIBIT_DM_BANNER + " is set to true");
-      }
-      // Set this log writer in DistributedSystemConfigImpl
-      this.config.setInternalLogWriter(this.logWriter);
-    }
-
-    // set up other details that depend on config attrs...
-    this.controller = ManagedEntityControllerFactory.createManagedEntityController(this);
-    initializeDistributionLocators();
-    initializeCacheServers();
-  }
-
-  // -------------------------------------------------------------------------
-  // Initialization
-  // -------------------------------------------------------------------------
-
-  /**
-   * Creates DistributionLocator instances for every locator entry in the
-   * {@link org.apache.geode.admin.DistributedSystemConfig}
-   */
-  private void initializeDistributionLocators() {
-    DistributionLocatorConfig[] configs = this.config.getDistributionLocatorConfigs();
-    if (configs.length == 0) {
-      // No work to do
-      return;
-    }
-
-    for (int i = 0; i < configs.length; i++) {
-      // the Locator impl may vary in this class from the config...
-      DistributionLocatorConfig conf = configs[i];
-      DistributionLocator locator = createDistributionLocatorImpl(conf);
-      this.locatorSet.add(new FutureResult(locator));
-    }
-    // update locators string...
-    setLocators(parseLocatorSet());
-  }
-
-  /**
-   * Creates <code>CacheServer</code> instances for every cache server entry in the
-   * {@link org.apache.geode.admin.DistributedSystemConfig}
-   */
-  private void initializeCacheServers() {
-    CacheServerConfig[] cacheServerConfigs = this.config.getCacheServerConfigs();
-    for (int i = 0; i < cacheServerConfigs.length; i++) {
-      try {
-        CacheServerConfig conf = cacheServerConfigs[i];
-        CacheServerConfigImpl copy = new CacheServerConfigImpl(conf);
-        this.cacheServerSet.add(new FutureResult(createCacheServer(copy)));
-      } catch (java.lang.Exception e) {
-        logger.warn(e.getMessage(), e);
-        continue;
-      } catch (VirtualMachineError err) {
-        SystemFailure.initiateFailure(err);
-        // If this ever returns, rethrow the error. We're poisoned
-        // now, so don't let this thread continue.
-        throw err;
-      } catch (java.lang.Error e) {
-        // Whenever you catch Error or Throwable, you must also
-        // catch VirtualMachineError (see above). However, there is
-        // _still_ a possibility that you are dealing with a cascading
-        // error condition, so you also need to check to see if the JVM
-        // is still usable:
-        SystemFailure.checkFailure();
-        logger.error(e.getMessage(), e);
-        continue;
-      }
-    }
-  }
-
-  /**
-   * Checks to make sure that {@link #connect()} has been called.
-   *
-   * @throws IllegalStateException If {@link #connect()} has not been called.
-   */
-  private void checkConnectCalled() {
-    if (this.gfManagerAgent == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
-              .toLocalizedString());
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // Attributes of this DistributedSystem
-  // -------------------------------------------------------------------------
-
-  public GfManagerAgent getGfManagerAgent() {
-    return this.gfManagerAgent;
-  }
-
-  public boolean isConnected() {
-    return this.gfManagerAgent != null && this.gfManagerAgent.isConnected();
-  }
-
-  public String getId() {
-    return this.id;
-  }
-
-  public String getName() {
-    String name = this.config.getSystemName();
-    if (name != null && name.length() > 0) {
-      return name;
-
-    } else {
-      return getId();
-    }
-  }
-
-  public String getSystemName() {
-    return this.config.getSystemName();
-  }
-
-  public String getRemoteCommand() {
-    return this.config.getRemoteCommand();
-  }
-
-  public void setRemoteCommand(String remoteCommand) {
-    this.config.setRemoteCommand(remoteCommand);
-  }
-
-  public void setAlertLevel(AlertLevel level) {
-    if (this.isConnected()) {
-      this.gfManagerAgent.setAlertLevel(level.getSeverity());
-    }
-
-    this.alertLevel = level;
-  }
-
-  public AlertLevel getAlertLevel() {
-    return this.alertLevel;
-  }
-
-  public void addAlertListener(AlertListener listener) {
-    synchronized (this.alertLock) {
-      Set<AlertListener> oldListeners = this.alertListeners;
-      if (!oldListeners.contains(listener)) {
-        Set<AlertListener> newListeners = new HashSet<AlertListener>(oldListeners);
-        newListeners.add(listener);
-        this.alertListeners = newListeners;
-      }
-    }
-  }
-
-  public int getAlertListenerCount() {
-    synchronized (this.alertLock) {
-      return this.alertListeners.size();
-    }
-  }
-
-  public void removeAlertListener(AlertListener listener) {
-    synchronized (this.alertLock) {
-      Set<AlertListener> oldListeners = this.alertListeners;
-      if (oldListeners.contains(listener)) { // fixed bug 34687
-        Set<AlertListener> newListeners = new HashSet<AlertListener>(oldListeners);
-        if (newListeners.remove(listener)) {
-          this.alertListeners = newListeners;
-        }
-      }
-    }
-  }
-
-  public void addMembershipListener(SystemMembershipListener listener) {
-    synchronized (this.membershipLock) {
-      Set oldListeners = this.membershipListeners;
-      if (!oldListeners.contains(listener)) {
-        Set newListeners = new HashSet(oldListeners);
-        newListeners.add(listener);
-        this.membershipListeners = newListeners;
-      }
-    }
-  }
-
-  public void removeMembershipListener(SystemMembershipListener listener) {
-    synchronized (this.membershipLock) {
-      Set oldListeners = this.membershipListeners;
-      if (oldListeners.contains(listener)) { // fixed bug 34687
-        Set newListeners = new HashSet(oldListeners);
-        if (newListeners.remove(listener)) {
-          this.membershipListeners = newListeners;
-        }
-      }
-    }
-  }
-
-  public String getMcastAddress() {
-    return this.config.getMcastAddress();
-  }
-
-  public int getMcastPort() {
-    return this.config.getMcastPort();
-  }
-
-  public boolean getDisableTcp() {
-    return this.config.getDisableTcp();
-  }
-
-  public boolean getDisableAutoReconnect() {
-    return this.config.getDisableAutoReconnect();
-  }
-
-  public String getLocators() {
-    return this.config.getLocators();
-  }
-
-  protected void setLocators(String locators) {
-    this.config.setLocators(locators);
-  }
-
-  public String getMembershipPortRange() {
-    return this.getConfig().getMembershipPortRange();
-  }
-
-  /** get the direct-channel port to use, or zero if not set */
-  public int getTcpPort() {
-    return this.getConfig().getTcpPort();
-  }
-
-  public void setTcpPort(int port) {
-    this.getConfig().setTcpPort(port);
-  }
-
-  public void setMembershipPortRange(String membershipPortRange) {
-    this.getConfig().setMembershipPortRange(membershipPortRange);
-  }
-
-  public DistributedSystemConfig getConfig() {
-    return this.config;
-  }
-
-  /**
-   * Returns true if any members of this system are currently running.
-   */
-  public boolean isRunning() {
-    if (this.gfManagerAgent == null)
-      return false;
-    // is there a better way??
-    // this.gfManagerAgent.isConnected() ... this.gfManagerAgent.isListening()
-
-    if (isAnyMemberRunning())
-      return true;
-    return false;
-  }
-
-  /** Returns true if this system can use multicast for communications */
-  public boolean isMcastEnabled() {
-    return this.getMcastPort() > 0;
-  }
-
-  ManagedEntityController getEntityController() {
-    return this.controller;
-  }
-
-  static private final String TIMEOUT_MS_NAME = "AdminDistributedSystemImpl.TIMEOUT_MS";
-  static private final int TIMEOUT_MS_DEFAULT = 60000; // 30000 -- see bug36470
-  static private final int TIMEOUT_MS =
-      Integer.getInteger(TIMEOUT_MS_NAME, TIMEOUT_MS_DEFAULT).intValue();
-
-
-  // -------------------------------------------------------------------------
-  // Operations of this DistributedSystem
-  // -------------------------------------------------------------------------
-
-  /**
-   * Starts all managed entities in this system.
-   */
-  public void start() throws AdminException {
-    // Wait for each managed entity to start (see bug 32569)
-    DistributionLocator[] locs = getDistributionLocators();
-    for (int i = 0; i < locs.length; i++) {
-      locs[i].start();
-    }
-    for (int i = 0; i < locs.length; i++) {
-      try {
-        if (!locs[i].waitToStart(TIMEOUT_MS)) {
-          throw new AdminException(
-              LocalizedStrings.AdminDistributedSystemImpl_0_DID_NOT_START_AFTER_1_MS
-                  .toLocalizedString(new Object[] {locs[i], Integer.valueOf(TIMEOUT_MS)}));
-        }
-
-      } catch (InterruptedException ex) {
-        Thread.currentThread().interrupt();
-        throw new AdminException(
-            LocalizedStrings.AdminDistributedSystemImpl_INTERRUPTED_WHILE_WAITING_FOR_0_TO_START
-                .toLocalizedString(locs[i]),
-            ex);
-      }
-    }
-
-    CacheServer[] servers = getCacheServers();
-    for (int i = 0; i < servers.length; i++) {
-      servers[i].start();
-    }
-    for (int i = 0; i < servers.length; i++) {
-      try {
-        if (!servers[i].waitToStart(TIMEOUT_MS)) {
-          throw new AdminException(
-              LocalizedStrings.AdminDistributedSystemImpl_0_DID_NOT_START_AFTER_1_MS
-                  .toLocalizedString(new Object[] {servers[i], Integer.valueOf(TIMEOUT_MS)}));
-        }
-
-      } catch (InterruptedException ex) {
-        Thread.currentThread().interrupt();
-        throw new AdminException(
-            LocalizedStrings.AdminDistributedSystemImpl_INTERRUPTED_WHILE_WAITING_FOR_0_TO_START
-                .toLocalizedString(servers[i]),
-            ex);
-      }
-    }
-  }
-
-  /**
-   * Stops all GemFire managers that are members of this system.
-   */
-  public void stop() throws AdminException {
-    // Stop cache server before GemFire managers because the cache
-    // server might host a cache proxy that is dependent on the
-    // manager. See bug 32569.
-
-    // Wait for each managed entity to stop (see bug 32569)
-    long timeout = 30;
-
-    CacheServer[] servers = getCacheServers();
-    for (int i = 0; i < servers.length; i++) {
-      servers[i].stop();
-    }
-    for (int i = 0; i < servers.length; i++) {
-      try {
-        if (!servers[i].waitToStop(timeout * 1000)) {
-          throw new AdminException(
-              LocalizedStrings.AdminDistributedSystemImpl_0_DID_NOT_STOP_AFTER_1_SECONDS
-                  .toLocalizedString(new Object[] {servers[i], Long.valueOf(timeout)}));
-        }
-
-      } catch (InterruptedException ex) {
-        Thread.currentThread().interrupt();
-        throw new AdminException(
-            LocalizedStrings.AdminDistributedSystemImpl_INTERRUPTED_WHILE_WAITING_FOR_0_TO_STOP
-                .toLocalizedString(servers[i]),
-            ex);
-      }
-    }
-
-    DistributionLocator[] locs = getDistributionLocators();
-    for (int i = 0; i < locs.length; i++) {
-      locs[i].stop();
-    }
-    for (int i = 0; i < locs.length; i++) {
-      try {
-        if (!locs[i].waitToStop(timeout * 1000)) {
-          throw new AdminException(
-              LocalizedStrings.AdminDistributedSystemImpl_0_DID_NOT_STOP_AFTER_1_SECONDS
-                  .toLocalizedString(new Object[] {locs[i], Long.valueOf(timeout)}));
-        }
-
-      } catch (InterruptedException ex) {
-        Thread.currentThread().interrupt();
-        throw new AdminException(
-            LocalizedStrings.AdminDistributedSystemImpl_INTERRUPTED_WHILE_WAITING_FOR_0_TO_STOP
-                .toLocalizedString(locs[i]),
-            ex);
-      }
-    }
-  }
-
-  /** Display merged system member logs */
-  public String displayMergedLogs() {
-    return this.logCollator.collateLogs(this.gfManagerAgent);
-  }
-
-  /**
-   * Returns the license for this GemFire product; else null if unable to retrieve license
-   * information
-   *
-   * @return license for this GemFire product
-   */
-  public java.util.Properties getLicense() {
-    SystemMember member = findFirstRunningMember();
-    if (member != null) {
-      return new Properties();
-    } else {
-      return null;
-    }
-  }
-
-  /**
-   * Sets the distribution-related portion of the given managed entity's configuration so that the
-   * entity is part of this distributed system.
-   * 
-   * @throws AdminException TODO-javadocs
-   */
-  private void setDistributionParameters(SystemMember member) throws AdminException {
-
-    Assert.assertTrue(member instanceof ManagedSystemMemberImpl);
-
-    // set some config parms to match this system...
-    ConfigurationParameter[] configParms = new ConfigurationParameter[] {
-        new ConfigurationParameterImpl(MCAST_PORT, Integer.valueOf(this.config.getMcastPort())),
-        new ConfigurationParameterImpl(LOCATORS, this.config.getLocators()),
-        new ConfigurationParameterImpl(MCAST_ADDRESS,
-            InetAddressUtil.toInetAddress(this.config.getMcastAddress())),
-        new ConfigurationParameterImpl(DISABLE_TCP, Boolean.valueOf(this.config.getDisableTcp())),};
-    member.setConfiguration(configParms);
-  }
-
-  /**
-   * Handles an <code>ExecutionException</code> by examining its cause and throwing an appropriate
-   * runtime exception.
-   */
-  private static void handle(ExecutionException ex) {
-    Throwable cause = ex.getCause();
-
-    if (cause instanceof OperationCancelledException) {
-      // Operation was cancelled, we don't necessary want to propagate
-      // this up to the user.
-      return;
-    }
-    if (cause instanceof CancelException) { // bug 37285
-      throw new FutureCancelledException(
-          LocalizedStrings.AdminDistributedSystemImpl_FUTURE_CANCELLED_DUE_TO_SHUTDOWN
-              .toLocalizedString(),
-          ex);
-    }
-
-    // Don't just throw the cause because the stack trace can be
-    // misleading. For instance, the cause might have occurred in a
-    // different thread. In addition to the cause, we also want to
-    // know which code was waiting for the Future.
-    throw new RuntimeAdminException(
-        LocalizedStrings.AdminDistributedSystemImpl_WHILE_WAITING_FOR_FUTURE.toLocalizedString(),
-        ex);
-  }
-
-  protected void checkCancellation() {
-    DM dm = this.getDistributionManager();
-    // TODO does dm == null mean we're dead?
-    if (dm != null) {
-      dm.getCancelCriterion().checkCancelInProgress(null);
-    }
-  }
-
-  /**
-   * Returns a list of manageable SystemMember instances for each member of this distributed system.
-   *
-   * @return array of system members for each non-manager member
-   */
-  public SystemMember[] getSystemMemberApplications() throws org.apache.geode.admin.AdminException {
-    synchronized (this.applicationSet) {
-      Collection coll = new ArrayList(this.applicationSet.size());
-      APPS: for (Iterator iter = this.applicationSet.iterator(); iter.hasNext();) {
-        Future future = (Future) iter.next();
-        // this.logger.info("DEBUG: getSystemMemberApplications: " + future);
-        for (;;) {
-          checkCancellation();
-          boolean interrupted = Thread.interrupted();
-          try {
-            coll.add(future.get());
-            break;
-          } catch (InterruptedException ex) {
-            interrupted = true;
-            continue; // keep trying
-          } catch (CancellationException ex) {
-            // this.logger.info("DEBUG: cancelled: " + future, ex);
-            continue APPS;
-          } catch (ExecutionException ex) {
-            // this.logger.info("DEBUG: executed: " + future);
-            handle(ex);
-            continue APPS;
-          } finally {
-            if (interrupted) {
-              Thread.currentThread().interrupt();
-            }
-          }
-        } // for
-      } // APPS
-      SystemMember[] array = new SystemMember[coll.size()];
-      coll.toArray(array);
-      return array;
-    }
-  }
-
-  /**
-   * Display in readable format the latest Alert in this distributed system.
-   *
-   * TODO: create an external admin api object for Alert
-   */
-  public String getLatestAlert() {
-    if (this.latestAlert == null) {
-      return "";
-    }
-    return this.latestAlert.toString();
-  }
-
-  /**
-   * Connects to the currently configured system.
-   */
-  public void connect() {
-    connect(this.logWriter);
-  }
-
-  /**
-   * Connects to the currently configured system. This method is public for internal use only
-   * (testing, for example).
-   *
-   * <p>
-   *
-   * See {@link org.apache.geode.distributed.DistributedSystem#connect} for a list of exceptions
-   * that may be thrown.
-   *
-   * @param logWriter the InternalLogWriter to use for any logging
-   */
-  public void connect(InternalLogWriter logWriter) {
-    synchronized (CONNECTION_SYNC) {
-      // Check if the gfManagerAgent is NOT null.
-      // If it is already listening, then just return since the connection is already established OR
-      // in process.
-      // Otherwise cleanup the state of AdminDistributedSystemImpl. This needs to happen
-      // automatically.
-      if (this.gfManagerAgent != null) {
-        if (this.gfManagerAgent.isListening()) {
-          if (logger.isDebugEnabled()) {
-            logger.debug(
-                "The RemoteGfManagerAgent is already listening for this AdminDistributedSystem.");
-          }
-          return;
-        }
-        this.disconnect();
-      }
-
-      if (thisAdminDS != null) { // TODO: beef up toString and add thisAdminDS
-        throw new IllegalStateException(
-            LocalizedStrings.AdminDistributedSystemImpl_ONLY_ONE_ADMINDISTRIBUTEDSYSTEM_CONNECTION_CAN_BE_MADE_AT_ONCE
-                .toLocalizedString());
-      }
-
-      thisAdminDS = this; // added for feature requests #32887
-
-      if (this.getLocators().length() == 0) {
-        this.id = this.getMcastAddress() + "[" + this.getMcastPort() + "]";
-
-      } else {
-        this.id = this.getLocators();
-      }
-
-      if (this.config instanceof DistributedSystemConfigImpl) {
-        ((DistributedSystemConfigImpl) this.config).validate();
-        ((DistributedSystemConfigImpl) this.config).setDistributedSystem(this);
-      }
-
-      // LOG: passes the AdminDistributedSystemImpl LogWriterLogger into GfManagerAgentConfig for
-      // RemoteGfManagerAgent
-      GfManagerAgent agent = GfManagerAgentFactory.getManagerAgent(buildAgentConfig(logWriter));
-      this.gfManagerAgent = agent;
-
-      // sync to prevent bug 33341 Admin API can double-represent system members
-      synchronized (this.membershipListenerLock) {
-        // build the list of applications...
-        ApplicationVM[] apps = this.gfManagerAgent.listApplications();
-        for (int i = 0; i < apps.length; i++) {
-          try {
-            nodeJoined(null, apps[i]);
-          } catch (RuntimeAdminException e) {
-            this.logWriter.warning("encountered a problem processing member " + apps[i]);
-          }
-        }
-      }
-
-      // Build admin objects for all locators (see bug 31959)
-      String locators = this.getLocators();
-      StringTokenizer st = new StringTokenizer(locators, ",");
-      NEXT: while (st.hasMoreTokens()) {
-        String locator = st.nextToken();
-        int first = locator.indexOf("[");
-        int last = locator.indexOf("]");
-        String host = locator.substring(0, first);
-        int colidx = host.lastIndexOf('@');
-        if (colidx < 0) {
-          colidx = host.lastIndexOf(':');
-        }
-        String bindAddr = null;
-        if (colidx > 0 && colidx < (host.length() - 1)) {
-          String orig = host;
-          bindAddr = host.substring(colidx + 1, host.length());
-          host = host.substring(0, colidx);
-          // if the host contains a colon and there's no '@', we probably
-          // parsed an ipv6 address incorrectly - try again
-          if (host.indexOf(':') >= 0) {
-            int bindidx = orig.lastIndexOf('@');
-            if (bindidx >= 0) {
-              host = orig.substring(0, bindidx);
-              bindAddr = orig.substring(bindidx + 1);
-            } else {
-              host = orig;
-              bindAddr = null;
-            }
-          }
-        }
-        int port = Integer.parseInt(locator.substring(first + 1, last));
-
-        synchronized (this.locatorSet) {
-          LOCATORS: for (Iterator iter = this.locatorSet.iterator(); iter.hasNext();) {
-            Future future = (Future) iter.next();
-            DistributionLocatorImpl impl = null;
-            for (;;) {
-              checkCancellation();
-              boolean interrupted = Thread.interrupted();
-              try {
-                impl = (DistributionLocatorImpl) future.get();
-                break; // success
-              } catch (InterruptedException ex) {
-                interrupted = true;
-                continue; // keep trying
-              } catch (CancellationException ex) {
-                continue LOCATORS;
-              } catch (ExecutionException ex) {
-                handle(ex);
-                continue LOCATORS;
-              } finally {
-                if (interrupted) {
-                  Thread.currentThread().interrupt();
-                }
-              }
-            } // for
-
-            DistributionLocatorConfig conf = impl.getConfig();
-
-            InetAddress host1 = InetAddressUtil.toInetAddress(host);
-            InetAddress host2 = InetAddressUtil.toInetAddress(conf.getHost());
-            if (port == conf.getPort() && host1.equals(host2)) {
-              // Already have an admin object for this locator
-              continue NEXT;
-            }
-          }
-        }
-
-        // None of the existing locators matches the locator in the
-        // string. Contact the locator to get information and create
-        // an admin object for it.
-        InetAddress bindAddress = null;
-        if (bindAddr != null) {
-          bindAddress = InetAddressUtil.toInetAddress(bindAddr);
-        }
-        DistributionLocatorConfig conf =
-            DistributionLocatorConfigImpl.createConfigFor(host, port, bindAddress);
-        if (conf != null) {
-          DistributionLocator impl = createDistributionLocatorImpl(conf);
-          synchronized (this.locatorSet) {
-            this.locatorSet.add(new FutureResult(impl));
-          }
-        }
-      }
-    }
-  }
-
-  /**
-   * Polls to determine whether or not the connection to the distributed system has been made.
-   */
-  public boolean waitToBeConnected(long timeout) throws InterruptedException {
-
-    if (Thread.interrupted())
-      throw new InterruptedException();
-
-    checkConnectCalled();
-
-    long start = System.currentTimeMillis();
-    while (System.currentTimeMillis() - start < timeout) {
-      if (this.gfManagerAgent.isInitialized()) {
-        return true;
-
-      } else {
-        Thread.sleep(100);
-      }
-    }
-
-    return this.isConnected();
-  }
-
-  /**
-   * Closes all connections and resources to the connected distributed system.
-   *
-   * @see org.apache.geode.distributed.DistributedSystem#disconnect()
-   */
-  public void disconnect() {
-    synchronized (CONNECTION_SYNC) {
-      // if (!isConnected()) {
-      // throw new IllegalStateException(this + " is not connected");
-      // }
-      // Assert.assertTrue(thisAdminDS == this);
-      if (this.logWriterAppender != null) {
-        LogWriterAppenders.stop(LogWriterAppenders.Identifier.MAIN);
-      }
-      try {
-        if (thisAdminDS == this) {
-          thisAdminDS = null;
-        }
-        if (this.gfManagerAgent != null && this.gfManagerAgent.isListening()) {
-          synchronized (this) {
-            if (this.health != null) {
-              this.health.close();
-            }
-          }
-          this.gfManagerAgent.removeJoinLeaveListener(this);
-          this.gfManagerAgent.disconnect();
-        }
-        this.gfManagerAgent = null;
-        if (this.config instanceof DistributedSystemConfigImpl) {
-          ((DistributedSystemConfigImpl) this.config).setDistributedSystem(null);
-        }
-      } finally {
-        if (logWriterAppender != null) {
-          LogWriterAppenders.destroy(LogWriterAppenders.Identifier.MAIN);
-        }
-      }
-    }
-  }
-
-  /**
-   * Returns the DistributionManager this implementation is using to connect to the distributed
-   * system.
-   */
-  public DM getDistributionManager() {
-    if (this.gfManagerAgent == null) {
-      return null;
-    }
-    return this.gfManagerAgent.getDM();
-
-  }
-
-  /**
-   * Returns the internal admin API's agent used for administering this
-   * <code>AdminDistributedSystem</code>.
-   *
-   * @since GemFire 4.0
-   */
-  public GfManagerAgent getAdminAgent() {
-    return this.gfManagerAgent;
-  }
-
-  /**
-   * Adds a new, unstarted <code>DistributionLocator</code> to this distributed system.
-   */
-  public DistributionLocator addDistributionLocator() {
-    DistributionLocatorConfig conf = new DistributionLocatorConfigImpl();
-    DistributionLocator locator = createDistributionLocatorImpl(conf);
-    synchronized (this.locatorSet) {
-      this.locatorSet.add(new FutureResult(locator));
-    }
-
-    // update locators string...
-    setLocators(parseLocatorSet());
-    return locator;
-  }
-
-  public DistributionLocator[] getDistributionLocators() {
-    synchronized (this.locatorSet) {
-      Collection coll = new ArrayList(this.locatorSet.size());
-      LOCATORS: for (Iterator iter = this.locatorSet.iterator(); iter.hasNext();) {
-        Future future = (Future) iter.next();
-        for (;;) {
-          checkCancellation();
-          boolean interrupted = Thread.interrupted();
-          try {
-            coll.add(future.get());
-            break; // success
-          } catch (InterruptedException ex) {
-            interrupted = true;
-            continue; // keep trying
-          } catch (CancellationException ex) {
-            continue LOCATORS;
-          } catch (ExecutionException ex) {
-            handle(ex);
-            continue LOCATORS;
-          } finally {
-            if (interrupted) {
-              Thread.currentThread().interrupt();
-            }
-          }
-        } // for
-      }
-
-      DistributionLocator[] array = new DistributionLocator[coll.size()];
-      coll.toArray(array);
-      return array;
-    }
-  }
-
-  /**
-   * Updates the locator string that is used to discover members of the distributed system.
-   *
-   * @see #getLocators
-   */
-  void updateLocatorsString() {
-    this.setLocators(parseLocatorSet());
-  }
-
-  protected String parseLocatorSet() {
-    StringBuffer sb = new StringBuffer();
-    LOCATORS: for (Iterator iter = this.locatorSet.iterator(); iter.hasNext();) {
-      Future future = (Future) iter.next();
-      DistributionLocator locator = null;
-      for (;;) {
-        checkCancellation();
-        boolean interrupted = Thread.interrupted();
-        try {
-          locator = (DistributionLocator) future.get();
-          break; // success
-        } catch (InterruptedException ex) {
-          interrupted = true;
-          continue; // keep trying
-        } catch (CancellationException ex) {
-          continue LOCATORS;
-        } catch (ExecutionException ex) {
-          handle(ex);
-          continue LOCATORS;
-        } finally {
-          if (interrupted) {
-            Thread.currentThread().interrupt();
-          }
-        }
-      }
-      sb.append(locator.getConfig().getHost());
-      sb.append("[").append(locator.getConfig().getPort()).append("]");
-
-      if (iter.hasNext()) {
-        sb.append(",");
-      }
-    }
-    return sb.toString();
-  }
-
-  // -------------------------------------------------------------------------
-  // Listener callback methods
-  // -------------------------------------------------------------------------
-
-  /** sync to prevent bug 33341 Admin API can double-represent system members */
-  private final Object membershipListenerLock = new Object();
-
-  // --------- org.apache.geode.internal.admin.JoinLeaveListener ---------
-  /**
-   * Listener callback for when a member has joined this DistributedSystem.
-   * <p>
-   * React by adding the SystemMember to this system's internal lists, if they are not already
-   * there. Notice that we add a {@link Future} into the list so that the admin object is not
-   * initialized while locks are held.
-   *
-   * @param source the distributed system that fired nodeJoined
-   * @param vm the VM that joined
-   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeJoined
-   */
-  public void nodeJoined(GfManagerAgent source, final GemFireVM vm) {
-    // sync to prevent bug 33341 Admin API can double-represent system members
-    synchronized (this.membershipListenerLock) {
-      // this.logger.info("DEBUG: nodeJoined: " + vm.getId(), new RuntimeException("STACK"));
-
-      // does it already exist?
-      SystemMember member = findSystemMember(vm);
-
-      // if not then create it...
-      if (member == null) {
-        // this.logger.info("DEBUG: no existing member: " + vm.getId());
-        FutureTask future = null;
-        // try {
-        if (vm instanceof ApplicationVM) {
-          final ApplicationVM app = (ApplicationVM) vm;
-          if (app.isDedicatedCacheServer()) {
-            synchronized (this.cacheServerSet) {
-              future = new AdminFutureTask(vm.getId(), new Callable() {
-                public Object call() throws Exception {
-                  logger.info(LogMarker.DM,
-                      LocalizedMessage.create(
-                          LocalizedStrings.AdminDistributedSystemImpl_ADDING_NEW_CACHESERVER_FOR__0,
-                          vm));
-                  return createCacheServer(app);
-                }
-              });
-
-              this.cacheServerSet.add(future);
-            }
-
-          } else {
-            synchronized (this.applicationSet) {
-              future = new AdminFutureTask(vm.getId(), new Callable() {
-                public Object call() throws Exception {
-                  logger.info(LogMarker.DM,
-                      LocalizedMessage.create(
-                          LocalizedStrings.AdminDistributedSystemImpl_ADDING_NEW_APPLICATION_FOR__0,
-                          vm));
-                  return createSystemMember(app);
-                }
-              });
-              this.applicationSet.add(future);
-            }
-          }
-
-        } else {
-          Assert.assertTrue(false, "Unknown GemFireVM type: " + vm.getClass().getName());
-        }
-
-        // } catch (AdminException ex) {
-        // String s = "Could not create a SystemMember for " + vm;
-        // this.logger.warning(s, ex);
-        // }
-
-        // Wait for the SystemMember to be created. We want to do this
-        // outside of the "set" locks.
-        future.run();
-        for (;;) {
-          checkCancellation();
-          boolean interrupted = Thread.interrupted();
-          try {
-            member = (SystemMember) future.get();
-            break; // success
-          } catch (InterruptedException ex) {
-            interrupted = true;
-            continue; // keep trying
-          } catch (CancellationException ex) {
-            // this.logger.info("DEBUG: run cancelled: " + future, ex);
-            return;
-          } catch (ExecutionException ex) {
-            // this.logger.info("DEBUG: run executed: " + future, ex);
-            handle(ex);
-            return;
-          } finally {
-            if (interrupted) {
-              Thread.currentThread().interrupt();
-            }
-          }
-        } // for
-
-        Assert.assertTrue(member != null);
-
-        // moved this up into the if that creates a new member to fix bug 34517
-        SystemMembershipEvent event = new SystemMembershipEventImpl(member.getDistributedMember());
-        for (Iterator iter = this.membershipListeners.iterator(); iter.hasNext();) {
-          SystemMembershipListener listener = (SystemMembershipListener) iter.next();
-          listener.memberJoined(event);
-        }
-        // } else {
-        // this.logger.info("DEBUG: found existing member: " + member);
-      }
-
-    }
-  }
-
-  /**
-   * Listener callback for when a member of this DistributedSystem has left.
-   * <p>
-   * Reacts by removing the member.
-   *
-   * @param source the distributed system that fired nodeCrashed
-   * @param vm the VM that left
-   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeLeft
-   */
-  public void nodeLeft(GfManagerAgent source, GemFireVM vm) {
-    // sync to prevent bug 33341 Admin API can double-represent system members
-    synchronized (this.membershipListenerLock) {
-      // member has left...
-      SystemMember member = AdminDistributedSystemImpl.this.removeSystemMember(vm.getId());
-      if (member == null) {
-        return; // reinstated this early-out because removal does not fix 39429
-      }
-
-      // Can't call member.getId() because it is nulled-out when the
-      // SystemMember is removed.
-      SystemMembershipEvent event = new SystemMembershipEventImpl(vm.getId());
-      for (Iterator iter = this.membershipListeners.iterator(); iter.hasNext();) {
-        SystemMembershipListener listener = (SystemMembershipListener) iter.next();
-        listener.memberLeft(event);
-      }
-    }
-  }
-
-  /**
-   * Listener callback for when a member of this DistributedSystem has crashed.
-   * <p>
-   * Reacts by removing the member.
-   *
-   * @param source the distributed system that fired nodeCrashed
-   * @param vm the VM that crashed
-   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeCrashed
-   */
-  public void nodeCrashed(GfManagerAgent source, GemFireVM vm) {
-    // sync to prevent bug 33341 Admin API can double-represent system members
-    synchronized (this.membershipListenerLock) {
-      // member has crashed...
-      SystemMember member = AdminDistributedSystemImpl.this.removeSystemMember(vm.getId());
-      if (member == null) {
-        // Unknown member crashed. Hmm...
-        return;
-      }
-
-      // Can't call member.getId() because it is nulled-out when the
-      // SystemMember is removed.
-      SystemMembershipEvent event = new SystemMembershipEventImpl(vm.getId());
-      for (Iterator iter = this.membershipListeners.iterator(); iter.hasNext();) {
-        SystemMembershipListener listener = (SystemMembershipListener) iter.next();
-        listener.memberCrashed(event);
-      }
-    }
-  }
-
-  // ----------- org.apache.geode.internal.admin.AlertListener -----------
-  /**
-   * Listener callback for when a SystemMember of this DistributedSystem has crashed.
-   *
-   * @param alert the latest alert from the system
-   * @see org.apache.geode.internal.admin.AlertListener#alert
-   */
-  public void alert(org.apache.geode.internal.admin.Alert alert) {
-    if (AlertLevel.forSeverity(alert.getLevel()).ordinal < alertLevel.ordinal) {
-      return;
-    }
-    Alert alert2 = new AlertImpl(alert);
-    this.latestAlert = alert2;
-    for (Iterator<AlertListener> iter = this.alertListeners.iterator(); iter.hasNext();) {
-      AlertListener listener = iter.next();
-      listener.alert(alert2);
-    }
-  }
-
-  public void onDisconnect(InternalDistributedSystem sys) {
-    logger.debug("Calling AdminDistributedSystemImpl#onDisconnect");
-    disconnect();
-    logger.debug("Completed AdminDistributedSystemImpl#onDisconnect");
-  }
-
-  // -------------------------------------------------------------------------
-  // Template methods overriden from superclass...
-  // -------------------------------------------------------------------------
-
-  protected CacheServer createCacheServer(ApplicationVM member) throws AdminException {
-
-    return new CacheServerImpl(this, member);
-  }
-
-  protected CacheServer createCacheServer(CacheServerConfigImpl conf) throws AdminException {
-
-    return new CacheServerImpl(this, conf);
-  }
-
-  /**
-   * Override createSystemMember by instantiating SystemMemberImpl
-   * 
-   * @throws AdminException TODO-javadocs
-   */
-  protected SystemMember createSystemMember(ApplicationVM app)
-      throws org.apache.geode.admin.AdminException {
-    return new SystemMemberImpl(this, app);
-  }
-
-  /**
-   * Constructs & returns a SystemMember instance using the corresponding InternalDistributedMember
-   * object.
-   * 
-   * @param member InternalDistributedMember instance for which a SystemMember instance is to be
-   *        constructed.
-   * @return constructed SystemMember instance
-   * @throws org.apache.geode.admin.AdminException if construction of SystemMember instance fails
-   * @since GemFire 6.5
-   */
-  protected SystemMember createSystemMember(InternalDistributedMember member)
-      throws org.apache.geode.admin.AdminException {
-    return new SystemMemberImpl(this, member);
-  }
-
-  /**
-   * Template-method for creating a new <code>DistributionLocatorImpl</code> instance.
-   */
-  protected DistributionLocatorImpl createDistributionLocatorImpl(DistributionLocatorConfig conf) {
-    return new DistributionLocatorImpl(conf, this);
-  }
-
-  // -------------------------------------------------------------------------
-  // Non-public implementation methods... TODO: narrow access levels
-  // -------------------------------------------------------------------------
-
-  // TODO: public void connect(...) could stand to have some internals factored out
-
-  /**
-   * Returns List of Locators including Locators or Multicast.
-   *
-   * @return list of locators or multicast values
-   */
-  protected List parseLocators() {
-
-    // assumes host[port] format, delimited by ","
-    List locatorIds = new ArrayList();
-    if (isMcastEnabled()) {
-      String mcastId = new StringBuffer(this.getMcastAddress()).append("[")
-          .append(this.getMcastPort()).append("]").toString();
-      locatorIds.add(new DistributionLocatorId(mcastId));
-    }
-    StringTokenizer st = new StringTokenizer(this.getLocators(), ",");
-    while (st.hasMoreTokens()) {
-      locatorIds.add(new DistributionLocatorId(st.nextToken()));
-    }
-
-    if (logger.isDebugEnabled()) {
-      StringBuffer sb = new StringBuffer("Locator set is: ");
-      for (Iterator iter = locatorIds.iterator(); iter.hasNext();) {
-        sb.append(iter.next());
-        sb.append(" ");
-      }
-      logger.debug(sb);
-    }
-
-    return locatorIds;
-  }
-
-  /**
-   * Returns whether or not a <code>SystemMember</code> corresponds to a <code>GemFireVM</code>.
-   *
-   * @param examineConfig Should we take the configuration of the member into consideration? In
-   *        general, we want to consider the configuration when a member starts up. But when we are
-   *        notified that it has shut down, we do not want to examine the configuration because that
-   *        might involve contacting the member. Which, of course, cannot be done because it has
-   *        shut down.
-   */
-  private boolean isSame(SystemMemberImpl member, GemFireVM vm, boolean examineConfig) {
-    if (vm.equals(member.getGemFireVM())) {
-      return true;
-    }
-
-    InternalDistributedMember memberId = member.getInternalId();
-    InternalDistributedMember vmId = vm.getId();
-
-    if (vmId.equals(memberId)) {
-      return true;
-    }
-
-    if ((member instanceof ManagedSystemMemberImpl) && examineConfig) {
-
-      // We can't compare information about managers because the
-      // member might have already gone away. Attempts to send it
-      // messages (to get its product directory, for instance) will
-      // time out.
-
-      ManagedSystemMemberImpl entity = (ManagedSystemMemberImpl) member;
-
-      // Make sure that the type of the managed entity matches the
-      // type of the internal admin object.
-      if (entity instanceof CacheServer) {
-        if (!(vm instanceof ApplicationVM)) {
-          return false;
-        }
-
-        ApplicationVM app = (ApplicationVM) vm;
-        if (!app.isDedicatedCacheServer()) {
-          return false;
-        }
-      }
-
-      ManagedEntityConfig conf = entity.getEntityConfig();
-      InetAddress managedHost = InetAddressUtil.toInetAddress(conf.getHost());
-      File managedWorkingDir = new File(conf.getWorkingDirectory());
-      File managedProdDir = new File(conf.getProductDirectory());
-
-      InetAddress vmHost = vm.getHost();
-      File vmWorkingDir = vm.getWorkingDirectory();
-      File vmProdDir = vm.getGemFireDir();
-
-      if (vmHost.equals(managedHost) && isSameFile(vmWorkingDir, managedWorkingDir)
-          && isSameFile(vmProdDir, managedProdDir)) {
-        return true;
-      }
-    }
-
-    return false;
-  }
-
-  /**
-   * Returns whether or not the names of the two files represent the same file.
-   */
-  private boolean isSameFile(File file1, File file2) {
-    if (file1.equals(file2)) {
-      return true;
-    }
-
-    if (file1.getAbsoluteFile().equals(file2.getAbsoluteFile())) {
-      return true;
-    }
-
-    try {
-      if (file1.getCanonicalFile().equals(file2.getCanonicalFile())) {
-        return true;
-      }
-
-      // StringBuffer sb = new StringBuffer();
-      // sb.append("File 1: ");
-      // sb.append(file1);
-      // sb.append("\nFile 2: ");
-      // sb.append(file2);
-      // sb.append("\n Absolute 1: ");
-      // sb.append(file1.getAbsoluteFile());
-      // sb.append("\n Absolute 2: ");
-      // sb.append(file2.getAbsoluteFile());
-      // sb.append("\n Canonical 1: ");
-      // sb.append(file1.getCanonicalFile());
-      // sb.append("\n Canonical 2: ");
-      // sb.append(file2.getCanonicalFile());
-      // logger.info(sb.toString());
-
-    } catch (IOException ex) {
-      // oh well...
-      logger.info(LocalizedMessage
-          .create(LocalizedStrings.AdminDistributedSystemImpl_WHILE_GETTING_CANONICAL_FILE), ex);
-    }
-
-    return false;
-  }
-
-  /**
-   * Finds and returns the <code>SystemMember</code> that corresponds to the given
-   * <code>GemFireVM</code> or <code>null</code> if no <code>SystemMember</code> corresponds.
-   */
-  protected SystemMember findSystemMember(GemFireVM vm) {
-    return findSystemMember(vm, true);
-  }
-
-  /**
-   * Finds and returns the <code>SystemMember</code> that corresponds to the given
-   * <code>GemFireVM</code> or <code>null</code> if no Finds and returns the
-   * <code>SystemMember</code> that corresponds to the given <code>GemFireVM</code> or
-   * <code>null</code> if no <code>SystemMember</code> corresponds.
-   * 
-   * 
-   * @param vm GemFireVM instance
-   * @param compareConfig Should the members' configurations be compared? <code>true</code> when the
-   *        member has joined, <code>false</code> when the member has left Should the members'
-   *        configurations be compared? <code>true</code> when the member has joined,
-   *        <code>false</code> when the member has left. Additionally also used to check if system
-   *        member config is to be synchronized with the VM.
-   */
-  protected SystemMember findSystemMember(GemFireVM vm, boolean compareConfig) {
-
-    SystemMemberImpl member = null;
-
-    synchronized (this.cacheServerSet) {
-      SERVERS: for (Iterator iter = this.cacheServerSet.iterator(); iter.hasNext();) {
-        Future future = (Future) iter.next();
-        CacheServerImpl cacheServer = null;
-        for (;;) {
-          checkCancellation();
-          boolean interrupted = Thread.interrupted();
-          try {
-            cacheServer = (CacheServerImpl) future.get();
-            break; // success
-          } catch (InterruptedException ex) {
-            interrupted = true;
-            continue; // keep trying
-          } catch (CancellationException ex) {
-            continue SERVERS;
-          } catch (ExecutionException ex) {
-            handle(ex);
-            continue SERVERS;
-          } finally {
-            if (interrupted) {
-              Thread.currentThread().interrupt();
-            }
-          }
-        } // for
-
-        if (isSame(cacheServer, vm, compareConfig)) {
-          member = cacheServer;
-          break;
-        }
-      }
-    }
-
-    if (member == null) {
-      synchronized (this.applicationSet) {
-        APPS: for (Iterator iter = this.applicationSet.iterator(); iter.hasNext();) {
-          Future future = (Future) iter.next();
-          SystemMemberImpl application = null;
-          for (;;) {
-            checkCancellation();
-            boolean interrupted = Thread.interrupted();
-            try {
-              application = (SystemMemberImpl) future.get();
-              break; // success
-            } catch (InterruptedException ex) {
-              interrupted = true;
-              continue; // keep trying
-            } catch (CancellationException ex) {
-              continue APPS;
-            } catch (ExecutionException ex) {
-              handle(ex);
-              continue APPS;
-            } finally {
-              if (interrupted) {
-                Thread.currentThread().interrupt();
-              }
-            }
-          } // for
-
-          if (isSame(application, vm, compareConfig)) {
-            member = application;
-            break;
-          }
-        } // APPS
-      }
-    }
-
-    if (member != null && compareConfig) {
-      try {
-        member.setGemFireVM(vm);
-
-      } catch (AdminException ex) {
-        logger.warn(LocalizedMessage
-            .create(LocalizedStrings.AdminDistributedSystem_COULD_NOT_SET_THE_GEMFIRE_VM), ex);
-      }
-    }
-
-    return member;
-  }
-
-  /**
-   * Removes a SystemMember from this system's list of known members.
-   *
-   * @param systemMember the member to remove
-   * @return the system member that was removed; null if no match was found
-   */
-  protected SystemMember removeSystemMember(SystemMember systemMember) {
-    return removeSystemMember(((SystemMemberImpl) systemMember).getInternalId());
-  }
-
-  /**
-   * Removes a SystemMember from this system's list of known members. This method is called in
-   * response to a member leaving the system. TODO: this method is a mess of defns
-   *
-   * @param internalId the unique id that specifies which member to remove
-   * @return the system member that was removed; null if no match was found
-   */
-  protected SystemMember removeSystemMember(InternalDistributedMember internalId) {
-    if (internalId == null)
-      return null;
-
-    // this.logger.info("DEBUG: removeSystemMember: " + internalId, new RuntimeException("STACK"));
-
-    boolean found = false;
-    SystemMemberImpl member = null;
-
-    synchronized (this.cacheServerSet) {
-      SERVERS: for (Iterator iter = this.cacheServerSet.iterator(); iter.hasNext() && !found;) {
-        Future future = (Future) iter.next();
-        if (future instanceof AdminFutureTask) {
-          AdminFutureTask task = (AdminFutureTask) future;
-          if (task.getMemberId().equals(internalId)) {
-            // this.logger.info("DEBUG: removeSystemMember cs cancelling: " + future);
-            future.cancel(true);
-
-          } else {
-            // This is not the member we are looking for...
-            continue SERVERS;
-          }
-        }
-        for (;;) {
-          checkCancellation();
-          boolean interrupted = Thread.interrupted();
-          try {
-            member = (SystemMemberImpl) future.get();
-            break; // success
-          } catch (InterruptedException ex) {
-            interrupted = true;
-            continue; // keep trying
-          } catch (CancellationException ex) {
-            continue SERVERS;
-          } catch (ExecutionException ex) {
-            handle(ex);
-            return null; // Dead code
-          } finally {
-            if (interrupted) {
-              Thread.currentThread().interrupt();
-            }
-          }
-        }
-
-        InternalDistributedMember cacheServerId = member.getInternalId();
-        if (internalId.equals(cacheServerId)) {
-          // found a match...
-          iter.remove();
-          found = true;
-        }
-      } // SERVERS
-    }
-
-    synchronized (this.applicationSet) {
-      for (Iterator iter = this.applicationSet.iterator(); iter.hasNext() && !found;) {
-        Future future = (Future) iter.next();
-        try {
-          if (future instanceof AdminFutureTask) {
-            AdminFutureTask task = (AdminFutureTask) future;
-            if (task.getMemberId().equals(internalId)) {
-              iter.remove(); // Only remove applications
-              found = true;
-              if (future.isDone()) {
-                member = (SystemMemberImpl) future.get();
-              }
-              break;
-            } else {
-              // This is not the member we are looking for...
-              continue;
-            }
-          }
-          if (future.isDone()) {
-            member = (SystemMemberImpl) future.get();
-          } else {
-            // this.logger.info("DEBUG: removeSystemMember as cancelling: " + future);
-            future.cancel(true);
-          }
-
-        } catch (InterruptedException ex) {
-          Thread.currentThread().interrupt();
-          checkCancellation();
-          throw new RuntimeException(
-              LocalizedStrings.AdminDistributedSystemImpl_INTERRUPTED.toLocalizedString(), ex);
-
-        } catch (CancellationException ex) {
-          continue;
-
-        } catch (ExecutionException ex) {
-          handle(ex);
-          return null; // Dead code
-        }
-
-        InternalDistributedMember applicationId = member.getInternalId();
-        if (internalId.equals(applicationId)) {
-          // found a match...
-          iter.remove(); // Only remove applications
-          found = true;
-        }
-      }
-    }
-
-    if (found) {
-      try {
-        if (member != null) {
-          member.setGemFireVM(null);
-        }
-
-      } catch (AdminException ex) {
-        logger.fatal(LocalizedMessage
-            .create(LocalizedStrings.AdminDistributedSystem_UNEXPECTED_ADMINEXCEPTION), ex);
-      }
-      return member;
-
-    } else {
-      if (logger.isDebugEnabled()) {
-        logger.debug("Couldn't remove member {}", internalId);
-      }
-      return null;
-    }
-  }
-
-  /**
-   * Builds the configuration needed to connect to a GfManagerAgent which is the main gateway into
-   * the internal.admin api. GfManagerAgent is used to actually connect to the distributed gemfire
-   * system.
-   *
-   * @param logWriter the LogWriterI18n to use for any logging
-   * @return the configuration needed to connect to a GfManagerAgent
-   */
-  // LOG: saves LogWriterLogger from AdminDistributedSystemImpl for RemoteGfManagerAgentConfig
-  private GfManagerAgentConfig buildAgentConfig(InternalLogWriter logWriter) {
-    RemoteTransportConfig conf = new RemoteTransportConfig(isMcastEnabled(), getDisableTcp(),
-        getDisableAutoReconnect(), getBindAddress(), buildSSLConfig(), parseLocators(),
-        getMembershipPortRange(), getTcpPort(), DistributionManager.ADMIN_ONLY_DM_TYPE);
-    return new GfManagerAgentConfig(getSystemName(), conf, logWriter, this.alertLevel.getSeverity(),
-        this, this);
-  }
-
-  protected SSLConfig buildSSLConfig() {
-    SSLConfig conf = new SSLConfig();
-    if (getConfig() != null) {
-      conf.setEnabled(getConfig().isSSLEnabled());
-      conf.setProtocols(getConfig().getSSLProtocols());
-      conf.setCiphers(getConfig().getSSLCiphers());
-      conf.setRequireAuth(getConfig().isSSLAuthenticationRequired());
-      conf.setProperties(getConfig().getSSLProperties());
-    }
-    return conf;
-  }
-
-  /**
-   * Returns the currently configured address to bind to when administering this system.
-   */
-  private String getBindAddress() {
-    return this.config.getBindAddress();
-  }
-
-  /** Returns whether or not the given member is running */
-  private boolean isRunning(SystemMember member) {
-    if (member instanceof ManagedEntity) {
-      return ((ManagedEntity) member).isRunning();
-
-    } else {
-      // member must be an application VM. It is running
-      return true;
-    }
-  }
-
-  /** Returns any member manager that is known to be running */
-  private SystemMember findFirstRunningMember() {
-    synchronized (this.cacheServerSet) {
-      SERVERS: for (Iterator iter = this.cacheServerSet.iterator(); iter.hasNext();) {
-        Future future = (Future) iter.next();
-        SystemMember member = null;
-        for (;;) {
-          checkCancellation();
-          boolean interrupted = Thread.interrupted();
-          try {
-            member = (SystemMember) future.get();
-            break; // success
-          } catch (InterruptedException ex) {
-            interrupted = true;
-            continue; // keep trying
-          } catch (CancellationException ex) {
-            continue SERVERS;
-          } catch (ExecutionException ex) {
-            handle(ex);
-            return null; // Dead code
-          } finally {
-            if (interrupted) {
-              Thread.currentThread().interrupt();
-            }
-          }
-        } // for
-
-        if (isRunning(member)) {
-          return member;
-        }
-      }
-    }
-
-    synchronized (this.applicationSet) {
-      APPS: for (Iterator iter = this.applicationSet.iterator(); iter.hasNext();) {
-        Future future = (Future) iter.next();
-        SystemMember member = null;
-        for (;;) {
-          checkCancellation();
-          boolean interrupted = Thread.interrupted();
-          try {
-            member = (SystemMember) future.get();
-            break; // success
-          } catch (InterruptedException ex) {
-            interrupted = true;
-            continue; // keep trying
-          } catch (CancellationException ex) {
-            continue APPS;
-          } catch (ExecutionException ex) {
-            handle(ex);
-            return null; // Dead code
-          } finally {
-            if (interrupted) {
-              Thread.currentThread().interrupt();
-            }
-          }
-        } // for
-
-        if (isRunning(member)) {
-          return member;
-        }
-      } // APPS
-    }
-
-    return null;
-  }
-
-  /**
-   * Returns the instance of system member that is running either as a CacheVm or only ApplicationVm
-   * for the given string representation of the id.
-   * 
-   * @param memberId string representation of the member identifier
-   * @return instance of system member which could be either as a CacheVm or Application VM
-   */
-  protected SystemMember findCacheOrAppVmById(String memberId) {
-    SystemMember found = null;
-
-    if (memberId != null) {
-      try {
-        boolean foundSender = false;
-        CacheVm[] cacheVms = getCacheVms();
-
-        /*
-         * cacheVms could be null. See AdminDistributedSystemImpl.getCacheVmsCollection() for
-         * ExecutionException
-         */
-        if (cacheVms != null) {
-          for (CacheVm cacheVm : cacheVms) {
-            if (cacheVm.getId().equals(memberId) && cacheVm instanceof CacheVm) {
-              found = (SystemMember) cacheVm;
-              foundSender = true;
-              break;
-            }
-          }
-        }
-
-        if (!foundSender) {
-          SystemMember[] appVms = getSystemMemberApplications();
-
-          for (SystemMember appVm : appVms) {
-            if (appVm.getId().equals(memberId) && appVm instanceof SystemMember) {
-              found = (SystemMember) appVm;
-              foundSender = true;
-              break;
-            }
-          }
-
-        }
-      } catch (AdminException e) {
-        if (logger.isDebugEnabled()) {
-          logger.debug("Could not find System Member for member id: {}", memberId, e);
-        }
-      }
-    }
-
-    return found;
-  }
-
-  /** Returns true if any member application is known to be running */
-  protected boolean isAnyMemberRunning() {
-    return findFirstRunningMember() != null;
-  }
-
-  // -------------------------------------------------------------------------
-  // Health methods
-  // -------------------------------------------------------------------------
-
-  /**
-   * Lazily initializes the GemFire health monitor
-   *
-   * @see #createGemFireHealth
-   */
-  public final GemFireHealth getGemFireHealth() {
-    synchronized (this) {
-      if (this.health == null || this.health.isClosed()) {
-        try {
-          this.health = createGemFireHealth(this.gfManagerAgent);
-
-        } catch (AdminException ex) {
-          throw new RuntimeAdminException(
-              LocalizedStrings.AdminDistributedSystemImpl_AN_ADMINEXCEPTION_WAS_THROWN_WHILE_GETTING_THE_GEMFIRE_HEALTH
-                  .toLocalizedString(),
-              ex);
-        }
-      }
-
-      return this.health;
-    }
-  }
-
-  /**
-   * A "template factory" method for creating an instance of <code>GemFireHealth</code>. It can be
-   * overridden by subclasses to produce instances of different <code>GemFireHealth</code>
-   * implementations.
-   *
-   * @see #getGemFireHealth
-   */
-  protected GemFireHealth createGemFireHealth(GfManagerAgent agent) throws AdminException {
-
-    if (agent == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.AdminDistributedSystemImpl_GFMANAGERAGENT_MUST_NOT_BE_NULL
-              .toLocalizedString());
-    }
-    return new GemFireHealthImpl(agent, this);
-  }
-
-  public CacheVm addCacheVm() throws AdminException {
-    return (CacheVm) addCacheServer();
-  }
-
-  public CacheServer addCacheServer() throws AdminException {
-    CacheServerConfigImpl conf = new CacheServerConfigImpl();
-    CacheServer server = createCacheServer(conf);
-    setDistributionParameters(server);
-
-    synchronized (this.cacheServerSet) {
-      this.cacheServerSet.add(new FutureResult(server));
-    }
-
-    return server;
-  }
-
-  private Collection getCacheVmsCollection() throws AdminException {
-    synchronized (this.cacheServerSet) {
-      Collection coll = new ArrayList(this.cacheServerSet.size());
-      SERVERS: for (Iterator iter = this.cacheServerSet.iterator(); iter.hasNext();) {
-        Future future = (Future) iter.next();
-        Object get = null;
-        for (;;) {
-          checkCancellation();
-          boolean interrupted = Thread.interrupted();
-          try {
-            get = future.get();
-            break; // success
-          } catch (InterruptedException ex) {
-            interrupted = true;
-            continue; // keep trying
-          } catch (CancellationException ex) {
-            continue SERVERS;
-          } catch (ExecutionException ex) {
-            handle(ex);
-            return null; // Dead code
-          } finally {
-            if (interrupted) {
-              Thread.currentThread().interrupt();
-            }
-          }
-        } // for
-        coll.add(get);
-      } // SERVERS
-      return coll;
-    }
-  }
-
-  /**
-   * Returns all the cache server members of the distributed system which are hosting a client queue
-   * for the particular durable-client having the given durableClientId
-   * 
-   * @param durableClientId - durable-id of the client
-   * @return array of CacheServer(s) having the queue for the durable client
-   * @throws AdminException
-   * 
-   * @since GemFire 5.6
-   */
-  public CacheServer[] getCacheServers(String durableClientId) throws AdminException {
-    Collection serversForDurableClient = new ArrayList();
-    CacheServer[] servers = getCacheServers();
-
-    for (int i = 0; i < servers.length; i++) {
-      RemoteApplicationVM vm = (RemoteApplicationVM) ((CacheServerImpl) servers[i]).getGemFireVM();
-      if (vm != null && vm.hasDurableClient(durableClientId)) {
-        serversForDurableClient.add(servers[i]);
-      }
-    }
-    CacheServer[] array = new CacheServer[serversForDurableClient.size()];
-    serversForDurableClient.toArray(array);
-    return array;
-  }
-
-  public CacheVm[] getCacheVms() throws AdminException {
-    Collection coll = getCacheVmsCollection();
-    if (coll == null)
-      return null;
-    CacheVm[] array = new CacheVm[coll.size()];
-    coll.toArray(array);
-    return array;
-  }
-
-  public CacheServer[] getCacheServers() throws AdminException {
-    Collection coll = getCacheVmsCollection();
-    if (coll == null)
-      return null;
-    CacheServer[] array = new CacheServer[coll.size()];
-    coll.toArray(array);
-    return array;
-  }
-
-  // -------------------------------------------------------------------------
-  // Overriden java.lang.Object methods
-  // -------------------------------------------------------------------------
-
-  /**
-   * Returns a string representation of the object.
-   * 
-   * @return a string representation of the object
-   */
-  @Override // GemStoneAddition
-  public String toString() {
-    return getName();
-  }
-
-  /**
-   * returns instance of AdminDistributedSystem that is current connected. See
-   * <code>thisAdminDS</code>. (for feature requests #32887)
-   * <p>
-   * TODO: remove this static method during reimplementation of
-   * {@link SystemMemberCacheEventProcessor}
-   * 
-   * @return AdminDistributedSystem
-   */
-  public static AdminDistributedSystemImpl getConnectedInstance() {
-    synchronized (CONNECTION_SYNC) {
-      return thisAdminDS;
-    }
-  }
-
-  public void addCacheListener(SystemMemberCacheListener listener) {
-    synchronized (this.cacheListLock) {
-      // never modify cacheListeners in place.
-      // this allows iteration without concurrent mod worries
-      List oldListeners = this.cacheListeners;
-      if (!oldListeners.contains(listener)) {
-        List newListeners = new ArrayList(oldListeners);
-        newListeners.add(listener);
-        this.cacheListeners = newListeners;
-      }
-    }
-  }
-
-  public void removeCacheListener(SystemMemberCacheListener listener) {
-    synchronized (this.cacheListLock) {
-      List oldListeners = this.cacheListeners;
-      if (oldListeners.contains(listener)) {
-        List newListeners = new ArrayList(oldListeners);
-        if (newListeners.remove(listener)) {
-          if (newListeners.isEmpty()) {
-            newListeners = Collections.EMPTY_LIST;
-          }
-          this.cacheListeners = newListeners;
-        }
-      }
-    }
-  }
-
-  public List getCacheListeners() {
-    return this.cacheListeners;
-  }
-
-  public SystemMember lookupSystemMember(DistributedMember distributedMember)
-      throws AdminException {
-    if (distributedMember == null)
-      return null;
-    SystemMember[] members = getSystemMemberApplications();
-    for (int i = 0; i < members.length; i++) {
-      if (distributedMember.equals(members[i].getDistributedMember())) {
-        return members[i];
-      }
-    }
-    return null;
-  }
-
-  //////////////////////// Inner Classes ////////////////////////
-
-  /**
-   * Object that converts an <code>internal.admin.Alert</code> into an external
-   * <code>admin.Alert</code>.
-   */
-  public class AlertImpl implements Alert {
-    /** The Alert to which most behavior is delegated */
-    private final org.apache.geode.internal.admin.Alert alert;
-    private SystemMember systemMember;
-
-    /////////////////////// Constructors ///////////////////////
-
-    /**
-     * Creates a new <code>Alert</code> that delegates to the given object.
-     */
-    AlertImpl(org.apache.geode.internal.admin.Alert alert) {
-      this.alert = alert;
-      GemFireVM vm = alert.getGemFireVM();
-
-      /*
-       * Related to #39657. Avoid setting GemFireVM again in the system member. Eager initialization
-       * of member variable - systemMember.
-       */
-      this.systemMember = vm == null ? null : findSystemMember(vm, false);
-      if (this.systemMember == null) {
-        /*
-         * try to use sender information to construct the SystemMember that can be used for disply
-         * purpose at least
-         */
-        InternalDistributedMember sender = alert.getSender();
-        if (sender != null) {
-          try {
-            this.systemMember = AdminDistributedSystemImpl.this.createSystemMember(sender);
-          } catch (AdminException e) {
-            /*
-             * AdminException might be thrown if creation of System Member instance fails.
-             */
-            this.systemMember = null;
-          }
-        } // else this.systemMember will be null
-      }
-    }
-
-    ////////////////////// Instance Methods //////////////////////
-
-    public AlertLevel getLevel() {
-      return AlertLevel.forSeverity(alert.getLevel());
-    }
-
-    /*
-     * Eager initialization of system member is done while creating this alert only.
-     */
-    public SystemMember getSystemMember() {
-      return systemMember;
-    }
-
-    public String getConnectionName() {
-      return alert.getConnectionName();
-    }
-
-    public String getSourceId() {
-      return alert.getSourceId();
-    }
-
-    public String getMessage() {
-      return alert.getMessage();
-    }
-
-    public java.util.Date getDate() {
-      return alert.getDate();
-    }
-
-    @Override
-    public String toString() {
-      return alert.toString();
-    }
-  }
-
-  /**
-   * A JSR-166 <code>FutureTask</code> whose {@link #get} method properly handles an
-   * <code>ExecutionException</code> that wraps an <code>InterruptedException</code>. This is
-   * necessary because there are places in the admin API that wrap
-   * <code>InterruptedException</code>s. See bug 32634.
-   *
-   * <P>
-   *
-   * This is by no means an ideal solution to this problem. It would be better to modify the code
-   * invoked by the <code>Callable</code> to explicitly throw <code>InterruptedException</code>.
-   */
-  static class AdminFutureTask extends FutureTask {
-
-    /**
-     * The id of the member whose admin object we are creating. Keeping track of this allows us to
-     * cancel a FutureTask for a member that has gone away.
-     */
-    private final InternalDistributedMember memberId;
-
-    public AdminFutureTask(InternalDistributedMember memberId, Callable callable) {
-      super(callable);
-      this.memberId = memberId;
-    }
-
-    /**
-     * Returns the id of the member of the distributed system for which this <code>FutureTask</code>
-     * is doing work.
-     */
-    public InternalDistributedMember getMemberId() {
-      return this.memberId;
-    }
-
-    /**
-     * If the <code>ExecutionException</code> is caused by an <code>InterruptedException</code>,
-     * throw the <code>CancellationException</code> instead.
-     */
-    @Override
-    public Object get() throws InterruptedException, ExecutionException {
-
-      if (Thread.interrupted())
-        throw new InterruptedException();
-      try {
-        return super.get();
-
-      } catch (ExecutionException ex) {
-        for (Throwable cause = ex.getCause(); cause != null; cause = cause.getCause()) {
-          if (cause instanceof InterruptedException) {
-            // We interrupted the runnable but we don't want the thread
-            // that called get to think he was interrupted.
-            CancellationException ex2 = new CancellationException(
-                LocalizedStrings.AdminDistributedSystemImpl_BY_INTERRUPT.toLocalizedString());
-            ex2.setStackTrace(cause.getStackTrace());
-            throw ex2;
-          }
-        }
-
-        throw ex;
-      }
-
-    }
-
-  }
-
-  public DistributedMember getDistributedMember() {
-    return getDistributionManager().getId();
-  }
-
-  private void connectAdminDS() {
-    connect((InternalLogWriter) this.logWriter);
-    try {
-      thisAdminDS.waitToBeConnected(3000);
-    } catch (InterruptedException ie) {
-      logger.warn("Interrupted while waiting to connect", ie);
-    }
-  }
-
-  public Set<PersistentID> getMissingPersistentMembers() throws AdminException {
-    connectAdminDS();
-    DM dm = getDistributionManager();
-    if (dm == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
-              .toLocalizedString());
-    }
-    return getMissingPersistentMembers(dm);
-  }
-
-  public static Set<PersistentID> getMissingPersistentMembers(DM dm) {
-    return MissingPersistentIDsRequest.send(dm);
-  }
-
-  public void revokePersistentMember(InetAddress host, String directory) throws AdminException {
-    connectAdminDS();
-    DM dm = getDistributionManager();
-    if (dm == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
-              .toLocalizedString());
-    }
-    revokePersistentMember(dm, host, directory);
-
-  }
-
-  public void revokePersistentMember(UUID diskStoreID) throws AdminException {
-    connectAdminDS();
-    DM dm = getDistributionManager();
-    if (dm == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
-              .toLocalizedString());
-    }
-    revokePersistentMember(dm, diskStoreID);
-
-  }
-
-  public static void revokePersistentMember(DM dm, UUID diskStoreID) {
-    PersistentMemberPattern pattern = new PersistentMemberPattern(diskStoreID);
-    boolean success = false;
-    try {
-      // make sure that the disk store we're revoking is actually missing
-      boolean found = false;
-      Set<PersistentID> details = getMissingPersistentMembers(dm);
-      if (details != null) {
-        for (PersistentID id : details) {
-          if (id.getUUID().equals(diskStoreID)) {
-            found = true;
-            break;
-          }
-        }
-      }
-      if (!found) {
-        return;
-      }
-
-      // Fix for 42607 - verify that the persistent id is not already
-      // running before revoking it.
-      PrepareRevokePersistentIDRequest.send(dm, pattern);
-      success = true;
-    } finally {
-      if (success) {
-        // revoke the persistent member if were able to prepare the revoke
-        RevokePersistentIDRequest.send(dm, pattern);
-      } else {
-        // otherwise, cancel the revoke.
-        PrepareRevokePersistentIDRequest.cancel(dm, pattern);
-      }
-    }
-  }
-
-  /**
-   * 
-   * @deprecated use {@link #revokePersistentMember(UUID)} instead
-   */
-  public static void revokePersistentMember(DM dm, InetAddress host, String directory) {
-
-    PersistentMemberPattern pattern =
-        new PersistentMemberPattern(host, directory, System.currentTimeMillis());
-    boolean success = false;
-    try {
-      // Fix for 42607 - verify that the persistent id is not already
-      // running before revoking it.
-      PrepareRevokePersistentIDRequest.send(dm, pattern);
-      success = true;
-    } finally {
-      if (success) {
-        // revoke the persistent member if were able to prepare the revoke
-        RevokePersistentIDRequest.send(dm, pattern);
-      } else {
-        // otherwise, cancel the revoke.
-        PrepareRevokePersistentIDRequest.cancel(dm, pattern);
-      }
-    }
-  }
-
-  public Set shutDownAllMembers() throws AdminException {
-    return shutDownAllMembers(0);
-  }
-
-  public Set shutDownAllMembers(long timeout) throws AdminException {
-    connectAdminDS();
-    DM dm = getDistributionManager();
-    if (dm == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
-              .toLocalizedString());
-    }
-    return shutDownAllMembers(dm, timeout);
-  }
-
-  /**
-   * Shutdown all members.
-   * 
-   * @param dm
-   * @param timeout the amount of time (in ms) to spending trying to shutdown the members
-   *        gracefully. After this time period, the members will be forceable shut down. If the
-   *        timeout is exceeded, persistent recovery after the shutdown may need to do a GII. -1
-   *        indicates that the shutdown should wait forever.
-   */
-  public static Set shutDownAllMembers(DM dm, long timeout) {
-    return ShutdownAllRequest.send(dm, timeout);
-  }
-
-  public BackupStatus backupAllMembers(File targetDir) throws AdminException {
-    return backupAllMembers(targetDir, null);
-  }
-
-  public BackupStatus backupAllMembers(File targetDir, File baselineDir) throws AdminException {
-    connectAdminDS();
-    DM dm = getDistributionManager();
-    if (dm == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
-              .toLocalizedString());
-    }
-    return backupAllMembers(dm, targetDir, baselineDir);
-  }
-
-  public static BackupStatus backupAllMembers(DM dm, File targetDir, File baselineDir)
-      throws AdminException {
-    BackupStatus status = null;
-    if (BackupDataStoreHelper.obtainLock(dm)) {
-      try {
-        Set<PersistentID> missingMembers = getMissingPersistentMembers(dm);
-        Set recipients = dm.getOtherDistributionManagerIds();
-
-        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
-        targetDir = new File(targetDir, format.format(new Date()));
-        BackupDataStoreResult result =
-            BackupDataStoreHelper.backupAllMembers(dm, recipients, targetDir, baselineDir);
-
-        // It's possible that when calling getMissingPersistentMembers, some members are
-        // still creating/recovering regions, and at FinishBackupRequest.send, the
-        // regions at the members are ready. Logically, since the members in successfulMembers
-        // should override the previous missingMembers
-        for (Set<PersistentID> onlineMembersIds : result.getSuccessfulMembers().values()) {
-          missingMembers.removeAll(onlineMembersIds);
-        }
-
-        result.getExistingDataStores().keySet().removeAll(result.getSuccessfulMembers().keySet());
-        for (Set<PersistentID> lostMembersIds : result.getExistingDataStores().values()) {
-          missingMembers.addAll(lostMembersIds);
-        }
-
-        status = new BackupStatusImpl(result.getSuccessfulMembers(), missingMembers);
-      } finally {
-        BackupDataStoreHelper.releaseLock(dm);
-      }
-    } else {
-      throw new AdminException(
-          LocalizedStrings.DistributedSystem_BACKUP_ALREADY_IN_PROGRESS.toLocalizedString());
-    }
-    return status;
-  }
-
-  public Map<DistributedMember, Set<PersistentID>> compactAllDiskStores() throws AdminException {
-    connectAdminDS();
-    DM dm = getDistributionManager();
-    if (dm == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
-              .toLocalizedString());
-    }
-    return compactAllDiskStores(dm);
-  }
-
-  public static Map<DistributedMember, Set<PersistentID>> compactAllDiskStores(DM dm)
-      throws AdminException {
-    return CompactRequest.send(dm);
-  }
-
-  /**
-   * This method can be used to process ClientMembership events sent for BridgeMembership by bridge
-   * servers to all admin members.
-   * 
-   * NOTE: Not implemented currently. JMX implementation which is a subclass of this class i.e.
-   * AdminDistributedSystemJmxImpl implements it.
-   * 
-   * @param senderId id of the member that sent the ClientMembership changes for processing (could
-   *        be null)
-   * @param clientId id of a client for which the notification was sent
-   * @param clientHost host on which the client is/was running
-   * @param eventType denotes whether the client Joined/Left/Crashed should be one of
-   *        ClientMembershipMessage#JOINED, ClientMembershipMessage#LEFT,
-   *        ClientMembershipMessage#CRASHED
-   */
-  public void processClientMembership(String senderId, String clientId, String clientHost,
-      int eventType) {}
-
-  public void setAlertLevelAsString(String level) {
-    AlertLevel newAlertLevel = AlertLevel.forName(level);
-
-    if (newAlertLevel != null) {
-      setAlertLevel(newAlertLevel);
-    } else {
-      System.out.println("ERROR:: " + level
-          + " is invalid. Allowed alert levels are: WARNING, ERROR, SEVERE, OFF");
-      throw new IllegalArgumentException(LocalizedStrings.DEBUG.toLocalizedString(
-          level + " is invalid. Allowed alert levels are: WARNING, ERROR, SEVERE, OFF"));
-    }
-  }
-
-  public String getAlertLevelAsString() {
-    return getAlertLevel().getName();
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreHelper.java b/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreHelper.java
deleted file mode 100644
index 551aaa1..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/BackupDataStoreHelper.java
+++ /dev/null
@@ -1,74 +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.admin.internal;
-
-import java.io.File;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedLockService;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.internal.DM;
-import org.apache.geode.internal.Assert;
-
-public class BackupDataStoreHelper {
-
-  public static String LOCK_SERVICE_NAME = BackupDataStoreHelper.class.getSimpleName();
-
-  private static String LOCK_NAME = LOCK_SERVICE_NAME + "_token";
-
-  private static Object LOCK_SYNC = new Object();
-
-  @SuppressWarnings("rawtypes")
-  public static BackupDataStoreResult backupAllMembers(DM dm, Set recipients, File targetDir,
-      File baselineDir) {
-    FlushToDiskRequest.send(dm, recipients);
-
-    boolean abort = true;
-    Map<DistributedMember, Set<PersistentID>> successfulMembers;
-    Map<DistributedMember, Set<PersistentID>> existingDataStores;
-    try {
-      existingDataStores = PrepareBackupRequest.send(dm, recipients);
-      abort = false;
-    } finally {
-      successfulMembers = FinishBackupRequest.send(dm, recipients, targetDir, baselineDir, abort);
-    }
-    return new BackupDataStoreResult(existingDataStores, successfulMembers);
-  }
-
-  private static DistributedLockService getLockService(DM dm) {
-    DistributedLockService dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
-    if (dls == null) {
-      synchronized (LOCK_SYNC) {
-        dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
-        if (dls == null) {
-          // Create the DistributedLockService
-          dls = DistributedLockService.create(LOCK_SERVICE_NAME, dm.getSystem());
-        }
-      }
-    }
-    Assert.assertTrue(dls != null);
-    return dls;
-  }
-
-  public static boolean obtainLock(DM dm) {
-    return getLockService(dm).lock(LOCK_NAME, 0, -1);
-  }
-
-  public static void releaseLock(DM dm) {
-    getLockService(dm).unlock(LOCK_NAME);
-  }
-}



[45/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java
deleted file mode 100644
index a352616..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthEvaluator.java
+++ /dev/null
@@ -1,167 +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.admin.internal;
-
-import org.apache.geode.admin.DistributedSystemHealthConfig;
-import org.apache.geode.distributed.internal.DM;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.distributed.internal.MembershipListener;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * Contains the logic for evaluating the health of an entire GemFire distributed system according to
- * the thresholds provided in a {@link DistributedSystemHealthConfig}.
- *
- * <P>
- *
- * Note that unlike other evaluators, the <code>DistributedSystemHealthEvaluator</code> resides in
- * the "administrator" VM and not in the member VMs. This is because there only needs to be one
- * <code>DistributedSystemHealthEvaluator</code> per distributed system.
- *
- *
- * @since GemFire 3.5
- */
-class DistributedSystemHealthEvaluator extends AbstractHealthEvaluator
-    implements MembershipListener {
-
-  /** The config from which we get the evaluation criteria */
-  private DistributedSystemHealthConfig config;
-
-  /**
-   * The distribution manager with which this MembershipListener is registered
-   */
-  private DM dm;
-
-  /** The description of the distributed system being evaluated */
-  private String description;
-
-  /**
-   * The number of application members that have unexpectedly left since the previous evaluation
-   */
-  private int crashedApplications;
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>DistributedSystemHealthEvaluator</code>
-   */
-  DistributedSystemHealthEvaluator(DistributedSystemHealthConfig config, DM dm) {
-    super(null, dm);
-
-    this.config = config;
-    this.dm = dm;
-    this.dm.addMembershipListener(this);
-
-    StringBuffer sb = new StringBuffer();
-    sb.append("Distributed System ");
-
-    String desc = null;
-    if (dm instanceof DistributionManager) {
-      desc = ((DistributionManager) dm).getDistributionConfigDescription();
-    }
-
-    if (desc != null) {
-      sb.append(desc);
-
-    } else {
-      DistributionConfig dsc = dm.getSystem().getConfig();
-      String locators = dsc.getLocators();
-      if (locators == null || locators.equals("")) {
-        sb.append("using multicast ");
-        sb.append(dsc.getMcastAddress());
-        sb.append(":");
-        sb.append(dsc.getMcastPort());
-
-      } else {
-        sb.append("using locators ");
-        sb.append(locators);
-      }
-    }
-
-    this.description = sb.toString();
-  }
-
-  //////////////////// Instance Methods ////////////////////
-
-  @Override
-  protected String getDescription() {
-    return this.description;
-  }
-
-  /**
-   * Checks to make sure that the number of application members of the distributed system that have
-   * left unexpected since the last evaluation is less than the
-   * {@linkplain DistributedSystemHealthConfig#getMaxDepartedApplications threshold}. If not, the
-   * status is "poor" health.
-   */
-  void checkDepartedApplications(List status) {
-    synchronized (this) {
-      long threshold = this.config.getMaxDepartedApplications();
-      if (this.crashedApplications > threshold) {
-        String s =
-            LocalizedStrings.DistributedSystemHealth_THE_NUMBER_OF_APPLICATIONS_THAT_HAVE_LEFT_THE_DISTRIBUTED_SYSTEM_0_EXCEEDS_THE_THRESHOLD_1
-                .toLocalizedString(
-                    new Object[] {Long.valueOf(this.crashedApplications), Long.valueOf(threshold)});
-        status.add(poorHealth(s));
-      }
-      this.crashedApplications = 0;
-    }
-  }
-
-  @Override
-  protected void check(List status) {
-    checkDepartedApplications(status);
-  }
-
-  @Override
-  void close() {
-    this.dm.removeMembershipListener(this);
-  }
-
-  public void memberJoined(InternalDistributedMember id) {
-
-  }
-
-  /**
-   * Keeps track of which members depart unexpectedly
-   */
-  public void memberDeparted(InternalDistributedMember id, boolean crashed) {
-    if (!crashed)
-      return;
-    synchronized (this) {
-      int kind = id.getVmKind();
-      switch (kind) {
-        case DistributionManager.LOCATOR_DM_TYPE:
-        case DistributionManager.NORMAL_DM_TYPE:
-          this.crashedApplications++;
-          break;
-        default:
-          break;
-      }
-    } // synchronized
-  }
-
-  public void quorumLost(Set<InternalDistributedMember> failures,
-      List<InternalDistributedMember> remaining) {}
-
-  public void memberSuspect(InternalDistributedMember id, InternalDistributedMember whoSuspected,
-      String reason) {}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthMonitor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthMonitor.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthMonitor.java
deleted file mode 100644
index 246f518..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributedSystemHealthMonitor.java
+++ /dev/null
@@ -1,461 +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.admin.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.GemFireHealth;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.admin.GemFireMemberStatus;
-import org.apache.geode.admin.RegionSubRegionSnapshot;
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.RegionAttributes;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.Config;
-import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.internal.admin.AdminBridgeServer;
-import org.apache.geode.internal.admin.CacheInfo;
-import org.apache.geode.internal.admin.DLockInfo;
-import org.apache.geode.internal.admin.GemFireVM;
-import org.apache.geode.internal.admin.GfManagerAgent;
-import org.apache.geode.internal.admin.HealthListener;
-import org.apache.geode.internal.admin.Stat;
-import org.apache.geode.internal.admin.StatAlertDefinition;
-import org.apache.geode.internal.admin.StatListener;
-import org.apache.geode.internal.admin.StatResource;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.LoggingThreadGroup;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-
-/**
- * A thread that monitors the health of the distributed system. It is kind of like a
- * {@link org.apache.geode.distributed.internal.HealthMonitorImpl}. In order to get it to place nice
- * with the rest of the health monitoring APIs, this class pretends that it is a
- * <code>GemFireVM</code>. Kind of hokey, but it beats a bunch of special-case code.
- *
- *
- * @since GemFire 3.5
- */
-class DistributedSystemHealthMonitor implements Runnable, GemFireVM {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /** Evaluates the health of the distributed system */
-  private DistributedSystemHealthEvaluator eval;
-
-  /** Notified when the health of the distributed system changes */
-  private GemFireHealthImpl healthImpl;
-
-  /** The number of seconds between health checks */
-  private int interval;
-
-  /** The thread in which the monitoring occurs */
-  private Thread thread;
-
-  /** Has this monitor been asked to stop? */
-  private volatile boolean stopRequested = false;
-
-  /** The health of the distributed system the last time we checked. */
-  private GemFireHealth.Health prevHealth = GemFireHealth.GOOD_HEALTH;
-
-  /**
-   * The most recent <code>OKAY_HEALTH</code> diagnoses of the GemFire system
-   */
-  private List okayDiagnoses;
-
-  /**
-   * The most recent <code>POOR_HEALTH</code> diagnoses of the GemFire system
-   */
-  private List poorDiagnoses;
-
-  ////////////////////// Constructors //////////////////////
-
-  /**
-   * Creates a new <code>DistributedSystemHealthMonitor</code> that evaluates the health of the
-   * distributed system against the given thresholds once every <code>interval</code> seconds.
-   *
-   * @param eval Used to evaluate the health of the distributed system
-   * @param healthImpl Receives callbacks when the health of the distributed system changes
-   * @param interval How often the health is checked
-   */
-  DistributedSystemHealthMonitor(DistributedSystemHealthEvaluator eval,
-      GemFireHealthImpl healthImpl, int interval) {
-    this.eval = eval;
-    this.healthImpl = healthImpl;
-    this.interval = interval;
-    this.okayDiagnoses = new ArrayList();
-    this.poorDiagnoses = new ArrayList();
-
-    ThreadGroup group = LoggingThreadGroup.createThreadGroup(
-        LocalizedStrings.DistributedSystemHealthMonitor_HEALTH_MONITORS.toLocalizedString(),
-        logger);
-    String name = LocalizedStrings.DistributedSystemHealthMonitor_HEALTH_MONITOR_FOR_0
-        .toLocalizedString(eval.getDescription());
-    this.thread = new Thread(group, this, name);
-    this.thread.setDaemon(true);
-  }
-
-  /**
-   * Does the work of monitoring the health of the distributed system.
-   */
-  public void run() {
-    if (logger.isDebugEnabled()) {
-      logger.debug("Monitoring health of {} every {} seconds", this.eval.getDescription(),
-          interval);
-    }
-
-    while (!this.stopRequested) {
-      SystemFailure.checkFailure();
-      try {
-        Thread.sleep(interval * 1000);
-        List status = new ArrayList();
-        eval.evaluate(status);
-
-        GemFireHealth.Health overallHealth = GemFireHealth.GOOD_HEALTH;
-        this.okayDiagnoses.clear();
-        this.poorDiagnoses.clear();
-
-        for (Iterator iter = status.iterator(); iter.hasNext();) {
-          AbstractHealthEvaluator.HealthStatus health =
-              (AbstractHealthEvaluator.HealthStatus) iter.next();
-          if (overallHealth == GemFireHealth.GOOD_HEALTH) {
-            if ((health.getHealthCode() != GemFireHealth.GOOD_HEALTH)) {
-              overallHealth = health.getHealthCode();
-            }
-
-          } else if (overallHealth == GemFireHealth.OKAY_HEALTH) {
-            if (health.getHealthCode() == GemFireHealth.POOR_HEALTH) {
-              overallHealth = GemFireHealth.POOR_HEALTH;
-            }
-          }
-
-          GemFireHealth.Health healthCode = health.getHealthCode();
-          if (healthCode == GemFireHealth.OKAY_HEALTH) {
-            this.okayDiagnoses.add(health.getDiagnosis());
-
-          } else if (healthCode == GemFireHealth.POOR_HEALTH) {
-            this.poorDiagnoses.add(health.getDiagnosis());
-            break;
-          }
-        }
-
-        if (overallHealth != prevHealth) {
-          healthImpl.healthChanged(this, overallHealth);
-          this.prevHealth = overallHealth;
-        }
-
-      } catch (InterruptedException ex) {
-        // We're all done
-        // No need to reset the interrupted flag, since we're going to exit.
-        break;
-      }
-    }
-
-    eval.close();
-    if (logger.isDebugEnabled()) {
-      logger.debug("Stopped checking for distributed system health");
-    }
-  }
-
-  /**
-   * Starts this <code>DistributedSystemHealthMonitor</code>
-   */
-  void start() {
-    this.thread.start();
-  }
-
-  /**
-   * Stops this <code>DistributedSystemHealthMonitor</code>
-   */
-  void stop() {
-    if (this.thread.isAlive()) {
-      this.stopRequested = true;
-      this.thread.interrupt();
-      this.healthImpl.nodeLeft(null, this);
-
-      try {
-        this.thread.join();
-      } catch (InterruptedException ex) {
-        Thread.currentThread().interrupt();
-        logger.warn(
-            LocalizedMessage.create(
-                LocalizedStrings.DistributedSystemHealthMonitor_INTERRUPTED_WHILE_STOPPING_HEALTH_MONITOR_THREAD),
-            ex);
-      }
-    }
-  }
-
-  ////////////////////// GemFireVM Methods //////////////////////
-
-  public java.net.InetAddress getHost() {
-    try {
-      return SocketCreator.getLocalHost();
-
-    } catch (Exception ex) {
-      throw new org.apache.geode.InternalGemFireException(
-          LocalizedStrings.DistributedSystemHealthMonitor_COULD_NOT_GET_LOCALHOST
-              .toLocalizedString());
-    }
-  }
-
-  public String getName() {
-    // return getId().toString();
-    throw new UnsupportedOperationException("Not a real GemFireVM");
-  }
-
-  public java.io.File getWorkingDirectory() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public java.io.File getGemFireDir() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public java.util.Date getBirthDate() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public Properties getLicenseInfo() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public GemFireMemberStatus getSnapshot() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public RegionSubRegionSnapshot getRegionSnapshot() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public StatResource[] getStats(String statisticsTypeName) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public StatResource[] getAllStats() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public DLockInfo[] getDistributedLockInfo() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public void addStatListener(StatListener observer, StatResource observedResource,
-      Stat observedStat) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public void removeStatListener(StatListener observer) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public void addHealthListener(HealthListener observer, GemFireHealthConfig cfg) {
-
-  }
-
-  public void removeHealthListener() {
-
-  }
-
-  public void resetHealthStatus() {
-    this.prevHealth = GemFireHealth.GOOD_HEALTH;
-  }
-
-  public String[] getHealthDiagnosis(GemFireHealth.Health healthCode) {
-    if (healthCode == GemFireHealth.GOOD_HEALTH) {
-      return new String[0];
-
-    } else if (healthCode == GemFireHealth.OKAY_HEALTH) {
-      String[] array = new String[this.okayDiagnoses.size()];
-      this.okayDiagnoses.toArray(array);
-      return array;
-
-    } else {
-      Assert.assertTrue(healthCode == GemFireHealth.POOR_HEALTH);
-      String[] array = new String[this.poorDiagnoses.size()];
-      this.poorDiagnoses.toArray(array);
-      return array;
-    }
-  }
-
-  public Config getConfig() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public void setConfig(Config cfg) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public GfManagerAgent getManagerAgent() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public String[] getSystemLogs() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public void setInspectionClasspath(String classpath) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public String getInspectionClasspath() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public Region[] getRootRegions() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public Region getRegion(CacheInfo c, String path) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public Region createVMRootRegion(CacheInfo c, String name, RegionAttributes attrs) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public Region createSubregion(CacheInfo c, String parentPath, String name,
-      RegionAttributes attrs) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public void setCacheInspectionMode(int mode) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public int getCacheInspectionMode() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public void takeRegionSnapshot(String regionName, int snapshotId) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public InternalDistributedMember getId() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public CacheInfo getCacheInfo() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public String getVersionInfo() {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public CacheInfo setCacheLockTimeout(CacheInfo c, int v) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public CacheInfo setCacheLockLease(CacheInfo c, int v) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public CacheInfo setCacheSearchTimeout(CacheInfo c, int v) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public AdminBridgeServer addCacheServer(CacheInfo cache) throws AdminException {
-
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public AdminBridgeServer getBridgeInfo(CacheInfo cache, int id) throws AdminException {
-
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public AdminBridgeServer startBridgeServer(CacheInfo cache, AdminBridgeServer bridge)
-      throws AdminException {
-
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  public AdminBridgeServer stopBridgeServer(CacheInfo cache, AdminBridgeServer bridge)
-      throws AdminException {
-
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  /**
-   * This operation is not supported for this object. Will throw UnsupportedOperationException if
-   * invoked.
-   */
-  public void setAlertsManager(StatAlertDefinition[] alertDefs, long refreshInterval,
-      boolean setRemotely) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  /**
-   * This operation is not supported for this object. Will throw UnsupportedOperationException if
-   * invoked.
-   */
-  public void setRefreshInterval(long refreshInterval) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-
-  /**
-   * This operation is not supported for this object. Will throw UnsupportedOperationException if
-   * invoked.
-   */
-  public void updateAlertDefinitions(StatAlertDefinition[] alertDefs, int actionCode) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java
deleted file mode 100644
index c3cab6f..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorConfigImpl.java
+++ /dev/null
@@ -1,187 +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.admin.internal;
-
-import org.apache.geode.admin.DistributionLocator;
-import org.apache.geode.admin.DistributionLocatorConfig;
-import org.apache.geode.distributed.internal.tcpserver.*;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import java.net.InetAddress;
-import java.util.Properties;
-
-import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
-
-/**
- * Provides an implementation of <code>DistributionLocatorConfig</code>.
- *
- * @since GemFire 4.0
- */
-public class DistributionLocatorConfigImpl extends ManagedEntityConfigImpl
-    implements DistributionLocatorConfig {
-
-  /** The minimum networking port (0) */
-  public static final int MIN_PORT = 0;
-
-  /** The maximum networking port (65535) */
-  public static final int MAX_PORT = 65535;
-
-  ////////////////////// Instance Fields //////////////////////
-
-  /** The port on which this locator listens */
-  private int port;
-
-  /** The address to bind to on a multi-homed host */
-  private String bindAddress;
-
-  /**
-   * The properties used to configure the DistributionLocator's DistributedSystem
-   */
-  private Properties dsProperties;
-
-  /** The DistributionLocator that was created with this config */
-  private DistributionLocator locator;
-
-  ////////////////////// Static Methods //////////////////////
-
-  /**
-   * Contacts a distribution locator on the given host and port and creates a
-   * <code>DistributionLocatorConfig</code> for it.
-   *
-   * @see TcpClient#getLocatorInfo
-   *
-   * @return <code>null</code> if the locator cannot be contacted
-   */
-  static DistributionLocatorConfig createConfigFor(String host, int port, InetAddress bindAddress) {
-    TcpClient client = new TcpClient();
-    String[] info = null;
-    if (bindAddress != null) {
-      info = client.getInfo(bindAddress, port);
-    } else {
-      info = client.getInfo(InetAddressUtil.toInetAddress(host), port);
-    }
-    if (info == null) {
-      return null;
-    }
-
-    DistributionLocatorConfigImpl config = new DistributionLocatorConfigImpl();
-    config.setHost(host);
-    config.setPort(port);
-    if (bindAddress != null) {
-      config.setBindAddress(bindAddress.getHostAddress());
-    }
-    config.setWorkingDirectory(info[0]);
-    config.setProductDirectory(info[1]);
-
-    return config;
-  }
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>DistributionLocatorConfigImpl</code> with the default settings.
-   */
-  public DistributionLocatorConfigImpl() {
-    this.port = 0;
-    this.bindAddress = null;
-    this.locator = null;
-    this.dsProperties = new java.util.Properties();
-    this.dsProperties.setProperty(MCAST_PORT, "0");
-  }
-
-  ///////////////////// Instance Methods /////////////////////
-
-  /**
-   * Sets the locator that was configured with this <Code>DistributionLocatorConfigImpl</code>.
-   */
-  void setLocator(DistributionLocator locator) {
-    this.locator = locator;
-  }
-
-  @Override
-  protected boolean isReadOnly() {
-    return this.locator != null && this.locator.isRunning();
-  }
-
-  public int getPort() {
-    return this.port;
-  }
-
-  public void setPort(int port) {
-    checkReadOnly();
-    this.port = port;
-    configChanged();
-  }
-
-  public String getBindAddress() {
-    return this.bindAddress;
-  }
-
-  public void setBindAddress(String bindAddress) {
-    checkReadOnly();
-    this.bindAddress = bindAddress;
-    configChanged();
-  }
-
-  public void setDistributedSystemProperties(Properties props) {
-    this.dsProperties = props;
-  }
-
-  public Properties getDistributedSystemProperties() {
-    return this.dsProperties;
-  }
-
-  @Override
-  public void validate() {
-    super.validate();
-
-    if (port < MIN_PORT || port > MAX_PORT) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.DistributionLocatorConfigImpl_PORT_0_MUST_BE_AN_INTEGER_BETWEEN_1_AND_2
-              .toLocalizedString(new Object[] {Integer.valueOf(port), Integer.valueOf(MIN_PORT),
-                  Integer.valueOf(MAX_PORT)}));
-    }
-
-    if (this.bindAddress != null && InetAddressUtil.validateHost(this.bindAddress) == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.DistributionLocatorConfigImpl_INVALID_HOST_0
-              .toLocalizedString(this.bindAddress));
-    }
-  }
-
-  /**
-   * Currently, listeners are not supported on the locator config.
-   */
-  @Override
-  protected void configChanged() {
-
-  }
-
-  @Override
-  public Object clone() throws CloneNotSupportedException {
-    DistributionLocatorConfigImpl clone = (DistributionLocatorConfigImpl) super.clone();
-    clone.locator = null;
-    return clone;
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder();
-    sb.append("DistributionLocatorConfig: host=").append(getHost());
-    sb.append(", bindAddress=").append(getBindAddress());
-    sb.append(", port=").append(getPort());
-    return sb.toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java
deleted file mode 100755
index c1bfc93..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java
+++ /dev/null
@@ -1,329 +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.admin.internal;
-
-import org.apache.geode.admin.AdminDistributedSystem;
-import org.apache.geode.admin.DistributionLocator;
-import org.apache.geode.admin.DistributionLocatorConfig;
-import org.apache.geode.admin.ManagedEntityConfig;
-import org.apache.geode.distributed.internal.DM;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.admin.remote.DistributionLocatorId;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.logging.log4j.Logger;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-
-/**
- * Default administrative implementation of a DistributionLocator.
- *
- * @since GemFire 3.5
- */
-public class DistributionLocatorImpl implements DistributionLocator, InternalManagedEntity {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /**
-   * How many new <code>DistributionLocator</code>s have been created?
-   */
-  private static int newLocators = 0;
-
-  //////////////////// Instance Fields ////////////////////
-
-  /**
-   * The configuration object for this locator
-   */
-  private final DistributionLocatorConfigImpl config;
-
-  /**
-   * The id of this distribution locator
-   */
-  private final String id;
-
-  /**
-   * Used to control the actual DistributionLocator service
-   */
-  private ManagedEntityController controller;
-
-  /**
-   * The system that this locator is a part of
-   */
-  private AdminDistributedSystemImpl system;
-
-  // -------------------------------------------------------------------------
-  // constructor(s)...
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs new instance of <code>DistributionLocatorImpl</code> that is a member of the given
-   * distributed system.
-   */
-  public DistributionLocatorImpl(DistributionLocatorConfig config,
-      AdminDistributedSystemImpl system) {
-    this.config = (DistributionLocatorConfigImpl) config;
-    this.config.validate();
-    this.config.setManagedEntity(this);
-    this.id = getNewId();
-    this.controller = system.getEntityController();
-    this.system = system;
-  }
-
-  // -------------------------------------------------------------------------
-  // Attribute accessors/mutators...
-  // -------------------------------------------------------------------------
-
-  public String getId() {
-    return this.id;
-  }
-
-  public String getNewId() {
-    synchronized (DistributionLocatorImpl.class) {
-      return "Locator" + (++newLocators);
-    }
-  }
-
-  /**
-   * Returns the configuration object for this locator.
-   *
-   * @since GemFire 4.0
-   */
-  public DistributionLocatorConfig getConfig() {
-    return this.config;
-  }
-
-  public AdminDistributedSystem getDistributedSystem() {
-    return this.system;
-  }
-
-  /**
-   * Unfortunately, it doesn't make much sense to maintain the state of a locator. The admin API
-   * does not receive notification when the locator actually starts and stops. If we try to guess,
-   * we'll just end up with race conditions galore. So, we can't fix bug 32455 for locators.
-   */
-  public int setState(int state) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.DistributionLocatorImpl_CAN_NOT_SET_THE_STATE_OF_A_LOCATOR
-            .toLocalizedString());
-  }
-
-  // -------------------------------------------------------------------------
-  // Operations...
-  // -------------------------------------------------------------------------
-
-  /**
-   * Polls to determine whether or not this managed entity has started.
-   */
-  public boolean waitToStart(long timeout) throws InterruptedException {
-
-    if (Thread.interrupted())
-      throw new InterruptedException();
-
-    long start = System.currentTimeMillis();
-    while (System.currentTimeMillis() - start < timeout) {
-      if (this.isRunning()) {
-        return true;
-
-      } else {
-        Thread.sleep(100);
-      }
-    }
-
-    logger.info(
-        LocalizedMessage.create(LocalizedStrings.DistributionLocatorImpl_DONE_WAITING_FOR_LOCATOR));
-    return this.isRunning();
-  }
-
-  /**
-   * Polls to determine whether or not this managed entity has stopped.
-   */
-  public boolean waitToStop(long timeout) throws InterruptedException {
-
-    if (Thread.interrupted())
-      throw new InterruptedException();
-
-    long start = System.currentTimeMillis();
-    while (System.currentTimeMillis() - start < timeout) {
-      if (!this.isRunning()) {
-        return true;
-
-      } else {
-        Thread.sleep(100);
-      }
-    }
-
-    return !this.isRunning();
-  }
-
-  public boolean isRunning() {
-    DM dm = ((AdminDistributedSystemImpl) getDistributedSystem()).getDistributionManager();
-    if (dm == null) {
-      try {
-        return this.controller.isRunning(this);
-      } catch (IllegalStateException e) {
-        return false;
-      }
-    }
-
-    String host = getConfig().getHost();
-    int port = getConfig().getPort();
-    String bindAddress = getConfig().getBindAddress();
-
-    boolean found = false;
-    Map<InternalDistributedMember, Collection<String>> hostedLocators = dm.getAllHostedLocators();
-    for (Iterator<InternalDistributedMember> memberIter =
-        hostedLocators.keySet().iterator(); memberIter.hasNext();) {
-      for (Iterator<String> locatorIter =
-          hostedLocators.get(memberIter.next()).iterator(); locatorIter.hasNext();) {
-        DistributionLocatorId locator = new DistributionLocatorId(locatorIter.next());
-        found = found || locator.getHost().getHostAddress().equals(host);
-        found = found || locator.getHost().getHostName().equals(host);
-        if (!found && !host.contains(".")) {
-          try {
-            InetAddress inetAddr = InetAddress.getByName(host);
-            found = locator.getHost().getHostName().equals(inetAddr.getHostName());
-            if (!found) {
-              found = locator.getHost().getHostAddress().equals(inetAddr.getHostAddress());
-            }
-          } catch (UnknownHostException e) {
-            // try config host as if it is an IP address instead of host name
-          }
-        }
-        if (locator.getBindAddress() != null && !locator.getBindAddress().isEmpty()
-            && bindAddress != null && !bindAddress.isEmpty()) {
-          found = found && locator.getBindAddress().equals(bindAddress);
-        }
-        found = found && locator.getPort() == port;
-        if (found) {
-          return true;
-        }
-      }
-    }
-    return found;
-  }
-
-  public void start() {
-    this.config.validate();
-    this.controller.start(this);
-    this.config.setLocator(this);
-    this.system.updateLocatorsString();
-  }
-
-  public void stop() {
-    this.controller.stop(this);
-    this.config.setLocator(null);
-  }
-
-  public String getLog() {
-    return this.controller.getLog(this);
-  }
-
-  /**
-   * Returns a string representation of the object.
-   *
-   * @return a string representation of the object
-   */
-  @Override
-  public String toString() {
-    return "DistributionLocator " + getId();
-  }
-
-  //////////////////////// Command execution ////////////////////////
-
-  public ManagedEntityConfig getEntityConfig() {
-    return this.getConfig();
-  }
-
-  public String getEntityType() {
-    return "Locator";
-  }
-
-  public String getStartCommand() {
-    StringBuffer sb = new StringBuffer();
-    sb.append(this.controller.getProductExecutable(this, "gemfire"));
-    sb.append(" start-locator -q -dir=");
-    sb.append(this.getConfig().getWorkingDirectory());
-    sb.append(" -port=");
-    sb.append(this.getConfig().getPort());
-    Properties props = config.getDistributedSystemProperties();
-    Enumeration en = props.propertyNames();
-    while (en.hasMoreElements()) {
-      String pn = (String) en.nextElement();
-      sb.append(" -D" + DistributionConfig.GEMFIRE_PREFIX + "" + pn + "=" + props.getProperty(pn));
-    }
-
-    String bindAddress = this.getConfig().getBindAddress();
-    if (bindAddress != null && bindAddress.length() > 0) {
-      sb.append(" -address=");
-      sb.append(this.getConfig().getBindAddress());
-    }
-    sb.append(" ");
-
-    String sslArgs = this.controller.buildSSLArguments(this.system.getConfig());
-    if (sslArgs != null) {
-      sb.append(sslArgs);
-    }
-
-    return sb.toString().trim();
-  }
-
-  public String getStopCommand() {
-    StringBuffer sb = new StringBuffer();
-    sb.append(this.controller.getProductExecutable(this, "gemfire"));
-    sb.append(" stop-locator -q -dir=");
-    sb.append(this.getConfig().getWorkingDirectory());
-    sb.append(" -port=");
-    sb.append(this.getConfig().getPort());
-
-    String bindAddress = this.getConfig().getBindAddress();
-    if (bindAddress != null && bindAddress.length() > 0) {
-      sb.append(" -address=");
-      sb.append(this.getConfig().getBindAddress());
-    }
-    sb.append(" ");
-
-    String sslArgs = this.controller.buildSSLArguments(this.system.getConfig());
-    if (sslArgs != null) {
-      sb.append(sslArgs);
-    }
-
-    return sb.toString().trim();
-  }
-
-  public String getIsRunningCommand() {
-    StringBuffer sb = new StringBuffer();
-    sb.append(this.controller.getProductExecutable(this, "gemfire"));
-    sb.append(" status-locator -dir=");
-    sb.append(this.getConfig().getWorkingDirectory());
-
-    return sb.toString().trim();
-  }
-
-  public String getLogCommand() {
-    StringBuffer sb = new StringBuffer();
-    sb.append(this.controller.getProductExecutable(this, "gemfire"));
-    sb.append(" tail-locator-log -dir=");
-    sb.append(this.getConfig().getWorkingDirectory());
-
-    return sb.toString().trim();
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/EnabledManagedEntityController.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/EnabledManagedEntityController.java b/geode-core/src/main/java/org/apache/geode/admin/internal/EnabledManagedEntityController.java
deleted file mode 100755
index 59e8386..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/EnabledManagedEntityController.java
+++ /dev/null
@@ -1,385 +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.admin.internal;
-
-import org.apache.geode.admin.AdminDistributedSystem;
-import org.apache.geode.admin.DistributedSystemConfig;
-import org.apache.geode.admin.ManagedEntity;
-import org.apache.geode.admin.ManagedEntityConfig;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.ProcessOutputReader;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.LoggingThreadGroup;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.logging.log4j.Logger;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.Properties;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-/**
- * Implements the actual administration (starting, stopping, etc.) of GemFire
- * {@link ManagedEntity}s. It {@link Runtime#exec(java.lang.String) executes} commands to administer
- * the entities based on information provided by the {@link InternalManagedEntity} object. Note that
- * it does not use <code>SystemAdmin</code> to manage "local" entities; it always execs the scripts.
- *
- * <P>
- *
- * This class is a refactoring of <code>Systemcontroller</code>, <code>RemoteCommand</code>, and
- * <code>LocatorRemoteCommand</code>.
- *
- * @since GemFire 4.0
- */
-class EnabledManagedEntityController implements ManagedEntityController {
-  private static final Logger logger = LogService.getLogger();
-
-  // /** A lock to ensure that only entity is managed at a time. See bug
-  // * 31374. */
-  // private static Object startStopLock = new Object();
-
-  /** Known strings found in output indicating error. */
-  private static final String[] ERROR_OUTPUTS = new String[] {"No such file or directory",
-      "The system cannot find the file specified.", "Access is denied.", "cannot open", "ERROR"};
-
-  /** Token in command prefix to be replaced with actual HOST */
-  private static final String HOST = "{HOST}";
-
-  /** Token in command prefix to be replaced with actual execution CMD */
-  private static final String CMD = "{CMD}";
-
-  ////////////////////// Instance Fields //////////////////////
-
-  /**
-   * The thread group in which threads launched by this system controller reside.
-   */
-  private final ThreadGroup threadGroup;
-
-  /** System to which the managed entities belong */
-  private final AdminDistributedSystem system;
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>ManagedEntityController</code> for entities in the given distributed
-   * system.
-   */
-  EnabledManagedEntityController(AdminDistributedSystem system) {
-    this.system = system;
-    this.threadGroup =
-        LoggingThreadGroup.createThreadGroup("ManagedEntityController threads", logger);
-  }
-
-  ///////////////////// Instance Methods /////////////////////
-
-  /**
-   * Returns <code>true</code> if the <code>output</code> string contains a known error message.
-   */
-  private boolean outputIsError(String output) {
-    if (output == null)
-      return false;
-    boolean error = false;
-    for (int i = 0; i < ERROR_OUTPUTS.length; i++) {
-      error = output.indexOf(ERROR_OUTPUTS[i]) > -1;
-      if (error)
-        return error;
-    }
-    return error;
-  }
-
-  /**
-   * Executes a command using {@link Runtime#exec(java.lang.String)}.
-   *
-   * @param command The full command to remotely execute
-   *
-   * @return Output from the command that was executed or <code>null</code> if the executing the
-   *         command failed.
-   */
-  protected String execute(String command, InternalManagedEntity entity) {
-    /*
-     * TODO: this is getting ugly... clients of this method really need to have the ability to do
-     * their own parsing/checking of 'output'
-     */
-    if (command == null || command.length() == 0) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.ManagedEntityController_EXECUTION_COMMAND_IS_EMPTY.toLocalizedString());
-    }
-
-    File workingDir = new File(entity.getEntityConfig().getWorkingDirectory());
-    logger.info(LocalizedMessage.create(
-        LocalizedStrings.ManagedEntityController_EXECUTING_REMOTE_COMMAND_0_IN_DIRECTORY_1,
-        new Object[] {command, workingDir}));
-    Process p = null;
-    try {
-      p = Runtime.getRuntime().exec(command, null /* env */, workingDir);
-
-    } catch (java.io.IOException e) {
-      logger.fatal(LocalizedMessage
-          .create(LocalizedStrings.ManagedEntityController_WHILE_EXECUTING_0, command), e);
-      return null;
-    }
-
-    final ProcessOutputReader pos = new ProcessOutputReader(p);
-    int retCode = pos.getExitCode();
-    final String output = pos.getOutput();
-    logger.info(
-        LocalizedMessage.create(LocalizedStrings.ManagedEntityController_RESULT_OF_EXECUTING_0_IS_1,
-            new Object[] {command, Integer.valueOf(retCode)}));
-    logger.info(LocalizedMessage.create(LocalizedStrings.ManagedEntityController_OUTPUT_OF_0_IS_1,
-        new Object[] {command, output}));
-
-    if (retCode != 0 || outputIsError(output)) {
-      logger.warn(LocalizedMessage
-          .create(LocalizedStrings.ManagedEntityController_REMOTE_EXECUTION_OF_0_FAILED, command));
-      return null;
-    }
-
-    return output;
-  }
-
-  /** Returns true if the path ends with a path separator. */
-  private boolean endsWithSeparator(String path) {
-    return path.endsWith("/") || path.endsWith("\\");
-  }
-
-  /** Translates the path between Windows and UNIX. */
-  private String getOSPath(String path) {
-    if (pathIsWindows(path)) {
-      return path.replace('/', '\\');
-    } else {
-      return path.replace('\\', '/');
-    }
-  }
-
-  // /** Returns true if the path is on Windows. */
-  // private boolean pathIsWindows(File path) {
-  // return pathIsWindows(path.toString());
-  // }
-
-  /** Returns true if the path is on Windows. */
-  private boolean pathIsWindows(String path) {
-    if (path != null && path.length() > 1) {
-      return (Character.isLetter(path.charAt(0)) && path.charAt(1) == ':')
-          || (path.startsWith("//") || path.startsWith("\\\\"));
-    }
-    return false;
-  }
-
-  /**
-   * If the managed entity resides on a remote host, then <code>command</code> is munged to take the
-   * remote command into account.
-   *
-   * @throws IllegalStateException If a remote command is required, but one has not been specified.
-   */
-  private String arrangeRemoteCommand(InternalManagedEntity entity, String cmd) {
-
-    String host = entity.getEntityConfig().getHost();
-    if (InetAddressUtil.isLocalHost(host)) {
-      // No arranging necessary
-      return cmd;
-    }
-
-    String prefix = entity.getEntityConfig().getRemoteCommand();
-    if (prefix == null || prefix.length() <= 0) {
-      prefix = entity.getDistributedSystem().getRemoteCommand();
-    }
-
-    if (prefix == null || prefix.length() <= 0) {
-      throw new IllegalStateException(
-          LocalizedStrings.ManagedEntityController_A_REMOTE_COMMAND_MUST_BE_SPECIFIED_TO_OPERATE_ON_A_MANAGED_ENTITY_ON_HOST_0
-              .toLocalizedString(host));
-    }
-
-    int hostIdx = prefix.indexOf(HOST);
-    int cmdIdx = prefix.indexOf(CMD);
-    if (hostIdx == -1 && cmdIdx == -1) {
-      return prefix + " " + host + " " + cmd;
-    }
-
-    if (hostIdx >= 0) {
-      String start = prefix.substring(0, hostIdx);
-      String end = null;
-      if (hostIdx + HOST.length() >= prefix.length()) {
-        end = "";
-      } else {
-        end = prefix.substring(hostIdx + HOST.length());
-      }
-      prefix = start + host + end;
-      cmdIdx = prefix.indexOf(CMD); // recalculate;
-    }
-
-    if (cmdIdx >= 0) {
-      String start = prefix.substring(0, cmdIdx);
-      String end = null;
-      if (cmdIdx + CMD.length() >= prefix.length()) {
-        end = "";
-      } else {
-        end = prefix.substring(cmdIdx + CMD.length());
-      }
-      prefix = start + cmd + end;
-    }
-    return prefix;
-  }
-
-  /**
-   * Returns the full path to the executable in <code>$GEMFIRE/bin</code> taking into account the
-   * {@linkplain ManagedEntityConfig#getProductDirectory product directory} and the platform's file
-   * separator.
-   *
-   * <P>
-   *
-   * Note: we should probably do a better job of determine whether or not the machine on which the
-   * entity runs is Windows or Linux.
-   *
-   * @param executable The name of the executable that resides in <code>$GEMFIRE/bin</code>.
-   */
-  public String getProductExecutable(InternalManagedEntity entity, String executable) {
-    String productDirectory = entity.getEntityConfig().getProductDirectory();
-    String path = null;
-    File productDir = new File(productDirectory);
-    // if (productDir != null) (cannot be null)
-    {
-      path = productDir.getPath();
-      if (!endsWithSeparator(path)) {
-        path += File.separator;
-      }
-      path += "bin" + File.separator;
-    }
-    // else {
-    // path = "";
-    // }
-
-    String bat = "";
-    if (pathIsWindows(path)) {
-      bat = ".bat";
-    }
-    return getOSPath(path) + executable + bat;
-  }
-
-  /**
-   * Builds optional SSL command-line arguments. Returns null if SSL is not enabled for the
-   * distributed system.
-   */
-  public String buildSSLArguments(DistributedSystemConfig config) {
-    Properties sslProps = buildSSLProperties(config, true);
-    if (sslProps == null)
-      return null;
-
-    StringBuffer sb = new StringBuffer();
-    for (Iterator iter = sslProps.keySet().iterator(); iter.hasNext();) {
-      String key = (String) iter.next();
-      String value = sslProps.getProperty(key);
-      sb.append(" -J-D" + key + "=" + value);
-    }
-
-    return sb.toString();
-  }
-
-  /**
-   * Builds optional SSL properties for DistributionLocator. Returns null if SSL is not enabled for
-   * the distributed system.
-   *
-   * @param forCommandLine true indicates that {@link DistributionConfig#GEMFIRE_PREFIX} should be
-   *        prepended so the argument will become -Dgemfire.xxxx
-   */
-  private Properties buildSSLProperties(DistributedSystemConfig config, boolean forCommandLine) {
-    if (!config.isSSLEnabled())
-      return null;
-
-    String prefix = "";
-    if (forCommandLine)
-      prefix = DistributionConfig.GEMFIRE_PREFIX;
-
-    Properties sslProps = (Properties) config.getSSLProperties().clone();
-    // add ssl-enabled, etc...
-    sslProps.setProperty(prefix + MCAST_PORT, "0");
-    sslProps.setProperty(prefix + CLUSTER_SSL_ENABLED, String.valueOf(config.isSSLEnabled()));
-    sslProps.setProperty(prefix + CLUSTER_SSL_CIPHERS, config.getSSLCiphers());
-    sslProps.setProperty(prefix + CLUSTER_SSL_PROTOCOLS, config.getSSLProtocols());
-    sslProps.setProperty(prefix + CLUSTER_SSL_REQUIRE_AUTHENTICATION,
-        String.valueOf(config.isSSLAuthenticationRequired()));
-    return sslProps;
-  }
-
-
-  /**
-   * Starts a managed entity.
-   */
-  public void start(final InternalManagedEntity entity) {
-    final String command = arrangeRemoteCommand(entity, entity.getStartCommand());
-    Thread start = new Thread(this.threadGroup, new Runnable() {
-      public void run() {
-        execute(command, entity);
-      }
-    }, "Start " + entity.getEntityType());
-    start.start();
-  }
-
-  /**
-   * Stops a managed entity.
-   */
-  public void stop(final InternalManagedEntity entity) {
-    final String command = arrangeRemoteCommand(entity, entity.getStopCommand());
-    Thread stop = new Thread(this.threadGroup, new Runnable() {
-      public void run() {
-        execute(command, entity);
-      }
-    }, "Stop " + entity.getEntityType());
-    stop.start();
-  }
-
-  /**
-   * Returns whether or not a managed entity is running
-   */
-  public boolean isRunning(InternalManagedEntity entity) {
-    final String command = arrangeRemoteCommand(entity, entity.getIsRunningCommand());
-    String output = execute(command, entity);
-
-    if (output == null || (output.indexOf("stop" /* "ing" "ped" */) != -1)
-        || (output.indexOf("killed") != -1) || (output.indexOf("starting") != -1)) {
-      return false;
-
-    } else if (output.indexOf("running") != -1) {
-      return true;
-
-    } else {
-      throw new IllegalStateException(
-          LocalizedStrings.ManagedEntityController_COULD_NOT_DETERMINE_IF_MANAGED_ENTITY_WAS_RUNNING_0
-              .toLocalizedString(output));
-    }
-  }
-
-  /**
-   * Returns the contents of a locator's log file. Other APIs are used to get the log file of
-   * managed entities that are also system members.
-   */
-  public String getLog(DistributionLocatorImpl locator) {
-    String command = arrangeRemoteCommand(locator, locator.getLogCommand());
-    return execute(command, locator);
-  }
-
-  /**
-   * Returns the contents of the given directory using the given managed entity to determine the
-   * host and remote command.
-   */
-  private String listDirectory(InternalManagedEntity entity, String dir) {
-    ManagedEntityConfig config = entity.getEntityConfig();
-    String listFile = pathIsWindows(config.getProductDirectory()) ? "dir " : "ls ";
-    String command = arrangeRemoteCommand(entity, listFile + dir);
-    return execute(command, entity);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java b/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java
deleted file mode 100644
index 25abd7e..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupRequest.java
+++ /dev/null
@@ -1,173 +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.admin.internal;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.DataSerializer;
-import org.apache.geode.cache.persistence.PersistentID;
-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.ReplyException;
-import org.apache.geode.internal.admin.remote.AdminFailureResponse;
-import org.apache.geode.internal.admin.remote.AdminMultipleReplyProcessor;
-import org.apache.geode.internal.admin.remote.AdminResponse;
-import org.apache.geode.internal.admin.remote.CliLegacyMessage;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-
-/**
- * A request send from an admin VM to all of the peers to indicate that that should complete the
- * backup operation.
- * 
- *
- */
-public class FinishBackupRequest extends CliLegacyMessage {
-  private static final Logger logger = LogService.getLogger();
-
-  private File targetDir;
-  private File baselineDir;
-  private boolean abort;
-
-  public FinishBackupRequest() {
-    super();
-  }
-
-  public FinishBackupRequest(File targetDir, File baselineDir, boolean abort) {
-    this.targetDir = targetDir;
-    this.baselineDir = baselineDir;
-    this.abort = abort;
-  }
-
-  public static Map<DistributedMember, Set<PersistentID>> send(DM dm, Set recipients,
-      File targetDir, File baselineDir, boolean abort) {
-    FinishBackupRequest request = new FinishBackupRequest(targetDir, baselineDir, abort);
-    request.setRecipients(recipients);
-
-    FinishBackupReplyProcessor replyProcessor = new FinishBackupReplyProcessor(dm, recipients);
-    request.msgId = replyProcessor.getProcessorId();
-    dm.putOutgoing(request);
-    try {
-      replyProcessor.waitForReplies();
-    } catch (ReplyException e) {
-      if (!(e.getCause() instanceof CancelException)) {
-        throw e;
-      }
-    } catch (InterruptedException e) {
-      e.printStackTrace();
-    }
-    AdminResponse response = request.createResponse((DistributionManager) dm);
-    response.setSender(dm.getDistributionManagerId());
-    replyProcessor.process(response);
-    return replyProcessor.results;
-  }
-
-  @Override
-  protected AdminResponse createResponse(DistributionManager dm) {
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-    HashSet<PersistentID> persistentIds;
-    if (cache == null || cache.getBackupManager() == null) {
-      persistentIds = new HashSet<PersistentID>();
-    } else {
-      try {
-        persistentIds = cache.getBackupManager().finishBackup(targetDir, baselineDir, abort);
-      } catch (IOException e) {
-        logger.error(
-            LocalizedMessage.create(LocalizedStrings.CliLegacyMessage_ERROR, this.getClass()), e);
-        return AdminFailureResponse.create(dm, getSender(), e);
-      }
-    }
-
-    return new FinishBackupResponse(this.getSender(), persistentIds);
-  }
-
-  public int getDSFID() {
-    return FINISH_BACKUP_REQUEST;
-  }
-
-  @Override
-  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
-    super.fromData(in);
-    targetDir = DataSerializer.readFile(in);
-    baselineDir = DataSerializer.readFile(in);
-    abort = DataSerializer.readBoolean(in);
-  }
-
-  @Override
-  public void toData(DataOutput out) throws IOException {
-    super.toData(out);
-    DataSerializer.writeFile(targetDir, out);
-    DataSerializer.writeFile(baselineDir, out);
-    DataSerializer.writeBoolean(abort, out);
-  }
-
-  private static class FinishBackupReplyProcessor extends AdminMultipleReplyProcessor {
-    Map<DistributedMember, Set<PersistentID>> results =
-        Collections.synchronizedMap(new HashMap<DistributedMember, Set<PersistentID>>());
-
-    public FinishBackupReplyProcessor(DM dm, Collection initMembers) {
-      super(dm, initMembers);
-    }
-
-    @Override
-    protected boolean stopBecauseOfExceptions() {
-      return false;
-    }
-
-
-
-    @Override
-    protected int getAckWaitThreshold() {
-      // Disable the 15 second warning if the backup is taking a long time
-      return 0;
-    }
-
-    @Override
-    public long getAckSevereAlertThresholdMS() {
-      // Don't log severe alerts for backups either
-      return Long.MAX_VALUE;
-    }
-
-    @Override
-    protected void process(DistributionMessage msg, boolean warn) {
-      if (msg instanceof FinishBackupResponse) {
-        final HashSet<PersistentID> persistentIds = ((FinishBackupResponse) msg).getPersistentIds();
-        if (persistentIds != null && !persistentIds.isEmpty()) {
-          results.put(msg.getSender(), persistentIds);
-        }
-      }
-      super.process(msg, warn);
-    }
-
-
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupResponse.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupResponse.java b/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupResponse.java
deleted file mode 100644
index ab032b7..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/FinishBackupResponse.java
+++ /dev/null
@@ -1,76 +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.admin.internal;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.HashSet;
-
-import org.apache.geode.DataSerializer;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.admin.remote.AdminResponse;
-
-/**
- * The reply for a {@link FinishBackupRequest}. The reply contains the persistent ids of the disk
- * stores that were backed up on this member.
- * 
- *
- */
-public class FinishBackupResponse extends AdminResponse {
-
-  private HashSet<PersistentID> persistentIds;
-
-  public FinishBackupResponse() {
-    super();
-  }
-
-  public FinishBackupResponse(InternalDistributedMember sender,
-      HashSet<PersistentID> persistentIds) {
-    this.setRecipient(sender);
-    this.persistentIds = persistentIds;
-  }
-
-  public HashSet<PersistentID> getPersistentIds() {
-    return persistentIds;
-  }
-
-  @Override
-  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
-    super.fromData(in);
-    persistentIds = DataSerializer.readHashSet(in);
-  }
-
-  @Override
-  public void toData(DataOutput out) throws IOException {
-    super.toData(out);
-    DataSerializer.writeHashSet(persistentIds, out);
-  }
-
-  @Override
-  protected Object clone() throws CloneNotSupportedException {
-    return super.clone();
-  }
-
-  public int getDSFID() {
-    return FINISH_BACKUP_RESPONSE;
-  }
-
-  @Override
-  public String toString() {
-    return getClass().getName() + ": " + persistentIds;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskRequest.java b/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskRequest.java
deleted file mode 100644
index ff6dd9d..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskRequest.java
+++ /dev/null
@@ -1,94 +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.admin.internal;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.geode.CancelException;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.internal.DM;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.distributed.internal.ReplyException;
-import org.apache.geode.internal.admin.remote.AdminMultipleReplyProcessor;
-import org.apache.geode.internal.admin.remote.AdminResponse;
-import org.apache.geode.internal.admin.remote.CliLegacyMessage;
-import org.apache.geode.internal.cache.DiskStoreImpl;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-
-/**
- * A request to from an admin VM to all non admin members to start a backup. In the prepare phase of
- * the backup, the members will suspend bucket destroys to make sure buckets aren't missed during
- * the backup.
- * 
- *
- */
-public class FlushToDiskRequest extends CliLegacyMessage {
-
-  public FlushToDiskRequest() {
-
-  }
-
-  public static void send(DM dm, Set recipients) {
-    FlushToDiskRequest request = new FlushToDiskRequest();
-    request.setRecipients(recipients);
-
-    FlushToDiskProcessor replyProcessor = new FlushToDiskProcessor(dm, recipients);
-    request.msgId = replyProcessor.getProcessorId();
-    dm.putOutgoing(request);
-    try {
-      replyProcessor.waitForReplies();
-    } catch (ReplyException e) {
-      if (!(e.getCause() instanceof CancelException)) {
-        throw e;
-      }
-    } catch (InterruptedException e) {
-      e.printStackTrace();
-    }
-    AdminResponse response = request.createResponse((DistributionManager) dm);
-    response.setSender(dm.getDistributionManagerId());
-    replyProcessor.process(response);
-  }
-
-  @Override
-  protected AdminResponse createResponse(DistributionManager dm) {
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-    HashSet<PersistentID> persistentIds;
-    if (cache != null) {
-      Collection<DiskStoreImpl> diskStores = cache.listDiskStoresIncludingRegionOwned();
-      for (DiskStoreImpl store : diskStores) {
-        store.flush();
-      }
-    }
-
-    return new FlushToDiskResponse(this.getSender());
-  }
-
-  public int getDSFID() {
-    return FLUSH_TO_DISK_REQUEST;
-  }
-
-  private static class FlushToDiskProcessor extends AdminMultipleReplyProcessor {
-    public FlushToDiskProcessor(DM dm, Collection initMembers) {
-      super(dm, initMembers);
-    }
-
-    @Override
-    protected boolean stopBecauseOfExceptions() {
-      return false;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskResponse.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskResponse.java b/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskResponse.java
deleted file mode 100644
index 5461ebb..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/FlushToDiskResponse.java
+++ /dev/null
@@ -1,43 +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.admin.internal;
-
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.admin.remote.AdminResponse;
-
-/**
- * The response to the {@link FlushToDiskRequest}
- * 
- *
- */
-public class FlushToDiskResponse extends AdminResponse {
-
-  public FlushToDiskResponse() {
-    super();
-  }
-
-  public FlushToDiskResponse(InternalDistributedMember sender) {
-    this.setRecipient(sender);
-  }
-
-  public int getDSFID() {
-    return FLUSH_TO_DISK_RESPONSE;
-  }
-
-  @Override
-  public String toString() {
-    return getClass().getName();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthConfigImpl.java
deleted file mode 100644
index 4bf0305..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthConfigImpl.java
+++ /dev/null
@@ -1,80 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-// @todo davidw Delegate to a "parent" config for properties that are not overridden.
-// This will be made easier with a special <code>HealthConfigAttribute</code> class.
-/**
- * The implementation of <code>GemFireHealthConfig</code>
- *
- *
- *
- * @since GemFire 3.5
- */
-public class GemFireHealthConfigImpl extends CacheHealthConfigImpl implements GemFireHealthConfig {
-
-  private static final long serialVersionUID = -6797673296902808018L;
-
-  /** The name of the host to which this configuration applies. */
-  private String hostName;
-
-  /**
-   * The number of seconds to wait between evaluating the health of GemFire.
-   */
-  private int interval = DEFAULT_HEALTH_EVALUATION_INTERVAL;
-
-  //////////////////////// Constructors ////////////////////////
-
-  /**
-   * Creates a new <code>GemFireHealthConfigImpl</code> that applies to the host with the given
-   * name.
-   *
-   * @param hostName The name of the host to which this configuration applies. If <code>null</code>,
-   *        then this is the "default" configuration.
-   */
-  public GemFireHealthConfigImpl(String hostName) {
-    this.hostName = hostName;
-  }
-
-  /////////////////////// Instance Methods ///////////////////////
-
-  public String getHostName() {
-    return this.hostName;
-  }
-
-  public void setHealthEvaluationInterval(int interval) {
-    this.interval = interval;
-  }
-
-  public int getHealthEvaluationInterval() {
-    return this.interval;
-  }
-
-  @Override
-  public String toString() {
-    if (this.hostName == null) {
-      return LocalizedStrings.GemFireHealthConfigImpl_DEFAULT_GEMFIRE_HEALTH_CONFIGURATION
-          .toLocalizedString();
-
-    } else {
-      return LocalizedStrings.GemFireHealthConfigImpl_GEMFIRE_HEALTH_CONFIGURATION_FOR_HOST_0
-          .toLocalizedString(this.hostName);
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthEvaluator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthEvaluator.java
deleted file mode 100644
index 1573ca7..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/GemFireHealthEvaluator.java
+++ /dev/null
@@ -1,182 +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.admin.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.admin.GemFireHealth;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-
-/**
- * Evaluates the health of various GemFire components in the VM according to a
- * {@link GemFireHealthConfig}.
- *
- * <P>
- *
- * Note that evaluators never reside in the administration VM, they only in member VMs. They are not
- * <code>Serializable</code> and aren't meant to be.
- *
- * @see MemberHealthEvaluator
- * @see CacheHealthEvaluator
- *
- *
- * @since GemFire 3.5
- */
-public class GemFireHealthEvaluator {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /** Determines how the health of GemFire is determined */
-  private GemFireHealthConfig config;
-
-  /** Evaluates the health of this member of the distributed system */
-  private MemberHealthEvaluator memberHealth;
-
-  /** Evaluates the health of the Cache hosted in this VM */
-  private CacheHealthEvaluator cacheHealth;
-
-  /**
-   * The most recent <code>OKAY_HEALTH</code> diagnoses of the GemFire system
-   */
-  private List okayDiagnoses;
-
-  /**
-   * The most recent <code>POOR_HEALTH</code> diagnoses of the GemFire system
-   */
-  private List poorDiagnoses;
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>GemFireHealthEvaluator</code>
-   *
-   * @param config The configuration that determines whether or GemFire is healthy
-   * @param dm The distribution manager
-   */
-  public GemFireHealthEvaluator(GemFireHealthConfig config, DistributionManager dm) {
-    if (config == null) {
-      throw new NullPointerException(
-          LocalizedStrings.GemFireHealthEvaluator_NULL_GEMFIREHEALTHCONFIG.toLocalizedString());
-    }
-
-    this.config = config;
-    this.memberHealth = new MemberHealthEvaluator(config, dm);
-    this.cacheHealth = new CacheHealthEvaluator(config, dm);
-    this.okayDiagnoses = new ArrayList();
-    this.poorDiagnoses = new ArrayList();
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Evaluates the health of the GemFire components in this VM.
-   *
-   * @return The aggregate health code (such as {@link GemFireHealth#OKAY_HEALTH}) of the GemFire
-   *         components.
-   */
-  public GemFireHealth.Health evaluate() {
-    List status = new ArrayList();
-    this.memberHealth.evaluate(status);
-    this.cacheHealth.evaluate(status);
-
-    GemFireHealth.Health overallHealth = GemFireHealth.GOOD_HEALTH;
-    this.okayDiagnoses.clear();
-    this.poorDiagnoses.clear();
-
-    for (Iterator iter = status.iterator(); iter.hasNext();) {
-      AbstractHealthEvaluator.HealthStatus health =
-          (AbstractHealthEvaluator.HealthStatus) iter.next();
-      if (overallHealth == GemFireHealth.GOOD_HEALTH) {
-        if ((health.getHealthCode() != GemFireHealth.GOOD_HEALTH)) {
-          overallHealth = health.getHealthCode();
-        }
-
-      } else if (overallHealth == GemFireHealth.OKAY_HEALTH) {
-        if (health.getHealthCode() == GemFireHealth.POOR_HEALTH) {
-          overallHealth = GemFireHealth.POOR_HEALTH;
-        }
-      }
-
-      GemFireHealth.Health healthCode = health.getHealthCode();
-      if (healthCode == GemFireHealth.OKAY_HEALTH) {
-        this.okayDiagnoses.add(health.getDiagnosis());
-
-      } else if (healthCode == GemFireHealth.POOR_HEALTH) {
-        this.poorDiagnoses.add(health.getDiagnosis());
-      }
-    }
-
-    if (logger.isDebugEnabled()) {
-      logger.debug("Evaluated health to be {}", overallHealth);
-    }
-    return overallHealth;
-  }
-
-  /**
-   * Returns detailed information explaining the current health status. Each array element is a
-   * different cause for the current status. An empty array will be returned if the current status
-   * is {@link GemFireHealth#GOOD_HEALTH}.
-   */
-  public String[] getDiagnosis(GemFireHealth.Health healthCode) {
-    if (healthCode == GemFireHealth.GOOD_HEALTH) {
-      return new String[0];
-
-    } else if (healthCode == GemFireHealth.OKAY_HEALTH) {
-      String[] array = new String[this.okayDiagnoses.size()];
-      this.okayDiagnoses.toArray(array);
-      return array;
-
-    } else {
-      Assert.assertTrue(healthCode == GemFireHealth.POOR_HEALTH);
-      String[] array = new String[this.poorDiagnoses.size()];
-      this.poorDiagnoses.toArray(array);
-      return array;
-    }
-  }
-
-  /**
-   * Resets the state of this evaluator
-   */
-  public void reset() {
-    this.okayDiagnoses.clear();
-    this.poorDiagnoses.clear();
-  }
-
-  /**
-   * Returns the heath evaluation interval, in seconds.
-   *
-   * @see GemFireHealthConfig#getHealthEvaluationInterval
-   */
-  public int getEvaluationInterval() {
-    return this.config.getHealthEvaluationInterval();
-  }
-
-  /**
-   * Closes this evaluator and releases all of its resources
-   */
-  public void close() {
-    this.memberHealth.close();
-    this.cacheHealth.close();
-  }
-
-}


[12/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java b/geode-core/src/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java
deleted file mode 100644
index c61cbd0..0000000
--- a/geode-core/src/test/java/org/apache/geode/admin/internal/HealthEvaluatorTestCase.java
+++ /dev/null
@@ -1,71 +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.admin.internal;
-
-import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.junit.After;
-import org.junit.Before;
-
-import java.util.Properties;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-/**
- * Superclass of tests for the {@linkplain org.apache.geode.admin.internal.AbstractHealthEvaluator
- * health evaluator} classes.
- *
- *
- * @since GemFire 3.5
- */
-public abstract class HealthEvaluatorTestCase {
-
-  /** The DistributedSystem used for this test */
-  protected InternalDistributedSystem system;
-
-  /**
-   * Creates a "loner" <code>DistributedSystem</code> for this test.
-   */
-  @Before
-  public void setUp() {
-    Properties props = getProperties();
-    system = (InternalDistributedSystem) DistributedSystem.connect(props);
-  }
-
-  /**
-   * Closes the "loner" <code>DistributedSystem</code>
-   */
-  @After
-  public void tearDown() {
-    if (this.system != null) {
-      this.system.disconnect();
-    }
-
-    this.system = null;
-  }
-
-  /**
-   * Creates the <code>Properties</code> objects used to connect to the distributed system.
-   */
-  protected Properties getProperties() {
-    Properties props = new Properties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "");
-    props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
-
-    return props;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java
deleted file mode 100644
index d20ce36..0000000
--- a/geode-core/src/test/java/org/apache/geode/admin/internal/MemberHealthEvaluatorJUnitTest.java
+++ /dev/null
@@ -1,96 +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.admin.internal;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import org.apache.geode.admin.GemFireHealth;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.internal.statistics.GemFireStatSampler;
-import org.apache.geode.internal.statistics.platform.ProcessStats;
-import org.apache.geode.internal.PureJavaMode;
-import org.apache.geode.test.junit.categories.IntegrationTest;
-
-/**
- * Contains simple tests for the {@link MemberHealthEvaluator}.
- *
- *
- * @since GemFire 3.5
- */
-@SuppressWarnings("deprecation")
-@Category(IntegrationTest.class)
-public class MemberHealthEvaluatorJUnitTest extends HealthEvaluatorTestCase {
-
-  /**
-   * Tests that we are in {@link GemFireHealth#OKAY_HEALTH okay} health if the VM's process size is
-   * too big.
-   *
-   * @see MemberHealthEvaluator#checkVMProcessSize
-   */
-  @Test
-  public void testCheckVMProcessSize() throws InterruptedException {
-    if (PureJavaMode.osStatsAreAvailable()) {
-      GemFireStatSampler sampler = system.getStatSampler();
-      assertNotNull(sampler);
-
-      sampler.waitForInitialization(10000); // fix: remove infinite wait
-
-      ProcessStats stats = sampler.getProcessStats();
-      assertNotNull(stats);
-
-      List status = new ArrayList();
-      long threshold = stats.getProcessSize() * 2;
-
-      if (threshold <= 0) {
-        // The process size is zero on some Linux versions
-        return;
-      }
-
-      GemFireHealthConfig config = new GemFireHealthConfigImpl(null);
-      config.setMaxVMProcessSize(threshold);
-
-      MemberHealthEvaluator eval =
-          new MemberHealthEvaluator(config, this.system.getDistributionManager());
-      eval.evaluate(status);
-      assertTrue(status.isEmpty());
-
-      status = new ArrayList();
-      long processSize = stats.getProcessSize();
-      threshold = processSize / 2;
-      assertTrue("Threshold (" + threshold + ") is > 0.  " + "Process size is " + processSize,
-          threshold > 0);
-
-      config = new GemFireHealthConfigImpl(null);
-      config.setMaxVMProcessSize(threshold);
-
-      eval = new MemberHealthEvaluator(config, this.system.getDistributionManager());
-      eval.evaluate(status);
-      assertEquals(1, status.size());
-
-      AbstractHealthEvaluator.HealthStatus ill =
-          (AbstractHealthEvaluator.HealthStatus) status.get(0);
-      assertEquals(GemFireHealth.OKAY_HEALTH, ill.getHealthCode());
-      assertTrue(ill.getDiagnosis().indexOf("The size of this VM") != -1);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java
index 5a0d3fc..ade1450 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/dunit/QueryUsingPoolDUnitTest.java
@@ -198,7 +198,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
       }
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
               + regionName;
 
       try {
@@ -212,7 +212,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
       assertTrue(!results.getCollectionType().allowsDuplicates());
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
               + regionName + " where ticker = 'ibm'";
       try {
         Query query = qService.newQuery(queryString);
@@ -224,7 +224,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
       assertTrue(!results.getCollectionType().allowsDuplicates());
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
               + regionName + " where ticker = 'IBM'";
       try {
         Query query = qService.newQuery(queryString);
@@ -236,7 +236,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
       assertTrue(!results.getCollectionType().allowsDuplicates());
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
               + regionName + " where price > 49";
       try {
         Query query = qService.newQuery(queryString);
@@ -248,7 +248,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
       assertTrue(!results.getCollectionType().allowsDuplicates());
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
               + regionName + " where price = 50";
       try {
         Query query = qService.newQuery(queryString);
@@ -260,7 +260,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
       assertTrue(!results.getCollectionType().allowsDuplicates());
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct * from "
               + regionName + " where ticker = 'ibm' and price = 50";
       try {
         Query query = qService.newQuery(queryString);
@@ -318,7 +318,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
       }
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
               + regionName;
       try {
         Query query = qService.newQuery(queryString);
@@ -331,7 +331,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
           && results.getCollectionType().getElementType().isStructType());
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
               + regionName + " where ticker = 'ibm'";
       try {
         Query query = qService.newQuery(queryString);
@@ -344,7 +344,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
           && results.getCollectionType().getElementType().isStructType());
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
               + regionName + " where ticker = 'IBM'";
       try {
         Query query = qService.newQuery(queryString);
@@ -357,7 +357,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
           && results.getCollectionType().getElementType().isStructType());
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
               + regionName + " where price > 49";
       try {
         Query query = qService.newQuery(queryString);
@@ -370,7 +370,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
           && results.getCollectionType().getElementType().isStructType());
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
               + regionName + " where price = 50";
       try {
         Query query = qService.newQuery(queryString);
@@ -383,7 +383,7 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
           && results.getCollectionType().getElementType().isStructType());
 
       queryString =
-          "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
+          "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject; select distinct ticker, price from "
               + regionName + " where ticker = 'ibm' and price = 50";
       try {
         Query query = qService.newQuery(queryString);
@@ -1654,7 +1654,8 @@ public class QueryUsingPoolDUnitTest extends JUnit4CacheTestCase {
       }
 
       try {
-        String importString = "import org.apache.geode.admin.QueryUsingPoolDUnitTest.TestObject;";
+        String importString =
+            "import org.apache.geode.query.dunit.QueryUsingPoolDUnitTest.TestObject;";
         qService.createIndex("test", IndexType.FUNCTIONAL, "ticker", regionName1, importString);
       } catch (UnsupportedOperationException e) {
         // Expected behavior.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/distributed/internal/ConsoleDistributionManagerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/ConsoleDistributionManagerDUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/ConsoleDistributionManagerDUnitTest.java
index 1da473f..90c1cd9 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/ConsoleDistributionManagerDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/ConsoleDistributionManagerDUnitTest.java
@@ -56,8 +56,7 @@ import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.FlakyTest;
 
 /**
- * This class tests the functionality of the {@linkplain org.apache.geode.internal.admin internal
- * admin} API.
+ * This class tests the functionality of the internal admin API.
  */
 @Category(DistributedTest.class)
 public class ConsoleDistributionManagerDUnitTest extends JUnit4CacheTestCase

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionManagerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionManagerDUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionManagerDUnitTest.java
index 1329c24..7ce39da 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionManagerDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionManagerDUnitTest.java
@@ -28,12 +28,12 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.LogWriter;
-import org.apache.geode.admin.AdminDistributedSystem;
-import org.apache.geode.admin.AdminDistributedSystemFactory;
-import org.apache.geode.admin.Alert;
-import org.apache.geode.admin.AlertLevel;
-import org.apache.geode.admin.AlertListener;
-import org.apache.geode.admin.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminDistributedSystemFactory;
+import org.apache.geode.internal.admin.api.Alert;
+import org.apache.geode.internal.admin.api.AlertLevel;
+import org.apache.geode.internal.admin.api.AlertListener;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheListener;
 import org.apache.geode.cache.DataPolicy;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/AvailablePortJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/AvailablePortJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/AvailablePortJUnitTest.java
index 8134f36..6855dbd 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/AvailablePortJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/AvailablePortJUnitTest.java
@@ -14,7 +14,7 @@
  */
 package org.apache.geode.internal;
 
-import org.apache.geode.admin.internal.InetAddressUtil;
+import org.apache.geode.internal.admin.api.impl.InetAddressUtil;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.After;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/admin/api/AdminTestHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/admin/api/AdminTestHelper.java b/geode-core/src/test/java/org/apache/geode/internal/admin/api/AdminTestHelper.java
new file mode 100644
index 0000000..18568ee
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/admin/api/AdminTestHelper.java
@@ -0,0 +1,44 @@
+/*
+ * 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.internal.admin.api;
+
+import static org.junit.Assert.*;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.internal.admin.api.AdminDistributedSystemFactory;
+
+public class AdminTestHelper {
+  private AdminTestHelper() {}
+
+  public static void checkEnableAdministrationOnly(boolean v, boolean expectException) {
+    boolean origIsDedicatedAdminVM = DistributionManager.isDedicatedAdminVM;
+    if (expectException) {
+      try {
+        AdminDistributedSystemFactory.setEnableAdministrationOnly(v);
+        fail("expected IllegalStateException");
+      } catch (IllegalStateException expected) {
+        assertEquals(origIsDedicatedAdminVM, DistributionManager.isDedicatedAdminVM);
+      } finally {
+        DistributionManager.isDedicatedAdminVM = origIsDedicatedAdminVM;
+      }
+    } else {
+      try {
+        AdminDistributedSystemFactory.setEnableAdministrationOnly(v);
+        assertEquals(v, DistributionManager.isDedicatedAdminVM);
+      } finally {
+        DistributionManager.isDedicatedAdminVM = origIsDedicatedAdminVM;
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/admin/api/AlertLevelJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/admin/api/AlertLevelJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/admin/api/AlertLevelJUnitTest.java
new file mode 100644
index 0000000..100ce34
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/admin/api/AlertLevelJUnitTest.java
@@ -0,0 +1,64 @@
+/*
+ * 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.internal.admin.api;
+
+import static org.apache.geode.internal.Assert.assertTrue;
+import static org.junit.Assert.*;
+
+import java.lang.reflect.Constructor;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.internal.admin.api.AlertLevel;
+import org.apache.geode.test.junit.categories.UnitTest;
+
+/**
+ * AlertLevel Tester.
+ */
+@Category(UnitTest.class)
+public class AlertLevelJUnitTest {
+
+  /**
+   * Method: equals(Object other)
+   */
+
+  private AlertLevel alertLevel1 = AlertLevel.WARNING;
+  private AlertLevel alertLevel2 = AlertLevel.ERROR;
+  private AlertLevel alertLevel3 = AlertLevel.WARNING;
+
+
+  @Test
+  public void testEquals() throws Exception {
+    // TODO: Test goes here...
+    assertTrue(alertLevel1.equals(alertLevel3));
+    assertFalse(alertLevel1.equals(alertLevel2));
+    assertFalse(alertLevel1.equals(null));
+
+    Constructor<AlertLevel> constructor;
+    constructor = AlertLevel.class.getDeclaredConstructor(int.class, String.class);
+    constructor.setAccessible(true);
+    AlertLevel level = constructor.newInstance(AlertLevel.ERROR.getSeverity(), "ERROR");
+    assertEquals(level.getSeverity(), AlertLevel.ERROR.getSeverity());
+
+
+    AlertLevel level1 =
+        constructor.newInstance(AlertLevel.ERROR.getSeverity(), new String("ERROR"));
+    assertEquals(level1.getName(), alertLevel2.getName());
+    assertTrue(level1.equals(alertLevel2));
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/BindDistributedSystemJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/BindDistributedSystemJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/BindDistributedSystemJUnitTest.java
new file mode 100755
index 0000000..b342b7d
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/BindDistributedSystemJUnitTest.java
@@ -0,0 +1,86 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.internal.AvailablePortHelper;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.impl.InetAddressUtil;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.util.Properties;
+
+import static org.apache.geode.distributed.ConfigurationProperties.BIND_ADDRESS;
+import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests {@link AdminDistributedSystemImpl}.
+ *
+ * @created August 30, 2004
+ * @since GemFire 3.5
+ */
+@SuppressWarnings("deprecation")
+@Category(IntegrationTest.class)
+public class BindDistributedSystemJUnitTest {
+
+  private final static int RETRY_ATTEMPTS = 3;
+  private final static int RETRY_SLEEP = 100;
+
+  private DistributedSystem system;
+
+  @After
+  public void tearDown() {
+    if (this.system != null) {
+      this.system.disconnect();
+    }
+    this.system = null;
+  }
+
+  // public void testBindToAddressNull() throws Exception {
+  // DistributedSystemFactory.bindToAddress(null);
+  // todo...
+  // }
+  //
+  // public void testBindToAddressEmpty() throws Exception {
+  // DistributedSystemFactory.bindToAddress("");
+  // todo...
+  // }
+
+  @Test
+  public void testBindToAddressLoopback() throws Exception {
+    String bindTo = "127.0.0.1";
+    // make sure bindTo is the loopback... needs to be later in test...
+    assertEquals(true, InetAddressUtil.isLoopback(bindTo));
+
+    Properties props = new Properties();
+    props.setProperty(BIND_ADDRESS, bindTo);
+    props.setProperty(START_LOCATOR,
+        "localhost[" + AvailablePortHelper.getRandomAvailableTCPPort() + "]");
+    this.system = org.apache.geode.distributed.DistributedSystem.connect(props);
+
+    assertEquals(true, this.system.isConnected());
+
+    // Because of fix for bug 31409
+    this.system.disconnect();
+
+  }
+
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/CacheHealthEvaluatorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/CacheHealthEvaluatorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/CacheHealthEvaluatorJUnitTest.java
new file mode 100644
index 0000000..4ccc7c5
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/CacheHealthEvaluatorJUnitTest.java
@@ -0,0 +1,200 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import static org.junit.Assert.*;
+
+import org.apache.geode.cache.*;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.cache.*;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+
+import java.util.*;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
+
+/**
+ * Contains simple tests for the {@link CacheHealthEvaluator}
+ *
+ *
+ * @since GemFire 3.5
+ */
+@SuppressWarnings("deprecation")
+@Category(IntegrationTest.class)
+public class CacheHealthEvaluatorJUnitTest extends HealthEvaluatorTestCase {
+
+  @Rule
+  public TestName testName = new TestName();
+
+  /**
+   * Tests that we are in {@link GemFireHealth#OKAY_HEALTH okay} health if cache loads take too
+   * long.
+   *
+   * @see CacheHealthEvaluator#checkLoadTime
+   */
+  @Test
+  public void testCheckLoadTime() throws CacheException {
+    Cache cache = CacheFactory.create(this.system);
+    CachePerfStats stats = ((GemFireCacheImpl) cache).getCachePerfStats();
+
+    AttributesFactory factory = new AttributesFactory();
+    factory.setScope(Scope.LOCAL);
+    factory.setCacheLoader(new CacheLoader() {
+      public Object load(LoaderHelper helper) throws CacheLoaderException {
+
+        return "Loaded";
+      }
+
+      public void close() {}
+    });
+
+    RegionAttributes attrs = factory.create();
+    Region region = cache.createRegion(getName(), attrs);
+
+    GemFireHealthConfig config = new GemFireHealthConfigImpl(null);
+    config.setMaxLoadTime(100);
+
+    CacheHealthEvaluator eval =
+        new CacheHealthEvaluator(config, this.system.getDistributionManager());
+    for (int i = 0; i < 10; i++) {
+      region.get("Test1 " + i);
+    }
+    long firstLoadTime = stats.getLoadTime();
+    long firstLoadsCompleted = stats.getLoadsCompleted();
+    assertTrue(firstLoadTime >= 0);
+    assertTrue(firstLoadsCompleted > 0);
+
+    // First time should always be empty
+    List status = new ArrayList();
+    eval.evaluate(status);
+    assertEquals(0, status.size());
+
+    config = new GemFireHealthConfigImpl(null);
+    config.setMaxLoadTime(10);
+    eval = new CacheHealthEvaluator(config, this.system.getDistributionManager());
+    eval.evaluate(status);
+
+    long start = System.currentTimeMillis();
+    for (int i = 0; i < 100; i++) {
+      region.get("Test2 " + i);
+    }
+    assertTrue(System.currentTimeMillis() - start < 1000);
+    long secondLoadTime = stats.getLoadTime();
+    long secondLoadsCompleted = stats.getLoadsCompleted();
+    assertTrue("firstLoadTime=" + firstLoadTime + ", secondLoadTime=" + secondLoadTime,
+        secondLoadTime >= firstLoadTime);
+    assertTrue(secondLoadsCompleted > firstLoadsCompleted);
+
+    // Averge should be less than 10 milliseconds
+    status = new ArrayList();
+    eval.evaluate(status);
+    assertEquals(0, status.size());
+
+    region.getAttributesMutator().setCacheLoader(new CacheLoader() {
+      public Object load(LoaderHelper helper) throws CacheLoaderException {
+
+        try {
+          Thread.sleep(20);
+
+        } catch (InterruptedException ex) {
+          fail("Why was I interrupted?");
+        }
+        return "Loaded";
+      }
+
+      public void close() {}
+
+    });
+
+    for (int i = 0; i < 50; i++) {
+      region.get("Test3 " + i);
+    }
+
+    long thirdLoadTime = stats.getLoadTime();
+    long thirdLoadsCompleted = stats.getLoadsCompleted();
+    assertTrue(thirdLoadTime > secondLoadTime);
+    assertTrue(thirdLoadsCompleted > secondLoadsCompleted);
+
+    status = new ArrayList();
+    eval.evaluate(status);
+    assertEquals(1, status.size());
+
+    AbstractHealthEvaluator.HealthStatus ill = (AbstractHealthEvaluator.HealthStatus) status.get(0);
+    assertEquals(GemFireHealth.OKAY_HEALTH, ill.getHealthCode());
+    String s = "The average duration of a Cache load";
+    assertTrue(ill.getDiagnosis().indexOf(s) != -1);
+  }
+
+  /**
+   * Tests that we are in {@link GemFireHealth#OKAY_HEALTH okay} health if the hit ratio dips below
+   * the threshold.
+   */
+  @Test
+  public void testCheckHitRatio() throws CacheException {
+    Cache cache = CacheFactory.create(this.system);
+    // CachePerfStats stats = ((GemFireCache) cache).getCachePerfStats();
+
+    AttributesFactory factory = new AttributesFactory();
+    factory.setScope(Scope.LOCAL);
+    factory.setCacheLoader(new CacheLoader() {
+      public Object load(LoaderHelper helper) throws CacheLoaderException {
+
+        return "Loaded";
+      }
+
+      public void close() {}
+    });
+
+    RegionAttributes attrs = factory.create();
+    Region region = cache.createRegion(getName(), attrs);
+
+    GemFireHealthConfig config = new GemFireHealthConfigImpl(null);
+    config.setMinHitRatio(0.5);
+
+    CacheHealthEvaluator eval =
+        new CacheHealthEvaluator(config, this.system.getDistributionManager());
+    List status = new ArrayList();
+    eval.evaluate(status);
+    assertEquals(0, status.size());
+
+    region.get("One");
+    region.get("One");
+    region.get("One");
+
+    status = new ArrayList();
+    eval.evaluate(status);
+    assertEquals(0, status.size());
+
+    for (int i = 0; i < 50; i++) {
+      region.get("Miss " + i);
+    }
+
+    status = new ArrayList();
+    eval.evaluate(status);
+
+    AbstractHealthEvaluator.HealthStatus ill = (AbstractHealthEvaluator.HealthStatus) status.get(0);
+    assertEquals(GemFireHealth.OKAY_HEALTH, ill.getHealthCode());
+    String s = "The hit ratio of this Cache";
+    assertTrue(ill.getDiagnosis().indexOf(s) != -1);
+  }
+
+  private String getName() {
+    return getClass().getSimpleName() + "_" + testName.getMethodName();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/DistributedSystemTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/DistributedSystemTestCase.java b/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/DistributedSystemTestCase.java
new file mode 100755
index 0000000..fd9212c
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/DistributedSystemTestCase.java
@@ -0,0 +1,64 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.distributed.DistributedSystem;
+import org.junit.After;
+import org.junit.Before;
+
+import java.util.Properties;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+/**
+ * Provides common setUp and tearDown for testing the Admin API.
+ *
+ * @since GemFire 3.5
+ */
+public abstract class DistributedSystemTestCase {
+
+  /** The DistributedSystem used for this test */
+  protected DistributedSystem system;
+
+  /**
+   * Creates a "loner" <code>DistributedSystem</code> for this test.
+   */
+  @Before
+  public void setUp() throws Exception {
+    this.system = DistributedSystem.connect(defineProperties());
+  }
+
+  /**
+   * Closes the "loner" <code>DistributedSystem</code>
+   */
+  @After
+  public void tearDown() throws Exception {
+    if (this.system != null) {
+      this.system.disconnect();
+    }
+    this.system = null;
+  }
+
+  /**
+   * Defines the <code>Properties</code> used to connect to the distributed system.
+   */
+  protected Properties defineProperties() {
+    Properties props = new Properties();
+    props.setProperty(MCAST_PORT, "0");
+    props.setProperty(LOCATORS, "");
+    props.setProperty(CONSERVE_SOCKETS, "true");
+    return props;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/HealthEvaluatorTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/HealthEvaluatorTestCase.java b/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/HealthEvaluatorTestCase.java
new file mode 100644
index 0000000..858603f
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/HealthEvaluatorTestCase.java
@@ -0,0 +1,72 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.internal.admin.api.impl.AbstractHealthEvaluator;
+
+import org.junit.After;
+import org.junit.Before;
+
+import java.util.Properties;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+/**
+ * Superclass of tests for the {@linkplain AbstractHealthEvaluator health evaluator} classes.
+ *
+ *
+ * @since GemFire 3.5
+ */
+public abstract class HealthEvaluatorTestCase {
+
+  /** The DistributedSystem used for this test */
+  protected InternalDistributedSystem system;
+
+  /**
+   * Creates a "loner" <code>DistributedSystem</code> for this test.
+   */
+  @Before
+  public void setUp() {
+    Properties props = getProperties();
+    system = (InternalDistributedSystem) DistributedSystem.connect(props);
+  }
+
+  /**
+   * Closes the "loner" <code>DistributedSystem</code>
+   */
+  @After
+  public void tearDown() {
+    if (this.system != null) {
+      this.system.disconnect();
+    }
+
+    this.system = null;
+  }
+
+  /**
+   * Creates the <code>Properties</code> objects used to connect to the distributed system.
+   */
+  protected Properties getProperties() {
+    Properties props = new Properties();
+    props.setProperty(MCAST_PORT, "0");
+    props.setProperty(LOCATORS, "");
+    props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
+
+    return props;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/MemberHealthEvaluatorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/MemberHealthEvaluatorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/MemberHealthEvaluatorJUnitTest.java
new file mode 100644
index 0000000..c45bf00
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/admin/api/impl/MemberHealthEvaluatorJUnitTest.java
@@ -0,0 +1,96 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.statistics.GemFireStatSampler;
+import org.apache.geode.internal.statistics.platform.ProcessStats;
+import org.apache.geode.internal.PureJavaMode;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+
+/**
+ * Contains simple tests for the {@link MemberHealthEvaluator}.
+ *
+ *
+ * @since GemFire 3.5
+ */
+@SuppressWarnings("deprecation")
+@Category(IntegrationTest.class)
+public class MemberHealthEvaluatorJUnitTest extends HealthEvaluatorTestCase {
+
+  /**
+   * Tests that we are in {@link GemFireHealth#OKAY_HEALTH okay} health if the VM's process size is
+   * too big.
+   *
+   * @see MemberHealthEvaluator#checkVMProcessSize
+   */
+  @Test
+  public void testCheckVMProcessSize() throws InterruptedException {
+    if (PureJavaMode.osStatsAreAvailable()) {
+      GemFireStatSampler sampler = system.getStatSampler();
+      assertNotNull(sampler);
+
+      sampler.waitForInitialization(10000); // fix: remove infinite wait
+
+      ProcessStats stats = sampler.getProcessStats();
+      assertNotNull(stats);
+
+      List status = new ArrayList();
+      long threshold = stats.getProcessSize() * 2;
+
+      if (threshold <= 0) {
+        // The process size is zero on some Linux versions
+        return;
+      }
+
+      GemFireHealthConfig config = new GemFireHealthConfigImpl(null);
+      config.setMaxVMProcessSize(threshold);
+
+      MemberHealthEvaluator eval =
+          new MemberHealthEvaluator(config, this.system.getDistributionManager());
+      eval.evaluate(status);
+      assertTrue(status.isEmpty());
+
+      status = new ArrayList();
+      long processSize = stats.getProcessSize();
+      threshold = processSize / 2;
+      assertTrue("Threshold (" + threshold + ") is > 0.  " + "Process size is " + processSize,
+          threshold > 0);
+
+      config = new GemFireHealthConfigImpl(null);
+      config.setMaxVMProcessSize(threshold);
+
+      eval = new MemberHealthEvaluator(config, this.system.getDistributionManager());
+      eval.evaluate(status);
+      assertEquals(1, status.size());
+
+      AbstractHealthEvaluator.HealthStatus ill =
+          (AbstractHealthEvaluator.HealthStatus) status.get(0);
+      assertEquals(GemFireHealth.OKAY_HEALTH, ill.getHealthCode());
+      assertTrue(ill.getDiagnosis().indexOf("The size of this VM") != -1);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/cache/BackupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/BackupDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/BackupDUnitTest.java
index 10931e1..8ba922c 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/BackupDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/BackupDUnitTest.java
@@ -19,8 +19,6 @@ import org.junit.Test;
 
 import static org.junit.Assert.*;
 
-import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 import java.io.BufferedReader;
@@ -38,10 +36,8 @@ import java.util.TreeSet;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 
-import org.apache.geode.GemFireIOException;
-import org.apache.geode.admin.BackupStatus;
-import org.apache.geode.admin.internal.FinishBackupRequest;
-import org.apache.geode.admin.internal.PrepareBackupRequest;
+import org.apache.geode.internal.admin.api.BackupStatus;
+import org.apache.geode.internal.admin.api.impl.PrepareBackupRequest;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.DataPolicy;
 import org.apache.geode.cache.DiskStore;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
index 9c459a9..657a26b 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
@@ -32,12 +32,12 @@ import java.util.Set;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.admin.AdminDistributedSystem;
-import org.apache.geode.admin.AdminDistributedSystemFactory;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.BackupStatus;
-import org.apache.geode.admin.DistributedSystemConfig;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminDistributedSystemFactory;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.BackupStatus;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.Region;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
index 3f2ab70..47507f3 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
@@ -16,7 +16,6 @@ package org.apache.geode.internal.cache.partitioned;
 
 import org.junit.experimental.categories.Category;
 import org.mockito.ArgumentCaptor;
-import org.mockito.Mockito;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.core.Appender;
@@ -34,8 +33,6 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
 import static org.mockito.Mockito.when;
 import static org.mockito.Mockito.times;
 
-import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 import java.io.IOException;
@@ -49,7 +46,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 
 import com.jayway.awaitility.core.ConditionTimeoutException;
 
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
 import org.apache.geode.cache.AttributesFactory;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheClosedException;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
index 09893be..4b95d0e 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
@@ -28,11 +28,11 @@ import java.util.TreeSet;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.geode.admin.AdminDistributedSystem;
-import org.apache.geode.admin.AdminDistributedSystemFactory;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.BackupStatus;
-import org.apache.geode.admin.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminDistributedSystemFactory;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.BackupStatus;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
 import org.apache.geode.cache.AttributesFactory;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.DataPolicy;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java
index 1bb06f1..dd64ca7 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java
@@ -27,10 +27,10 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.InternalGemFireError;
-import org.apache.geode.admin.AdminDistributedSystemFactory;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.DistributedSystemConfig;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.AdminDistributedSystemFactory;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
 import org.apache.geode.cache.AttributesFactory;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheClosedException;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java
index 5f2575d..f501b65 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java
@@ -35,10 +35,10 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.DataSerializer;
-import org.apache.geode.admin.AdminDistributedSystem;
-import org.apache.geode.admin.AdminDistributedSystemFactory;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminDistributedSystemFactory;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
 import org.apache.geode.cache.AttributesFactory;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheClosedException;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/management/internal/beans/DistributedSystemBridgeJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/beans/DistributedSystemBridgeJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/beans/DistributedSystemBridgeJUnitTest.java
index a886ff7..1ad7c2f 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/beans/DistributedSystemBridgeJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/beans/DistributedSystemBridgeJUnitTest.java
@@ -26,9 +26,9 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.mockito.InOrder;
 
-import org.apache.geode.admin.internal.BackupDataStoreHelper;
-import org.apache.geode.admin.internal.FinishBackupRequest;
-import org.apache.geode.admin.internal.PrepareBackupRequest;
+import org.apache.geode.internal.admin.api.impl.BackupDataStoreHelper;
+import org.apache.geode.internal.admin.api.impl.FinishBackupRequest;
+import org.apache.geode.internal.admin.api.impl.PrepareBackupRequest;
 import org.apache.geode.distributed.internal.DM;
 import org.apache.geode.distributed.internal.locks.DLockService;
 import org.apache.geode.internal.cache.GemFireCacheImpl;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java b/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java
index 838bb29..cf19cb6 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/internal/JUnit4DistributedTestCase.java
@@ -31,7 +31,7 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
 
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.query.QueryTestUtils;
@@ -44,7 +44,6 @@ import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.DistributionMessageObserver;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.internal.net.SSLConfigurationFactory;
 import org.apache.geode.internal.net.SocketCreator;
 import org.apache.geode.internal.admin.ClientStatsManager;
 import org.apache.geode.internal.cache.DiskStoreObserver;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
index 23162e5..2a8e368 100644
--- a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
+++ b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
@@ -1,27 +1,3 @@
-org/apache/geode/admin/RegionSubRegionSnapshot,2
-fromData,62,2a2bb80023b500082a2bb900240100b5000b2a2bb80025b500052ab40005b9002601004d2cb9002701009900132cb900280100c000292ab6001ba7ffeab1
-toData,30,2ab400082bb800202b2ab4000bb9002102002ab40005c000032bb80022b1
-
-org/apache/geode/admin/internal/FinishBackupRequest,2
-fromData,33,2a2bb700292a2bb8002ab500022a2bb8002ab500032a2bb8002bb6002cb50004b1
-toData,33,2a2bb7002d2ab400022bb8002e2ab400032bb8002e2ab40004b8002f2bb80030b1
-
-org/apache/geode/admin/internal/FinishBackupResponse,2
-fromData,14,2a2bb700042a2bb80005b50003b1
-toData,14,2a2bb700062ab400032bb80007b1
-
-org/apache/geode/admin/internal/PrepareBackupResponse,2
-fromData,14,2a2bb700042a2bb80005b50003b1
-toData,14,2a2bb700062ab400032bb80007b1
-
-org/apache/geode/admin/internal/SystemMemberCacheEventProcessor$SystemMemberCacheMessage,2
-fromData,27,2a2bb7001a2a2bb8001bb5000c2a2bb9001c0100b8001db5000fb1
-toData,27,2a2bb7001e2ab4000c2bb8001f2b2ab4000fb40020b900210200b1
-
-org/apache/geode/admin/jmx/internal/StatAlertNotification,2
-fromData,39,2a2bb8002ab600032a2bb8002bb600072a2bb8002cc0002dc0002db600052a2bb8002eb50008b1
-toData,33,2ab600162bb800262ab600202bb800272ab6000e2bb800282ab400082bb80029b1
-
 org/apache/geode/cache/ExpirationAttributes,2
 fromData,22,2a2bb900120100b500022a2bb80013c00014b50004b1
 toData,19,2b2ab40002b9001502002ab400042bb80016b1
@@ -199,9 +175,9 @@ fromData,27,2a2bb7000c2a2bb9000d0100b500032a2bb8000ec0000fb50002b1
 toData,24,2a2bb700092b2ab40003b9000a02002ab400022bb8000bb1
 
 org/apache/geode/distributed/internal/StartupMessage,3
-fromDataProblem,38,2ab40039c7000e2abb006759b70068b500392ab400392bb60069572ab40039126ab6006957b1
-fromData,293,2a2bb7006b2a2bb8006cb500092a2bb9006d0100b5000c2a2bb9006e0100b5000d2a2bb9006e0100b500112bb9006d01003d033e1d1ca2003e2bb8006f3a042bb9006d010036051904c6000d19040301011505b80070a700183a062ab2007104bd00225903190653b60026b70072840301a7ffc32bb9006d01003e03360415041da200492bb8006f3a052bb8006f3a062bb9006d010036071905c600121906c6000d19051906150703b80073a700183a082ab2007404bd00225903190853b60026b70072840401a7ffb72a2bb80075c00076b500122a2bb9006d0100b500172a2bb8006cb500182a2bb9006e0100b50019bb006059b700613a0419042bb600772a1904b60078b5000a2a1904b60079b5000b2a1904b6007ab5000e2a1904b6007bb5000fb1
-toData,318,2a2bb7004d2ab400092bb8004e2b2ab4000cb9004f02002b2ab4000db9005002002b2ab40011b900500200b800514d2b2cbeb9004f0200033e1d2cbea2001f2c1d32b600522bb800532b2c1d32b60054b9004f0200840301a7ffe1b800554e2b2dbeb9004f020003360415042dbea200782d150432c100569900302d150432c00056b60057b600583a052d150432c00056b60059b600583a062d150432c00056b6005a3607a700272d150432c0005bb6005c3a052d150432c0005bb6005d3a062d150432c0005bb6005e360719052bb8005319062bb800532b1507b9004f0200840401a7ff872ab400122bb8005f2b2ab40017b9004f02002ab400182bb8004e2b2ab40019b900500200bb006059b700613a0419042ab4000ab6006219042ab4000bb6006319042ab4000eb6006419042ab4000fb6006519042bb60066b1
+fromDataProblem,38,2ab40037c7000e2abb006559b70066b500372ab400372bb60067572ab400371268b6006757b1
+fromData,293,2a2bb700692a2bb8006ab500092a2bb9006b0100b5000c2a2bb9006c0100b5000d2a2bb9006c0100b500112bb9006b01003d033e1d1ca2003e2bb8006d3a042bb9006b010036051904c6000d19040301011505b8006ea700183a062ab2006f04bd00205903190653b60024b70070840301a7ffc32bb9006b01003e03360415041da200492bb8006d3a052bb8006d3a062bb9006b010036071905c600121906c6000d19051906150703b80071a700183a082ab2007204bd00205903190853b60024b70070840401a7ffb72a2bb80073c00074b500122a2bb9006b0100b500172a2bb8006ab500182a2bb9006c0100b50019bb005e59b7005f3a0419042bb600752a1904b60076b5000a2a1904b60077b5000b2a1904b60078b5000e2a1904b60079b5000fb1
+toData,318,2a2bb7004b2ab400092bb8004c2b2ab4000cb9004d02002b2ab4000db9004e02002b2ab40011b9004e0200b8004f4d2b2cbeb9004d0200033e1d2cbea2001f2c1d32b600502bb800512b2c1d32b60052b9004d0200840301a7ffe1b800534e2b2dbeb9004d020003360415042dbea200782d150432c100549900302d150432c00054b60055b600563a052d150432c00054b60057b600563a062d150432c00054b600583607a700272d150432c00059b6005a3a052d150432c00059b6005b3a062d150432c00059b6005c360719052bb8005119062bb800512b1507b9004d0200840401a7ff872ab400122bb8005d2b2ab40017b9004d02002ab400182bb8004c2b2ab40019b9004e0200bb005e59b7005f3a0419042ab4000ab6006019042ab4000bb6006119042ab4000eb6006219042ab4000fb6006319042bb60064b1
 
 org/apache/geode/distributed/internal/StartupResponseMessage,3
 fromDataProblem,43,2ab40026c7000e2abb003859b70039b500262ab400262bb6003a572ab40026123b123cb8003db6003a57b1
@@ -293,8 +269,8 @@ toDataPre_GFE_7_1_0_0,226,2ab400139e000704a7000403b800432ab600502bb800982b2ab600
 toDataPre_GFE_9_0_0_0,225,2ab600502bb800982b2ab6004fb9009902002ab400062bb8007d033d2ab40029b9007e01009900071c04803d2ab40029b9006d01009900071c05803d2ab4003a9900071c07803d1c1008803d2b1c1100ff7e91b9009a02002b2ab40011b9009902002b2ab40002b9009902002b2ab40013b9009a02002ab400202bb800802ab400182bb8007d2ab40013100da0000e2ab400192bb8007da7000e2ab40014b8009b2bb8007d2ab4001ec700081247a7000a2ab4001eb600812bb8007d2ab4001ec7000911012ca7000a2ab4001eb60082b800832bb800842b2ab4001b04b80085b1
 
 org/apache/geode/distributed/internal/membership/NetView,2
-fromData,98,2a2bb8006ec0002bb500112a2bb9006f0100b500062a2bb80070b50009b200409a00122ab40009c7000bbb004159b70042bf2abb000a592ab40009b7000bb5000c2a2bb80071b5000e2a2bb80071b500102a2bb80072b500052a2bb80073b50004b1
-toData,60,2ab400112bb800682b2ab40006b9006902002a2ab400092bb7006a2ab4000e2bb8006b2ab400102bb8006b2ab400052bb8006c2ab400042bb8006db1
+fromData,98,2a2bb80070c0002db500132a2bb900710100b500082a2bb80072b5000bb200429a00122ab4000bc7000bbb004359b70044bf2abb000c592ab4000bb7000db5000e2a2bb80073b500102a2bb80073b500122a2bb80074b500052a2bb80075b50004b1
+toData,60,2ab400132bb8006a2b2ab40008b9006b02002a2ab4000b2bb7006c2ab400102bb8006d2ab400122bb8006d2ab400052bb8006e2ab400042bb8006fb1
 
 org/apache/geode/distributed/internal/membership/gms/GMSMember,2
 fromData,62,2a2bb600472a2bb900480100b500052a2bb900490100b5003b2a2bb900490100b500072a2bb900480100b500062a2bb8004ab500082a2bb8004bb50009b1
@@ -413,6 +389,30 @@ org/apache/geode/internal/admin/ClientMembershipMessage,2
 fromData,32,2a2bb7000d2a2bb8000eb500022a2bb8000eb500032a2bb9000f0100b50004b1
 toData,32,2a2bb7000a2ab400022bb8000b2ab400032bb8000b2b2ab40004b9000c0200b1
 
+org/apache/geode/internal/admin/api/RegionSubRegionSnapshot,2
+fromData,62,2a2bb80023b500082a2bb900240100b5000b2a2bb80025b500052ab40005b9002601004d2cb9002701009900132cb900280100c000292ab6001ba7ffeab1
+toData,30,2ab400082bb800202b2ab4000bb9002102002ab40005c000032bb80022b1
+
+org/apache/geode/internal/admin/api/impl/FinishBackupRequest,2
+fromData,33,2a2bb700292a2bb8002ab500022a2bb8002ab500032a2bb8002bb6002cb50004b1
+toData,33,2a2bb7002d2ab400022bb8002e2ab400032bb8002e2ab40004b8002f2bb80030b1
+
+org/apache/geode/internal/admin/api/impl/FinishBackupResponse,2
+fromData,14,2a2bb700042a2bb80005b50003b1
+toData,14,2a2bb700062ab400032bb80007b1
+
+org/apache/geode/internal/admin/api/impl/PrepareBackupResponse,2
+fromData,14,2a2bb700042a2bb80005b50003b1
+toData,14,2a2bb700062ab400032bb80007b1
+
+org/apache/geode/internal/admin/api/impl/SystemMemberCacheEventProcessor$SystemMemberCacheMessage,2
+fromData,27,2a2bb7001a2a2bb8001bb5000c2a2bb9001c0100b8001db5000fb1
+toData,27,2a2bb7001e2ab4000c2bb8001f2b2ab4000fb40020b900210200b1
+
+org/apache/geode/internal/admin/api/jmx/impl/StatAlertNotification,2
+fromData,39,2a2bb8002ab600032a2bb8002bb600072a2bb8002cc0002dc0002db600052a2bb8002eb50008b1
+toData,33,2ab600162bb800262ab600202bb800272ab6000e2bb800282ab400082bb80029b1
+
 org/apache/geode/internal/admin/remote/AddHealthListenerRequest,2
 fromData,17,2a2bb700102a2bb80011c00012b50007b1
 toData,14,2a2bb7000e2ab400072bb8000fb1
@@ -2079,8 +2079,8 @@ fromData,31,2a2bb80019b6001ab500022a2bb8001bb500032a2bb8001cc0001db50004b1
 toData,28,2ab40002b800152bb800162ab400032bb800172ab400042bb80018b1
 
 org/apache/geode/management/internal/configuration/domain/XmlEntity,2
-fromData,52,2a2bb8006ab500072a2bb8006bc0006cb500042a2bb8006ab500032a2bb8006ab5001c2a2bb8006ab500062a2bb8006ab50005b1
-toData,49,2ab400072bb800682ab400042bb800692ab400032bb800682ab4001c2bb800682ab400062bb800682ab400052bb80068b1
+fromData,52,2a2bb80065b500072a2bb80066c00067b500042a2bb80065b500032a2bb80065b5001c2a2bb80065b500062a2bb80065b50005b1
+toData,49,2ab400072bb800632ab400042bb800642ab400032bb800632ab4001c2bb800632ab400062bb800632ab400052bb80063b1
 
 org/apache/geode/management/internal/configuration/messages/ConfigurationRequest,2
 fromData,73,2a2bb900130100b500052bb9001401003dbb000259b700034e1c9e001f03360415041ca200162d2bb900150100b90009020057840401a7ffea2a2db500042a2bb900140100b50007b1
@@ -2124,7 +2124,7 @@ toData,105,2ab400022bb800112b2ab40003b9001202002b2ab40004b9001202002ab400052bb80
 
 org/apache/geode/pdx/internal/PdxType,2
 fromData,109,2a2bb80018b5000c2ab7000e2bb9001901003d2a1c047e99000704a7000403b5000d2a1c057e99000704a7000403b5001b2a2bb9001c0100b5000f2a2bb9001c0100b500102bb8001d3d033e1d1ca2001ebb001459b7001e3a0419042bb6001f2a1904b60015840301a7ffe3b1
-toData,124,2ab4000c2bb8001d033d2ab4000d9900081c0480913d2bb8001e4e2db2001fb600209b000f2ab400189900081c0580913d2b1cb9002102002b2ab4000eb9002202002b2ab4000fb9002202002ab40005b600232bb80024033d1c2ab40005b60023a2001a2ab400051cb60025c000134e2d2bb60026840201a7ffe1b1
+toData,124,2ab4000c2bb80020033d2ab4000d9900081c0480913d2bb800214e2db20022b600239b000f2ab4001b9900081c0580913d2b1cb9002402002b2ab4000fb9002502002b2ab40010b9002502002ab40005b600262bb80027033d1c2ab40005b60026a2001a2ab400051cb60028c000144e2d2bb60029840201a7ffe1b1
 
 org/apache/geode/redis/internal/ByteArrayWrapper,2
 fromData,20,2a2bb80006b500022a2ab40002b80003b50004b1

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
index 03bb3ea..8625afa 100644
--- a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
+++ b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
@@ -25,32 +25,6 @@ org/apache/geode/ToDataException,true,-2329606027453879918
 org/apache/geode/UncreatedSystemException,true,5424354567878425435
 org/apache/geode/UnmodifiableException,true,-1043243260052395455
 org/apache/geode/UnstartedSystemException,true,-4285897556527521788
-org/apache/geode/admin/AdminException,true,879398950879472021
-org/apache/geode/admin/AdminXmlException,true,-6848726449157550169
-org/apache/geode/admin/AlertLevel,true,-4752438966587392126,ordinal:int
-org/apache/geode/admin/CacheDoesNotExistException,true,-1639933911265729978
-org/apache/geode/admin/GemFireHealth$Health,true,3039539430412151801,healthString:java/lang/String
-org/apache/geode/admin/GemFireMemberStatus,true,3389997790525991310,_bindAddress:java/lang/String,_clientHealthStats:java/util/Map,_clientHostNames:java/util/Map,_clientQueueSizes:java/util/Map,_connectedClients:java/util/Set,_connectedIncomingGateways:java/util/Map,_connectedPeers:java/util/Set,_connectedServers:java/util/Set,_freeHeapSize:long,_gatewayHubStatus:java/lang/Object,_gatewayQueueSizes:java/util/Map,_hostAddress:java/net/InetAddress,_isClient:boolean,_isConnected:boolean,_isGatewayHub:boolean,_isLocator:boolean,_isPrimaryGatewayHub:boolean,_isServer:boolean,_locators:java/lang/String,_maximumHeapSize:long,_mcastAddress:java/net/InetAddress,_mcastPort:int,_memberId:java/io/Serializable,_memberName:java/lang/String,_outgoingGateways:java/util/Map,_regionStatuses:java/util/Map,_serverPort:int,_unconnectedServers:java/util/Set,upTime:long
-org/apache/geode/admin/OperationCancelledException,true,5474068770227602546
-org/apache/geode/admin/RegionNotFoundException,true,1758668137691463909
-org/apache/geode/admin/RuntimeAdminException,true,-7512771113818634005
-org/apache/geode/admin/SystemMemberType,true,3284366994485749302,ordinal:int
-org/apache/geode/admin/UnmodifiableConfigurationException,true,-7653547392992060646
-org/apache/geode/admin/internal/BackupStatusImpl,true,3704162840296921840,backedUpDiskStores:java/util/Map,offlineDiskStores:java/util/Set
-org/apache/geode/admin/internal/CacheHealthConfigImpl,false,maxEventQueueSize:long,maxLoadTime:long,maxNetSearchTime:long,minHitRatio:double
-org/apache/geode/admin/internal/GemFireHealthConfigImpl,true,-6797673296902808018,hostName:java/lang/String,interval:int
-org/apache/geode/admin/internal/MemberHealthConfigImpl,true,3966032573073580490,maxMessageQueueSize:long,maxReplyTimeouts:long,maxRetransmissionRatio:double,maxVMProcessSize:long
-org/apache/geode/admin/internal/StatisticImpl,true,3899296873901634399,internalStat:org/apache/geode/internal/admin/Stat
-org/apache/geode/admin/jmx/internal/AgentImpl$StartupException,true,6614145962199330348
-org/apache/geode/admin/jmx/internal/AgentLauncher$Status,true,-7758402454664266174,baseName:java/lang/String,exception:java/lang/Throwable,msg:java/lang/String,pid:int,state:int
-org/apache/geode/admin/jmx/internal/ConfigAttributeInfo,true,-1918437700841687078,config:org/apache/geode/admin/jmx/internal/ConfigurationParameterJmxImpl
-org/apache/geode/admin/jmx/internal/ConfigurationParameterJmxImpl,true,-7822171853906772375,deserialized:boolean
-org/apache/geode/admin/jmx/internal/ConnectionNotificationFilterImpl,true,1
-org/apache/geode/admin/jmx/internal/DynamicManagedBean,true,4051924500150228160
-org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl,true,1482719647163239953,delegate:org/apache/geode/admin/GemFireHealthConfig,health:org/apache/geode/admin/GemFireHealth,mbeanName:java/lang/String,modelMBean:javax/management/modelmbean/ModelMBean,objectName:javax/management/ObjectName
-org/apache/geode/admin/jmx/internal/ManagedResourceType,true,3752874768667480449,ordinal:int
-org/apache/geode/admin/jmx/internal/RefreshNotificationType,true,4376763592395613794,ordinal:int
-org/apache/geode/admin/jmx/internal/StatisticAttributeInfo,true,28022387514935560,stat:org/apache/geode/admin/Statistic
 org/apache/geode/cache/AttributesFactory$RegionAttributesImpl,true,-3663000883567530374,asyncEventQueueIds:java/util/Set,cacheListeners:java/util/ArrayList,cacheLoader:org/apache/geode/cache/CacheLoader,cacheWriter:org/apache/geode/cache/CacheWriter,compressor:org/apache/geode/compression/Compressor,concurrencyChecksEnabled:boolean,concurrencyLevel:int,customEntryIdleTimeout:org/apache/geode/cache/CustomExpiry,customEntryTimeToLive:org/apache/geode/cache/CustomExpiry,dataPolicy:org/apache/geode/cache/DataPolicy,diskDirs:java/io/File[],diskSizes:int[],diskStoreName:java/lang/String,diskSynchronous:boolean,diskWriteAttributes:org/apache/geode/cache/DiskWriteAttributes,earlyAck:boolean,enableAsyncConflation:boolean,enableSubscriptionConflation:boolean,entryIdleTimeout:int,entryIdleTimeoutExpirationAction:org/apache/geode/cache/ExpirationAction,entryTimeToLive:int,entryTimeToLiveExpirationAction:org/apache/geode/cache/ExpirationAction,evictionAttributes:org/apache/geode/internal/cache/E
 victionAttributesImpl,gatewaySenderIds:java/util/Set,ignoreJTA:boolean,indexMaintenanceSynchronous:boolean,initialCapacity:int,isBucketRegion:boolean,isCloningEnabled:boolean,isLockGrantor:boolean,keyConstraint:java/lang/Class,loadFactor:float,membershipAttributes:org/apache/geode/cache/MembershipAttributes,multicastEnabled:boolean,offHeap:boolean,partitionAttributes:org/apache/geode/cache/PartitionAttributes,poolName:java/lang/String,publisher:boolean,regionIdleTimeout:int,regionIdleTimeoutExpirationAction:org/apache/geode/cache/ExpirationAction,regionTimeToLive:int,regionTimeToLiveExpirationAction:org/apache/geode/cache/ExpirationAction,scope:org/apache/geode/cache/Scope,statisticsEnabled:boolean,subscriptionAttributes:org/apache/geode/cache/SubscriptionAttributes,valueConstraint:java/lang/Class
 org/apache/geode/cache/CacheClosedException,true,-6479561694497811262
 org/apache/geode/cache/CacheException,true,7699432887938858940
@@ -136,7 +110,6 @@ org/apache/geode/cache/persistence/PersistentReplicatesOfflineException,true,620
 org/apache/geode/cache/persistence/RevokeFailedException,true,-2629287782021455875
 org/apache/geode/cache/persistence/RevokedPersistentDataException,true,0
 org/apache/geode/cache/query/AmbiguousNameException,true,5635771575414148564
-org/apache/geode/cache/query/CqAttributesFactory$CqAttributesImpl,true,-959395592883099100,clSync:java/lang/Object,cqListeners:java/util/ArrayList,dataPolicyHasBeenSet:boolean
 org/apache/geode/cache/query/CqClosedException,true,-3793993436374495840
 org/apache/geode/cache/query/CqException,true,-5905461592471139171
 org/apache/geode/cache/query/CqExistsException,true,-4805225282677926623
@@ -246,13 +219,38 @@ org/apache/geode/internal/CopyOnWriteHashSet,true,8591978652141659932
 org/apache/geode/internal/DSFIDNotFoundException,true,130596009484324655,dsfid:int,versionOrdinal:short
 org/apache/geode/internal/InternalDataSerializer$SERIALIZATION_VERSION,false
 org/apache/geode/internal/InternalStatisticsDisabledException,true,4146181546364258311
-org/apache/geode/internal/LinuxProcFsStatistics$CPU,false
 org/apache/geode/internal/ObjIdConcurrentMap,true,7249069246763182397,segmentMask:int,segmentShift:int,segments:org/apache/geode/internal/ObjIdConcurrentMap$Segment[]
 org/apache/geode/internal/ObjIdConcurrentMap$Segment,true,2249069246763182397,loadFactor:float
 org/apache/geode/internal/SystemAdmin$CombinedResources,false
 org/apache/geode/internal/admin/CompoundEntrySnapshot,true,5776382582897895718,allUserAttributes:java/util/Set,allValues:java/util/Set,hitRatio:float,hitRatioSum:double,hitResponders:long,lastAccessTime:long,lastModifiedTime:long,name:java/lang/Object,numHits:long,numMisses:long
 org/apache/geode/internal/admin/CompoundRegionSnapshot,true,6295026394298398004,allCacheLoaders:java/util/Set,allCacheWriters:java/util/Set,allCapControllers:java/util/Set,allConcLevels:java/util/Set,allCustomIdle:java/util/HashSet,allCustomTtl:java/util/HashSet,allDataPolicies:java/util/Set,allEntryIdleTimeout:java/util/Set,allEntryTtl:java/util/Set,allInitialCaps:java/util/Set,allKeyConstraints:java/util/Set,allListeners:java/util/Set,allLoadFactors:java/util/Set,allRegionIdleTimeout:java/util/Set,allRegionTtl:java/util/Set,allScopes:java/util/Set,allStatsEnabled:java/util/Set,allUserAttributes:java/util/Set,allValueConstraints:java/util/Set,hitRatio:float,hitRatioSum:double,hitResponders:long,lastAccessTime:long,lastModifiedTime:long,name:java/lang/String,numHits:long,numMisses:long
 org/apache/geode/internal/admin/StatAlert,true,5725457607122449170,definitionId:int,time:java/util/Date,values:java/lang/Number[]
+org/apache/geode/internal/admin/api/AdminException,true,879398950879472021
+org/apache/geode/internal/admin/api/AdminXmlException,true,-6848726449157550169
+org/apache/geode/internal/admin/api/AlertLevel,true,-4752438966587392126,ordinal:int
+org/apache/geode/internal/admin/api/CacheDoesNotExistException,true,-1639933911265729978
+org/apache/geode/internal/admin/api/GemFireHealth$Health,true,3039539430412151801,healthString:java/lang/String
+org/apache/geode/internal/admin/api/GemFireMemberStatus,true,3389997790525991310,_bindAddress:java/lang/String,_clientHealthStats:java/util/Map,_clientHostNames:java/util/Map,_clientQueueSizes:java/util/Map,_connectedClients:java/util/Set,_connectedIncomingGateways:java/util/Map,_connectedPeers:java/util/Set,_connectedServers:java/util/Set,_freeHeapSize:long,_gatewayHubStatus:java/lang/Object,_gatewayQueueSizes:java/util/Map,_hostAddress:java/net/InetAddress,_isClient:boolean,_isConnected:boolean,_isGatewayHub:boolean,_isLocator:boolean,_isPrimaryGatewayHub:boolean,_isServer:boolean,_locators:java/lang/String,_maximumHeapSize:long,_mcastAddress:java/net/InetAddress,_mcastPort:int,_memberId:java/io/Serializable,_memberName:java/lang/String,_outgoingGateways:java/util/Map,_regionStatuses:java/util/Map,_serverPort:int,_unconnectedServers:java/util/Set,upTime:long
+org/apache/geode/internal/admin/api/OperationCancelledException,true,5474068770227602546
+org/apache/geode/internal/admin/api/RegionNotFoundException,true,1758668137691463909
+org/apache/geode/internal/admin/api/RuntimeAdminException,true,-7512771113818634005
+org/apache/geode/internal/admin/api/SystemMemberType,true,3284366994485749302,ordinal:int
+org/apache/geode/internal/admin/api/UnmodifiableConfigurationException,true,-7653547392992060646
+org/apache/geode/internal/admin/api/impl/BackupStatusImpl,true,3704162840296921840,backedUpDiskStores:java/util/Map,offlineDiskStores:java/util/Set
+org/apache/geode/internal/admin/api/impl/CacheHealthConfigImpl,false,maxEventQueueSize:long,maxLoadTime:long,maxNetSearchTime:long,minHitRatio:double
+org/apache/geode/internal/admin/api/impl/GemFireHealthConfigImpl,true,-6797673296902808018,hostName:java/lang/String,interval:int
+org/apache/geode/internal/admin/api/impl/MemberHealthConfigImpl,true,3966032573073580490,maxMessageQueueSize:long,maxReplyTimeouts:long,maxRetransmissionRatio:double,maxVMProcessSize:long
+org/apache/geode/internal/admin/api/impl/StatisticImpl,true,3899296873901634399,internalStat:org/apache/geode/internal/admin/Stat
+org/apache/geode/internal/admin/api/jmx/impl/AgentImpl$StartupException,true,6614145962199330348
+org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher$Status,true,-7758402454664266174,baseName:java/lang/String,exception:java/lang/Throwable,msg:java/lang/String,pid:int,state:int
+org/apache/geode/internal/admin/api/jmx/impl/ConfigAttributeInfo,true,-1918437700841687078,config:org/apache/geode/internal/admin/api/jmx/impl/ConfigurationParameterJmxImpl
+org/apache/geode/internal/admin/api/jmx/impl/ConfigurationParameterJmxImpl,true,-7822171853906772375,deserialized:boolean
+org/apache/geode/internal/admin/api/jmx/impl/ConnectionNotificationFilterImpl,true,1
+org/apache/geode/internal/admin/api/jmx/impl/DynamicManagedBean,true,4051924500150228160
+org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl,true,1482719647163239953,delegate:org/apache/geode/internal/admin/api/GemFireHealthConfig,health:org/apache/geode/internal/admin/api/GemFireHealth,mbeanName:java/lang/String,modelMBean:javax/management/modelmbean/ModelMBean,objectName:javax/management/ObjectName
+org/apache/geode/internal/admin/api/jmx/impl/ManagedResourceType,true,3752874768667480449,ordinal:int
+org/apache/geode/internal/admin/api/jmx/impl/RefreshNotificationType,true,4376763592395613794,ordinal:int
+org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo,true,28022387514935560,stat:org/apache/geode/internal/admin/api/Statistic
 org/apache/geode/internal/admin/remote/DistributionLocatorId,true,6587390186971937865,bindAddress:java/lang/String,host:java/net/InetAddress,hostnameForClients:java/lang/String,peerLocator:boolean,port:int,serverLocator:boolean
 org/apache/geode/internal/admin/remote/EntryValueNodeImpl,false,fields:org/apache/geode/internal/admin/remote/EntryValueNodeImpl[],name:java/lang/String,primitive:boolean,primitiveVal:java/lang/Object,type:java/lang/String
 org/apache/geode/internal/cache/BackupLock,false,backupDone:java/util/concurrent/locks/Condition,backupThread:java/lang/Thread,isBackingUp:boolean
@@ -441,7 +439,6 @@ org/apache/geode/internal/memcached/ResponseStatus$4,false
 org/apache/geode/internal/memcached/ResponseStatus$5,false
 org/apache/geode/internal/memcached/ResponseStatus$6,false
 org/apache/geode/internal/memcached/commands/ClientError,true,-2426928000696680541
-org/apache/geode/internal/net/SSLEnabledComponent,false,constant:java/lang/String
 org/apache/geode/internal/offheap/MemoryBlock$State,false
 org/apache/geode/internal/offheap/OffHeapStorage$1,false
 org/apache/geode/internal/offheap/OffHeapStorage$2,false
@@ -659,10 +656,6 @@ org/apache/geode/pdx/internal/PdxInstanceImpl,true,-1669268527103938431
 org/apache/geode/pdx/internal/PdxInstanceInputStream,false
 org/apache/geode/pdx/internal/PdxReaderImpl,true,-6094553093860427759,blobType:org/apache/geode/pdx/internal/PdxType,dis:org/apache/geode/pdx/internal/PdxInputStream
 org/apache/geode/pdx/internal/WritablePdxInstanceImpl,true,7398999150097596214,dirtyFields:java/lang/Object[]
-org/apache/geode/security/AuthenticationFailedException,true,-8202866472279088879
-org/apache/geode/security/AuthenticationRequiredException,true,4675976651103154919
-org/apache/geode/security/GemFireSecurityException,true,3814254578203076926,cause:java/lang/Throwable
-org/apache/geode/security/NotAuthorizedException,true,419215768216387745,principal:java/security/Principal
 org/apache/geode/redis/internal/RedisCommandParserException,true,4707944288714910949
 org/apache/geode/redis/internal/RedisCommandType,false
 org/apache/geode/redis/internal/RedisCommandType$1,false,dataType:org/apache/geode/redis/internal/RedisDataType,executor:org/apache/geode/redis/internal/Executor
@@ -844,3 +837,7 @@ org/apache/geode/redis/internal/executor/SortedSetQuery$7,false
 org/apache/geode/redis/internal/executor/SortedSetQuery$8,false
 org/apache/geode/redis/internal/executor/SortedSetQuery$9,false
 org/apache/geode/redis/internal/executor/list/ListExecutor$ListDirection,false
+org/apache/geode/security/AuthenticationFailedException,true,-8202866472279088879
+org/apache/geode/security/AuthenticationRequiredException,true,4675976651103154919
+org/apache/geode/security/GemFireSecurityException,true,3814254578203076926,cause:java/lang/Throwable
+org/apache/geode/security/NotAuthorizedException,true,419215768216387745,principal:java/security/Principal

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java
index ba14a91..7664e65 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java
@@ -21,10 +21,10 @@ import java.util.Set;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.admin.AdminDistributedSystemFactory;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.DistributedSystemConfig;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.AdminDistributedSystemFactory;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
 import org.apache.geode.cache.Region;
 import org.apache.geode.internal.cache.CacheObserverAdapter;
 import org.apache.geode.internal.cache.CacheObserverHolder;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/gradle/rat.gradle
----------------------------------------------------------------------
diff --git a/gradle/rat.gradle b/gradle/rat.gradle
index e9fc70f..a1975c5 100644
--- a/gradle/rat.gradle
+++ b/gradle/rat.gradle
@@ -210,7 +210,7 @@ rat {
     'geode-pulse/src/main/webapp/scripts/multiselect/prettify.js',
 
     // MX4J License
-    'geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java'
+    'geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java'
   ]
 }
 


[16/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo.java
new file mode 100755
index 0000000..ec675f1
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticAttributeInfo.java
@@ -0,0 +1,71 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.geode.internal.admin.api.Statistic;
+import org.apache.geode.internal.Assert;
+
+import javax.management.Descriptor;
+import javax.management.modelmbean.DescriptorSupport;
+import javax.management.modelmbean.ModelMBeanAttributeInfo;
+
+/**
+ * Subclass of AttributeInfo with {@link Statistic} added for use as the
+ * {@link javax.management.modelmbean.ModelMBeanAttributeInfo} descriptor's <i>targetObject</i>
+ * value.
+ *
+ * @since GemFire 3.5
+ *
+ */
+class StatisticAttributeInfo extends org.apache.commons.modeler.AttributeInfo {
+  private static final long serialVersionUID = 28022387514935560L;
+
+  private Statistic stat;
+
+  public StatisticAttributeInfo() {
+    super();
+  }
+
+  public Statistic getStat() {
+    return this.stat;
+  }
+
+  public void setStat(Statistic stat) {
+    // System.out.println(">> stat = " + stat);
+    Assert.assertTrue(stat != null, "Attempting to set stat to null");
+    this.stat = stat;
+  }
+
+  @Override
+  public ModelMBeanAttributeInfo createAttributeInfo() {
+    Descriptor desc = new DescriptorSupport(new String[] {"name=" + this.displayName,
+        "descriptorType=attribute", "currencyTimeLimit=-1", // always stale
+        "displayName=" + this.displayName, "getMethod=getValue"});
+
+    Assert.assertTrue(this.stat != null, "Stat target object is null!");
+    desc.setField("targetObject", this.stat);
+
+    ModelMBeanAttributeInfo info = new ModelMBeanAttributeInfo(this.displayName, // name
+        this.type, // type
+        this.description, // description
+        this.readable, // isReadable
+        this.writeable, // isWritable
+        this.is, // isIs
+        desc);
+
+    return info;
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java
new file mode 100755
index 0000000..f7b776b
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatisticResourceJmxImpl.java
@@ -0,0 +1,342 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import javax.management.Notification;
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+import javax.naming.OperationNotSupportedException;
+
+import org.apache.commons.modeler.ManagedBean;
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.OperationCancelledException;
+import org.apache.geode.internal.admin.api.Statistic;
+import org.apache.geode.internal.admin.StatResource;
+import org.apache.geode.internal.admin.api.impl.StatisticResourceImpl;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+
+/**
+ * Provides MBean support for the monitoring of a statistic resource.
+ *
+ * @since GemFire 3.5
+ *
+ */
+public class StatisticResourceJmxImpl extends StatisticResourceImpl
+    implements javax.management.NotificationListener, ManagedResource {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /**
+   * Interval in seconds between refreshes. Values less than one results in no refreshing .
+   */
+  private int refreshInterval = 0;
+
+  /** The JMX object name of this managed resource */
+  private ObjectName objectName;
+
+  /** A flag to indicate if time is inited. MBeanUtil lookup is costly */
+  private boolean timerInited = false;
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructor for the StatisticResource object
+   *
+   * @param statResource the admin StatResource to manage/monitor
+   * @param member the SystemMember owning this resource
+   * @exception AdminException if unable to create this StatisticResource for administration
+   */
+  public StatisticResourceJmxImpl(StatResource statResource, SystemMemberJmx member)
+      throws AdminException {
+    super(statResource, member);
+    initializeMBean();
+  }
+
+  /** Create and register the MBean to manage this resource */
+  private void initializeMBean() throws AdminException {
+    this.mbeanName = new StringBuffer("GemFire.Statistic:").append("source=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(this.member.getId())).append(",type=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(getType())).append(",name=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(getName())).append(",uid=")
+        .append(getUniqueId()).toString();
+
+    this.objectName =
+        MBeanUtil.createMBean(this, addDynamicAttributes(MBeanUtil.lookupManagedBean(this)));
+
+    // Refresh Interval
+    AdminDistributedSystemJmxImpl sysJmx =
+        (AdminDistributedSystemJmxImpl) this.member.getDistributedSystem();
+    if (sysJmx.getRefreshInterval() > 0)
+      this.refreshInterval = sysJmx.getRefreshInterval();
+  }
+
+  // -------------------------------------------------------------------------
+  // MBean attributes - accessors/mutators
+  // -------------------------------------------------------------------------
+
+  /**
+   * Gets the interval in seconds between statistics refreshes
+   *
+   * @return the current refresh interval in seconds
+   */
+  public int getRefreshInterval() {
+    return this.refreshInterval;
+  }
+
+  /**
+   * Sets interval in seconds between statistic refreshes; zero or less turns off auto refreshing.
+   * Manual refreshing has no effect on when the next scheduled refresh will occur.
+   *
+   * @param refreshInterval the new refresh interval in seconds
+   */
+  private void _setRefreshInterval(int refreshInterval) {
+    boolean isRegistered = MBeanUtil.isRefreshNotificationRegistered(this,
+        RefreshNotificationType.STATISTIC_RESOURCE_STATISTICS);
+
+    if (isRegistered && (getRefreshInterval() == refreshInterval))
+      return;
+
+    try {
+      MBeanUtil.registerRefreshNotification(this, // NotificationListener
+          getMBeanName(), // User Data as MBean Name
+          RefreshNotificationType.STATISTIC_RESOURCE_STATISTICS, refreshInterval); // int
+
+      this.refreshInterval = refreshInterval;
+      timerInited = true;
+    } catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e); // dead in water, print, and then ignore
+      this.refreshInterval = 0; // zero out to avoid more exceptions
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e); // dead in water, print, and then ignore
+      this.refreshInterval = 0; // zero out to avoid more exceptions
+    }
+  }
+
+  /**
+   * RefreshInterval is now set only through the AdminDistributedSystem property refreshInterval.
+   * Attempt to set refreshInterval on StatisticResourceJmx MBean would result in an
+   * OperationNotSupportedException Auto-refresh is enabled on demand when a call to getStatistics
+   * is made
+   * 
+   * @param refreshInterval the new refresh interval in seconds
+   * @deprecated since 6.0 use DistributedSystemConfig.refreshInterval instead
+   */
+  @Deprecated
+  public void setRefreshInterval(int refreshInterval) throws OperationNotSupportedException {
+    throw new OperationNotSupportedException(
+        LocalizedStrings.MANAGED_RESOURCE_REFRESH_INTERVAL_CANT_BE_SET_DIRECTLY
+            .toLocalizedString());
+  }
+
+  // -------------------------------------------------------------------------
+  // JMX Notification listener
+  // -------------------------------------------------------------------------
+
+  /**
+   * Handles notification to refresh. Reacts by refreshing the values of this SystemMember's
+   * ConfigurationParamaters. Any other notification is ignored. Given notification is handled only
+   * if there is any JMX client connected to the system.
+   * <p>
+   * TODO: investigate use of NotificationFilter instead of explicit check...
+   * 
+   * @param notification the JMX notification being received
+   * @param hb handback object is unused
+   */
+  public void handleNotification(Notification notification, Object hb) {
+    AdminDistributedSystemJmxImpl adminDSJmx =
+        (AdminDistributedSystemJmxImpl) this.member.getDistributedSystem();
+
+    String typeStatResourceStats = RefreshNotificationType.STATISTIC_RESOURCE_STATISTICS.getType();
+
+    if (typeStatResourceStats.equals(notification.getType())
+        && getMBeanName().equals(notification.getUserData())
+        && !adminDSJmx.isRmiClientCountZero()) {
+      try {
+        refresh();
+
+      } catch (AdminException e) {
+        logger.warn(e.getMessage(), e);
+      } catch (OperationCancelledException e) {
+        // underlying resource is no longer reachable by remote admin
+        logger.warn(e.getMessage(), e);
+        _setRefreshInterval(0);
+      } catch (CancelException e) {
+        // shutting down - okay to ignore
+      } catch (java.lang.RuntimeException e) {
+        logger.debug(e.getMessage(), e); // dead in water, print, and then ignore
+        _setRefreshInterval(0); // zero out to avoid more exceptions
+      } catch (VirtualMachineError err) {
+        SystemFailure.initiateFailure(err);
+        // If this ever returns, rethrow the error. We're poisoned
+        // now, so don't let this thread continue.
+        throw err;
+      } catch (java.lang.Error e) {
+        // Whenever you catch Error or Throwable, you must also
+        // catch VirtualMachineError (see above). However, there is
+        // _still_ a possibility that you are dealing with a cascading
+        // error condition, so you also need to check to see if the JVM
+        // is still usable:
+        SystemFailure.checkFailure();
+        logger.error(e.getMessage(), e); // dead in water, print, and then ignore
+        this.refreshInterval = 0; // zero out to avoid more exceptions
+      }
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // Create MBean attributes for each Statistic
+  // -------------------------------------------------------------------------
+
+  /**
+   * Add MBean attribute definitions for each Statistic.
+   *
+   * @param managed the mbean definition to add attributes to
+   * @return a new instance of ManagedBean copied from <code>managed</code> but with the new
+   *         attributes added
+   */
+  ManagedBean addDynamicAttributes(ManagedBean managed) throws AdminException {
+    if (managed == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.StatisticResourceJmxImpl_MANAGEDBEAN_IS_NULL.toLocalizedString());
+    }
+
+    refresh(); // to get the stats...
+
+    // need to create a new instance of ManagedBean to clean the "slate"...
+    ManagedBean newManagedBean = new DynamicManagedBean(managed);
+    for (int i = 0; i < this.statistics.length; i++) {
+      StatisticAttributeInfo attrInfo = new StatisticAttributeInfo();
+
+      attrInfo.setName(this.statistics[i].getName());
+      attrInfo.setDisplayName(this.statistics[i].getName());
+      attrInfo.setDescription(this.statistics[i].getDescription());
+      attrInfo.setType("java.lang.Number");
+
+      attrInfo.setIs(false);
+      attrInfo.setReadable(true);
+      attrInfo.setWriteable(false);
+
+      attrInfo.setStat(this.statistics[i]);
+
+      newManagedBean.addAttribute(attrInfo);
+    }
+    return newManagedBean;
+  }
+
+  public Statistic[] getStatistics() {
+    if (!timerInited) {
+      // 1st call to getStatistics would trigger
+      // the auto-refresh if an interval is set
+      if (this.refreshInterval > 0) {
+        this._setRefreshInterval(this.refreshInterval);
+      }
+    }
+
+    if (this.statistics == null) {
+      try {
+        this.refresh();
+      } catch (AdminException e) {
+        this.statistics = new Statistic[0];
+      }
+    }
+
+    return this.statistics;
+  }
+
+  // -------------------------------------------------------------------------
+  // ManagedResource implementation
+  // -------------------------------------------------------------------------
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.STATISTIC_RESOURCE;
+  }
+
+  public void cleanupResource() {
+    this.modelMBean = null;
+    this.member = null;
+    this.statistics = null;
+    this.statResource = null;
+  }
+
+  /**
+   * Checks equality of the given object with <code>this</code> based on the type (Class) and the
+   * MBean Name returned by <code>getMBeanName()</code> methods.
+   * 
+   * @param obj object to check equality with
+   * @return true if the given object is if the same type and its MBean Name is same as
+   *         <code>this</code> object's MBean Name, false otherwise
+   */
+  @Override
+  public boolean equals(Object obj) {
+    if (!(obj instanceof StatisticResourceJmxImpl)) {
+      return false;
+    }
+
+    StatisticResourceJmxImpl other = (StatisticResourceJmxImpl) obj;
+
+    return this.getMBeanName().equals(other.getMBeanName());
+  }
+
+  /**
+   * Returns hash code for <code>this</code> object which is based on the MBean Name generated.
+   * 
+   * @return hash code for <code>this</code> object
+   */
+  @Override
+  public int hashCode() {
+    return this.getMBeanName().hashCode();
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberBridgeServerJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberBridgeServerJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberBridgeServerJmxImpl.java
new file mode 100644
index 0000000..b40cc65
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberBridgeServerJmxImpl.java
@@ -0,0 +1,124 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.SystemMemberBridgeServer;
+import org.apache.geode.internal.admin.api.impl.SystemMemberBridgeServerImpl;
+import org.apache.geode.internal.admin.api.impl.SystemMemberCacheImpl;
+import org.apache.geode.internal.admin.AdminBridgeServer;
+import org.apache.geode.internal.admin.GemFireVM;
+
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+
+/**
+ * MBean representation of a {@link SystemMemberBridgeServer}.
+ *
+ * @since GemFire 4.0
+ */
+public class SystemMemberBridgeServerJmxImpl extends SystemMemberBridgeServerImpl
+    implements ManagedResource {
+
+  /** The object name of this managed resource */
+  private ObjectName objectName;
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  ////////////////////// Constructors //////////////////////
+
+  /**
+   * Creates a new <code>SystemMemberBridgeServerJmxImpl</code> that serves the contents of the
+   * given cache.
+   */
+  SystemMemberBridgeServerJmxImpl(SystemMemberCacheImpl cache, AdminBridgeServer bridgeInfo)
+      throws AdminException {
+
+    super(cache, bridgeInfo);
+    initializeMBean(cache);
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Creates and registers the MBean to manage this resource
+   */
+  private void initializeMBean(SystemMemberCacheImpl cache) throws AdminException {
+
+    GemFireVM vm = cache.getVM();
+    this.mbeanName = new StringBuffer("GemFire.Cache:").append("name=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(cache.getName())).append(",id=")
+        .append(this.getBridgeId()).append(",owner=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(vm.getId().toString()))
+        .append(",type=CacheServer").toString();
+
+    this.objectName = MBeanUtil.createMBean(this);
+  }
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.SYSTEM_MEMBER_CACHE_SERVER;
+  }
+
+  public void cleanupResource() {}
+
+  /**
+   * Checks equality of the given object with <code>this</code> based on the type (Class) and the
+   * MBean Name returned by <code>getMBeanName()</code> methods.
+   * 
+   * @param obj object to check equality with
+   * @return true if the given object is if the same type and its MBean Name is same as
+   *         <code>this</code> object's MBean Name, false otherwise
+   */
+  @Override
+  public boolean equals(Object obj) {
+    if (!(obj instanceof SystemMemberBridgeServerJmxImpl)) {
+      return false;
+    }
+
+    SystemMemberBridgeServerJmxImpl other = (SystemMemberBridgeServerJmxImpl) obj;
+
+    return this.getMBeanName().equals(other.getMBeanName());
+  }
+
+  /**
+   * Returns hash code for <code>this</code> object which is based on the MBean Name generated.
+   * 
+   * @return hash code for <code>this</code> object
+   */
+  @Override
+  public int hashCode() {
+    return this.getMBeanName().hashCode();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberCacheJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberCacheJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberCacheJmxImpl.java
new file mode 100644
index 0000000..2e21b87
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberCacheJmxImpl.java
@@ -0,0 +1,443 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+
+import org.apache.commons.modeler.ManagedBean;
+import org.apache.logging.log4j.Level;
+
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.SystemMemberCache;
+import org.apache.geode.internal.admin.api.SystemMemberCacheServer;
+import org.apache.geode.internal.admin.api.SystemMemberRegion;
+import org.apache.geode.internal.admin.api.impl.SystemMemberBridgeServerImpl;
+import org.apache.geode.cache.Region;
+import org.apache.geode.internal.admin.AdminBridgeServer;
+import org.apache.geode.internal.admin.GemFireVM;
+import org.apache.geode.internal.admin.api.impl.SystemMemberCacheImpl;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+/**
+ * MBean representation of {@link SystemMemberCache}.
+ *
+ * @since GemFire 3.5
+ */
+public class SystemMemberCacheJmxImpl extends SystemMemberCacheImpl implements ManagedResource {
+
+  /** The object name of this managed resource */
+  private ObjectName objectName;
+
+  /** collection to collect all the resources created for this member */
+  private Map<String, SystemMemberRegionJmxImpl> managedRegionResourcesMap =
+      new HashMap<String, SystemMemberRegionJmxImpl>();
+  private Map<Number, SystemMemberBridgeServerJmxImpl> managedCacheServerResourcesMap =
+      new HashMap<Number, SystemMemberBridgeServerJmxImpl>();
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs an instance of SystemMemberCacheJmxImpl.
+   *
+   * @param vm The vm owning the cache this object will manage
+   */
+  public SystemMemberCacheJmxImpl(GemFireVM vm) throws AdminException {
+    super(vm);
+    initializeMBean();
+  }
+
+  /** Create and register the MBean to manage this resource */
+  private void initializeMBean() throws AdminException {
+    this.mbeanName = new StringBuffer("GemFire.Cache:").append("name=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(getName())).append(",id=").append(getId())
+        .append(",owner=").append(MBeanUtil.makeCompliantMBeanNameProperty(vm.getId().toString()))
+        .append(",type=Cache").toString();
+
+    this.objectName =
+        MBeanUtil.createMBean(this, addDynamicAttributes(MBeanUtil.lookupManagedBean(this)));
+  }
+
+  // -------------------------------------------------------------------------
+  // Template methods overriden from superclass...
+  // -------------------------------------------------------------------------
+
+  /**
+   * Override createSystemMemberRegion by instantiating SystemMemberRegionJmxImpl. This instance is
+   * also added to the managedResources collection.
+   * 
+   * @param r reference to Region instance for which this JMX resource is to be created
+   * @return SystemMemberRegionJmxImpl - JMX Implementation of SystemMemberRegion
+   * @throws AdminException if constructing SystemMemberRegionJmxImpl instance fails
+   */
+  @Override
+  protected SystemMemberRegion createSystemMemberRegion(Region r) throws AdminException {
+    SystemMemberRegionJmxImpl managedSystemMemberRegion = null;
+    boolean needsRefresh = false;
+    synchronized (this.managedRegionResourcesMap) {
+      /*
+       * Ensuring that a single instance of System Member Region is created per Region.
+       */
+      SystemMemberRegionJmxImpl managedResource = managedRegionResourcesMap.get(r.getFullPath());
+      if (managedResource != null) {
+        managedSystemMemberRegion = managedResource;
+      } else {
+        managedSystemMemberRegion = new SystemMemberRegionJmxImpl(this, r);
+        managedRegionResourcesMap.put(r.getFullPath(), managedSystemMemberRegion);
+        needsRefresh = true;
+      }
+    }
+    if (needsRefresh) {
+      managedSystemMemberRegion.refresh();
+    }
+    return managedSystemMemberRegion;
+  }
+
+  /**
+   * Creates a SystemMemberBridgeServerJmxImpl instance. This instance is also added to the
+   * managedResources collection.
+   * 
+   * @param bridge reference to AdminBridgeServer for which this JMX resource is to be created
+   * @return SystemMemberBridgeServerJmxImpl - JMX Implementation of SystemMemberBridgeServerImpl
+   * @throws AdminException if constructing SystemMemberBridgeServerJmxImpl instance fails
+   */
+  @Override
+  protected SystemMemberBridgeServerImpl createSystemMemberBridgeServer(AdminBridgeServer bridge)
+      throws AdminException {
+    SystemMemberBridgeServerJmxImpl managedSystemMemberBridgeServer = null;
+    synchronized (this.managedCacheServerResourcesMap) {
+      /*
+       * Ensuring that a single instance of SystemMember BridgeServer is created per
+       * AdminBridgeServer.
+       */
+      SystemMemberBridgeServerJmxImpl managedCacheServerResource =
+          managedCacheServerResourcesMap.get(bridge.getId());
+      if (managedCacheServerResource != null) {
+        managedSystemMemberBridgeServer = managedCacheServerResource;
+      } else {
+        managedSystemMemberBridgeServer = new SystemMemberBridgeServerJmxImpl(this, bridge);
+        managedCacheServerResourcesMap.put(bridge.getId(), managedSystemMemberBridgeServer);
+      }
+    }
+    return managedSystemMemberBridgeServer;
+  }
+
+  // -------------------------------------------------------------------------
+  // Create MBean attributes for each Statistic
+  // -------------------------------------------------------------------------
+
+  /**
+   * Add MBean attribute definitions for each Statistic.
+   *
+   * @param managed the mbean definition to add attributes to
+   * @return a new instance of ManagedBean copied from <code>managed</code> but with the new
+   *         attributes added
+   */
+  ManagedBean addDynamicAttributes(ManagedBean managed) throws AdminException {
+    if (managed == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.SystemMemberCacheJmxImpl_MANAGEDBEAN_IS_NULL.toLocalizedString());
+    }
+
+    refresh(); // to get the stats...
+
+    // need to create a new instance of ManagedBean to clean the "slate"...
+    ManagedBean newManagedBean = new DynamicManagedBean(managed);
+    for (int i = 0; i < this.statistics.length; i++) {
+      StatisticAttributeInfo attrInfo = new StatisticAttributeInfo();
+
+      attrInfo.setName(this.statistics[i].getName());
+      attrInfo.setDisplayName(this.statistics[i].getName());
+      attrInfo.setDescription(this.statistics[i].getDescription());
+      attrInfo.setType("java.lang.Number");
+
+      attrInfo.setIs(false);
+      attrInfo.setReadable(true);
+      attrInfo.setWriteable(false);
+
+      attrInfo.setStat(this.statistics[i]);
+
+      newManagedBean.addAttribute(attrInfo);
+    }
+
+    return newManagedBean;
+  }
+
+  // -------------------------------------------------------------------------
+  // MBean Operations
+  // -------------------------------------------------------------------------
+
+  /**
+   * Returns the ObjectName of the Region for the specified path.
+   *
+   * @throws AdminException If no region with path <code>path</code> exists
+   */
+  public ObjectName manageRegion(String path) throws AdminException, MalformedObjectNameException {
+    try {
+      SystemMemberRegionJmxImpl region = null;
+
+      try {
+        region = (SystemMemberRegionJmxImpl) getRegion(path);
+
+      } catch (AdminException e) {
+        MBeanUtil.logStackTrace(Level.WARN, e);
+        throw e;
+      }
+
+      if (region == null) {
+        throw new AdminException(
+            LocalizedStrings.SystemMemberCacheJmxImpl_THIS_CACHE_DOES_NOT_CONTAIN_REGION_0
+                .toLocalizedString(path));
+
+      } else {
+        return ObjectName.getInstance(region.getMBeanName());
+      }
+    } catch (RuntimeException e) {
+      MBeanUtil.logStackTrace(Level.WARN, e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      MBeanUtil.logStackTrace(Level.ERROR, e);
+      throw e;
+    }
+  }
+
+  /**
+   * Creates a new cache server MBean and returns its <code>ObjectName</code>.
+   *
+   * @since GemFire 5.7
+   */
+  public ObjectName manageCacheServer() throws AdminException, MalformedObjectNameException {
+
+    try {
+      SystemMemberBridgeServerJmxImpl bridge = (SystemMemberBridgeServerJmxImpl) addCacheServer();
+      return ObjectName.getInstance(bridge.getMBeanName());
+    } catch (AdminException e) {
+      MBeanUtil.logStackTrace(Level.WARN, e);
+      throw e;
+    } catch (RuntimeException e) {
+      MBeanUtil.logStackTrace(Level.WARN, e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      MBeanUtil.logStackTrace(Level.ERROR, e);
+      throw e;
+    }
+  }
+
+  /**
+   * Returns the MBean <code>ObjectName</code>s for all cache servers that serve this cache to
+   * clients.
+   *
+   * @since GemFire 4.0
+   */
+  public ObjectName[] manageCacheServers() throws AdminException, MalformedObjectNameException {
+
+    try {
+      SystemMemberCacheServer[] bridges = getCacheServers();
+      ObjectName[] names = new ObjectName[bridges.length];
+      for (int i = 0; i < bridges.length; i++) {
+        SystemMemberBridgeServerJmxImpl bridge = (SystemMemberBridgeServerJmxImpl) bridges[i];
+        names[i] = ObjectName.getInstance(bridge.getMBeanName());
+      }
+
+      return names;
+    } catch (AdminException e) {
+      MBeanUtil.logStackTrace(Level.WARN, e);
+      throw e;
+    } catch (RuntimeException e) {
+      MBeanUtil.logStackTrace(Level.WARN, e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      MBeanUtil.logStackTrace(Level.ERROR, e);
+      throw e;
+    }
+  }
+
+  /**
+   * Returns the MBean <code>ObjectName</code>s for all bridge servers that serve this cache.
+   *
+   * @since GemFire 4.0
+   * @deprecated as of 5.7
+   */
+  @Deprecated
+  public ObjectName[] manageBridgeServers() throws AdminException, MalformedObjectNameException {
+    return manageCacheServers();
+  }
+
+  // -------------------------------------------------------------------------
+  // ManagedResource implementation
+  // -------------------------------------------------------------------------
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.SYSTEM_MEMBER_CACHE;
+  }
+
+
+  /**
+   * Un-registers all the statistics & cache managed resource created for this member. After
+   * un-registering the resource MBean instances, clears this.memberResources collection.
+   * 
+   * Creates ConfigurationParameterJmxImpl, StatisticResourceJmxImpl and SystemMemberCacheJmxImpl.
+   * But cleans up only StatisticResourceJmxImpl and SystemMemberCacheJmxImpl which are of type
+   * ManagedResource.
+   */
+  public void cleanupResource() {
+    synchronized (this.managedRegionResourcesMap) {
+      Collection<SystemMemberRegionJmxImpl> values = managedRegionResourcesMap.values();
+
+      for (SystemMemberRegionJmxImpl systemMemberRegionJmxImpl : values) {
+        MBeanUtil.unregisterMBean(systemMemberRegionJmxImpl);
+      }
+
+      this.managedRegionResourcesMap.clear();
+    }
+
+    synchronized (this.managedCacheServerResourcesMap) {
+      Collection<SystemMemberBridgeServerJmxImpl> values = managedCacheServerResourcesMap.values();
+
+      for (SystemMemberBridgeServerJmxImpl SystemMemberBridgeServerJmxImpl : values) {
+        MBeanUtil.unregisterMBean(SystemMemberBridgeServerJmxImpl);
+      }
+
+      this.managedCacheServerResourcesMap.clear();
+    }
+  }
+
+  /**
+   * Cleans up managed resources created for the region that was (created and) destroyed in a cache
+   * represented by this Managed Resource.
+   * 
+   * @param regionPath path of the region that got destroyed
+   * @return a managed resource related to this region path
+   */
+  public ManagedResource cleanupRegionResources(String regionPath) {
+    ManagedResource cleaned = null;
+
+    synchronized (this.managedRegionResourcesMap) {
+      Set<Entry<String, SystemMemberRegionJmxImpl>> entries = managedRegionResourcesMap.entrySet();
+      for (Iterator<Entry<String, SystemMemberRegionJmxImpl>> it = entries.iterator(); it
+          .hasNext();) {
+        Entry<String, SystemMemberRegionJmxImpl> entry = it.next();
+        SystemMemberRegionJmxImpl managedResource = entry.getValue();
+        ObjectName objName = managedResource.getObjectName();
+
+        String pathProp = objName.getKeyProperty("path");
+        if (pathProp != null && pathProp.equals(regionPath)) {
+          cleaned = managedResource;
+          it.remove();
+
+          break;
+        }
+      }
+    }
+
+    return cleaned;
+  }
+
+  /**
+   * Checks equality of the given object with <code>this</code> based on the type (Class) and the
+   * MBean Name returned by <code>getMBeanName()</code> methods.
+   * 
+   * @param obj object to check equality with
+   * @return true if the given object is if the same type and its MBean Name is same as
+   *         <code>this</code> object's MBean Name, false otherwise
+   */
+  @Override
+  public boolean equals(Object obj) {
+    if (!(obj instanceof SystemMemberCacheJmxImpl)) {
+      return false;
+    }
+
+    SystemMemberCacheJmxImpl other = (SystemMemberCacheJmxImpl) obj;
+
+    return this.getMBeanName().equals(other.getMBeanName());
+  }
+
+  /**
+   * Returns hash code for <code>this</code> object which is based on the MBean Name generated.
+   * 
+   * @return hash code for <code>this</code> object
+   */
+  @Override
+  public int hashCode() {
+    return this.getMBeanName().hashCode();
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmx.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmx.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmx.java
new file mode 100644
index 0000000..3e67419
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmx.java
@@ -0,0 +1,466 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.geode.SystemFailure;
+import org.apache.geode.cache.Operation;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.internal.admin.ClientMembershipMessage;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+import org.apache.geode.internal.admin.api.OperationCancelledException;
+import org.apache.geode.internal.admin.api.StatisticResource;
+import org.apache.geode.internal.admin.api.SystemMember;
+import org.apache.geode.internal.admin.api.SystemMemberCache;
+import org.apache.geode.internal.admin.api.SystemMemberCacheEvent;
+import org.apache.geode.internal.admin.api.SystemMemberRegionEvent;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.commons.modeler.ManagedBean;
+import org.apache.logging.log4j.Logger;
+
+import javax.management.*;
+import javax.naming.OperationNotSupportedException;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * Defines methods that all <code>SystemMember</code> MBeans should implement.
+ *
+ * @since GemFire 4.0
+ */
+public interface SystemMemberJmx extends SystemMember, NotificationListener {
+  /**
+   * Notification type for indicating a cache got created on a member of this distributed system.
+   */
+  public static final String NOTIF_CACHE_CREATED =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.created";
+  /**
+   * Notification type for indicating a cache is closed on a member of this distributed system.
+   */
+  public static final String NOTIF_CACHE_CLOSED =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.closed";
+  /**
+   * Notification type for indicating a region is created in a cache on a member of this distributed
+   * system.
+   */
+  public static final String NOTIF_REGION_CREATED =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.region.created";
+  /**
+   * Notification type for indicating a region was removed from a cache on a member of this
+   * distributed system.
+   */
+  public static final String NOTIF_REGION_LOST =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.region.lost";
+
+  /** Notification type for indicating client joined */
+  public static final String NOTIF_CLIENT_JOINED =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.client.joined";
+
+  /** Notification type for indicating client left */
+  public static final String NOTIF_CLIENT_LEFT =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.client.left";
+
+  /** Notification type for indicating client crashed */
+  public static final String NOTIF_CLIENT_CRASHED =
+      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.cache.client.crashed";
+
+  /**
+   * Gets the interval in seconds between config refreshes
+   *
+   * @return the current refresh interval in seconds
+   */
+  public int getRefreshInterval();
+
+  /**
+   * RefreshInterval is now set only through the AdminDistributedSystem property refreshInterval.
+   * Attempt to set refreshInterval on SystemMemberJmx MBean would result in an
+   * OperationNotSupportedException Auto-refresh is enabled on demand when a call to refreshConfig
+   * is made
+   *
+   * @param refreshInterval the new refresh interval in seconds
+   * @deprecated since 6.0 use DistributedSystemConfig.refreshInterval instead
+   */
+  @Deprecated
+  public void setRefreshInterval(int refreshInterval) throws OperationNotSupportedException;
+
+  /**
+   * Sets the refresh interval field. Sets interval in seconds between config refreshes; zero or
+   * less turns off auto refreshing. Manual refreshing has no effect on when the next scheduled
+   * refresh will occur.
+   */
+  public void _setRefreshInterval(int refreshInterval);
+
+  /**
+   * Gets this member's cache.
+   *
+   * @return <code>ObjectName</code> for this member's cache
+   *
+   * @throws AdminException If this system member does not host a cache
+   */
+  public ObjectName manageCache() throws AdminException, MalformedObjectNameException;
+
+  /**
+   * Gets all active StatisticResources for this manager.
+   *
+   * @return array of ObjectName instances
+   */
+  public ObjectName[] manageStats() throws AdminException, MalformedObjectNameException;
+
+  /**
+   * Gets the active StatisticResources for this manager, based on the typeName as the key
+   *
+   * @return ObjectName of StatisticResourceJMX instance
+   */
+  public ObjectName[] manageStat(String statisticsTypeName)
+      throws AdminException, MalformedObjectNameException;
+
+  /**
+   * Handles notification to refresh. Reacts by refreshing the values of this GemFireManager's
+   * ConfigurationParamaters. Any other notification is ignored.
+   *
+   * @param notification the JMX notification being received
+   * @param hb handback object is unused
+   */
+  public void handleNotification(Notification notification, Object hb);
+
+  /**
+   * Add MBean attribute definitions for each ConfigurationParameter.
+   *
+   * @param managed the mbean definition to add attributes to
+   * @return a new instance of ManagedBean copied from <code>managed</code> but with the new
+   *         attributes added
+   */
+  public ManagedBean addDynamicAttributes(ManagedBean managed) throws AdminException;
+
+
+  /**
+   * Implementation should handle creation of cache by extracting the details from the given event
+   * object.
+   * 
+   * @param event event object corresponding to the creation of the cache
+   */
+  public void handleCacheCreate(SystemMemberCacheEvent event);
+
+  /**
+   * Implementation should handle closure of cache by extracting the details from the given event
+   * object.
+   * 
+   * @param event event object corresponding to the closure of the cache
+   */
+  public void handleCacheClose(SystemMemberCacheEvent event);
+
+  /**
+   * Implementation should handle creation of region by extracting the details from the given event
+   * object.
+   * 
+   * @param event event object corresponding to the creation of a region
+   */
+  public void handleRegionCreate(SystemMemberRegionEvent event);
+
+  /**
+   * Implementation should handle loss of region by extracting the details from the given event
+   * object.
+   * 
+   * @param event event object corresponding to the loss of a region
+   */
+  public void handleRegionLoss(SystemMemberRegionEvent event);
+
+  /**
+   * Implementation should handle client membership changes.
+   * 
+   * @param clientId id of the client for whom membership change happened
+   * @param eventType membership change type; one of {@link ClientMembershipMessage#JOINED},
+   *        {@link ClientMembershipMessage#LEFT}, {@link ClientMembershipMessage#CRASHED}
+   */
+  public void handleClientMembership(String clientId, int eventType);
+
+  ////////////////////// Inner Classess //////////////////////
+
+  /**
+   * A helper class that provides implementation of the <code>SystemMemberJmx</code> interface as
+   * static methods.
+   */
+  public static class Helper {
+    private static final Logger logger = LogService.getLogger();
+
+    private static AtomicInteger notificationSequenceNumber = new AtomicInteger();
+
+    public static int setAndReturnRefreshInterval(SystemMemberJmx member, int refreshInterval) {
+      int ret = refreshInterval;
+
+      try {
+        MBeanUtil.registerRefreshNotification(member, // NotificationListener
+            ((ManagedResource) member).getMBeanName(), // User Data
+            RefreshNotificationType.SYSTEM_MEMBER_CONFIG, refreshInterval); // int
+
+      } catch (RuntimeException e) {
+        logger.warn(e.getMessage(), e); // dead in water, print, and then ignore
+        ret = 0; // zero out to avoid more exceptions
+
+      } catch (VirtualMachineError err) {
+        SystemFailure.initiateFailure(err);
+        // If this ever returns, rethrow the error. We're poisoned
+        // now, so don't let this thread continue.
+        throw err;
+      } catch (Error e) {
+        // Whenever you catch Error or Throwable, you must also
+        // catch VirtualMachineError (see above). However, there is
+        // _still_ a possibility that you are dealing with a cascading
+        // error condition, so you also need to check to see if the JVM
+        // is still usable:
+        SystemFailure.checkFailure();
+        logger.error(e.getMessage(), e); // dead in water, print, and then ignore
+        ret = 0; // zero out to avoid more exceptions
+      }
+
+      return ret;
+    }
+
+    public static ObjectName manageCache(SystemMemberJmx member)
+        throws AdminException, MalformedObjectNameException {
+      boolean IthrewIt = false;
+      try {
+        SystemMemberCache cache = member.getCache();
+        if (cache == null) {
+          IthrewIt = true;
+          throw new AdminException(
+              LocalizedStrings.SystemMemberJmx_THIS_SYSTEM_MEMBER_DOES_NOT_HAVE_A_CACHE
+                  .toLocalizedString());
+        }
+        // Assert.assertTrue(cache != null); (cannot be null)
+        SystemMemberCacheJmxImpl cacheJmx = (SystemMemberCacheJmxImpl) cache;
+        return ObjectName.getInstance(cacheJmx.getMBeanName());
+      } catch (AdminException e) {
+        if (!IthrewIt) {
+          logger.warn(e.getMessage(), e);
+        }
+        throw e;
+      } catch (RuntimeException e) {
+        logger.warn(e.getMessage(), e);
+        throw e;
+      } catch (VirtualMachineError err) {
+        SystemFailure.initiateFailure(err);
+        // If this ever returns, rethrow the error. We're poisoned
+        // now, so don't let this thread continue.
+        throw err;
+      } catch (Error e) {
+        // Whenever you catch Error or Throwable, you must also
+        // catch VirtualMachineError (see above). However, there is
+        // _still_ a possibility that you are dealing with a cascading
+        // error condition, so you also need to check to see if the JVM
+        // is still usable:
+        SystemFailure.checkFailure();
+        logger.error(e.getMessage(), e);
+        throw e;
+      }
+    }
+
+    public static ObjectName[] manageStats(SystemMemberJmx member)
+        throws AdminException, MalformedObjectNameException {
+      try {
+        StatisticResource[] stats = member.getStats();
+        ObjectName[] onames = new ObjectName[stats.length];
+        for (int i = 0; i < stats.length; i++) {
+          StatisticResourceJmxImpl stat = (StatisticResourceJmxImpl) stats[i];
+          onames[i] = ObjectName.getInstance(stat.getMBeanName());
+        }
+        return onames;
+      } catch (AdminException e) {
+        logger.warn(e.getMessage(), e);
+        throw e;
+      } catch (RuntimeException e) {
+        logger.warn(e.getMessage(), e);
+        throw e;
+      } catch (VirtualMachineError err) {
+        SystemFailure.initiateFailure(err);
+        // If this ever returns, rethrow the error. We're poisoned
+        // now, so don't let this thread continue.
+        throw err;
+      } catch (Error e) {
+        // Whenever you catch Error or Throwable, you must also
+        // catch VirtualMachineError (see above). However, there is
+        // _still_ a possibility that you are dealing with a cascading
+        // error condition, so you also need to check to see if the JVM
+        // is still usable:
+        SystemFailure.checkFailure();
+        logger.error(e.getMessage(), e);
+        throw e;
+      }
+    }
+
+    public static ObjectName[] manageStat(SystemMemberJmx member, String statisticsTypeName)
+        throws AdminException, MalformedObjectNameException {
+      try {
+        StatisticResource[] stats = member.getStat(statisticsTypeName);
+        if (stats == null)
+          return null;
+        else {
+          ObjectName[] statNames = new ObjectName[stats.length];
+          for (int i = 0; i < stats.length; i++) {
+            StatisticResourceJmxImpl statJMX = (StatisticResourceJmxImpl) stats[i];
+            statNames[i] = ObjectName.getInstance(statJMX.getMBeanName());
+          }
+          return statNames;
+        }
+      } catch (AdminException e) {
+        logger.warn(e.getMessage(), e);
+        throw e;
+      } catch (RuntimeException e) {
+        logger.warn(e.getMessage(), e);
+        throw e;
+      } catch (Error e) {
+        logger.error(e.getMessage(), e);
+        throw e;
+      }
+    }
+
+    public static void handleNotification(SystemMemberJmx member, Notification notification,
+        Object hb) {
+      if (RefreshNotificationType.SYSTEM_MEMBER_CONFIG.getType().equals(notification.getType())
+          && ((ManagedResource) member).getMBeanName().equals(notification.getUserData())) {
+
+        try {
+          member.refreshConfig();
+
+        } catch (AdminException e) {
+          logger.warn(e.getMessage(), e);
+        } catch (OperationCancelledException e) {
+          // underlying resource is no longer reachable by remote admin
+          logger.warn(e.getMessage(), e);
+          member._setRefreshInterval(0);
+
+        } catch (java.lang.RuntimeException e) {
+          logger.warn(e.getMessage(), e); // dead in water, print, and then ignore
+          member._setRefreshInterval(0); // zero out to avoid more exceptions
+
+        } catch (VirtualMachineError err) {
+          SystemFailure.initiateFailure(err);
+          // If this ever returns, rethrow the error. We're poisoned
+          // now, so don't let this thread continue.
+          throw err;
+        } catch (java.lang.Error e) {
+          // Whenever you catch Error or Throwable, you must also
+          // catch VirtualMachineError (see above). However, there is
+          // _still_ a possibility that you are dealing with a cascading
+          // error condition, so you also need to check to see if the JVM
+          // is still usable:
+          SystemFailure.checkFailure();
+          logger.error(e.getMessage(), e); // dead in water, print, and then ignore
+          member._setRefreshInterval(0); // zero out to avoid more exceptions
+        }
+      }
+    }
+
+    public static ManagedBean addDynamicAttributes(SystemMemberJmx member, ManagedBean managed)
+        throws AdminException {
+
+      if (managed == null) {
+        throw new IllegalArgumentException(
+            LocalizedStrings.SystemMemberJmx_MANAGEDBEAN_IS_NULL.toLocalizedString());
+      }
+
+      member.refreshConfig(); // to get the config parms...
+
+      // need to create a new instance of ManagedBean to clean the "slate"...
+      ManagedBean newManagedBean = new DynamicManagedBean(managed);
+      ConfigurationParameter[] params = member.getConfiguration();
+      for (int i = 0; i < params.length; i++) {
+        ConfigurationParameterJmxImpl parm = (ConfigurationParameterJmxImpl) params[i];
+        ConfigAttributeInfo attrInfo = new ConfigAttributeInfo(parm);
+
+        attrInfo.setName(parm.getName());
+        attrInfo.setDisplayName(parm.getName());
+        attrInfo.setDescription(parm.getDescription());
+        attrInfo.setType(parm.getJmxValueType().getName());
+
+        attrInfo.setIs(false);
+        attrInfo.setReadable(true);
+        attrInfo.setWriteable(parm.isModifiable());
+
+        newManagedBean.addAttribute(attrInfo);
+      }
+      return newManagedBean;
+    }
+
+    /**
+     * Returns the next notification sequence number.
+     * 
+     * @return the notificationSequenceNumber
+     */
+    /* default */static int getNextNotificationSequenceNumber() {
+      return notificationSequenceNumber.incrementAndGet();
+    }
+
+    /**
+     * Returns the cache event details extracted from the given SystemMemberCacheEvent
+     * 
+     * @param event SystemMemberCacheEvent instance
+     * @return the cache event details extracted from the given SystemMemberCacheEvent
+     */
+    /* default */static String getCacheEventDetails(SystemMemberCacheEvent event) {
+      String memberId = event.getMemberId();
+      Operation operation = event.getOperation();
+
+      return "CacheEvent[MemberId: " + memberId + ", operation: " + operation + "]";
+    }
+
+    /**
+     * Returns the region event details extracted from the given SystemMemberRegionEvent
+     * 
+     * @param event SystemMemberRegionEvent instance
+     * @return the cache event details extracted from the given SystemMemberRegionEvent
+     */
+    /* default */static String getRegionEventDetails(SystemMemberRegionEvent event) {
+      String memberId = event.getMemberId();
+      Operation operation = event.getOperation();
+
+      return "RegionEvent[MemberId: " + memberId + ", operation: " + operation + ", region:"
+          + event.getRegionPath() + "]";
+    }
+
+    /**
+     * Sends the given notification.
+     * 
+     * @param notif notification to send
+     * 
+     * @throws NullPointerException if resource or ModelMBean for resource is null
+     */
+    /* default */static void sendNotification(ManagedResource resource, Notification notif) {
+      try {
+        if (MBeanUtil.isRegistered(resource.getObjectName())) {
+          resource.getModelMBean().sendNotification(notif);
+          if (logger.isDebugEnabled()) {
+            logger.debug("Sent '{}' notification", notif.getType());
+          }
+        }
+      } catch (RuntimeOperationsException e) {
+        logger
+            .info(
+                LocalizedMessage.create(
+                    LocalizedStrings.SystemMemberJmx_FAILED_TO_SEND_0_NOTIFICATION_FOR_1,
+                    new Object[] {"'" + notif.getType() + "'", "'" + notif.getMessage() + "'"}),
+                e);
+      } catch (MBeanException e) {
+        logger
+            .info(
+                LocalizedMessage.create(
+                    LocalizedStrings.SystemMemberJmx_FAILED_TO_SEND_0_NOTIFICATION_FOR_1,
+                    new Object[] {"'" + notif.getType() + "'", "'" + notif.getMessage() + "'"}),
+                e);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmxImpl.java
new file mode 100755
index 0000000..2e4ddd8
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberJmxImpl.java
@@ -0,0 +1,538 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.Notification;
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+import javax.naming.OperationNotSupportedException;
+
+import org.apache.commons.modeler.ManagedBean;
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+import org.apache.geode.internal.admin.api.StatisticResource;
+import org.apache.geode.internal.admin.api.SystemMemberCache;
+import org.apache.geode.internal.admin.api.SystemMemberCacheEvent;
+import org.apache.geode.internal.admin.api.SystemMemberRegionEvent;
+import org.apache.geode.internal.admin.api.impl.ConfigurationParameterImpl;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.admin.ApplicationVM;
+import org.apache.geode.internal.admin.ClientMembershipMessage;
+import org.apache.geode.internal.admin.GemFireVM;
+import org.apache.geode.internal.admin.StatResource;
+import org.apache.geode.internal.admin.api.impl.SystemMemberImpl;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+
+/**
+ * Provides MBean support for managing a SystemMember application.
+ * <p>
+ * TODO: refactor to implement SystemMember and delegate to SystemMemberImpl. Wrap all delegate
+ * calls w/ e.printStackTrace() since the HttpAdaptor devours them
+ *
+ * @since GemFire 3.5
+ *
+ */
+public class SystemMemberJmxImpl extends SystemMemberImpl
+    implements SystemMemberJmx, javax.management.NotificationListener, ManagedResource {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /**
+   * Interval in seconds between refreshes. Value less than one results in no refreshing
+   */
+  private int refreshInterval = 0;
+
+  /** The JMX object name of this managed resource */
+  private ObjectName objectName;
+
+  /** Reference to the cache MBean representing a Cache in the Cache VM Member */
+  private SystemMemberCacheJmxImpl managedSystemMemberCache;
+
+  /** collection to collect all the resources created for this member */
+  private Map<StatResource, StatisticResourceJmxImpl> managedStatisticsResourcesMap =
+      new HashMap<StatResource, StatisticResourceJmxImpl>();
+
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs an instance of SystemMemberJmxImpl.
+   *
+   * @param system the distributed system this SystemMember is a member of
+   * @param application the internal admin application to delegate actual work
+   */
+  public SystemMemberJmxImpl(AdminDistributedSystemJmxImpl system, ApplicationVM application)
+      throws AdminException {
+    super(system, application);
+    initializeMBean();
+  }
+
+  /**
+   * Constructs the instance of SystemMember using the corresponding InternalDistributedMember
+   * instance of a DS member for the given AdminDistributedSystem.
+   * 
+   * @param system Current AdminDistributedSystem instance
+   * @param member InternalDistributedMember instance for which a SystemMember instance is to be
+   *        constructed.
+   * @throws AdminException if construction of SystemMember fails
+   * 
+   * @since GemFire 6.5
+   */
+  protected SystemMemberJmxImpl(AdminDistributedSystemJmxImpl system,
+      InternalDistributedMember member) throws AdminException {
+    super(system, member);
+    initializeMBean();
+  }
+
+  /** Create and register the MBean to manage this resource */
+  private void initializeMBean() throws AdminException {
+    // initialize Managed Resources for stats & cache first.
+    // initializeManagedResources();
+
+    this.mbeanName = new StringBuffer("GemFire.Member:id=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(getId())).append(",type=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(getType().getName())).toString();
+
+    this.objectName =
+        MBeanUtil.createMBean(this, addDynamicAttributes(MBeanUtil.lookupManagedBean(this)));
+
+    // Refresh Interval
+    AdminDistributedSystemJmxImpl sysJmx = (AdminDistributedSystemJmxImpl) system;
+    if (sysJmx.getRefreshInterval() > 0)
+      this.refreshInterval = sysJmx.getRefreshInterval();
+  }
+
+  // -------------------------------------------------------------------------
+  // MBean attributes - accessors/mutators
+  // -------------------------------------------------------------------------
+
+  /**
+   * Gets the interval in seconds between config refreshes
+   *
+   * @return the current refresh interval in seconds
+   */
+  public int getRefreshInterval() {
+    return this.refreshInterval;
+  }
+
+  /**
+   * RefreshInterval is now set only through the AdminDistributedSystem property refreshInterval.
+   * Attempt to set refreshInterval on SystemMemberJmx MBean would result in an
+   * OperationNotSupportedException Auto-refresh is enabled on demand when a call to refreshConfig
+   * is made
+   * 
+   * @param refreshInterval the new refresh interval in seconds
+   * @deprecated since 6.0 use DistributedSystemConfig.refreshInterval instead
+   */
+  @Deprecated
+  public void setRefreshInterval(int refreshInterval) throws OperationNotSupportedException {
+    throw new OperationNotSupportedException(
+        LocalizedStrings.MANAGED_RESOURCE_REFRESH_INTERVAL_CANT_BE_SET_DIRECTLY
+            .toLocalizedString());
+  }
+
+  /**
+   * Sets interval in seconds between member config refreshes; zero or less turns off auto
+   * refreshing. Manual refreshing has no effect on when the next scheduled refresh will occur.
+   * 
+   * @param refreshInterval the new refresh interval in seconds
+   */
+  public void _setRefreshInterval(int refreshInterval) {
+    boolean isRegistered = MBeanUtil.isRefreshNotificationRegistered(this,
+        RefreshNotificationType.SYSTEM_MEMBER_CONFIG);
+
+    if (isRegistered && (getRefreshInterval() == refreshInterval))
+      return;
+
+    this.refreshInterval = Helper.setAndReturnRefreshInterval(this, refreshInterval);
+  }
+
+  // -------------------------------------------------------------------------
+  // MBean Operations
+  // -------------------------------------------------------------------------
+
+  public void refreshConfig() throws AdminException {
+    // 1st call to refreshConfig would trigger
+    // the auto-refresh if an interval is set
+    if (this.refreshInterval > 0) {
+      this._setRefreshInterval(this.refreshInterval);
+    }
+
+    super.refreshConfig();
+  }
+
+  /**
+   * Initializes Cache & Statistics managed resources.
+   * 
+   * @throws AdminException if initialization of managed resources fails
+   */
+  // private void initializeManagedResources() throws AdminException {
+  // try {
+  // manageCache();
+  // } catch (MalformedObjectNameException e) {
+  // throw new
+  // AdminException(LocalizedStrings.SystemMemberJmxImpl_EXCEPTION_OCCURRED_WHILE_INITIALIZING_0_MBEANS_FOR_1.toLocalizedString(
+  // new Object[] {"Cache", getId()}),
+  // e);
+  // } catch (AdminException ae) {
+  // if
+  // (LocalizedStrings.SystemMemberJmx_THIS_SYSTEM_MEMBER_DOES_NOT_HAVE_A_CACHE.toLocalizedString().equals(ae.getMessage()))
+  // {
+  // //ignore this exception for a cache-less peer
+  // } else {
+  // throw ae;
+  // }
+  // }
+  // try {
+  // manageStats();
+  // } catch (MalformedObjectNameException e) {
+  // throw new
+  // AdminException(LocalizedStrings.SystemMemberJmxImpl_EXCEPTION_OCCURRED_WHILE_INITIALIZING_0_MBEANS_FOR_1.toLocalizedString(
+  // new Object[] {"Statistics", getId()}),
+  // e);
+  // }
+  // }
+
+  /**
+   * Gets this member's cache.
+   *
+   * @return <code>ObjectName</code> for this member's cache
+   *
+   * @throws AdminException If this system member does not host a cache
+   */
+  public ObjectName manageCache() throws AdminException, MalformedObjectNameException {
+
+    return Helper.manageCache(this);
+  }
+
+  /**
+   * Gets all active StatisticResources for this manager.
+   *
+   * @return array of ObjectName instances
+   */
+  public ObjectName[] manageStats() throws AdminException, MalformedObjectNameException {
+
+    return Helper.manageStats(this);
+  }
+
+  /**
+   * Gets the active StatisticResources for this manager, based on the typeName as the key
+   *
+   * @return ObjectName of StatisticResourceJMX instance
+   */
+  public ObjectName[] manageStat(String statisticsTypeName)
+      throws AdminException, MalformedObjectNameException {
+
+    return Helper.manageStat(this, statisticsTypeName);
+  }
+
+  // -------------------------------------------------------------------------
+  // JMX Notification listener
+  // -------------------------------------------------------------------------
+
+  /**
+   * Handles notification to refresh. Reacts by refreshing the values of this SystemMember's
+   * ConfigurationParamaters. Any other notification is ignored. Given notification is handled only
+   * if there is any JMX client connected to the system.
+   * 
+   * @param notification the JMX notification being received
+   * @param hb handback object is unused
+   */
+  public void handleNotification(Notification notification, Object hb) {
+    AdminDistributedSystemJmxImpl systemJmx = (AdminDistributedSystemJmxImpl) this.system;
+
+    if (!systemJmx.isRmiClientCountZero()) {
+      Helper.handleNotification(this, notification, hb);
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // Template methods overriden from superclass...
+  // -------------------------------------------------------------------------
+
+  /**
+   * Template method for creating instance of ConfigurationParameter. Overridden to return
+   * ConfigurationParameterJmxImpl.
+   */
+  @Override
+  protected ConfigurationParameter createConfigurationParameter(String name, String description,
+      Object value, Class type, boolean userModifiable) {
+    return new ConfigurationParameterJmxImpl(name, description, value, type, userModifiable);
+  }
+
+  /**
+   * Override createStatisticResource by instantiating StatisticResourceJmxImpl if it was not
+   * created earlier otherwise returns the same instance.
+   * 
+   * @param stat StatResource reference for which this JMX resource is to be created
+   * @return StatisticResourceJmxImpl - JMX Implementation of StatisticResource
+   * @throws AdminException if constructing StatisticResourceJmxImpl instance fails
+   */
+  @Override
+  protected StatisticResource createStatisticResource(StatResource stat) throws AdminException {
+    StatisticResourceJmxImpl managedStatisticResource = null;
+
+    synchronized (this.managedStatisticsResourcesMap) {
+      /*
+       * Ensuring that a single instance of Statistic Resource is created per StatResource.
+       */
+      StatisticResourceJmxImpl statisticResourceJmxImpl = managedStatisticsResourcesMap.get(stat);
+      if (statisticResourceJmxImpl != null) {
+        managedStatisticResource = statisticResourceJmxImpl;
+      } else {
+        managedStatisticResource = new StatisticResourceJmxImpl(stat, this);
+        managedStatisticResource.getStatistics();// inits timer
+        managedStatisticsResourcesMap.put(stat, managedStatisticResource);
+      }
+    }
+    return managedStatisticResource;
+  }
+
+  /**
+   * Override createSystemMemberCache by instantiating SystemMemberCacheJmxImpl if it was not
+   * created earlier.
+   * 
+   * @param vm GemFireVM reference for which this JMX resource is to be created
+   * @return SystemMemberCacheJmxImpl - JMX Implementation of SystemMemberCache
+   * @throws AdminException if constructing SystemMemberCacheJmxImpl instance fails
+   */
+  @Override
+  protected SystemMemberCache createSystemMemberCache(GemFireVM vm) throws AdminException {
+    if (managedSystemMemberCache == null) {
+      managedSystemMemberCache = new SystemMemberCacheJmxImpl(vm);
+    }
+    return managedSystemMemberCache;
+  }
+
+  // -------------------------------------------------------------------------
+  // Create MBean attributes for each ConfigurationParameter
+  // -------------------------------------------------------------------------
+
+  /**
+   * Add MBean attribute definitions for each ConfigurationParameter.
+   *
+   * @param managed the mbean definition to add attributes to
+   * @return a new instance of ManagedBean copied from <code>managed</code> but with the new
+   *         attributes added
+   */
+  public ManagedBean addDynamicAttributes(ManagedBean managed) throws AdminException {
+
+    return Helper.addDynamicAttributes(this, managed);
+  }
+
+  // -------------------------------------------------------------------------
+  // ManagedResource implementation
+  // -------------------------------------------------------------------------
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.SYSTEM_MEMBER;
+  }
+
+  /**
+   * Un-registers all the statistics & cache managed resource created for this member. After
+   * un-registering the resource MBean instances, clears managedStatisticsResourcesMap collection.
+   */
+  public void cleanupResource() {
+    synchronized (this.managedStatisticsResourcesMap) {
+      ConfigurationParameter[] names = getConfiguration();
+      if (names != null) {
+        for (int i = 0; i < names.length; i++) {
+          ConfigurationParameter parm = names[i];
+          ((ConfigurationParameterImpl) parm).removeConfigurationParameterListener(this);
+        }
+      }
+      this.parms.clear();
+
+      Collection<StatisticResourceJmxImpl> statisticResources =
+          managedStatisticsResourcesMap.values();
+
+      for (StatisticResourceJmxImpl statisticResource : statisticResources) {
+        MBeanUtil.unregisterMBean(statisticResource);
+      }
+
+      this.managedStatisticsResourcesMap.clear();
+    }
+    MBeanUtil.unregisterMBean(managedSystemMemberCache);
+  }
+
+
+  /**
+   * Cleans up Managed Resources created for the client that was connected to the server represented
+   * by this class.
+   * 
+   * @param clientId id of the client to be removed
+   * @return List of ManagedResources associated with the client of given client id
+   */
+  /*
+   * This clean up is for the clients. The clients are started with a loner DM. Hence the clientId
+   * is not supposed to contain '/' as per InternalDistributedMember.toString().
+   */
+  public List<ManagedResource> cleanupBridgeClientResources(String clientId) {
+    List<ManagedResource> returnedResources = new ArrayList<ManagedResource>();
+
+    String compatibleId = "id_" + MBeanUtil.makeCompliantMBeanNameProperty(clientId);
+    synchronized (this.managedStatisticsResourcesMap) {
+      Set<Entry<StatResource, StatisticResourceJmxImpl>> entrySet =
+          this.managedStatisticsResourcesMap.entrySet();
+
+      for (Iterator<Entry<StatResource, StatisticResourceJmxImpl>> it = entrySet.iterator(); it
+          .hasNext();) {
+        Entry<StatResource, StatisticResourceJmxImpl> entry = it.next();
+        StatisticResourceJmxImpl resource = entry.getValue();
+        if (resource.getMBeanName().contains(compatibleId)) {
+          it.remove(); // remove matching entry
+          returnedResources.add(resource);
+        }
+      }
+    }
+    return returnedResources;
+  }
+
+  /**
+   * Implementation handles client membership changes.
+   * 
+   * @param clientId id of the client for whom membership change happened
+   * @param eventType membership change type; one of {@link ClientMembershipMessage#JOINED},
+   *        {@link ClientMembershipMessage#LEFT}, {@link ClientMembershipMessage#CRASHED}
+   */
+  public void handleClientMembership(String clientId, int eventType) {
+    String notifType = null;
+    List<ManagedResource> cleanedUp = null;
+
+    if (eventType == ClientMembershipMessage.LEFT) {
+      notifType = NOTIF_CLIENT_LEFT;
+      cleanedUp = cleanupBridgeClientResources(clientId);
+    } else if (eventType == ClientMembershipMessage.CRASHED) {
+      notifType = NOTIF_CLIENT_CRASHED;
+      cleanedUp = cleanupBridgeClientResources(clientId);
+    } else if (eventType == ClientMembershipMessage.JOINED) {
+      notifType = NOTIF_CLIENT_JOINED;
+    }
+
+    if (cleanedUp != null) {
+      for (ManagedResource resource : cleanedUp) {
+        MBeanUtil.unregisterMBean(resource);
+      }
+    }
+
+    Helper.sendNotification(this, new Notification(notifType, this.modelMBean,
+        Helper.getNextNotificationSequenceNumber(), clientId));
+  }
+
+  /**
+   * Implementation handles creation of cache by extracting the details from the given event object
+   * and sending the {@link SystemMemberJmx#NOTIF_CACHE_CREATED} notification to the connected JMX
+   * Clients.
+   * 
+   * @param event event object corresponding to the creation of the cache
+   */
+  public void handleCacheCreate(SystemMemberCacheEvent event) {
+    Helper.sendNotification(this, new Notification(NOTIF_CACHE_CREATED, this.modelMBean,
+        Helper.getNextNotificationSequenceNumber(), Helper.getCacheEventDetails(event)));
+  }
+
+  /**
+   * Implementation handles closure of cache by extracting the details from the given event object
+   * and sending the {@link SystemMemberJmx#NOTIF_CACHE_CLOSED} notification to the connected JMX
+   * Clients.
+   * 
+   * @param event event object corresponding to the closure of the cache
+   */
+  public void handleCacheClose(SystemMemberCacheEvent event) {
+    Helper.sendNotification(this, new Notification(NOTIF_CACHE_CLOSED, this.modelMBean,
+        Helper.getNextNotificationSequenceNumber(), Helper.getCacheEventDetails(event)));
+  }
+
+  /**
+   * Implementation handles creation of region by extracting the details from the given event object
+   * and sending the {@link SystemMemberJmx#NOTIF_REGION_CREATED} notification to the connected JMX
+   * Clients. Region Path is set as User Data in Notification.
+   * 
+   * @param event event object corresponding to the creation of a region
+   */
+  public void handleRegionCreate(SystemMemberRegionEvent event) {
+    Notification notification = new Notification(NOTIF_REGION_CREATED, this.modelMBean,
+        Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event));
+
+    notification.setUserData(event.getRegionPath());
+
+    Helper.sendNotification(this, notification);
+  }
+
+  /**
+   * Implementation should handle loss of region by extracting the details from the given event
+   * object and sending the {@link SystemMemberJmx#NOTIF_REGION_LOST} notification to the connected
+   * JMX Clients. Region Path is set as User Data in Notification. Additionally, it also clears the
+   * ManagedResources created for the region that is lost.
+   * 
+   * @param event event object corresponding to the loss of a region
+   */
+  public void handleRegionLoss(SystemMemberRegionEvent event) {
+    SystemMemberCacheJmxImpl cacheResource = this.managedSystemMemberCache;
+
+    if (cacheResource != null) {
+      ManagedResource cleanedUp = cacheResource.cleanupRegionResources(event.getRegionPath());
+
+      if (cleanedUp != null) {
+        MBeanUtil.unregisterMBean(cleanedUp);
+      }
+    }
+
+    Notification notification = new Notification(NOTIF_REGION_LOST, this.modelMBean,
+        Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event));
+
+    notification.setUserData(event.getRegionPath());
+
+    Helper.sendNotification(this, notification);
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberRegionJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberRegionJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberRegionJmxImpl.java
new file mode 100644
index 0000000..2829b98
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/SystemMemberRegionJmxImpl.java
@@ -0,0 +1,128 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.SystemMemberRegion;
+import org.apache.geode.internal.admin.api.impl.SystemMemberCacheImpl;
+import org.apache.geode.cache.Region;
+import org.apache.geode.internal.admin.GemFireVM;
+import org.apache.geode.internal.admin.api.impl.SystemMemberRegionImpl;
+
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+
+/**
+ * MBean representation of {@link SystemMemberRegion}.
+ *
+ * @since GemFire 3.5
+ */
+public class SystemMemberRegionJmxImpl extends SystemMemberRegionImpl implements ManagedResource {
+
+  /** The object name of this managed resource */
+  private ObjectName objectName;
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs an instance of SystemMemberRegionJmxImpl.
+   *
+   * @param cache the cache this region belongs to
+   * @param region internal region to delegate real work to
+   */
+  public SystemMemberRegionJmxImpl(SystemMemberCacheImpl cache, Region region)
+      throws AdminException {
+    super(cache, region);
+    initializeMBean(cache);
+  }
+
+  /** Create and register the MBean to manage this resource */
+  private void initializeMBean(SystemMemberCacheImpl cache) throws AdminException {
+
+    GemFireVM vm = cache.getVM();
+    this.mbeanName = new StringBuffer("GemFire.Cache:").append("path=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(getFullPath())).append(",name=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(cache.getName())).append(",id=")
+        .append(cache.getId()).append(",owner=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(vm.getId().toString()))
+        .append(",type=Region").toString();
+
+    this.objectName = MBeanUtil.createMBean(this);
+  }
+
+  // -------------------------------------------------------------------------
+  // ManagedResource implementation
+  // -------------------------------------------------------------------------
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.SYSTEM_MEMBER_REGION;
+  }
+
+  public void cleanupResource() {}
+
+  /**
+   * Checks equality of the given object with <code>this</code> based on the type (Class) and the
+   * MBean Name returned by <code>getMBeanName()</code> methods.
+   * 
+   * @param obj object to check equality with
+   * @return true if the given object is if the same type and its MBean Name is same as
+   *         <code>this</code> object's MBean Name, false otherwise
+   */
+  @Override
+  public boolean equals(Object obj) {
+    if (!(obj instanceof SystemMemberRegionJmxImpl)) {
+      return false;
+    }
+
+    SystemMemberRegionJmxImpl other = (SystemMemberRegionJmxImpl) obj;
+
+    return this.getMBeanName().equals(other.getMBeanName());
+  }
+
+  /**
+   * Returns hash code for <code>this</code> object which is based on the MBean Name generated.
+   * 
+   * @return hash code for <code>this</code> object
+   */
+  @Override
+  public int hashCode() {
+    return this.getMBeanName().hashCode();
+  }
+}
+


[29/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java
new file mode 100755
index 0000000..ef0012f
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AdminDistributedSystemImpl.java
@@ -0,0 +1,2418 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.Alert;
+import org.apache.geode.internal.admin.api.AlertLevel;
+import org.apache.geode.internal.admin.api.AlertListener;
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.FutureCancelledException;
+import org.apache.geode.distributed.internal.*;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.Banner;
+import org.apache.geode.internal.admin.*;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.BackupStatus;
+import org.apache.geode.internal.admin.api.CacheServer;
+import org.apache.geode.internal.admin.api.CacheServerConfig;
+import org.apache.geode.internal.admin.api.CacheVm;
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.DistributionLocator;
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.ManagedEntity;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+import org.apache.geode.internal.admin.api.OperationCancelledException;
+import org.apache.geode.internal.admin.api.RuntimeAdminException;
+import org.apache.geode.internal.admin.api.SystemMember;
+import org.apache.geode.internal.admin.api.SystemMemberCacheListener;
+import org.apache.geode.internal.admin.api.SystemMembershipEvent;
+import org.apache.geode.internal.admin.api.SystemMembershipListener;
+import org.apache.geode.internal.admin.remote.*;
+import org.apache.geode.internal.cache.persistence.PersistentMemberPattern;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.InternalLogWriter;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.LogWriterFactory;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.geode.internal.logging.log4j.LogMarker;
+import org.apache.geode.internal.logging.log4j.LogWriterAppender;
+import org.apache.geode.internal.logging.log4j.LogWriterAppenders;
+import org.apache.geode.internal.util.concurrent.FutureResult;
+import org.apache.logging.log4j.Logger;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+/**
+ * Represents a GemFire distributed system for remote administration/management.
+ *
+ * @since GemFire 3.5
+ */
+public class AdminDistributedSystemImpl
+    implements AdminDistributedSystem, org.apache.geode.internal.admin.JoinLeaveListener,
+    org.apache.geode.internal.admin.AlertListener,
+    org.apache.geode.distributed.internal.InternalDistributedSystem.DisconnectListener {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /** String identity of this distributed system */
+  private String id;
+
+  /** Latest alert broadcast by any system members */
+  private Alert latestAlert;
+
+  // -------------------------------------------------------------------------
+
+  /** Internal admin agent to delegate low-level work to */
+  private volatile GfManagerAgent gfManagerAgent;
+
+  /** Monitors the health of this distributed system */
+  private GemFireHealth health;
+
+  /** Set of non-Manager members in this system */
+  private final Set applicationSet = new HashSet();
+
+  /** Set of DistributionLocators for this system */
+  private final Set locatorSet = new HashSet();
+
+  /** Set of dedicated CacheServer members in this system */
+  private final Set cacheServerSet = new HashSet();
+
+  /** Configuration defining this distributed system */
+  private final DistributedSystemConfigImpl config;
+
+  /** Controller for starting and stopping managed entities */
+  private ManagedEntityController controller;
+
+  /** Log file collator for gathering and merging system member logs */
+  private LogCollator logCollator = new LogCollator();
+
+  /**
+   * The level above which alerts will be delivered to the alert listeners
+   */
+  private AlertLevel alertLevel = AlertLevel.WARNING;
+
+  /** The alert listeners registered on this distributed system. */
+  private volatile Set<AlertListener> alertListeners = Collections.emptySet();
+  private final Object alertLock = new Object();
+
+  private LogWriterAppender logWriterAppender;
+
+  private InternalLogWriter logWriter;
+
+  /** The membership listeners registered on this distributed system */
+  private volatile Set membershipListeners = Collections.EMPTY_SET;
+  private final Object membershipLock = new Object();
+
+  /* The region listeners registered on this distributed system */
+  // for feature requests #32887
+  private volatile List cacheListeners = Collections.EMPTY_LIST;
+  private final Object cacheListLock = new Object();
+
+  /**
+   * reference to AdminDistributedSystemImpl instance for feature requests #32887.
+   * <p>
+   * Guarded by {@link #CONNECTION_SYNC}.
+   * <p>
+   * TODO: reimplement this change and SystemMemberCacheEventProcessor to avoid using this static.
+   * SystemMemberCacheEvents should only be sent to Admin VMs that express interest.
+   * <p>
+   * This is volatile to allow SystemFailure to deliver fatal poison-pill to thisAdminDS without
+   * waiting on synchronization.
+   * 
+   * @guarded.By CONNECTION_SYNC
+   */
+  private static volatile AdminDistributedSystemImpl thisAdminDS;
+
+  /**
+   * Provides synchronization for {@link #connect()} and {@link #disconnect()}. {@link #thisAdminDS}
+   * is also now protected by CONNECTION_SYNC and has its lifecycle properly tied to
+   * connect/disconnect.
+   */
+  private static final Object CONNECTION_SYNC = new Object();
+
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs new DistributedSystemImpl with the given configuration.
+   *
+   * @param config configuration defining this distributed system
+   */
+  public AdminDistributedSystemImpl(DistributedSystemConfigImpl config) {
+
+    // init from config...
+    this.config = config;
+
+    String systemId = this.config.getSystemId();
+    if (systemId != null && systemId.length() > 0) {
+      this.id = systemId;
+
+    }
+    if (this.getLocators() != null && this.getLocators().length() > 0) {
+      this.id = this.getLocators();
+
+    } else {
+      this.id = new StringBuffer(this.getMcastAddress()).append("[").append(this.getMcastPort())
+          .append("]").toString();
+    }
+
+    // LOG: create LogWriterAppender unless one already exists
+    this.logWriterAppender = LogWriterAppenders.getOrCreateAppender(
+        LogWriterAppenders.Identifier.MAIN, false, this.config.createLogConfig(), false);
+
+    // LOG: look in DistributedSystemConfigImpl for existing LogWriter to use
+    InternalLogWriter existingLogWriter = this.config.getInternalLogWriter();
+    if (existingLogWriter != null) {
+      this.logWriter = existingLogWriter;
+    } else {
+      // LOG: create LogWriterLogger
+      this.logWriter = LogWriterFactory.createLogWriterLogger(false, false,
+          this.config.createLogConfig(), false);
+      if (!Boolean.getBoolean(InternalLocator.INHIBIT_DM_BANNER)) {
+        // LOG: changed statement from config to info
+        this.logWriter.info(Banner.getString(null));
+      } else {
+        logger.debug("skipping banner - " + InternalLocator.INHIBIT_DM_BANNER + " is set to true");
+      }
+      // Set this log writer in DistributedSystemConfigImpl
+      this.config.setInternalLogWriter(this.logWriter);
+    }
+
+    // set up other details that depend on config attrs...
+    this.controller = ManagedEntityControllerFactory.createManagedEntityController(this);
+    initializeDistributionLocators();
+    initializeCacheServers();
+  }
+
+  // -------------------------------------------------------------------------
+  // Initialization
+  // -------------------------------------------------------------------------
+
+  /**
+   * Creates DistributionLocator instances for every locator entry in the
+   * {@link DistributedSystemConfig}
+   */
+  private void initializeDistributionLocators() {
+    DistributionLocatorConfig[] configs = this.config.getDistributionLocatorConfigs();
+    if (configs.length == 0) {
+      // No work to do
+      return;
+    }
+
+    for (int i = 0; i < configs.length; i++) {
+      // the Locator impl may vary in this class from the config...
+      DistributionLocatorConfig conf = configs[i];
+      DistributionLocator locator = createDistributionLocatorImpl(conf);
+      this.locatorSet.add(new FutureResult(locator));
+    }
+    // update locators string...
+    setLocators(parseLocatorSet());
+  }
+
+  /**
+   * Creates <code>CacheServer</code> instances for every cache server entry in the
+   * {@link DistributedSystemConfig}
+   */
+  private void initializeCacheServers() {
+    CacheServerConfig[] cacheServerConfigs = this.config.getCacheServerConfigs();
+    for (int i = 0; i < cacheServerConfigs.length; i++) {
+      try {
+        CacheServerConfig conf = cacheServerConfigs[i];
+        CacheServerConfigImpl copy = new CacheServerConfigImpl(conf);
+        this.cacheServerSet.add(new FutureResult(createCacheServer(copy)));
+      } catch (java.lang.Exception e) {
+        logger.warn(e.getMessage(), e);
+        continue;
+      } catch (VirtualMachineError err) {
+        SystemFailure.initiateFailure(err);
+        // If this ever returns, rethrow the error. We're poisoned
+        // now, so don't let this thread continue.
+        throw err;
+      } catch (java.lang.Error e) {
+        // Whenever you catch Error or Throwable, you must also
+        // catch VirtualMachineError (see above). However, there is
+        // _still_ a possibility that you are dealing with a cascading
+        // error condition, so you also need to check to see if the JVM
+        // is still usable:
+        SystemFailure.checkFailure();
+        logger.error(e.getMessage(), e);
+        continue;
+      }
+    }
+  }
+
+  /**
+   * Checks to make sure that {@link #connect()} has been called.
+   *
+   * @throws IllegalStateException If {@link #connect()} has not been called.
+   */
+  private void checkConnectCalled() {
+    if (this.gfManagerAgent == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
+              .toLocalizedString());
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // Attributes of this DistributedSystem
+  // -------------------------------------------------------------------------
+
+  public GfManagerAgent getGfManagerAgent() {
+    return this.gfManagerAgent;
+  }
+
+  public boolean isConnected() {
+    return this.gfManagerAgent != null && this.gfManagerAgent.isConnected();
+  }
+
+  public String getId() {
+    return this.id;
+  }
+
+  public String getName() {
+    String name = this.config.getSystemName();
+    if (name != null && name.length() > 0) {
+      return name;
+
+    } else {
+      return getId();
+    }
+  }
+
+  public String getSystemName() {
+    return this.config.getSystemName();
+  }
+
+  public String getRemoteCommand() {
+    return this.config.getRemoteCommand();
+  }
+
+  public void setRemoteCommand(String remoteCommand) {
+    this.config.setRemoteCommand(remoteCommand);
+  }
+
+  public void setAlertLevel(AlertLevel level) {
+    if (this.isConnected()) {
+      this.gfManagerAgent.setAlertLevel(level.getSeverity());
+    }
+
+    this.alertLevel = level;
+  }
+
+  public AlertLevel getAlertLevel() {
+    return this.alertLevel;
+  }
+
+  public void addAlertListener(AlertListener listener) {
+    synchronized (this.alertLock) {
+      Set<AlertListener> oldListeners = this.alertListeners;
+      if (!oldListeners.contains(listener)) {
+        Set<AlertListener> newListeners = new HashSet<AlertListener>(oldListeners);
+        newListeners.add(listener);
+        this.alertListeners = newListeners;
+      }
+    }
+  }
+
+  public int getAlertListenerCount() {
+    synchronized (this.alertLock) {
+      return this.alertListeners.size();
+    }
+  }
+
+  public void removeAlertListener(AlertListener listener) {
+    synchronized (this.alertLock) {
+      Set<AlertListener> oldListeners = this.alertListeners;
+      if (oldListeners.contains(listener)) { // fixed bug 34687
+        Set<AlertListener> newListeners = new HashSet<AlertListener>(oldListeners);
+        if (newListeners.remove(listener)) {
+          this.alertListeners = newListeners;
+        }
+      }
+    }
+  }
+
+  public void addMembershipListener(SystemMembershipListener listener) {
+    synchronized (this.membershipLock) {
+      Set oldListeners = this.membershipListeners;
+      if (!oldListeners.contains(listener)) {
+        Set newListeners = new HashSet(oldListeners);
+        newListeners.add(listener);
+        this.membershipListeners = newListeners;
+      }
+    }
+  }
+
+  public void removeMembershipListener(SystemMembershipListener listener) {
+    synchronized (this.membershipLock) {
+      Set oldListeners = this.membershipListeners;
+      if (oldListeners.contains(listener)) { // fixed bug 34687
+        Set newListeners = new HashSet(oldListeners);
+        if (newListeners.remove(listener)) {
+          this.membershipListeners = newListeners;
+        }
+      }
+    }
+  }
+
+  public String getMcastAddress() {
+    return this.config.getMcastAddress();
+  }
+
+  public int getMcastPort() {
+    return this.config.getMcastPort();
+  }
+
+  public boolean getDisableTcp() {
+    return this.config.getDisableTcp();
+  }
+
+  public boolean getDisableAutoReconnect() {
+    return this.config.getDisableAutoReconnect();
+  }
+
+  public String getLocators() {
+    return this.config.getLocators();
+  }
+
+  protected void setLocators(String locators) {
+    this.config.setLocators(locators);
+  }
+
+  public String getMembershipPortRange() {
+    return this.getConfig().getMembershipPortRange();
+  }
+
+  /** get the direct-channel port to use, or zero if not set */
+  public int getTcpPort() {
+    return this.getConfig().getTcpPort();
+  }
+
+  public void setTcpPort(int port) {
+    this.getConfig().setTcpPort(port);
+  }
+
+  public void setMembershipPortRange(String membershipPortRange) {
+    this.getConfig().setMembershipPortRange(membershipPortRange);
+  }
+
+  public DistributedSystemConfig getConfig() {
+    return this.config;
+  }
+
+  /**
+   * Returns true if any members of this system are currently running.
+   */
+  public boolean isRunning() {
+    if (this.gfManagerAgent == null)
+      return false;
+    // is there a better way??
+    // this.gfManagerAgent.isConnected() ... this.gfManagerAgent.isListening()
+
+    if (isAnyMemberRunning())
+      return true;
+    return false;
+  }
+
+  /** Returns true if this system can use multicast for communications */
+  public boolean isMcastEnabled() {
+    return this.getMcastPort() > 0;
+  }
+
+  ManagedEntityController getEntityController() {
+    return this.controller;
+  }
+
+  static private final String TIMEOUT_MS_NAME = "AdminDistributedSystemImpl.TIMEOUT_MS";
+  static private final int TIMEOUT_MS_DEFAULT = 60000; // 30000 -- see bug36470
+  static private final int TIMEOUT_MS =
+      Integer.getInteger(TIMEOUT_MS_NAME, TIMEOUT_MS_DEFAULT).intValue();
+
+
+  // -------------------------------------------------------------------------
+  // Operations of this DistributedSystem
+  // -------------------------------------------------------------------------
+
+  /**
+   * Starts all managed entities in this system.
+   */
+  public void start() throws AdminException {
+    // Wait for each managed entity to start (see bug 32569)
+    DistributionLocator[] locs = getDistributionLocators();
+    for (int i = 0; i < locs.length; i++) {
+      locs[i].start();
+    }
+    for (int i = 0; i < locs.length; i++) {
+      try {
+        if (!locs[i].waitToStart(TIMEOUT_MS)) {
+          throw new AdminException(
+              LocalizedStrings.AdminDistributedSystemImpl_0_DID_NOT_START_AFTER_1_MS
+                  .toLocalizedString(new Object[] {locs[i], Integer.valueOf(TIMEOUT_MS)}));
+        }
+
+      } catch (InterruptedException ex) {
+        Thread.currentThread().interrupt();
+        throw new AdminException(
+            LocalizedStrings.AdminDistributedSystemImpl_INTERRUPTED_WHILE_WAITING_FOR_0_TO_START
+                .toLocalizedString(locs[i]),
+            ex);
+      }
+    }
+
+    CacheServer[] servers = getCacheServers();
+    for (int i = 0; i < servers.length; i++) {
+      servers[i].start();
+    }
+    for (int i = 0; i < servers.length; i++) {
+      try {
+        if (!servers[i].waitToStart(TIMEOUT_MS)) {
+          throw new AdminException(
+              LocalizedStrings.AdminDistributedSystemImpl_0_DID_NOT_START_AFTER_1_MS
+                  .toLocalizedString(new Object[] {servers[i], Integer.valueOf(TIMEOUT_MS)}));
+        }
+
+      } catch (InterruptedException ex) {
+        Thread.currentThread().interrupt();
+        throw new AdminException(
+            LocalizedStrings.AdminDistributedSystemImpl_INTERRUPTED_WHILE_WAITING_FOR_0_TO_START
+                .toLocalizedString(servers[i]),
+            ex);
+      }
+    }
+  }
+
+  /**
+   * Stops all GemFire managers that are members of this system.
+   */
+  public void stop() throws AdminException {
+    // Stop cache server before GemFire managers because the cache
+    // server might host a cache proxy that is dependent on the
+    // manager. See bug 32569.
+
+    // Wait for each managed entity to stop (see bug 32569)
+    long timeout = 30;
+
+    CacheServer[] servers = getCacheServers();
+    for (int i = 0; i < servers.length; i++) {
+      servers[i].stop();
+    }
+    for (int i = 0; i < servers.length; i++) {
+      try {
+        if (!servers[i].waitToStop(timeout * 1000)) {
+          throw new AdminException(
+              LocalizedStrings.AdminDistributedSystemImpl_0_DID_NOT_STOP_AFTER_1_SECONDS
+                  .toLocalizedString(new Object[] {servers[i], Long.valueOf(timeout)}));
+        }
+
+      } catch (InterruptedException ex) {
+        Thread.currentThread().interrupt();
+        throw new AdminException(
+            LocalizedStrings.AdminDistributedSystemImpl_INTERRUPTED_WHILE_WAITING_FOR_0_TO_STOP
+                .toLocalizedString(servers[i]),
+            ex);
+      }
+    }
+
+    DistributionLocator[] locs = getDistributionLocators();
+    for (int i = 0; i < locs.length; i++) {
+      locs[i].stop();
+    }
+    for (int i = 0; i < locs.length; i++) {
+      try {
+        if (!locs[i].waitToStop(timeout * 1000)) {
+          throw new AdminException(
+              LocalizedStrings.AdminDistributedSystemImpl_0_DID_NOT_STOP_AFTER_1_SECONDS
+                  .toLocalizedString(new Object[] {locs[i], Long.valueOf(timeout)}));
+        }
+
+      } catch (InterruptedException ex) {
+        Thread.currentThread().interrupt();
+        throw new AdminException(
+            LocalizedStrings.AdminDistributedSystemImpl_INTERRUPTED_WHILE_WAITING_FOR_0_TO_STOP
+                .toLocalizedString(locs[i]),
+            ex);
+      }
+    }
+  }
+
+  /** Display merged system member logs */
+  public String displayMergedLogs() {
+    return this.logCollator.collateLogs(this.gfManagerAgent);
+  }
+
+  /**
+   * Returns the license for this GemFire product; else null if unable to retrieve license
+   * information
+   *
+   * @return license for this GemFire product
+   */
+  public java.util.Properties getLicense() {
+    SystemMember member = findFirstRunningMember();
+    if (member != null) {
+      return new Properties();
+    } else {
+      return null;
+    }
+  }
+
+  /**
+   * Sets the distribution-related portion of the given managed entity's configuration so that the
+   * entity is part of this distributed system.
+   * 
+   * @throws AdminException TODO-javadocs
+   */
+  private void setDistributionParameters(SystemMember member) throws AdminException {
+
+    Assert.assertTrue(member instanceof ManagedSystemMemberImpl);
+
+    // set some config parms to match this system...
+    ConfigurationParameter[] configParms = new ConfigurationParameter[] {
+        new ConfigurationParameterImpl(MCAST_PORT, Integer.valueOf(this.config.getMcastPort())),
+        new ConfigurationParameterImpl(LOCATORS, this.config.getLocators()),
+        new ConfigurationParameterImpl(MCAST_ADDRESS,
+            InetAddressUtil.toInetAddress(this.config.getMcastAddress())),
+        new ConfigurationParameterImpl(DISABLE_TCP, Boolean.valueOf(this.config.getDisableTcp())),};
+    member.setConfiguration(configParms);
+  }
+
+  /**
+   * Handles an <code>ExecutionException</code> by examining its cause and throwing an appropriate
+   * runtime exception.
+   */
+  private static void handle(ExecutionException ex) {
+    Throwable cause = ex.getCause();
+
+    if (cause instanceof OperationCancelledException) {
+      // Operation was cancelled, we don't necessary want to propagate
+      // this up to the user.
+      return;
+    }
+    if (cause instanceof CancelException) { // bug 37285
+      throw new FutureCancelledException(
+          LocalizedStrings.AdminDistributedSystemImpl_FUTURE_CANCELLED_DUE_TO_SHUTDOWN
+              .toLocalizedString(),
+          ex);
+    }
+
+    // Don't just throw the cause because the stack trace can be
+    // misleading. For instance, the cause might have occurred in a
+    // different thread. In addition to the cause, we also want to
+    // know which code was waiting for the Future.
+    throw new RuntimeAdminException(
+        LocalizedStrings.AdminDistributedSystemImpl_WHILE_WAITING_FOR_FUTURE.toLocalizedString(),
+        ex);
+  }
+
+  protected void checkCancellation() {
+    DM dm = this.getDistributionManager();
+    // TODO does dm == null mean we're dead?
+    if (dm != null) {
+      dm.getCancelCriterion().checkCancelInProgress(null);
+    }
+  }
+
+  /**
+   * Returns a list of manageable SystemMember instances for each member of this distributed system.
+   *
+   * @return array of system members for each non-manager member
+   */
+  public SystemMember[] getSystemMemberApplications() throws AdminException {
+    synchronized (this.applicationSet) {
+      Collection coll = new ArrayList(this.applicationSet.size());
+      APPS: for (Iterator iter = this.applicationSet.iterator(); iter.hasNext();) {
+        Future future = (Future) iter.next();
+        // this.logger.info("DEBUG: getSystemMemberApplications: " + future);
+        for (;;) {
+          checkCancellation();
+          boolean interrupted = Thread.interrupted();
+          try {
+            coll.add(future.get());
+            break;
+          } catch (InterruptedException ex) {
+            interrupted = true;
+            continue; // keep trying
+          } catch (CancellationException ex) {
+            // this.logger.info("DEBUG: cancelled: " + future, ex);
+            continue APPS;
+          } catch (ExecutionException ex) {
+            // this.logger.info("DEBUG: executed: " + future);
+            handle(ex);
+            continue APPS;
+          } finally {
+            if (interrupted) {
+              Thread.currentThread().interrupt();
+            }
+          }
+        } // for
+      } // APPS
+      SystemMember[] array = new SystemMember[coll.size()];
+      coll.toArray(array);
+      return array;
+    }
+  }
+
+  /**
+   * Display in readable format the latest Alert in this distributed system.
+   *
+   * TODO: create an external admin api object for Alert
+   */
+  public String getLatestAlert() {
+    if (this.latestAlert == null) {
+      return "";
+    }
+    return this.latestAlert.toString();
+  }
+
+  /**
+   * Connects to the currently configured system.
+   */
+  public void connect() {
+    connect(this.logWriter);
+  }
+
+  /**
+   * Connects to the currently configured system. This method is public for internal use only
+   * (testing, for example).
+   *
+   * <p>
+   *
+   * See {@link org.apache.geode.distributed.DistributedSystem#connect} for a list of exceptions
+   * that may be thrown.
+   *
+   * @param logWriter the InternalLogWriter to use for any logging
+   */
+  public void connect(InternalLogWriter logWriter) {
+    synchronized (CONNECTION_SYNC) {
+      // Check if the gfManagerAgent is NOT null.
+      // If it is already listening, then just return since the connection is already established OR
+      // in process.
+      // Otherwise cleanup the state of AdminDistributedSystemImpl. This needs to happen
+      // automatically.
+      if (this.gfManagerAgent != null) {
+        if (this.gfManagerAgent.isListening()) {
+          if (logger.isDebugEnabled()) {
+            logger.debug(
+                "The RemoteGfManagerAgent is already listening for this AdminDistributedSystem.");
+          }
+          return;
+        }
+        this.disconnect();
+      }
+
+      if (thisAdminDS != null) { // TODO: beef up toString and add thisAdminDS
+        throw new IllegalStateException(
+            LocalizedStrings.AdminDistributedSystemImpl_ONLY_ONE_ADMINDISTRIBUTEDSYSTEM_CONNECTION_CAN_BE_MADE_AT_ONCE
+                .toLocalizedString());
+      }
+
+      thisAdminDS = this; // added for feature requests #32887
+
+      if (this.getLocators().length() == 0) {
+        this.id = this.getMcastAddress() + "[" + this.getMcastPort() + "]";
+
+      } else {
+        this.id = this.getLocators();
+      }
+
+      if (this.config instanceof DistributedSystemConfigImpl) {
+        ((DistributedSystemConfigImpl) this.config).validate();
+        ((DistributedSystemConfigImpl) this.config).setDistributedSystem(this);
+      }
+
+      // LOG: passes the AdminDistributedSystemImpl LogWriterLogger into GfManagerAgentConfig for
+      // RemoteGfManagerAgent
+      GfManagerAgent agent = GfManagerAgentFactory.getManagerAgent(buildAgentConfig(logWriter));
+      this.gfManagerAgent = agent;
+
+      // sync to prevent bug 33341 Admin API can double-represent system members
+      synchronized (this.membershipListenerLock) {
+        // build the list of applications...
+        ApplicationVM[] apps = this.gfManagerAgent.listApplications();
+        for (int i = 0; i < apps.length; i++) {
+          try {
+            nodeJoined(null, apps[i]);
+          } catch (RuntimeAdminException e) {
+            this.logWriter.warning("encountered a problem processing member " + apps[i]);
+          }
+        }
+      }
+
+      // Build admin objects for all locators (see bug 31959)
+      String locators = this.getLocators();
+      StringTokenizer st = new StringTokenizer(locators, ",");
+      NEXT: while (st.hasMoreTokens()) {
+        String locator = st.nextToken();
+        int first = locator.indexOf("[");
+        int last = locator.indexOf("]");
+        String host = locator.substring(0, first);
+        int colidx = host.lastIndexOf('@');
+        if (colidx < 0) {
+          colidx = host.lastIndexOf(':');
+        }
+        String bindAddr = null;
+        if (colidx > 0 && colidx < (host.length() - 1)) {
+          String orig = host;
+          bindAddr = host.substring(colidx + 1, host.length());
+          host = host.substring(0, colidx);
+          // if the host contains a colon and there's no '@', we probably
+          // parsed an ipv6 address incorrectly - try again
+          if (host.indexOf(':') >= 0) {
+            int bindidx = orig.lastIndexOf('@');
+            if (bindidx >= 0) {
+              host = orig.substring(0, bindidx);
+              bindAddr = orig.substring(bindidx + 1);
+            } else {
+              host = orig;
+              bindAddr = null;
+            }
+          }
+        }
+        int port = Integer.parseInt(locator.substring(first + 1, last));
+
+        synchronized (this.locatorSet) {
+          LOCATORS: for (Iterator iter = this.locatorSet.iterator(); iter.hasNext();) {
+            Future future = (Future) iter.next();
+            DistributionLocatorImpl impl = null;
+            for (;;) {
+              checkCancellation();
+              boolean interrupted = Thread.interrupted();
+              try {
+                impl = (DistributionLocatorImpl) future.get();
+                break; // success
+              } catch (InterruptedException ex) {
+                interrupted = true;
+                continue; // keep trying
+              } catch (CancellationException ex) {
+                continue LOCATORS;
+              } catch (ExecutionException ex) {
+                handle(ex);
+                continue LOCATORS;
+              } finally {
+                if (interrupted) {
+                  Thread.currentThread().interrupt();
+                }
+              }
+            } // for
+
+            DistributionLocatorConfig conf = impl.getConfig();
+
+            InetAddress host1 = InetAddressUtil.toInetAddress(host);
+            InetAddress host2 = InetAddressUtil.toInetAddress(conf.getHost());
+            if (port == conf.getPort() && host1.equals(host2)) {
+              // Already have an admin object for this locator
+              continue NEXT;
+            }
+          }
+        }
+
+        // None of the existing locators matches the locator in the
+        // string. Contact the locator to get information and create
+        // an admin object for it.
+        InetAddress bindAddress = null;
+        if (bindAddr != null) {
+          bindAddress = InetAddressUtil.toInetAddress(bindAddr);
+        }
+        DistributionLocatorConfig conf =
+            DistributionLocatorConfigImpl.createConfigFor(host, port, bindAddress);
+        if (conf != null) {
+          DistributionLocator impl = createDistributionLocatorImpl(conf);
+          synchronized (this.locatorSet) {
+            this.locatorSet.add(new FutureResult(impl));
+          }
+        }
+      }
+    }
+  }
+
+  /**
+   * Polls to determine whether or not the connection to the distributed system has been made.
+   */
+  public boolean waitToBeConnected(long timeout) throws InterruptedException {
+
+    if (Thread.interrupted())
+      throw new InterruptedException();
+
+    checkConnectCalled();
+
+    long start = System.currentTimeMillis();
+    while (System.currentTimeMillis() - start < timeout) {
+      if (this.gfManagerAgent.isInitialized()) {
+        return true;
+
+      } else {
+        Thread.sleep(100);
+      }
+    }
+
+    return this.isConnected();
+  }
+
+  /**
+   * Closes all connections and resources to the connected distributed system.
+   *
+   * @see org.apache.geode.distributed.DistributedSystem#disconnect()
+   */
+  public void disconnect() {
+    synchronized (CONNECTION_SYNC) {
+      // if (!isConnected()) {
+      // throw new IllegalStateException(this + " is not connected");
+      // }
+      // Assert.assertTrue(thisAdminDS == this);
+      if (this.logWriterAppender != null) {
+        LogWriterAppenders.stop(LogWriterAppenders.Identifier.MAIN);
+      }
+      try {
+        if (thisAdminDS == this) {
+          thisAdminDS = null;
+        }
+        if (this.gfManagerAgent != null && this.gfManagerAgent.isListening()) {
+          synchronized (this) {
+            if (this.health != null) {
+              this.health.close();
+            }
+          }
+          this.gfManagerAgent.removeJoinLeaveListener(this);
+          this.gfManagerAgent.disconnect();
+        }
+        this.gfManagerAgent = null;
+        if (this.config instanceof DistributedSystemConfigImpl) {
+          ((DistributedSystemConfigImpl) this.config).setDistributedSystem(null);
+        }
+      } finally {
+        if (logWriterAppender != null) {
+          LogWriterAppenders.destroy(LogWriterAppenders.Identifier.MAIN);
+        }
+      }
+    }
+  }
+
+  /**
+   * Returns the DistributionManager this implementation is using to connect to the distributed
+   * system.
+   */
+  public DM getDistributionManager() {
+    if (this.gfManagerAgent == null) {
+      return null;
+    }
+    return this.gfManagerAgent.getDM();
+
+  }
+
+  /**
+   * Returns the internal admin API's agent used for administering this
+   * <code>AdminDistributedSystem</code>.
+   *
+   * @since GemFire 4.0
+   */
+  public GfManagerAgent getAdminAgent() {
+    return this.gfManagerAgent;
+  }
+
+  /**
+   * Adds a new, unstarted <code>DistributionLocator</code> to this distributed system.
+   */
+  public DistributionLocator addDistributionLocator() {
+    DistributionLocatorConfig conf = new DistributionLocatorConfigImpl();
+    DistributionLocator locator = createDistributionLocatorImpl(conf);
+    synchronized (this.locatorSet) {
+      this.locatorSet.add(new FutureResult(locator));
+    }
+
+    // update locators string...
+    setLocators(parseLocatorSet());
+    return locator;
+  }
+
+  public DistributionLocator[] getDistributionLocators() {
+    synchronized (this.locatorSet) {
+      Collection coll = new ArrayList(this.locatorSet.size());
+      LOCATORS: for (Iterator iter = this.locatorSet.iterator(); iter.hasNext();) {
+        Future future = (Future) iter.next();
+        for (;;) {
+          checkCancellation();
+          boolean interrupted = Thread.interrupted();
+          try {
+            coll.add(future.get());
+            break; // success
+          } catch (InterruptedException ex) {
+            interrupted = true;
+            continue; // keep trying
+          } catch (CancellationException ex) {
+            continue LOCATORS;
+          } catch (ExecutionException ex) {
+            handle(ex);
+            continue LOCATORS;
+          } finally {
+            if (interrupted) {
+              Thread.currentThread().interrupt();
+            }
+          }
+        } // for
+      }
+
+      DistributionLocator[] array = new DistributionLocator[coll.size()];
+      coll.toArray(array);
+      return array;
+    }
+  }
+
+  /**
+   * Updates the locator string that is used to discover members of the distributed system.
+   *
+   * @see #getLocators
+   */
+  void updateLocatorsString() {
+    this.setLocators(parseLocatorSet());
+  }
+
+  protected String parseLocatorSet() {
+    StringBuffer sb = new StringBuffer();
+    LOCATORS: for (Iterator iter = this.locatorSet.iterator(); iter.hasNext();) {
+      Future future = (Future) iter.next();
+      DistributionLocator locator = null;
+      for (;;) {
+        checkCancellation();
+        boolean interrupted = Thread.interrupted();
+        try {
+          locator = (DistributionLocator) future.get();
+          break; // success
+        } catch (InterruptedException ex) {
+          interrupted = true;
+          continue; // keep trying
+        } catch (CancellationException ex) {
+          continue LOCATORS;
+        } catch (ExecutionException ex) {
+          handle(ex);
+          continue LOCATORS;
+        } finally {
+          if (interrupted) {
+            Thread.currentThread().interrupt();
+          }
+        }
+      }
+      sb.append(locator.getConfig().getHost());
+      sb.append("[").append(locator.getConfig().getPort()).append("]");
+
+      if (iter.hasNext()) {
+        sb.append(",");
+      }
+    }
+    return sb.toString();
+  }
+
+  // -------------------------------------------------------------------------
+  // Listener callback methods
+  // -------------------------------------------------------------------------
+
+  /** sync to prevent bug 33341 Admin API can double-represent system members */
+  private final Object membershipListenerLock = new Object();
+
+  // --------- org.apache.geode.internal.admin.JoinLeaveListener ---------
+  /**
+   * Listener callback for when a member has joined this DistributedSystem.
+   * <p>
+   * React by adding the SystemMember to this system's internal lists, if they are not already
+   * there. Notice that we add a {@link Future} into the list so that the admin object is not
+   * initialized while locks are held.
+   *
+   * @param source the distributed system that fired nodeJoined
+   * @param vm the VM that joined
+   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeJoined
+   */
+  public void nodeJoined(GfManagerAgent source, final GemFireVM vm) {
+    // sync to prevent bug 33341 Admin API can double-represent system members
+    synchronized (this.membershipListenerLock) {
+      // this.logger.info("DEBUG: nodeJoined: " + vm.getId(), new RuntimeException("STACK"));
+
+      // does it already exist?
+      SystemMember member = findSystemMember(vm);
+
+      // if not then create it...
+      if (member == null) {
+        // this.logger.info("DEBUG: no existing member: " + vm.getId());
+        FutureTask future = null;
+        // try {
+        if (vm instanceof ApplicationVM) {
+          final ApplicationVM app = (ApplicationVM) vm;
+          if (app.isDedicatedCacheServer()) {
+            synchronized (this.cacheServerSet) {
+              future = new AdminFutureTask(vm.getId(), new Callable() {
+                public Object call() throws Exception {
+                  logger.info(LogMarker.DM,
+                      LocalizedMessage.create(
+                          LocalizedStrings.AdminDistributedSystemImpl_ADDING_NEW_CACHESERVER_FOR__0,
+                          vm));
+                  return createCacheServer(app);
+                }
+              });
+
+              this.cacheServerSet.add(future);
+            }
+
+          } else {
+            synchronized (this.applicationSet) {
+              future = new AdminFutureTask(vm.getId(), new Callable() {
+                public Object call() throws Exception {
+                  logger.info(LogMarker.DM,
+                      LocalizedMessage.create(
+                          LocalizedStrings.AdminDistributedSystemImpl_ADDING_NEW_APPLICATION_FOR__0,
+                          vm));
+                  return createSystemMember(app);
+                }
+              });
+              this.applicationSet.add(future);
+            }
+          }
+
+        } else {
+          Assert.assertTrue(false, "Unknown GemFireVM type: " + vm.getClass().getName());
+        }
+
+        // } catch (AdminException ex) {
+        // String s = "Could not create a SystemMember for " + vm;
+        // this.logger.warning(s, ex);
+        // }
+
+        // Wait for the SystemMember to be created. We want to do this
+        // outside of the "set" locks.
+        future.run();
+        for (;;) {
+          checkCancellation();
+          boolean interrupted = Thread.interrupted();
+          try {
+            member = (SystemMember) future.get();
+            break; // success
+          } catch (InterruptedException ex) {
+            interrupted = true;
+            continue; // keep trying
+          } catch (CancellationException ex) {
+            // this.logger.info("DEBUG: run cancelled: " + future, ex);
+            return;
+          } catch (ExecutionException ex) {
+            // this.logger.info("DEBUG: run executed: " + future, ex);
+            handle(ex);
+            return;
+          } finally {
+            if (interrupted) {
+              Thread.currentThread().interrupt();
+            }
+          }
+        } // for
+
+        Assert.assertTrue(member != null);
+
+        // moved this up into the if that creates a new member to fix bug 34517
+        SystemMembershipEvent event = new SystemMembershipEventImpl(member.getDistributedMember());
+        for (Iterator iter = this.membershipListeners.iterator(); iter.hasNext();) {
+          SystemMembershipListener listener = (SystemMembershipListener) iter.next();
+          listener.memberJoined(event);
+        }
+        // } else {
+        // this.logger.info("DEBUG: found existing member: " + member);
+      }
+
+    }
+  }
+
+  /**
+   * Listener callback for when a member of this DistributedSystem has left.
+   * <p>
+   * Reacts by removing the member.
+   *
+   * @param source the distributed system that fired nodeCrashed
+   * @param vm the VM that left
+   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeLeft
+   */
+  public void nodeLeft(GfManagerAgent source, GemFireVM vm) {
+    // sync to prevent bug 33341 Admin API can double-represent system members
+    synchronized (this.membershipListenerLock) {
+      // member has left...
+      SystemMember member = AdminDistributedSystemImpl.this.removeSystemMember(vm.getId());
+      if (member == null) {
+        return; // reinstated this early-out because removal does not fix 39429
+      }
+
+      // Can't call member.getId() because it is nulled-out when the
+      // SystemMember is removed.
+      SystemMembershipEvent event = new SystemMembershipEventImpl(vm.getId());
+      for (Iterator iter = this.membershipListeners.iterator(); iter.hasNext();) {
+        SystemMembershipListener listener = (SystemMembershipListener) iter.next();
+        listener.memberLeft(event);
+      }
+    }
+  }
+
+  /**
+   * Listener callback for when a member of this DistributedSystem has crashed.
+   * <p>
+   * Reacts by removing the member.
+   *
+   * @param source the distributed system that fired nodeCrashed
+   * @param vm the VM that crashed
+   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeCrashed
+   */
+  public void nodeCrashed(GfManagerAgent source, GemFireVM vm) {
+    // sync to prevent bug 33341 Admin API can double-represent system members
+    synchronized (this.membershipListenerLock) {
+      // member has crashed...
+      SystemMember member = AdminDistributedSystemImpl.this.removeSystemMember(vm.getId());
+      if (member == null) {
+        // Unknown member crashed. Hmm...
+        return;
+      }
+
+      // Can't call member.getId() because it is nulled-out when the
+      // SystemMember is removed.
+      SystemMembershipEvent event = new SystemMembershipEventImpl(vm.getId());
+      for (Iterator iter = this.membershipListeners.iterator(); iter.hasNext();) {
+        SystemMembershipListener listener = (SystemMembershipListener) iter.next();
+        listener.memberCrashed(event);
+      }
+    }
+  }
+
+  // ----------- org.apache.geode.internal.admin.AlertListener -----------
+  /**
+   * Listener callback for when a SystemMember of this DistributedSystem has crashed.
+   *
+   * @param alert the latest alert from the system
+   * @see org.apache.geode.internal.admin.AlertListener#alert
+   */
+  public void alert(org.apache.geode.internal.admin.Alert alert) {
+    if (AlertLevel.forSeverity(alert.getLevel()).ordinal < alertLevel.ordinal) {
+      return;
+    }
+    Alert alert2 = new AlertImpl(alert);
+    this.latestAlert = alert2;
+    for (Iterator<AlertListener> iter = this.alertListeners.iterator(); iter.hasNext();) {
+      AlertListener listener = iter.next();
+      listener.alert(alert2);
+    }
+  }
+
+  public void onDisconnect(InternalDistributedSystem sys) {
+    logger.debug("Calling AdminDistributedSystemImpl#onDisconnect");
+    disconnect();
+    logger.debug("Completed AdminDistributedSystemImpl#onDisconnect");
+  }
+
+  // -------------------------------------------------------------------------
+  // Template methods overriden from superclass...
+  // -------------------------------------------------------------------------
+
+  protected CacheServer createCacheServer(ApplicationVM member) throws AdminException {
+
+    return new CacheServerImpl(this, member);
+  }
+
+  protected CacheServer createCacheServer(CacheServerConfigImpl conf) throws AdminException {
+
+    return new CacheServerImpl(this, conf);
+  }
+
+  /**
+   * Override createSystemMember by instantiating SystemMemberImpl
+   * 
+   * @throws AdminException TODO-javadocs
+   */
+  protected SystemMember createSystemMember(ApplicationVM app) throws AdminException {
+    return new SystemMemberImpl(this, app);
+  }
+
+  /**
+   * Constructs & returns a SystemMember instance using the corresponding InternalDistributedMember
+   * object.
+   * 
+   * @param member InternalDistributedMember instance for which a SystemMember instance is to be
+   *        constructed.
+   * @return constructed SystemMember instance
+   * @throws AdminException if construction of SystemMember instance fails
+   * @since GemFire 6.5
+   */
+  protected SystemMember createSystemMember(InternalDistributedMember member)
+      throws AdminException {
+    return new SystemMemberImpl(this, member);
+  }
+
+  /**
+   * Template-method for creating a new <code>DistributionLocatorImpl</code> instance.
+   */
+  protected DistributionLocatorImpl createDistributionLocatorImpl(DistributionLocatorConfig conf) {
+    return new DistributionLocatorImpl(conf, this);
+  }
+
+  // -------------------------------------------------------------------------
+  // Non-public implementation methods... TODO: narrow access levels
+  // -------------------------------------------------------------------------
+
+  // TODO: public void connect(...) could stand to have some internals factored out
+
+  /**
+   * Returns List of Locators including Locators or Multicast.
+   *
+   * @return list of locators or multicast values
+   */
+  protected List parseLocators() {
+
+    // assumes host[port] format, delimited by ","
+    List locatorIds = new ArrayList();
+    if (isMcastEnabled()) {
+      String mcastId = new StringBuffer(this.getMcastAddress()).append("[")
+          .append(this.getMcastPort()).append("]").toString();
+      locatorIds.add(new DistributionLocatorId(mcastId));
+    }
+    StringTokenizer st = new StringTokenizer(this.getLocators(), ",");
+    while (st.hasMoreTokens()) {
+      locatorIds.add(new DistributionLocatorId(st.nextToken()));
+    }
+
+    if (logger.isDebugEnabled()) {
+      StringBuffer sb = new StringBuffer("Locator set is: ");
+      for (Iterator iter = locatorIds.iterator(); iter.hasNext();) {
+        sb.append(iter.next());
+        sb.append(" ");
+      }
+      logger.debug(sb);
+    }
+
+    return locatorIds;
+  }
+
+  /**
+   * Returns whether or not a <code>SystemMember</code> corresponds to a <code>GemFireVM</code>.
+   *
+   * @param examineConfig Should we take the configuration of the member into consideration? In
+   *        general, we want to consider the configuration when a member starts up. But when we are
+   *        notified that it has shut down, we do not want to examine the configuration because that
+   *        might involve contacting the member. Which, of course, cannot be done because it has
+   *        shut down.
+   */
+  private boolean isSame(SystemMemberImpl member, GemFireVM vm, boolean examineConfig) {
+    if (vm.equals(member.getGemFireVM())) {
+      return true;
+    }
+
+    InternalDistributedMember memberId = member.getInternalId();
+    InternalDistributedMember vmId = vm.getId();
+
+    if (vmId.equals(memberId)) {
+      return true;
+    }
+
+    if ((member instanceof ManagedSystemMemberImpl) && examineConfig) {
+
+      // We can't compare information about managers because the
+      // member might have already gone away. Attempts to send it
+      // messages (to get its product directory, for instance) will
+      // time out.
+
+      ManagedSystemMemberImpl entity = (ManagedSystemMemberImpl) member;
+
+      // Make sure that the type of the managed entity matches the
+      // type of the internal admin object.
+      if (entity instanceof CacheServer) {
+        if (!(vm instanceof ApplicationVM)) {
+          return false;
+        }
+
+        ApplicationVM app = (ApplicationVM) vm;
+        if (!app.isDedicatedCacheServer()) {
+          return false;
+        }
+      }
+
+      ManagedEntityConfig conf = entity.getEntityConfig();
+      InetAddress managedHost = InetAddressUtil.toInetAddress(conf.getHost());
+      File managedWorkingDir = new File(conf.getWorkingDirectory());
+      File managedProdDir = new File(conf.getProductDirectory());
+
+      InetAddress vmHost = vm.getHost();
+      File vmWorkingDir = vm.getWorkingDirectory();
+      File vmProdDir = vm.getGemFireDir();
+
+      if (vmHost.equals(managedHost) && isSameFile(vmWorkingDir, managedWorkingDir)
+          && isSameFile(vmProdDir, managedProdDir)) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+  /**
+   * Returns whether or not the names of the two files represent the same file.
+   */
+  private boolean isSameFile(File file1, File file2) {
+    if (file1.equals(file2)) {
+      return true;
+    }
+
+    if (file1.getAbsoluteFile().equals(file2.getAbsoluteFile())) {
+      return true;
+    }
+
+    try {
+      if (file1.getCanonicalFile().equals(file2.getCanonicalFile())) {
+        return true;
+      }
+
+      // StringBuffer sb = new StringBuffer();
+      // sb.append("File 1: ");
+      // sb.append(file1);
+      // sb.append("\nFile 2: ");
+      // sb.append(file2);
+      // sb.append("\n Absolute 1: ");
+      // sb.append(file1.getAbsoluteFile());
+      // sb.append("\n Absolute 2: ");
+      // sb.append(file2.getAbsoluteFile());
+      // sb.append("\n Canonical 1: ");
+      // sb.append(file1.getCanonicalFile());
+      // sb.append("\n Canonical 2: ");
+      // sb.append(file2.getCanonicalFile());
+      // logger.info(sb.toString());
+
+    } catch (IOException ex) {
+      // oh well...
+      logger.info(LocalizedMessage
+          .create(LocalizedStrings.AdminDistributedSystemImpl_WHILE_GETTING_CANONICAL_FILE), ex);
+    }
+
+    return false;
+  }
+
+  /**
+   * Finds and returns the <code>SystemMember</code> that corresponds to the given
+   * <code>GemFireVM</code> or <code>null</code> if no <code>SystemMember</code> corresponds.
+   */
+  protected SystemMember findSystemMember(GemFireVM vm) {
+    return findSystemMember(vm, true);
+  }
+
+  /**
+   * Finds and returns the <code>SystemMember</code> that corresponds to the given
+   * <code>GemFireVM</code> or <code>null</code> if no Finds and returns the
+   * <code>SystemMember</code> that corresponds to the given <code>GemFireVM</code> or
+   * <code>null</code> if no <code>SystemMember</code> corresponds.
+   * 
+   * 
+   * @param vm GemFireVM instance
+   * @param compareConfig Should the members' configurations be compared? <code>true</code> when the
+   *        member has joined, <code>false</code> when the member has left Should the members'
+   *        configurations be compared? <code>true</code> when the member has joined,
+   *        <code>false</code> when the member has left. Additionally also used to check if system
+   *        member config is to be synchronized with the VM.
+   */
+  protected SystemMember findSystemMember(GemFireVM vm, boolean compareConfig) {
+
+    SystemMemberImpl member = null;
+
+    synchronized (this.cacheServerSet) {
+      SERVERS: for (Iterator iter = this.cacheServerSet.iterator(); iter.hasNext();) {
+        Future future = (Future) iter.next();
+        CacheServerImpl cacheServer = null;
+        for (;;) {
+          checkCancellation();
+          boolean interrupted = Thread.interrupted();
+          try {
+            cacheServer = (CacheServerImpl) future.get();
+            break; // success
+          } catch (InterruptedException ex) {
+            interrupted = true;
+            continue; // keep trying
+          } catch (CancellationException ex) {
+            continue SERVERS;
+          } catch (ExecutionException ex) {
+            handle(ex);
+            continue SERVERS;
+          } finally {
+            if (interrupted) {
+              Thread.currentThread().interrupt();
+            }
+          }
+        } // for
+
+        if (isSame(cacheServer, vm, compareConfig)) {
+          member = cacheServer;
+          break;
+        }
+      }
+    }
+
+    if (member == null) {
+      synchronized (this.applicationSet) {
+        APPS: for (Iterator iter = this.applicationSet.iterator(); iter.hasNext();) {
+          Future future = (Future) iter.next();
+          SystemMemberImpl application = null;
+          for (;;) {
+            checkCancellation();
+            boolean interrupted = Thread.interrupted();
+            try {
+              application = (SystemMemberImpl) future.get();
+              break; // success
+            } catch (InterruptedException ex) {
+              interrupted = true;
+              continue; // keep trying
+            } catch (CancellationException ex) {
+              continue APPS;
+            } catch (ExecutionException ex) {
+              handle(ex);
+              continue APPS;
+            } finally {
+              if (interrupted) {
+                Thread.currentThread().interrupt();
+              }
+            }
+          } // for
+
+          if (isSame(application, vm, compareConfig)) {
+            member = application;
+            break;
+          }
+        } // APPS
+      }
+    }
+
+    if (member != null && compareConfig) {
+      try {
+        member.setGemFireVM(vm);
+
+      } catch (AdminException ex) {
+        logger.warn(LocalizedMessage
+            .create(LocalizedStrings.AdminDistributedSystem_COULD_NOT_SET_THE_GEMFIRE_VM), ex);
+      }
+    }
+
+    return member;
+  }
+
+  /**
+   * Removes a SystemMember from this system's list of known members.
+   *
+   * @param systemMember the member to remove
+   * @return the system member that was removed; null if no match was found
+   */
+  protected SystemMember removeSystemMember(SystemMember systemMember) {
+    return removeSystemMember(((SystemMemberImpl) systemMember).getInternalId());
+  }
+
+  /**
+   * Removes a SystemMember from this system's list of known members. This method is called in
+   * response to a member leaving the system. TODO: this method is a mess of defns
+   *
+   * @param internalId the unique id that specifies which member to remove
+   * @return the system member that was removed; null if no match was found
+   */
+  protected SystemMember removeSystemMember(InternalDistributedMember internalId) {
+    if (internalId == null)
+      return null;
+
+    // this.logger.info("DEBUG: removeSystemMember: " + internalId, new RuntimeException("STACK"));
+
+    boolean found = false;
+    SystemMemberImpl member = null;
+
+    synchronized (this.cacheServerSet) {
+      SERVERS: for (Iterator iter = this.cacheServerSet.iterator(); iter.hasNext() && !found;) {
+        Future future = (Future) iter.next();
+        if (future instanceof AdminFutureTask) {
+          AdminFutureTask task = (AdminFutureTask) future;
+          if (task.getMemberId().equals(internalId)) {
+            // this.logger.info("DEBUG: removeSystemMember cs cancelling: " + future);
+            future.cancel(true);
+
+          } else {
+            // This is not the member we are looking for...
+            continue SERVERS;
+          }
+        }
+        for (;;) {
+          checkCancellation();
+          boolean interrupted = Thread.interrupted();
+          try {
+            member = (SystemMemberImpl) future.get();
+            break; // success
+          } catch (InterruptedException ex) {
+            interrupted = true;
+            continue; // keep trying
+          } catch (CancellationException ex) {
+            continue SERVERS;
+          } catch (ExecutionException ex) {
+            handle(ex);
+            return null; // Dead code
+          } finally {
+            if (interrupted) {
+              Thread.currentThread().interrupt();
+            }
+          }
+        }
+
+        InternalDistributedMember cacheServerId = member.getInternalId();
+        if (internalId.equals(cacheServerId)) {
+          // found a match...
+          iter.remove();
+          found = true;
+        }
+      } // SERVERS
+    }
+
+    synchronized (this.applicationSet) {
+      for (Iterator iter = this.applicationSet.iterator(); iter.hasNext() && !found;) {
+        Future future = (Future) iter.next();
+        try {
+          if (future instanceof AdminFutureTask) {
+            AdminFutureTask task = (AdminFutureTask) future;
+            if (task.getMemberId().equals(internalId)) {
+              iter.remove(); // Only remove applications
+              found = true;
+              if (future.isDone()) {
+                member = (SystemMemberImpl) future.get();
+              }
+              break;
+            } else {
+              // This is not the member we are looking for...
+              continue;
+            }
+          }
+          if (future.isDone()) {
+            member = (SystemMemberImpl) future.get();
+          } else {
+            // this.logger.info("DEBUG: removeSystemMember as cancelling: " + future);
+            future.cancel(true);
+          }
+
+        } catch (InterruptedException ex) {
+          Thread.currentThread().interrupt();
+          checkCancellation();
+          throw new RuntimeException(
+              LocalizedStrings.AdminDistributedSystemImpl_INTERRUPTED.toLocalizedString(), ex);
+
+        } catch (CancellationException ex) {
+          continue;
+
+        } catch (ExecutionException ex) {
+          handle(ex);
+          return null; // Dead code
+        }
+
+        InternalDistributedMember applicationId = member.getInternalId();
+        if (internalId.equals(applicationId)) {
+          // found a match...
+          iter.remove(); // Only remove applications
+          found = true;
+        }
+      }
+    }
+
+    if (found) {
+      try {
+        if (member != null) {
+          member.setGemFireVM(null);
+        }
+
+      } catch (AdminException ex) {
+        logger.fatal(LocalizedMessage
+            .create(LocalizedStrings.AdminDistributedSystem_UNEXPECTED_ADMINEXCEPTION), ex);
+      }
+      return member;
+
+    } else {
+      if (logger.isDebugEnabled()) {
+        logger.debug("Couldn't remove member {}", internalId);
+      }
+      return null;
+    }
+  }
+
+  /**
+   * Builds the configuration needed to connect to a GfManagerAgent which is the main gateway into
+   * the internal.admin api. GfManagerAgent is used to actually connect to the distributed gemfire
+   * system.
+   *
+   * @param logWriter the LogWriterI18n to use for any logging
+   * @return the configuration needed to connect to a GfManagerAgent
+   */
+  // LOG: saves LogWriterLogger from AdminDistributedSystemImpl for RemoteGfManagerAgentConfig
+  private GfManagerAgentConfig buildAgentConfig(InternalLogWriter logWriter) {
+    RemoteTransportConfig conf = new RemoteTransportConfig(isMcastEnabled(), getDisableTcp(),
+        getDisableAutoReconnect(), getBindAddress(), buildSSLConfig(), parseLocators(),
+        getMembershipPortRange(), getTcpPort(), DistributionManager.ADMIN_ONLY_DM_TYPE);
+    return new GfManagerAgentConfig(getSystemName(), conf, logWriter, this.alertLevel.getSeverity(),
+        this, this);
+  }
+
+  protected SSLConfig buildSSLConfig() {
+    SSLConfig conf = new SSLConfig();
+    if (getConfig() != null) {
+      conf.setEnabled(getConfig().isSSLEnabled());
+      conf.setProtocols(getConfig().getSSLProtocols());
+      conf.setCiphers(getConfig().getSSLCiphers());
+      conf.setRequireAuth(getConfig().isSSLAuthenticationRequired());
+      conf.setProperties(getConfig().getSSLProperties());
+    }
+    return conf;
+  }
+
+  /**
+   * Returns the currently configured address to bind to when administering this system.
+   */
+  private String getBindAddress() {
+    return this.config.getBindAddress();
+  }
+
+  /** Returns whether or not the given member is running */
+  private boolean isRunning(SystemMember member) {
+    if (member instanceof ManagedEntity) {
+      return ((ManagedEntity) member).isRunning();
+
+    } else {
+      // member must be an application VM. It is running
+      return true;
+    }
+  }
+
+  /** Returns any member manager that is known to be running */
+  private SystemMember findFirstRunningMember() {
+    synchronized (this.cacheServerSet) {
+      SERVERS: for (Iterator iter = this.cacheServerSet.iterator(); iter.hasNext();) {
+        Future future = (Future) iter.next();
+        SystemMember member = null;
+        for (;;) {
+          checkCancellation();
+          boolean interrupted = Thread.interrupted();
+          try {
+            member = (SystemMember) future.get();
+            break; // success
+          } catch (InterruptedException ex) {
+            interrupted = true;
+            continue; // keep trying
+          } catch (CancellationException ex) {
+            continue SERVERS;
+          } catch (ExecutionException ex) {
+            handle(ex);
+            return null; // Dead code
+          } finally {
+            if (interrupted) {
+              Thread.currentThread().interrupt();
+            }
+          }
+        } // for
+
+        if (isRunning(member)) {
+          return member;
+        }
+      }
+    }
+
+    synchronized (this.applicationSet) {
+      APPS: for (Iterator iter = this.applicationSet.iterator(); iter.hasNext();) {
+        Future future = (Future) iter.next();
+        SystemMember member = null;
+        for (;;) {
+          checkCancellation();
+          boolean interrupted = Thread.interrupted();
+          try {
+            member = (SystemMember) future.get();
+            break; // success
+          } catch (InterruptedException ex) {
+            interrupted = true;
+            continue; // keep trying
+          } catch (CancellationException ex) {
+            continue APPS;
+          } catch (ExecutionException ex) {
+            handle(ex);
+            return null; // Dead code
+          } finally {
+            if (interrupted) {
+              Thread.currentThread().interrupt();
+            }
+          }
+        } // for
+
+        if (isRunning(member)) {
+          return member;
+        }
+      } // APPS
+    }
+
+    return null;
+  }
+
+  /**
+   * Returns the instance of system member that is running either as a CacheVm or only ApplicationVm
+   * for the given string representation of the id.
+   * 
+   * @param memberId string representation of the member identifier
+   * @return instance of system member which could be either as a CacheVm or Application VM
+   */
+  protected SystemMember findCacheOrAppVmById(String memberId) {
+    SystemMember found = null;
+
+    if (memberId != null) {
+      try {
+        boolean foundSender = false;
+        CacheVm[] cacheVms = getCacheVms();
+
+        /*
+         * cacheVms could be null. See AdminDistributedSystemImpl.getCacheVmsCollection() for
+         * ExecutionException
+         */
+        if (cacheVms != null) {
+          for (CacheVm cacheVm : cacheVms) {
+            if (cacheVm.getId().equals(memberId) && cacheVm instanceof CacheVm) {
+              found = (SystemMember) cacheVm;
+              foundSender = true;
+              break;
+            }
+          }
+        }
+
+        if (!foundSender) {
+          SystemMember[] appVms = getSystemMemberApplications();
+
+          for (SystemMember appVm : appVms) {
+            if (appVm.getId().equals(memberId) && appVm instanceof SystemMember) {
+              found = (SystemMember) appVm;
+              foundSender = true;
+              break;
+            }
+          }
+
+        }
+      } catch (AdminException e) {
+        if (logger.isDebugEnabled()) {
+          logger.debug("Could not find System Member for member id: {}", memberId, e);
+        }
+      }
+    }
+
+    return found;
+  }
+
+  /** Returns true if any member application is known to be running */
+  protected boolean isAnyMemberRunning() {
+    return findFirstRunningMember() != null;
+  }
+
+  // -------------------------------------------------------------------------
+  // Health methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Lazily initializes the GemFire health monitor
+   *
+   * @see #createGemFireHealth
+   */
+  public final GemFireHealth getGemFireHealth() {
+    synchronized (this) {
+      if (this.health == null || this.health.isClosed()) {
+        try {
+          this.health = createGemFireHealth(this.gfManagerAgent);
+
+        } catch (AdminException ex) {
+          throw new RuntimeAdminException(
+              LocalizedStrings.AdminDistributedSystemImpl_AN_ADMINEXCEPTION_WAS_THROWN_WHILE_GETTING_THE_GEMFIRE_HEALTH
+                  .toLocalizedString(),
+              ex);
+        }
+      }
+
+      return this.health;
+    }
+  }
+
+  /**
+   * A "template factory" method for creating an instance of <code>GemFireHealth</code>. It can be
+   * overridden by subclasses to produce instances of different <code>GemFireHealth</code>
+   * implementations.
+   *
+   * @see #getGemFireHealth
+   */
+  protected GemFireHealth createGemFireHealth(GfManagerAgent agent) throws AdminException {
+
+    if (agent == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.AdminDistributedSystemImpl_GFMANAGERAGENT_MUST_NOT_BE_NULL
+              .toLocalizedString());
+    }
+    return new GemFireHealthImpl(agent, this);
+  }
+
+  public CacheVm addCacheVm() throws AdminException {
+    return (CacheVm) addCacheServer();
+  }
+
+  public CacheServer addCacheServer() throws AdminException {
+    CacheServerConfigImpl conf = new CacheServerConfigImpl();
+    CacheServer server = createCacheServer(conf);
+    setDistributionParameters(server);
+
+    synchronized (this.cacheServerSet) {
+      this.cacheServerSet.add(new FutureResult(server));
+    }
+
+    return server;
+  }
+
+  private Collection getCacheVmsCollection() throws AdminException {
+    synchronized (this.cacheServerSet) {
+      Collection coll = new ArrayList(this.cacheServerSet.size());
+      SERVERS: for (Iterator iter = this.cacheServerSet.iterator(); iter.hasNext();) {
+        Future future = (Future) iter.next();
+        Object get = null;
+        for (;;) {
+          checkCancellation();
+          boolean interrupted = Thread.interrupted();
+          try {
+            get = future.get();
+            break; // success
+          } catch (InterruptedException ex) {
+            interrupted = true;
+            continue; // keep trying
+          } catch (CancellationException ex) {
+            continue SERVERS;
+          } catch (ExecutionException ex) {
+            handle(ex);
+            return null; // Dead code
+          } finally {
+            if (interrupted) {
+              Thread.currentThread().interrupt();
+            }
+          }
+        } // for
+        coll.add(get);
+      } // SERVERS
+      return coll;
+    }
+  }
+
+  /**
+   * Returns all the cache server members of the distributed system which are hosting a client queue
+   * for the particular durable-client having the given durableClientId
+   * 
+   * @param durableClientId - durable-id of the client
+   * @return array of CacheServer(s) having the queue for the durable client
+   * @throws AdminException
+   * 
+   * @since GemFire 5.6
+   */
+  public CacheServer[] getCacheServers(String durableClientId) throws AdminException {
+    Collection serversForDurableClient = new ArrayList();
+    CacheServer[] servers = getCacheServers();
+
+    for (int i = 0; i < servers.length; i++) {
+      RemoteApplicationVM vm = (RemoteApplicationVM) ((CacheServerImpl) servers[i]).getGemFireVM();
+      if (vm != null && vm.hasDurableClient(durableClientId)) {
+        serversForDurableClient.add(servers[i]);
+      }
+    }
+    CacheServer[] array = new CacheServer[serversForDurableClient.size()];
+    serversForDurableClient.toArray(array);
+    return array;
+  }
+
+  public CacheVm[] getCacheVms() throws AdminException {
+    Collection coll = getCacheVmsCollection();
+    if (coll == null)
+      return null;
+    CacheVm[] array = new CacheVm[coll.size()];
+    coll.toArray(array);
+    return array;
+  }
+
+  public CacheServer[] getCacheServers() throws AdminException {
+    Collection coll = getCacheVmsCollection();
+    if (coll == null)
+      return null;
+    CacheServer[] array = new CacheServer[coll.size()];
+    coll.toArray(array);
+    return array;
+  }
+
+  // -------------------------------------------------------------------------
+  // Overriden java.lang.Object methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Returns a string representation of the object.
+   * 
+   * @return a string representation of the object
+   */
+  @Override // GemStoneAddition
+  public String toString() {
+    return getName();
+  }
+
+  /**
+   * returns instance of AdminDistributedSystem that is current connected. See
+   * <code>thisAdminDS</code>. (for feature requests #32887)
+   * <p>
+   * TODO: remove this static method during reimplementation of
+   * {@link SystemMemberCacheEventProcessor}
+   * 
+   * @return AdminDistributedSystem
+   */
+  public static AdminDistributedSystemImpl getConnectedInstance() {
+    synchronized (CONNECTION_SYNC) {
+      return thisAdminDS;
+    }
+  }
+
+  public void addCacheListener(SystemMemberCacheListener listener) {
+    synchronized (this.cacheListLock) {
+      // never modify cacheListeners in place.
+      // this allows iteration without concurrent mod worries
+      List oldListeners = this.cacheListeners;
+      if (!oldListeners.contains(listener)) {
+        List newListeners = new ArrayList(oldListeners);
+        newListeners.add(listener);
+        this.cacheListeners = newListeners;
+      }
+    }
+  }
+
+  public void removeCacheListener(SystemMemberCacheListener listener) {
+    synchronized (this.cacheListLock) {
+      List oldListeners = this.cacheListeners;
+      if (oldListeners.contains(listener)) {
+        List newListeners = new ArrayList(oldListeners);
+        if (newListeners.remove(listener)) {
+          if (newListeners.isEmpty()) {
+            newListeners = Collections.EMPTY_LIST;
+          }
+          this.cacheListeners = newListeners;
+        }
+      }
+    }
+  }
+
+  public List getCacheListeners() {
+    return this.cacheListeners;
+  }
+
+  public SystemMember lookupSystemMember(DistributedMember distributedMember)
+      throws AdminException {
+    if (distributedMember == null)
+      return null;
+    SystemMember[] members = getSystemMemberApplications();
+    for (int i = 0; i < members.length; i++) {
+      if (distributedMember.equals(members[i].getDistributedMember())) {
+        return members[i];
+      }
+    }
+    return null;
+  }
+
+  //////////////////////// Inner Classes ////////////////////////
+
+  /**
+   * Object that converts an <code>internal.admin.Alert</code> into an external
+   * <code>admin.Alert</code>.
+   */
+  public class AlertImpl implements Alert {
+    /** The Alert to which most behavior is delegated */
+    private final org.apache.geode.internal.admin.Alert alert;
+    private SystemMember systemMember;
+
+    /////////////////////// Constructors ///////////////////////
+
+    /**
+     * Creates a new <code>Alert</code> that delegates to the given object.
+     */
+    AlertImpl(org.apache.geode.internal.admin.Alert alert) {
+      this.alert = alert;
+      GemFireVM vm = alert.getGemFireVM();
+
+      /*
+       * Related to #39657. Avoid setting GemFireVM again in the system member. Eager initialization
+       * of member variable - systemMember.
+       */
+      this.systemMember = vm == null ? null : findSystemMember(vm, false);
+      if (this.systemMember == null) {
+        /*
+         * try to use sender information to construct the SystemMember that can be used for disply
+         * purpose at least
+         */
+        InternalDistributedMember sender = alert.getSender();
+        if (sender != null) {
+          try {
+            this.systemMember = AdminDistributedSystemImpl.this.createSystemMember(sender);
+          } catch (AdminException e) {
+            /*
+             * AdminException might be thrown if creation of System Member instance fails.
+             */
+            this.systemMember = null;
+          }
+        } // else this.systemMember will be null
+      }
+    }
+
+    ////////////////////// Instance Methods //////////////////////
+
+    public AlertLevel getLevel() {
+      return AlertLevel.forSeverity(alert.getLevel());
+    }
+
+    /*
+     * Eager initialization of system member is done while creating this alert only.
+     */
+    public SystemMember getSystemMember() {
+      return systemMember;
+    }
+
+    public String getConnectionName() {
+      return alert.getConnectionName();
+    }
+
+    public String getSourceId() {
+      return alert.getSourceId();
+    }
+
+    public String getMessage() {
+      return alert.getMessage();
+    }
+
+    public java.util.Date getDate() {
+      return alert.getDate();
+    }
+
+    @Override
+    public String toString() {
+      return alert.toString();
+    }
+  }
+
+  /**
+   * A JSR-166 <code>FutureTask</code> whose {@link #get} method properly handles an
+   * <code>ExecutionException</code> that wraps an <code>InterruptedException</code>. This is
+   * necessary because there are places in the admin API that wrap
+   * <code>InterruptedException</code>s. See bug 32634.
+   *
+   * <P>
+   *
+   * This is by no means an ideal solution to this problem. It would be better to modify the code
+   * invoked by the <code>Callable</code> to explicitly throw <code>InterruptedException</code>.
+   */
+  static class AdminFutureTask extends FutureTask {
+
+    /**
+     * The id of the member whose admin object we are creating. Keeping track of this allows us to
+     * cancel a FutureTask for a member that has gone away.
+     */
+    private final InternalDistributedMember memberId;
+
+    public AdminFutureTask(InternalDistributedMember memberId, Callable callable) {
+      super(callable);
+      this.memberId = memberId;
+    }
+
+    /**
+     * Returns the id of the member of the distributed system for which this <code>FutureTask</code>
+     * is doing work.
+     */
+    public InternalDistributedMember getMemberId() {
+      return this.memberId;
+    }
+
+    /**
+     * If the <code>ExecutionException</code> is caused by an <code>InterruptedException</code>,
+     * throw the <code>CancellationException</code> instead.
+     */
+    @Override
+    public Object get() throws InterruptedException, ExecutionException {
+
+      if (Thread.interrupted())
+        throw new InterruptedException();
+      try {
+        return super.get();
+
+      } catch (ExecutionException ex) {
+        for (Throwable cause = ex.getCause(); cause != null; cause = cause.getCause()) {
+          if (cause instanceof InterruptedException) {
+            // We interrupted the runnable but we don't want the thread
+            // that called get to think he was interrupted.
+            CancellationException ex2 = new CancellationException(
+                LocalizedStrings.AdminDistributedSystemImpl_BY_INTERRUPT.toLocalizedString());
+            ex2.setStackTrace(cause.getStackTrace());
+            throw ex2;
+          }
+        }
+
+        throw ex;
+      }
+
+    }
+
+  }
+
+  public DistributedMember getDistributedMember() {
+    return getDistributionManager().getId();
+  }
+
+  private void connectAdminDS() {
+    connect((InternalLogWriter) this.logWriter);
+    try {
+      thisAdminDS.waitToBeConnected(3000);
+    } catch (InterruptedException ie) {
+      logger.warn("Interrupted while waiting to connect", ie);
+    }
+  }
+
+  public Set<PersistentID> getMissingPersistentMembers() throws AdminException {
+    connectAdminDS();
+    DM dm = getDistributionManager();
+    if (dm == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
+              .toLocalizedString());
+    }
+    return getMissingPersistentMembers(dm);
+  }
+
+  public static Set<PersistentID> getMissingPersistentMembers(DM dm) {
+    return MissingPersistentIDsRequest.send(dm);
+  }
+
+  public void revokePersistentMember(InetAddress host, String directory) throws AdminException {
+    connectAdminDS();
+    DM dm = getDistributionManager();
+    if (dm == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
+              .toLocalizedString());
+    }
+    revokePersistentMember(dm, host, directory);
+
+  }
+
+  public void revokePersistentMember(UUID diskStoreID) throws AdminException {
+    connectAdminDS();
+    DM dm = getDistributionManager();
+    if (dm == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
+              .toLocalizedString());
+    }
+    revokePersistentMember(dm, diskStoreID);
+
+  }
+
+  public static void revokePersistentMember(DM dm, UUID diskStoreID) {
+    PersistentMemberPattern pattern = new PersistentMemberPattern(diskStoreID);
+    boolean success = false;
+    try {
+      // make sure that the disk store we're revoking is actually missing
+      boolean found = false;
+      Set<PersistentID> details = getMissingPersistentMembers(dm);
+      if (details != null) {
+        for (PersistentID id : details) {
+          if (id.getUUID().equals(diskStoreID)) {
+            found = true;
+            break;
+          }
+        }
+      }
+      if (!found) {
+        return;
+      }
+
+      // Fix for 42607 - verify that the persistent id is not already
+      // running before revoking it.
+      PrepareRevokePersistentIDRequest.send(dm, pattern);
+      success = true;
+    } finally {
+      if (success) {
+        // revoke the persistent member if were able to prepare the revoke
+        RevokePersistentIDRequest.send(dm, pattern);
+      } else {
+        // otherwise, cancel the revoke.
+        PrepareRevokePersistentIDRequest.cancel(dm, pattern);
+      }
+    }
+  }
+
+  /**
+   * 
+   * @deprecated use {@link #revokePersistentMember(UUID)} instead
+   */
+  public static void revokePersistentMember(DM dm, InetAddress host, String directory) {
+
+    PersistentMemberPattern pattern =
+        new PersistentMemberPattern(host, directory, System.currentTimeMillis());
+    boolean success = false;
+    try {
+      // Fix for 42607 - verify that the persistent id is not already
+      // running before revoking it.
+      PrepareRevokePersistentIDRequest.send(dm, pattern);
+      success = true;
+    } finally {
+      if (success) {
+        // revoke the persistent member if were able to prepare the revoke
+        RevokePersistentIDRequest.send(dm, pattern);
+      } else {
+        // otherwise, cancel the revoke.
+        PrepareRevokePersistentIDRequest.cancel(dm, pattern);
+      }
+    }
+  }
+
+  public Set shutDownAllMembers() throws AdminException {
+    return shutDownAllMembers(0);
+  }
+
+  public Set shutDownAllMembers(long timeout) throws AdminException {
+    connectAdminDS();
+    DM dm = getDistributionManager();
+    if (dm == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
+              .toLocalizedString());
+    }
+    return shutDownAllMembers(dm, timeout);
+  }
+
+  /**
+   * Shutdown all members.
+   * 
+   * @param dm
+   * @param timeout the amount of time (in ms) to spending trying to shutdown the members
+   *        gracefully. After this time period, the members will be forceable shut down. If the
+   *        timeout is exceeded, persistent recovery after the shutdown may need to do a GII. -1
+   *        indicates that the shutdown should wait forever.
+   */
+  public static Set shutDownAllMembers(DM dm, long timeout) {
+    return ShutdownAllRequest.send(dm, timeout);
+  }
+
+  public BackupStatus backupAllMembers(File targetDir) throws AdminException {
+    return backupAllMembers(targetDir, null);
+  }
+
+  public BackupStatus backupAllMembers(File targetDir, File baselineDir) throws AdminException {
+    connectAdminDS();
+    DM dm = getDistributionManager();
+    if (dm == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
+              .toLocalizedString());
+    }
+    return backupAllMembers(dm, targetDir, baselineDir);
+  }
+
+  public static BackupStatus backupAllMembers(DM dm, File targetDir, File baselineDir)
+      throws AdminException {
+    BackupStatus status = null;
+    if (BackupDataStoreHelper.obtainLock(dm)) {
+      try {
+        Set<PersistentID> missingMembers = getMissingPersistentMembers(dm);
+        Set recipients = dm.getOtherDistributionManagerIds();
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
+        targetDir = new File(targetDir, format.format(new Date()));
+        BackupDataStoreResult result =
+            BackupDataStoreHelper.backupAllMembers(dm, recipients, targetDir, baselineDir);
+
+        // It's possible that when calling getMissingPersistentMembers, some members are
+        // still creating/recovering regions, and at FinishBackupRequest.send, the
+        // regions at the members are ready. Logically, since the members in successfulMembers
+        // should override the previous missingMembers
+        for (Set<PersistentID> onlineMembersIds : result.getSuccessfulMembers().values()) {
+          missingMembers.removeAll(onlineMembersIds);
+        }
+
+        result.getExistingDataStores().keySet().removeAll(result.getSuccessfulMembers().keySet());
+        for (Set<PersistentID> lostMembersIds : result.getExistingDataStores().values()) {
+          missingMembers.addAll(lostMembersIds);
+        }
+
+        status = new BackupStatusImpl(result.getSuccessfulMembers(), missingMembers);
+      } finally {
+        BackupDataStoreHelper.releaseLock(dm);
+      }
+    } else {
+      throw new AdminException(
+          LocalizedStrings.DistributedSystem_BACKUP_ALREADY_IN_PROGRESS.toLocalizedString());
+    }
+    return status;
+  }
+
+  public Map<DistributedMember, Set<PersistentID>> compactAllDiskStores() throws AdminException {
+    connectAdminDS();
+    DM dm = getDistributionManager();
+    if (dm == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.AdminDistributedSystemImpl_CONNECT_HAS_NOT_BEEN_INVOKED_ON_THIS_ADMINDISTRIBUTEDSYSTEM
+              .toLocalizedString());
+    }
+    return compactAllDiskStores(dm);
+  }
+
+  public static Map<DistributedMember, Set<PersistentID>> compactAllDiskStores(DM dm)
+      throws AdminException {
+    return CompactRequest.send(dm);
+  }
+
+  /**
+   * This method can be used to process ClientMembership events sent for BridgeMembership by bridge
+   * servers to all admin members.
+   * 
+   * NOTE: Not implemented currently. JMX implementation which is a subclass of this class i.e.
+   * AdminDistributedSystemJmxImpl implements it.
+   * 
+   * @param senderId id of the member that sent the ClientMembership changes for processing (could
+   *        be null)
+   * @param clientId id of a client for which the notification was sent
+   * @param clientHost host on which the client is/was running
+   * @param eventType denotes whether the client Joined/Left/Crashed should be one of
+   *        ClientMembershipMessage#JOINED, ClientMembershipMessage#LEFT,
+   *        ClientMembershipMessage#CRASHED
+   */
+  public void processClientMembership(String senderId, String clientId, String clientHost,
+      int eventType) {}
+
+  public void setAlertLevelAsString(String level) {
+    AlertLevel newAlertLevel = AlertLevel.forName(level);
+
+    if (newAlertLevel != null) {
+      setAlertLevel(newAlertLevel);
+    } else {
+      System.out.println("ERROR:: " + level
+          + " is invalid. Allowed alert levels are: WARNING, ERROR, SEVERE, OFF");
+      throw new IllegalArgumentException(LocalizedStrings.DEBUG.toLocalizedString(
+          level + " is invalid. Allowed alert levels are: WARNING, ERROR, SEVERE, OFF"));
+    }
+  }
+
+  public String getAlertLevelAsString() {
+    return getAlertLevel().getName();
+  }
+}
+


[17/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java
new file mode 100644
index 0000000..95fd01c
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MemberInfoWithStatsMBean.java
@@ -0,0 +1,1355 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.CacheVm;
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+import org.apache.geode.internal.admin.api.GemFireMemberStatus;
+import org.apache.geode.internal.admin.api.RegionSubRegionSnapshot;
+import org.apache.geode.internal.admin.api.StatisticResource;
+import org.apache.geode.internal.admin.api.SystemMember;
+import org.apache.geode.internal.admin.api.SystemMemberCacheServer;
+import org.apache.geode.internal.admin.api.jmx.Agent;
+import org.apache.geode.cache.InterestPolicy;
+import org.apache.geode.cache.SubscriptionAttributes;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.internal.GemFireVersion;
+import org.apache.geode.internal.admin.remote.ClientHealthStats;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import mx4j.AbstractDynamicMBean;
+import org.apache.logging.log4j.Logger;
+
+import javax.management.*;
+import java.net.InetAddress;
+import java.text.MessageFormat;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * This class uses the JMX Attributes/Operations that use (return/throw) GemFire types. This is the
+ * single MBean accessible with ObjectName string {@link MemberInfoWithStatsMBean#MBEAN_NAME}}. This
+ * MBean can be used to retrieve the all member details as plain java types.
+ * 
+ * This MBean also acts as a Notification Hub for all the Notifications that are defined for Admin
+ * Distributed System.
+ * 
+ * 
+ * @since GemFire 6.5
+ */
+public class MemberInfoWithStatsMBean extends AbstractDynamicMBean implements NotificationEmitter {
+  private static final Logger logger = LogService.getLogger();
+
+  /* constants defining max no of attributes/operations/notifications */
+  private static final int MAX_ATTRIBUTES_COUNT = 3;
+  private static final int MAX_OPERATIONS_COUNT = 3;
+  private static final int MAX_NOTIFICATIONS_COUNT = 9;
+
+  private static final String NOT_AVAILABLE_STR = "N/A";
+  private static final String NOT_AVAILABLE = null;
+  private static final Number NOT_AVAILABLE_NUMBER = null;
+
+  /*
+   * String constant used for a region that is used on admin side just as a root for rootRegions
+   * defined on the member
+   */
+  private static final String PLACE_HOLDER_ROOT_REGION = "/Root/";
+
+  /* String that are used to form QueryExp/ObjectName for querying MBeanServer */
+  private static final String REGION_QUERY_EXPRESSION = "*GemFire.Cache*:*,owner={0},type=Region";
+  private static final String STATS_QUERY_EXPRESSION = "*GemFire.Statistic*:*,source={0},name={1}";
+
+  /** mbean name string for this MBean */
+  /* default */static final String MBEAN_NAME = "GemFire:type=MemberInfoWithStatsMBean";
+
+  /** ObjectName handle for this MBean */
+  private ObjectName objectName;
+
+  /** version of the GemFire Enterprise system that is running */
+  private String version;
+  private int refreshInterval;
+  private String id;
+
+  private Agent agent;
+  private AdminDistributedSystemJmxImpl adminDSJmx;
+
+  private NotificationForwarder forwarder;
+  private boolean isInitialized;// needs synchronization?
+
+  /**
+   * Default Constructor
+   * 
+   * @param agent Admin Agent instance
+   * @throws OperationsException if ObjectName can't be formed for this MBean
+   * @throws MBeanRegistrationException
+   * @throws AdminException
+   */
+  MemberInfoWithStatsMBean(Agent agent)
+      throws OperationsException, MBeanRegistrationException, AdminException {
+    this.agent = agent;
+    this.objectName = ObjectName.getInstance(MBEAN_NAME);
+    this.version = GemFireVersion.getGemFireVersion();
+    this.refreshInterval = -1;
+    this.id = NOT_AVAILABLE_STR;
+    this.forwarder = new NotificationForwarder(agent.getMBeanServer());
+  }
+
+  /**
+   * Returns attributes defined for this MBean as an array of MBeanAttributeInfo objects.
+   * 
+   * @return attributes defined as an array of MBeanAttributeInfo objects.
+   */
+  @Override
+  protected MBeanAttributeInfo[] createMBeanAttributeInfo() {
+    MBeanAttributeInfo[] attributesInfo = new MBeanAttributeInfo[MAX_ATTRIBUTES_COUNT];
+
+    /*
+     * First letter in attribute name has to be 'V' so that getVersion is called. With 'v' it looks
+     * for getversion, same for others
+     */
+    attributesInfo[0] = new MBeanAttributeInfo("Version", String.class.getName(),
+        "GemFire Enterprise Version", true, /* readable */
+        false, /* writable */
+        false);/* has getter with name like 'is****' */
+
+    attributesInfo[1] = new MBeanAttributeInfo("RefreshInterval", String.class.getName(),
+        "The interval (in seconds) between auto-polling for updating member & statistics resources. If this is '-1', it means the this MBean has not yet been initialized. First call to getMembers operation will initialize this MBean.",
+        true, /* readable */
+        false, /* writable */
+        false);/* has getter with name like 'is****' */
+
+    attributesInfo[2] = new MBeanAttributeInfo("Id", String.class.getName(),
+        "Identifier of the GemFire Enterprise. If this is 'N/A', it means the this MBean has not yet been initialized. First call to getMembers operation will initialize this MBean.",
+        true, /* readable */
+        false, /* writable */
+        false);/* has getter with name like 'is****' */
+
+
+    return attributesInfo;
+  }
+
+  /**
+   * Returns operations defined for this MBean as an array of MBeanOperationInfo objects.
+   * 
+   * @return operations defined as an array of MBeanOperationInfo objects.
+   */
+  @Override
+  protected MBeanOperationInfo[] createMBeanOperationInfo() {
+    MBeanOperationInfo[] operationsInfo = new MBeanOperationInfo[MAX_OPERATIONS_COUNT];
+
+    operationsInfo[0] = new MBeanOperationInfo("getMembers",
+        "Returns ids as strings for all the members - Application Peers & Cache Servers.",
+        new MBeanParameterInfo[] {}, String[].class.getName(), MBeanOperationInfo.ACTION_INFO);
+
+    MBeanParameterInfo[] getMemberDetailsArgs = new MBeanParameterInfo[1];
+    getMemberDetailsArgs[0] = new MBeanParameterInfo("memberId", String.class.getName(),
+        "Id of the member for all the details are to be retrieved.");
+    operationsInfo[1] =
+        new MBeanOperationInfo("getMemberDetails", "Returns details for a given member",
+            getMemberDetailsArgs, Map.class.getName(), MBeanOperationInfo.ACTION_INFO);
+
+    /*
+     * For retrieving ObjectNames of existing Region MBeans, MBeanServerConnection.queryMBeans(),
+     * could be called
+     */
+    MBeanParameterInfo[] getRegionSnapArgs = new MBeanParameterInfo[1];
+    getRegionSnapArgs[0] = new MBeanParameterInfo("memberId", String.class.getName(),
+        "Id of the member on which we want to discover all the region MBean.");
+    operationsInfo[2] = new MBeanOperationInfo("getRegions",
+        "Returns a java.util.Map of details of regions on a member", getRegionSnapArgs,
+        Map.class.getName(), MBeanOperationInfo.ACTION_INFO);
+
+
+    return operationsInfo;
+  }
+
+  /**
+   * Returns notifications defined for this MBean as an array of MBeanNotificationInfo objects.
+   * 
+   * @return notification definitions as an array of MBeanNotificationInfo objects.
+   */
+  @Override
+  protected MBeanNotificationInfo[] createMBeanNotificationInfo() {
+    MBeanNotificationInfo[] notificationsInfo = new MBeanNotificationInfo[MAX_NOTIFICATIONS_COUNT];
+
+    String[] notificationTypes = new String[] {AdminDistributedSystemJmxImpl.NOTIF_MEMBER_JOINED};
+    notificationsInfo[0] =
+        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
+            "A GemFire manager, cache, or other member has joined this distributed system.");
+
+    notificationTypes = new String[] {AdminDistributedSystemJmxImpl.NOTIF_MEMBER_LEFT};
+    notificationsInfo[1] =
+        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
+            "A GemFire manager, cache, or other member has left the distributed system.");
+
+    notificationTypes = new String[] {AdminDistributedSystemJmxImpl.NOTIF_MEMBER_CRASHED};
+    notificationsInfo[2] =
+        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
+            "A member of this distributed system has crashed instead of leaving cleanly.");
+
+    notificationTypes = new String[] {AdminDistributedSystemJmxImpl.NOTIF_ALERT};
+    notificationsInfo[3] =
+        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
+            "A member of this distributed system has generated an alert.");
+
+    notificationTypes = new String[] {AdminDistributedSystemJmxImpl.NOTIF_ADMIN_SYSTEM_DISCONNECT};
+    notificationsInfo[4] =
+        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
+            "A GemFire manager, cache, or other member has joined this distributed system.");
+
+    notificationTypes = new String[] {SystemMemberJmx.NOTIF_CACHE_CREATED};
+    notificationsInfo[5] =
+        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
+            "A cache got created on a member of this distributed system.");
+
+    notificationTypes = new String[] {SystemMemberJmx.NOTIF_CACHE_CLOSED};
+    notificationsInfo[6] = new MBeanNotificationInfo(notificationTypes,
+        Notification.class.getName(), "A cache is closed on a member of this distributed system.");
+
+    notificationTypes = new String[] {SystemMemberJmx.NOTIF_REGION_CREATED};
+    notificationsInfo[7] =
+        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
+            "A region is created in a cache on a member of this distributed system.");
+
+    notificationTypes = new String[] {SystemMemberJmx.NOTIF_REGION_LOST};
+    notificationsInfo[8] =
+        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
+            "A region was removed from a cache on a member of this distributed system.");
+
+    // String[] notificationTypes5 = new String[] {AdminDistributedSystemJmxImpl.NOTIF_STAT_ALERT};
+    // notificationsInfo[9] = new MBeanNotificationInfo(notificationTypes5,
+    // Notification.class.getName(),
+    // "An alert based on statistic(s) has been raised.");
+
+    return notificationsInfo;
+  }
+
+  /**
+   * 
+   * @return ObjectName of this MBean
+   */
+  /* default */ ObjectName getObjectName() {
+    return objectName;
+  }
+
+  /**
+   * Returns the version of the GemFire Enterprise instance as a string.
+   * 
+   * @return GemFire Enterprise version string derived from {@link GemFireVersion}
+   */
+  /* getter for attribute - Version */
+  public String getVersion() {
+    return version;
+  }
+
+  /**
+   * @return the refreshInterval
+   */
+  public int getRefreshInterval() {
+    return refreshInterval;
+  }
+
+  /**
+   * @return the id
+   */
+  public String getId() {
+    return id;
+  }
+
+  /**
+   * Connects the Admin Agent in the DS
+   * 
+   * @return AdminDistributedSystem MBean ObjectName
+   * @throws OperationsException if connection to the DS fails
+   * @throws AdminException if connection to the DS fails
+   */
+  private ObjectName connectToSystem() throws OperationsException, AdminException {
+    ObjectName adminDsObjName = agent.connectToSystem();
+
+    AdminDistributedSystem adminDS = agent.getDistributedSystem();
+    if (adminDSJmx == null && adminDS instanceof AdminDistributedSystemJmxImpl) {// instanceof
+                                                                                 // checks for null
+      adminDSJmx = (AdminDistributedSystemJmxImpl) adminDS;
+      refreshInterval = adminDSJmx.getRefreshInterval();
+      id = adminDSJmx.getId();
+      forwarder.registerNotificationListener(adminDSJmx.getObjectName());
+    }
+
+    return adminDsObjName;
+  }
+
+  /**
+   * 
+   * @param memberId
+   * @return SystemMemberJmx instance for given memberId
+   * @throws AdminException
+   */
+  private SystemMemberJmx findMember(String memberId) throws AdminException {
+    SystemMemberJmx foundMember = null;
+
+    if (agent.isConnected()) {
+      SystemMember[] members = adminDSJmx.getSystemMemberApplications();
+      for (SystemMember app : members) {
+        if (app.getId().equals(memberId)) {
+          foundMember = (SystemMemberJmx) app;
+          break;
+        }
+      }
+
+      if (foundMember == null) {
+        members = adminDSJmx.getCacheVms();
+        for (SystemMember cacheVm : members) {
+          if (cacheVm.getId().equals(memberId)) {
+            foundMember = (SystemMemberJmx) cacheVm;
+            break;
+          }
+        }
+      }
+    }
+
+    return foundMember;
+  }
+
+  /**
+   * Return ObjectNames for all the Member MBeans in the DS.
+   * 
+   * @return Array of ObjectNames of all Member MBeans
+   * @throws OperationsException if (1)agent could not connect in the DS OR (2)Notification Listener
+   *         could not be registered for the Admin DS MBean OR (3)fails to retrieve information from
+   *         Admin DS
+   */
+  public String[] getMembers() throws OperationsException {
+    String[] members = new String[0];
+
+    try {
+      if (!isInitialized) {
+        initializeAll(); // initialize if not yet
+      }
+
+      if (adminDSJmx != null) {
+        CacheVm[] cacheVms = adminDSJmx.getCacheVms();
+        SystemMember[] appVms = adminDSJmx.getSystemMemberApplications();
+
+        List<String> membersList = new ArrayList<String>();
+        if (cacheVms != null && cacheVms.length != 0) {
+          for (SystemMember cacheVm : cacheVms) {
+            membersList.add(cacheVm.getId());
+          }
+        }
+        if (appVms != null && appVms.length != 0) {
+          for (SystemMember appVm : appVms) {
+            membersList.add(appVm.getId());
+          }
+        }
+        members = new String[membersList.size()];
+        members = membersList.toArray(members);
+      }
+    } catch (AdminException e) {
+      logger.warn(
+          LocalizedMessage.create(
+              LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0, "getMembers"),
+          e);
+      throw new OperationsException(e.getMessage());
+    } catch (Exception e) {
+      logger.warn(
+          LocalizedMessage.create(
+              LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0, "getMembers"),
+          e);
+      throw new OperationsException(e.getMessage());
+    }
+
+    return members;
+  }
+
+  /**
+   * Returns information including ObjectNames for all regions on a member with given member id.
+   * 
+   * @param memberId member identifier as a String
+   * @return Map of details of all regions on a member with given id
+   * @throws OperationsException if fails to retrieve the regions information
+   */
+  public Map<String, Map<String, ?>> getRegions(String memberId) throws OperationsException {
+    Map<String, Map<String, ?>> regionsInfo = new LinkedHashMap<String, Map<String, ?>>();
+
+    if (memberId != null) {
+      try {
+        SystemMemberJmx foundMember = findMember(memberId);
+        if (foundMember != null) {
+          SystemMemberCacheJmxImpl cache = (SystemMemberCacheJmxImpl) foundMember.getCache();
+          if (cache != null) {
+            Map<String, ObjectName> existingRegionMbeans =
+                getExistingRegionMbeansFullPaths(memberId);
+            // TODO: this is in-efficient
+            // Can a region.create JMX notification be used?
+            regionsInfo = getAllRegionsDetails(cache, existingRegionMbeans);
+            existingRegionMbeans.clear();
+          }
+        }
+      } catch (AdminException e) {
+        logger.warn(LocalizedMessage.create(
+            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0_FOR_MEMBER_1,
+            new Object[] {"getRegions", memberId}), e);
+        throw new OperationsException(e.getMessage());
+      } catch (Exception e) {
+        logger.warn(LocalizedMessage.create(
+            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0_FOR_MEMBER_1,
+            new Object[] {"getRegions", memberId}), e);
+        throw new OperationsException(e.getMessage());
+      }
+    }
+
+    return regionsInfo;
+  }
+
+  /* **************************************************************************/
+  /* ************* INITIALIZE THE ENTIRE ADMIN DS AT A TIME *******************/
+  /* **************************************************************************/
+  /**
+   * Initializes all the possible MBeans for all the members.
+   * 
+   */
+  private void initializeAll() throws OperationsException {
+    try {
+      connectToSystem();
+      if (adminDSJmx != null) {
+        // Members are already inited after connectToSystem. Now init Cache, Region & Stats MBeans
+        SystemMember[] cacheVms = adminDSJmx.getCacheVms();
+        for (int i = 0; i < cacheVms.length; i++) {
+          try {
+            initializeCacheRegionsAndStats((SystemMemberJmx) cacheVms[i]);
+          } catch (AdminException e) {
+            logger.info(LocalizedMessage.create(
+                LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INTIALIZING_0_CONTINUING,
+                cacheVms[i].getId()), e);
+          }
+        }
+        SystemMember[] appVms = adminDSJmx.getSystemMemberApplications();
+        for (int i = 0; i < appVms.length; i++) {
+          try {
+            initializeCacheRegionsAndStats((SystemMemberJmx) appVms[i]);
+          } catch (AdminException e) {
+            logger.info(LocalizedMessage.create(
+                LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INTIALIZING_0_CONTINUING,
+                appVms[i].getId()), e);
+          }
+        }
+      }
+    } catch (AdminException e) {
+      logger.warn(LocalizedMessage
+          .create(LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INTIALIZING), e);
+      throw new OperationsException(e.getMessage());
+    } catch (Exception e) {
+      logger.warn(LocalizedMessage
+          .create(LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INTIALIZING), e);
+      throw new OperationsException(e.getMessage());
+    }
+
+    isInitialized = true;
+  }
+
+  /**
+   * Initializes Cache, Regions & Statistics Types MBeans for the given Member.
+   * 
+   * @param memberJmx Member Mbean instance
+   * @throws OperationsException if fails to initialize required MBeans
+   * @throws AdminException if fails to initialize required MBeans
+   */
+  private void initializeCacheRegionsAndStats(SystemMemberJmx memberJmx)
+      throws OperationsException, AdminException {
+    if (memberJmx != null) {
+      SystemMemberCacheJmxImpl cache = (SystemMemberCacheJmxImpl) memberJmx.getCache();
+      if (cache != null) {
+        RegionSubRegionSnapshot regionSnapshot = cache.getRegionSnapshot();
+        initializeRegionSubRegions(cache, regionSnapshot);
+      }
+      initStats(memberJmx);
+    }
+  }
+
+  /**
+   * Initializes statistics for a member with the given mbean.
+   * 
+   * @param memberJmx Member Mbean instance
+   * @throws AdminException if fails to initialize required statistic MBeans
+   */
+  private void initStats(SystemMemberJmx memberJmx) throws AdminException {
+    StatisticResource[] statResources = memberJmx.getStats();
+    for (StatisticResource statResource : statResources) {
+      statResource.getStatistics();
+    }
+  }
+
+  /**
+   * Initializes all regions & its subregions using the Cache MBean and the RegionSubRegionSnapshot
+   * for this cache MBean.
+   * 
+   * @param cache Cache MBean resource
+   * @param regionSnapshot RegionSubRegionSnapshot instance for the cache
+   * @throws MalformedObjectNameException if fails to initialize the region MBean
+   * @throws AdminException if fails to initialize the region MBean
+   */
+  @SuppressWarnings("rawtypes")
+  private void initializeRegionSubRegions(SystemMemberCacheJmxImpl cache,
+      RegionSubRegionSnapshot regionSnapshot) throws MalformedObjectNameException, AdminException {
+    String fullPath = regionSnapshot.getFullPath();
+    if (!fullPath.equals(PLACE_HOLDER_ROOT_REGION)) {
+      fullPath = fullPath.substring(PLACE_HOLDER_ROOT_REGION.length() - 1);
+
+      cache.manageRegion(fullPath);
+    }
+
+    Set subRegionSnapshots = regionSnapshot.getSubRegionSnapshots();
+
+    for (Iterator iterator = subRegionSnapshots.iterator(); iterator.hasNext();) {
+      RegionSubRegionSnapshot subRegion = (RegionSubRegionSnapshot) iterator.next();
+      try {
+        initializeRegionSubRegions(cache, subRegion);
+      } catch (AdminException e) {
+        logger.info(LocalizedMessage.create(
+            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INTIALIZING_0_CONTINUING,
+            subRegion.getFullPath()), e);
+      }
+    }
+  }
+
+
+  /* **************************************************************************/
+  /* ********************** EVERYTHING HYPERIC NEEDS **************************/
+  /* **************************************************************************/
+
+  /* constants defined that could be used simply retrieve needed info from Map */
+  private static final String TYPE_NAME_CACHESERVER = "Cache Server";
+  private static final String TYPE_NAME_APPLICATION = "Application Peer";
+  /*
+   * NOTE - (My Understanding about the followings - abhishek) 1. CacheVM - a VM started using Cache
+   * Server Launcher. This is considered to be a dedicated cache VM because there is only GemFire
+   * Cache code running here. 2. ApplicationVM - a VM started with a written code using APIs and we
+   * can not guarantee that there will be ONLY GemFire code running in this VM. 3. Cache Server -
+   * Responsible for serving requests from the clients. There could be multiple of these per Cache
+   * and hence per VM - one of 1 or 2 above. These could be specified by <cache-server> (or
+   * deprecated <bridge-server>) element(s) in the cache-xml file or using an API
+   * Cache.addCacheServer().
+   */
+
+  // private static final String VERSION = "gemfire.version.string";
+  // private static final String MEMBER_COUNT = "gemfire.membercount.int";
+  // private static final String GATEWAYHUB_COUNT = "gemfire.gatewayhubcount.int";
+  // private static final String CLIENT_COUNT = "gemfire.clientcount.int";
+
+  private static final String MEMBER_ID = DistributionConfig.GEMFIRE_PREFIX + "member.id.string";
+  private static final String MEMBER_NAME =
+      DistributionConfig.GEMFIRE_PREFIX + "member.name.string";
+  private static final String MEMBER_HOST =
+      DistributionConfig.GEMFIRE_PREFIX + "member.host.string";
+  private static final String MEMBER_PORT = DistributionConfig.GEMFIRE_PREFIX + "member.port.int";
+  private static final String MEMBER_UPTIME =
+      DistributionConfig.GEMFIRE_PREFIX + "member.uptime.long";
+  private static final String MEMBER_CLIENTS =
+      DistributionConfig.GEMFIRE_PREFIX + "member.clients.map";
+  private static final String MEMBER_REGIONS =
+      DistributionConfig.GEMFIRE_PREFIX + "member.regions.map";
+  private static final String MEMBER_TYPE =
+      DistributionConfig.GEMFIRE_PREFIX + "member.type.string";
+  private static final String IS_SERVER =
+      DistributionConfig.GEMFIRE_PREFIX + "member.isserver.boolean";
+  private static final String IS_GATEWAY =
+      DistributionConfig.GEMFIRE_PREFIX + "member.isgateway.boolean";
+
+  private static final String MEMBER_STATSAMPLING_ENABLED =
+      DistributionConfig.GEMFIRE_PREFIX + "member.config.statsamplingenabled.boolean";
+  private static final String MEMBER_TIME_STATS_ENABLED =
+      DistributionConfig.GEMFIRE_PREFIX + "member.config.timestatsenabled.boolean";
+
+  private static final String STATS_PROCESSCPUTIME =
+      DistributionConfig.GEMFIRE_PREFIX + "member.stat.processcputime.long";
+  private static final String STATS_CPUS =
+      DistributionConfig.GEMFIRE_PREFIX + "member.stat.cpus.int";
+  private static final String STATS_USEDMEMORY =
+      DistributionConfig.GEMFIRE_PREFIX + "member.stat.usedmemory.long";
+  private static final String STATS_MAXMEMORY =
+      DistributionConfig.GEMFIRE_PREFIX + "member.stat.maxmemory.long";
+  private static final String STATS_GETS =
+      DistributionConfig.GEMFIRE_PREFIX + "member.stat.gets.int";
+  private static final String STATS_GETTIME =
+      DistributionConfig.GEMFIRE_PREFIX + "member.stat.gettime.long";
+  private static final String STATS_PUTS =
+      DistributionConfig.GEMFIRE_PREFIX + "member.stat.puts.int";
+  private static final String STATS_PUTTIME =
+      DistributionConfig.GEMFIRE_PREFIX + "member.stat.puttime.long";
+
+  private static final String REGION_NAME =
+      DistributionConfig.GEMFIRE_PREFIX + "region.name.string";
+  private static final String REGION_PATH =
+      DistributionConfig.GEMFIRE_PREFIX + "region.path.string";
+  private static final String REGION_SCOPE =
+      DistributionConfig.GEMFIRE_PREFIX + "region.scope.string";
+  private static final String REGION_DATAPOLICY =
+      DistributionConfig.GEMFIRE_PREFIX + "region.datapolicy.string";
+  private static final String REGION_INTERESTPOLICY =
+      DistributionConfig.GEMFIRE_PREFIX + "region.interestpolicy.string";
+  private static final String REGION_ENTRYCOUNT =
+      DistributionConfig.GEMFIRE_PREFIX + "region.entrycount.int";
+  private static final String REGION_DISKATTRS =
+      DistributionConfig.GEMFIRE_PREFIX + "region.diskattrs.string";
+
+  private static final String CLIENT_ID = DistributionConfig.GEMFIRE_PREFIX + "client.id.string";
+  private static final String CLIENT_NAME =
+      DistributionConfig.GEMFIRE_PREFIX + "client.name.string";
+  private static final String CLIENT_HOST =
+      DistributionConfig.GEMFIRE_PREFIX + "client.host.string";
+  private static final String CLIENT_QUEUESIZE =
+      DistributionConfig.GEMFIRE_PREFIX + "client.queuesize.int";
+  private static final String CLIENT_STATS_GETS =
+      DistributionConfig.GEMFIRE_PREFIX + "client.stats.gets.int";
+  private static final String CLIENT_STATS_PUTS =
+      DistributionConfig.GEMFIRE_PREFIX + "client.stats.puts.int";
+  private static final String CLIENT_STATS_CACHEMISSES =
+      DistributionConfig.GEMFIRE_PREFIX + "client.stats.cachemisses.int";
+  private static final String CLIENT_STATS_CPUUSAGE =
+      DistributionConfig.GEMFIRE_PREFIX + "client.stats.cpuusage.long";
+  private static final String CLIENT_STATS_CPUS =
+      DistributionConfig.GEMFIRE_PREFIX + "client.stats.cpus.int";
+  private static final String CLIENT_STATS_UPDATETIME =
+      DistributionConfig.GEMFIRE_PREFIX + "client.stats.updatetime.long";
+  private static final String CLIENT_STATS_THREADS =
+      DistributionConfig.GEMFIRE_PREFIX + "client.stats.threads.int";
+
+  /**
+   * 
+   * @param memberId
+   * @return All the required details for a member with given memberId
+   * @throws OperationsException
+   */
+  public Map<String, Object> getMemberDetails(String memberId) throws OperationsException {
+    Map<String, Object> allDetails = new TreeMap<String, Object>();
+
+    if (memberId != null) {
+      try {
+        SystemMemberJmx member = findMember(memberId);
+        if (member != null) {
+          SystemMemberCacheJmxImpl cache = (SystemMemberCacheJmxImpl) member.getCache();
+          GemFireMemberStatus snapshot = cache.getSnapshot();
+          boolean isServer = snapshot.getIsServer();
+          boolean isGatewayHub = snapshot.getIsGatewayHub();
+
+          // 1. Member info
+          allDetails.put(MEMBER_ID, member.getId());
+          allDetails.put(MEMBER_NAME, member.getName());
+          String host = member.getHost();// from of GemFireVM.getHost
+          InetAddress hostAddr = member.getHostAddress();
+          // possibility of null host address
+          if (hostAddr != null) {
+            host = hostAddr.getHostName();
+          }
+          allDetails.put(MEMBER_HOST, host);
+          allDetails.put(MEMBER_UPTIME, snapshot.getUpTime());
+          allDetails.put(IS_SERVER, isServer);
+          allDetails.put(IS_GATEWAY, isGatewayHub);
+
+          String memberType = "";
+          if (member instanceof CacheServerJmxImpl) {
+            memberType = TYPE_NAME_CACHESERVER;
+          } else {// Mark it of Application type if neither a gateway hub nor a server
+            memberType = TYPE_NAME_APPLICATION;
+          }
+          // if (isGatewayHub) {
+          // memberType = TYPE_NAME_GATEWAYHUB;
+          // } else if (isServer) {
+          // memberType = TYPE_NAME_CACHESERVER;
+          // } else {//Mark it of Application type if neither a gateway nor a server
+          // memberType = TYPE_NAME_APPLICATION;
+          // }
+          allDetails.put(MEMBER_TYPE, memberType);
+
+          // 2. Region info
+          Map<String, ObjectName> existingRegionMbeans = getExistingRegionMbeansFullPaths(memberId);
+          allDetails.put(MEMBER_REGIONS, getAllRegionsDetails(cache, existingRegionMbeans));
+          existingRegionMbeans.clear();
+
+          // 3. Clients info
+          allDetails.put(MEMBER_CLIENTS, getClientDetails(snapshot));
+
+          boolean statSamplingEnabled = true;
+          // assuming will never return as per current implementation
+          ConfigurationParameter[] configParams = member.getConfiguration();
+          for (ConfigurationParameter configParam : configParams) {
+            if (STATISTIC_SAMPLING_ENABLED.equals(configParam.getName())) {
+              allDetails.put(MEMBER_STATSAMPLING_ENABLED, configParam.getValue());
+              statSamplingEnabled = Boolean.parseBoolean("" + configParam.getValue());
+            } else if (ENABLE_TIME_STATISTICS.equals(configParam.getName())) {
+              allDetails.put(MEMBER_TIME_STATS_ENABLED, configParam.getValue());
+            }
+          }
+
+          // 5. Stats info
+          allDetails.putAll(getRequiredStats(member, statSamplingEnabled));
+
+          SystemMemberCacheServer[] cacheServers = cache.getCacheServers();
+          // attempt refreshing the cache info once
+          if (cacheServers.length == 0) {
+            cache.refresh();
+            cacheServers = cache.getCacheServers();
+          }
+          Integer memberCacheServerPort = Integer.valueOf(0);
+          if (cacheServers.length != 0) {
+            /*
+             * Taking the first cache server port. We don't recommend multiple cache severs for a
+             * cache.
+             */
+            memberCacheServerPort = Integer.valueOf(cacheServers[0].getPort());
+          }
+          allDetails.put(MEMBER_PORT, memberCacheServerPort);
+        }
+
+      } catch (AdminException e) {
+        logger.warn(LocalizedMessage.create(
+            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0_FOR_MEMBER_1,
+            new Object[] {"getMemberDetails", memberId}), e);
+        throw new OperationsException(e.getMessage());
+      } catch (Exception e) {
+        logger.warn(LocalizedMessage.create(
+            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0_FOR_MEMBER_1,
+            new Object[] {"getMemberDetails", memberId}), e);
+        throw new OperationsException(e.getMessage());
+      }
+    }
+
+    return allDetails;
+  }
+
+  /**
+   * 
+   * @param snapshot
+   * @return Map of client details
+   */
+  @SuppressWarnings("rawtypes")
+  private Map<String, Map<String, ?>> getClientDetails(GemFireMemberStatus snapshot) {
+    Map<String, Map<String, ?>> clientsInfo = new LinkedHashMap<String, Map<String, ?>>();
+
+    Set connectedClients = snapshot.getConnectedClients();
+    if (!connectedClients.isEmpty()) {
+      Map clientHealthStatsMap = snapshot.getClientHealthStats();
+
+      for (Iterator iterator = connectedClients.iterator(); iterator.hasNext();) {
+        Map<String, Object> clientData = new HashMap<String, Object>();
+        String clientId = (String) iterator.next();
+        String host = snapshot.getClientHostName(clientId);
+        clientData.put(CLIENT_ID, clientId);
+        clientData.put(CLIENT_NAME, extractClientName(clientId, host));
+        clientData.put(CLIENT_HOST, host);
+        clientData.put(CLIENT_QUEUESIZE, snapshot.getClientQueueSize(clientId));
+
+        ClientHealthStats clientHealthStats =
+            (ClientHealthStats) clientHealthStatsMap.get(clientId);
+        if (clientHealthStats != null) {
+          clientData.put(CLIENT_STATS_GETS, clientHealthStats.getNumOfGets());
+          clientData.put(CLIENT_STATS_PUTS, clientHealthStats.getNumOfPuts());
+          clientData.put(CLIENT_STATS_CACHEMISSES, clientHealthStats.getNumOfMisses());
+          clientData.put(CLIENT_STATS_CPUUSAGE, clientHealthStats.getProcessCpuTime());
+          clientData.put(CLIENT_STATS_CPUS, clientHealthStats.getCpus());
+          clientData.put(CLIENT_STATS_UPDATETIME, clientHealthStats.getUpdateTime().getTime());
+          clientData.put(CLIENT_STATS_THREADS, clientHealthStats.getNumOfThreads());
+        } else {
+          clientData.put(CLIENT_STATS_GETS, Integer.valueOf(0));
+          clientData.put(CLIENT_STATS_PUTS, Integer.valueOf(0));
+          clientData.put(CLIENT_STATS_CACHEMISSES, Integer.valueOf(0));
+          clientData.put(CLIENT_STATS_CPUUSAGE, Long.valueOf(0));
+          clientData.put(CLIENT_STATS_CPUS, Integer.valueOf(0));
+          clientData.put(CLIENT_STATS_UPDATETIME, Long.valueOf(0));
+          clientData.put(CLIENT_STATS_THREADS, Integer.valueOf(0));
+        }
+
+        clientsInfo.put(clientId, clientData);
+      }
+    }
+
+    return clientsInfo;
+  }
+
+  /**
+   * Returns a Map containing information about regions.
+   * 
+   * @param cache Reference to an MBean representing a Cache on a member
+   * @param existingRegionMbeans Map of Path against Region MBean ObjectNames
+   * @return Map of all region details
+   * @throws OperationsException if fails to retrieve
+   */
+  private Map<String, Map<String, ?>> getAllRegionsDetails(SystemMemberCacheJmxImpl cache,
+      Map<String, ObjectName> existingRegionMbeans) throws OperationsException {
+    Map<String, Map<String, ?>> regionsInfo = new TreeMap<String, Map<String, ?>>();
+
+    if (cache != null) {
+      try {
+        RegionSubRegionSnapshot regionSnapshot = cache.getRegionSnapshot();
+        collectAllRegionsDetails(cache, regionSnapshot, regionsInfo, existingRegionMbeans);
+      } catch (AdminException e) {
+        logger.warn(LocalizedMessage.create(LocalizedStrings.ONE_ARG,
+            "Exception occurred while getting region details."), e);
+        throw new OperationsException(e.getMessage());
+      } catch (Exception e) {
+        logger.warn(LocalizedMessage.create(LocalizedStrings.ONE_ARG,
+            "Exception occurred while getting region details."), e);
+        throw new OperationsException(e.getMessage());
+      }
+    }
+
+    return regionsInfo;
+  }
+
+  /**
+   * Collects all the region details from the RegionSubRegionSnapshot instance passed and the Cache
+   * MBean. Checks in the set of existingRegionMbeans before initializing Region Mbeans if there are
+   * not initialized yet.
+   * 
+   * @param cache Cache MBean instance
+   * @param regionSnapshot RegionSubRegionSnapshot instance
+   * @param regionsInfo Map of regions information that gets populated recursively
+   * @param existingRegionMbeans Map of ObjectNames of existing region MBeans
+   * @throws AdminException if unable to initialize region MBean
+   * @throws OperationsException if fails to retrieve the Region MBean attribute info
+   * @throws MBeanException if fails to retrieve the Region MBean attribute info
+   * @throws ReflectionException if fails to retrieve the Region MBean attribute info
+   */
+  @SuppressWarnings("rawtypes")
+  private void collectAllRegionsDetails(SystemMemberCacheJmxImpl cache,
+      RegionSubRegionSnapshot regionSnapshot, Map<String, Map<String, ?>> regionsInfo,
+      Map<String, ObjectName> existingRegionMbeans)
+      throws AdminException, OperationsException, MBeanException, ReflectionException {
+    String fullPath = regionSnapshot.getFullPath();
+    if (!fullPath.equals(PLACE_HOLDER_ROOT_REGION)) {
+      fullPath = fullPath.substring(PLACE_HOLDER_ROOT_REGION.length() - 1);
+      String name = regionSnapshot.getName();
+      Integer entryCount = Integer.valueOf(regionSnapshot.getEntryCount());
+      Map<String, Object> details = new TreeMap<String, Object>();
+      details.put(REGION_NAME, name);
+      details.put(REGION_PATH, fullPath);
+      details.put(REGION_ENTRYCOUNT, entryCount);
+
+      ObjectName regionObjectName = existingRegionMbeans.get(fullPath);
+      if (regionObjectName == null) {// initialize if has not yet been
+        regionObjectName = cache.manageRegion(fullPath);
+      }
+
+      Object attribute = getAttribute(regionObjectName, "scope", NOT_AVAILABLE);
+      attribute = attribute != null ? attribute.toString() : attribute;
+      details.put(REGION_SCOPE, attribute);
+
+      attribute = getAttribute(regionObjectName, "dataPolicy", NOT_AVAILABLE);
+      attribute = attribute != null ? attribute.toString() : attribute;
+      details.put(REGION_DATAPOLICY, attribute);
+
+      SubscriptionAttributes interestPolicyAttr =
+          (SubscriptionAttributes) getAttribute(regionObjectName, "subscriptionAttributes", null);
+      String interestPolicyStr = NOT_AVAILABLE;
+      if (interestPolicyAttr != null) {
+        InterestPolicy interestPolicy = interestPolicyAttr.getInterestPolicy();
+        if (interestPolicy != null) {
+          interestPolicyStr = interestPolicy.toString();
+        }
+      }
+      details.put(REGION_INTERESTPOLICY, interestPolicyStr);
+
+      attribute = getAttribute(regionObjectName, "diskWriteAttributes", NOT_AVAILABLE);
+      attribute = attribute != null ? attribute.toString() : attribute;
+      details.put(REGION_DISKATTRS, attribute);
+
+      regionsInfo.put(fullPath, details);
+    }
+
+    Set subRegionSnapshots = regionSnapshot.getSubRegionSnapshots();
+
+    for (Iterator iterator = subRegionSnapshots.iterator(); iterator.hasNext();) {
+      RegionSubRegionSnapshot subRegion = (RegionSubRegionSnapshot) iterator.next();
+      collectAllRegionsDetails(cache, subRegion, regionsInfo, existingRegionMbeans);
+    }
+  }
+
+  /**
+   * Checks if the given host name string contains ':' as in IPv6 host address.
+   * 
+   * @param host host name string
+   * @return true if the host string contains ':', false otherwise
+   */
+  private static boolean isIPv6(String host) {
+    return host.contains(":");
+  }
+
+  /**
+   * Checks if the given host name is actually a String representation of an IPv4 address.
+   * 
+   * @param host host name string
+   * @return true if given host name is a String representation of an IPv4 address, false otherwise
+   */
+  private static boolean isIPv4(String host) {
+    String regex = "\\d{1,3}.\\d{1,3}.\\d{1,3}.\\d{1,3}";
+
+    return host.matches(regex);
+  }
+
+  /**
+   * Excludes the host name from the client id and returns the String. If the host name can not be
+   * detected, returns an empty string. Typically, the client id looks like:
+   * HOST(VM_PID:VM_KIND):PORT:RANDOM_STRING:CLIENT_NAME
+   * 
+   * Extracts the client name from the client id. If the client id is not in the expected format,
+   * returns 'N/A'
+   * 
+   * @param clientId string identifier for a client
+   * @param host host name (FQDN) the client is running on
+   * @return name extracted from given client id
+   */
+  /*
+   * Some examples of Client Id format: (1) Java Client:
+   * nase(21716:loner):51789:42e9a0bf:client_nase_21716 nase(2560:loner):2:7a84729a:Feeder
+   * 
+   * (2) Native Client: nase(21045:loner):2:GFNative_OnNnEpyRWL:ExampleDistributedSystem
+   * 
+   * (3) IPv6 Host whose name can not be resolved:
+   * fdf0:76cf:a0ed:9449:0:0:0:1001(21716:loner):51789:42e9a0b:client_nase_21716
+   * fdf0:76cf:a0ed:9449:0:0:0:1001:51789:42e9a0b:client_nase_21716
+   */
+  private static String extractClientName(String clientId, String host) {
+    /* This isIPv6, isIPv4, extractClientName is taken from GFMon code base */
+    String hostExcludedId = "";
+    if ((isIPv6(host) || isIPv4(host)) && clientId.startsWith(host)) {
+      hostExcludedId = clientId.substring(host.length());
+    } else {
+      int firstDotIndex = host.indexOf(".");
+      if (firstDotIndex != -1) {
+        String hostShortName = host.substring(0, firstDotIndex);
+        hostExcludedId = clientId.substring(hostShortName.length());
+      }
+    }
+
+    String vmPIDAndKindRegex = "\\(\\w+:\\w+\\)";
+    String regex = "(\\<ec\\>)?:[0-9]+(:\\w+){2}+";
+    String name = NOT_AVAILABLE;
+    String temp = hostExcludedId;
+
+    int openIndex = temp.indexOf("(");
+    if (openIndex != -1) {
+      regex = vmPIDAndKindRegex + regex;
+    }
+
+    if (temp.matches(regex)) {
+      String[] splitted = temp.split(":");
+      name = splitted[splitted.length - 1];
+    }
+
+    return name;
+  }
+
+  /**
+   * Returns a Map of all the statistics required for Hyperic currently. It relies on the attribute
+   * of the StatisticsResource Mbeans.
+   * 
+   * @param member instance for which the stats are needed
+   * @return Map of all the statistics required for Hyperic currently.
+   * @throws OperationsException exceptions thrown while retrieving the attributes
+   */
+  private Map<String, Object> getRequiredStats(SystemMemberJmx member, boolean statSamplingEnabled)
+      throws OperationsException {
+    Map<String, Object> statDetails = new TreeMap<String, Object>();
+
+    try {
+      if (!statSamplingEnabled) {
+        statDetails.put(STATS_PROCESSCPUTIME, NOT_AVAILABLE_NUMBER);
+        statDetails.put(STATS_CPUS, NOT_AVAILABLE_NUMBER);
+        statDetails.put(STATS_MAXMEMORY, NOT_AVAILABLE_NUMBER);
+        statDetails.put(STATS_USEDMEMORY, NOT_AVAILABLE_NUMBER);
+        statDetails.put(STATS_GETS, NOT_AVAILABLE_NUMBER);
+        statDetails.put(STATS_GETTIME, NOT_AVAILABLE_NUMBER);
+        statDetails.put(STATS_PUTS, NOT_AVAILABLE_NUMBER);
+        statDetails.put(STATS_PUTTIME, NOT_AVAILABLE_NUMBER);
+      } else {
+        MBeanServer mBeanServer = agent.getMBeanServer();
+        Number defaultVal = NOT_AVAILABLE_NUMBER;
+        Number processCpuTime = defaultVal;
+        Number cpus = defaultVal;
+        Number maxMemory = defaultVal;
+        Number usedMemory = defaultVal;
+        Number gets = defaultVal;
+        Number getTime = defaultVal;
+        Number puts = defaultVal;
+        Number putTime = defaultVal;
+
+        ObjectName[] vmMemoryUsageStats = getExistingStats(member.getId(), "vmHeapMemoryStats");
+        ObjectName[] vmStats = getExistingStats(member.getId(), "vmStats");
+        ObjectName[] cachePerfStats = getExistingStats(member.getId(), "cachePerfStats");
+        boolean needToReinit = false;
+        if (vmMemoryUsageStats.length == 0 || vmStats.length == 0 || cachePerfStats.length == 0) {
+          // if the StatisticResource MBeans are not created
+          needToReinit = true;
+        }
+        if (!needToReinit) {
+          /*
+           * To handle a case when the StatisticResource MBeans are created but not registered with
+           * RefreshTimer. If VMMemoryUsageStats are present, maxMemory should always be non-zero.
+           */
+          for (int i = 0; i < vmMemoryUsageStats.length; i++) {// ideally there should be a single
+                                                               // instance
+            String type = (String) mBeanServer.getAttribute(vmMemoryUsageStats[i], "type");
+
+            if ("VMMemoryUsageStats".equals(type)) { // first instance that has Statistics Type name
+              maxMemory = (Number) getAttribute(vmMemoryUsageStats[i], "maxMemory", defaultVal);
+              break;
+            }
+          }
+
+          needToReinit = 0 == maxMemory.longValue();
+        }
+
+        if (needToReinit) {
+          logger.info(LocalizedMessage.create(
+              LocalizedStrings.MemberInfoWithStatsMBean_REINITIALIZING_STATS_FOR_0,
+              member.getId()));
+          initStats(member);
+
+          vmMemoryUsageStats = getExistingStats(member.getId(), "vmHeapMemoryStats");
+          vmStats = getExistingStats(member.getId(), "vmStats");
+          cachePerfStats = getExistingStats(member.getId(), "cachePerfStats");
+        }
+
+        for (int i = 0; i < vmMemoryUsageStats.length; i++) {// ideally there should be a single
+                                                             // instance
+          String type = (String) mBeanServer.getAttribute(vmMemoryUsageStats[i], "type");
+
+          if ("VMMemoryUsageStats".equals(type)) { // first instance that has Statistics Type name
+            maxMemory = (Number) getAttribute(vmMemoryUsageStats[i], "maxMemory", defaultVal);
+            usedMemory = (Number) getAttribute(vmMemoryUsageStats[i], "usedMemory", defaultVal);
+            break;
+          }
+        }
+
+        for (int i = 0; i < vmStats.length; i++) {// ideally there should be a single instance
+          String type = (String) mBeanServer.getAttribute(vmStats[i], "type");
+
+          if ("VMStats".equals(type)) { // first instance that has Statistics Type name
+            processCpuTime = (Number) getAttribute(vmStats[i], "processCpuTime", defaultVal);
+            cpus = (Number) getAttribute(vmStats[i], "cpus", defaultVal);
+            break;
+          }
+        }
+
+        for (int i = 0; i < cachePerfStats.length; i++) {// ideally there should be a single
+                                                         // instance
+          String type = (String) mBeanServer.getAttribute(cachePerfStats[i], "type");
+
+          if ("CachePerfStats".equals(type)) { // first instance that has Statistics Type name
+            gets = (Number) getAttribute(cachePerfStats[i], "gets", defaultVal);
+            getTime = (Number) getAttribute(cachePerfStats[i], "getTime", defaultVal);
+            puts = (Number) getAttribute(cachePerfStats[i], "puts", defaultVal);
+            putTime = (Number) getAttribute(cachePerfStats[i], "putTime", defaultVal);
+            break;
+          }
+        }
+
+        statDetails.put(STATS_PROCESSCPUTIME, processCpuTime == NOT_AVAILABLE_NUMBER
+            ? NOT_AVAILABLE_NUMBER : processCpuTime.longValue());
+        statDetails.put(STATS_CPUS,
+            cpus == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : cpus.intValue());
+        statDetails.put(STATS_MAXMEMORY,
+            maxMemory == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : maxMemory.longValue());
+        statDetails.put(STATS_USEDMEMORY,
+            usedMemory == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : usedMemory.longValue());
+        statDetails.put(STATS_GETS,
+            gets == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : gets.intValue());
+        statDetails.put(STATS_GETTIME,
+            getTime == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : getTime.intValue());
+        statDetails.put(STATS_PUTS,
+            puts == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : puts.intValue());
+        statDetails.put(STATS_PUTTIME,
+            putTime == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : putTime.longValue());
+      }
+    } catch (Exception e) {
+      logger.warn(e.getMessage(), e);
+      throw new OperationsException(e.getMessage());
+    }
+
+    return statDetails;
+  }
+
+  /**
+   * Returns attribute with given attribute name on MBean with given ObjectName.
+   * 
+   * 
+   * @param objectName ObjectName for the MBean
+   * @param attribute attribute name
+   * @param unavailableValue return this value if the attribute value is null
+   * @return value of attribute with given attribute name
+   * @throws OperationsException if attribute is not found for MBean with this ObjectName or MBean
+   *         instance is not found
+   * @throws MBeanException if MBeans getter throws exception
+   * @throws ReflectionException thrown when trying to invoke the setter.
+   */
+  private Object getAttribute(ObjectName objectName, String attribute, Object unavailableValue)
+      throws OperationsException, MBeanException, ReflectionException {
+    /* NOTE: callers methods rely on non-null value being returned */
+    Object value = null;
+
+    MBeanServer mBeanServer = agent.getMBeanServer();
+    value = mBeanServer.getAttribute(objectName, attribute);
+
+    value = (value != null) ? value : unavailableValue;
+
+    return value;
+  }
+
+  /**
+   * Return Map of region full against the ObjectName of existing region MBeans.
+   * 
+   * @param memberId string identifier of a member
+   * @return Map of region path vs ObjectName for existing region MBeans
+   * @throws MalformedObjectNameException If the query expression used is not valid
+   */
+  private Map<String, ObjectName> getExistingRegionMbeansFullPaths(String memberId)
+      throws MalformedObjectNameException {
+    Map<String, ObjectName> pathsToObjName = new HashMap<String, ObjectName>();
+
+    if (memberId != null && memberId.trim().length() != 0) {
+      Object[] params = new Object[] {MBeanUtil.makeCompliantMBeanNameProperty(memberId)};
+      Set<ObjectName> queryNames = queryObjectNames(REGION_QUERY_EXPRESSION, params);
+      for (ObjectName objectName : queryNames) {
+        pathsToObjName.put(objectName.getKeyProperty("path"), objectName);
+      }
+    }
+
+    return pathsToObjName;
+  }
+
+  /**
+   * Returns an array of ObjectNames existing statistics types MBeans
+   * 
+   * @param memberId string identifier of a member
+   * @param name text id of the stats which appears in the stats ObjectName as name keyProperty
+   * @return Array of Stats MBean ObjectNames
+   * @throws MalformedObjectNameException If the query expression used is not valid
+   */
+  private ObjectName[] getExistingStats(String memberId, String name)
+      throws MalformedObjectNameException {
+    ObjectName[] statObjectNames = new ObjectName[0];
+
+    if (memberId != null && memberId.trim().length() != 0) {
+      Object[] params = new Object[] {MBeanUtil.makeCompliantMBeanNameProperty(memberId), name};
+      Set<ObjectName> queryNames = queryObjectNames(STATS_QUERY_EXPRESSION, params);
+      statObjectNames = new ObjectName[queryNames.size()];
+      statObjectNames = queryNames.toArray(statObjectNames);
+    }
+
+    return statObjectNames;
+  }
+
+  /**
+   * Queries the MBean server with the string formed using placing the params in the parameterized
+   * string passed as queryStr.
+   * 
+   * @param queryStr parameterized string
+   * @param params params to put in the string
+   * @return results of an ObjectName query
+   * @throws MalformedObjectNameException If the query expression ObjectName formed is not valid
+   */
+  private Set<ObjectName> queryObjectNames(String queryStr, Object... params)
+      throws MalformedObjectNameException {
+    Set<ObjectName> queried = Collections.emptySet();
+
+    queryStr = MessageFormat.format(queryStr, params);
+    ObjectName queryExp = ObjectName.getInstance(queryStr);
+    queried = agent.getMBeanServer().queryNames(null, queryExp);
+
+    return queried;
+  }
+
+
+  /* *************************************************************************/
+  /* **************** NOTIFICATION EMITTER IMPLEMENTATION ********************/
+  /* *************************************************************************/
+
+  /**
+   * @see NotificationEmitter#addNotificationListener(NotificationListener, NotificationFilter,
+   *      Object)
+   */
+  public void addNotificationListener(NotificationListener listener, NotificationFilter filter,
+      Object handback) throws IllegalArgumentException {
+    forwarder.addNotificationListener(listener, filter, handback);
+  }
+
+  /**
+   * @see NotificationEmitter#removeNotificationListener(NotificationListener)
+   */
+  public void removeNotificationListener(NotificationListener listener)
+      throws ListenerNotFoundException {
+    forwarder.removeNotificationListener(listener);
+  }
+
+  /**
+   * @see NotificationEmitter#getNotificationInfo()
+   */
+  public MBeanNotificationInfo[] getNotificationInfo() {
+    return getMBeanInfo().getNotifications();
+  }
+
+  /**
+   * @see NotificationEmitter#removeNotificationListener(NotificationListener, NotificationFilter,
+   *      Object)
+   */
+  public void removeNotificationListener(NotificationListener listener, NotificationFilter filter,
+      Object handback) throws ListenerNotFoundException {
+    forwarder.removeNotificationListener(listener, filter, handback);
+  }
+
+}
+
+
+/**
+ * This class acts as a hub for the Notifications defined on AdminDistributedSystem & SystemMember
+ * MBeans. This acts as a listener for these notifications and broadcasts them as notifications from
+ * the {@link MemberInfoWithStatsMBean} MBean. This class extends
+ * {@link NotificationBroadcasterSupport} only to have the functionality to send notifications.
+ * 
+ * 
+ * @since GemFire 6.5
+ */
+class NotificationForwarder extends NotificationBroadcasterSupport implements NotificationListener {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /* sequence generator for notifications from GemFireTypesWrapper MBean */
+  private static AtomicLong notificationSequenceNumber = new AtomicLong();
+
+  /* reference to the MBeanServer instance */
+  private MBeanServer mBeanServer;
+
+  /**
+   * Default Constructor
+   * 
+   * @param mBeanServer reference to the MBeanServer instance
+   */
+  /* default */ NotificationForwarder(MBeanServer mBeanServer) {
+    this.mBeanServer = mBeanServer;
+  }
+
+  /**
+   * Handles notifications as: 1. Member Joined: Registers this NotificationForwarder as a
+   * notification listener for Cache/Region Notifications. 2. Member Left/Crashed: Unregisters this
+   * NotificationForwarder as a notification listener for Cache/Region Notifications. 3.
+   * AdminDistributedSystem Disconnected: Unregisters this NotificationForwarder as a notification
+   * listener for member Notifications.
+   * 
+   * Forwards the notifications to the JMX Clients that have registered for notifications on this
+   * MBean
+   * 
+   * @param notification notification to be handled
+   * @param handback handback object used while NotificationForwarder was registered
+   * 
+   * @see NotificationListener#handleNotification(Notification, Object)
+   */
+  public void handleNotification(Notification notification, Object handback) {
+    Object notifSource = notification.getSource();
+    if (AdminDistributedSystemJmxImpl.NOTIF_MEMBER_JOINED.equals(notification.getType())) {
+      ObjectName source = (ObjectName) notifSource;
+      // initialize statistics/register with refreshTimer for new member
+      String[] noArgs = {};
+      try {
+        ObjectName[] stats =
+            (ObjectName[]) mBeanServer.invoke(source, "manageStats", noArgs, noArgs);
+        if (stats != null) {
+          for (ObjectName stat : stats) {
+            mBeanServer.invoke(stat, "getStatistics", noArgs, noArgs);
+          }
+        }
+        logger.debug("getStatistics call completed with no exceptions.");
+      } catch (ReflectionException e) {
+        logger.info(LocalizedMessage.create(
+            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INITIALIZING_STATISICS_FOR_0,
+            source.toString()), e);
+      } catch (MBeanException e) {
+        logger.info(LocalizedMessage.create(
+            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INITIALIZING_STATISICS_FOR_0,
+            source.toString()), e);
+      } catch (InstanceNotFoundException e) {
+        logger.info(LocalizedMessage.create(
+            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INITIALIZING_STATISICS_FOR_0,
+            source.toString()), e);
+      }
+      // register this listener for joined member's cache/region notifications
+      try {
+        registerNotificationListener(source);
+      } catch (OperationsException e) {
+        logger.info(LocalizedMessage.create(
+            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_REGISTERING_NOTIFICATION_LISTENER_FOR_0,
+            source.toString()), e);
+      }
+    } /*
+       * else if (AdminDistributedSystemJmxImpl.NOTIF_MEMBER_LEFT.equals(notification.getType()) ||
+       * AdminDistributedSystemJmxImpl.NOTIF_MEMBER_CRASHED.equals(notification.getType())) {
+       * ObjectName source = (ObjectName) notifSource; //unregister this listener from left member's
+       * cache/region notifications try { unregisterNotificationListener(source); } catch
+       * (OperationsException e) { logwriter.info(LocalizedMessage.create(LocalizedStrings.
+       * MemberInfoWithStatsMBean_EXCEPTION_WHILE_UNREGISTERING_NOTIFICATION_LISTENER_FOR_0,
+       * source.toString(), e); } } else if
+       * (AdminDistributedSystemJmxImpl.NOTIF_ADMIN_SYSTEM_DISCONNECT.equals(notification.getType())
+       * ) { String source = (String) notifSource; //This notification does not have ObjectName as a
+       * source. try { ObjectName instance = ObjectName.getInstance(source);
+       * unregisterNotificationListener(instance); } catch (OperationsException e) {
+       * logwriter.info(LocalizedMessage.create(LocalizedStrings.
+       * MemberInfoWithStatsMBean_EXCEPTION_WHILE_UNREGISTERING_NOTIFICATION_LISTENER_FOR_0,
+       * source.toString(), e); } catch (NullPointerException e) {
+       * logwriter.info(LocalizedMessage.create(LocalizedStrings.
+       * MemberInfoWithStatsMBean_EXCEPTION_WHILE_UNREGISTERING_NOTIFICATION_LISTENER_FOR_0,
+       * source.toString(), e); } }
+       */
+    // NOTIF_ALERT is sent as is
+
+    // TODO: Check if same notification instance can be reused by simply changing the sequence
+    // number
+    notification = new Notification(notification.getType(), notifSource,
+        notificationSequenceNumber.addAndGet(1L), notification.getTimeStamp(),
+        notification.getMessage());
+
+    sendNotification(notification);
+  }
+
+  /**
+   * Registers itself as a NotificationListener for Notifications sent from MBean with the
+   * ObjectName given as source.
+   * 
+   * @param source source of notifications
+   * @throws InstanceNotFoundException The MBean name provided does not match any of the registered
+   *         MBeans.
+   */
+  /* default */void registerNotificationListener(ObjectName source)
+      throws InstanceNotFoundException {
+    mBeanServer.addNotificationListener(source, this, null/* handback */, source);
+  }
+
+  /**
+   * Unregisters itself as a NotificationListener for Notifications sent from MBean with the
+   * ObjectName given as source.
+   * 
+   * @param source source of notifications
+   * @throws InstanceNotFoundException The MBean name provided does not match any of the registered
+   *         MBeans.
+   * @throws ListenerNotFoundException The listener is not registered in the MBean.
+   */
+  /* default */void unregisterNotificationListener(ObjectName source)
+      throws InstanceNotFoundException, ListenerNotFoundException {
+    mBeanServer.removeNotificationListener(source, this);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RMIRegistryService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RMIRegistryService.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RMIRegistryService.java
new file mode 100644
index 0000000..5664f85
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RMIRegistryService.java
@@ -0,0 +1,221 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.UnknownHostException;
+import java.rmi.NoSuchObjectException;
+import java.rmi.NotBoundException;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.RMIServerSocketFactory;
+import java.rmi.server.UnicastRemoteObject;
+
+/**
+ * This MBean is an implementation of {@link RMIRegistryServiceMBean}.
+ * 
+ */
+public class RMIRegistryService implements RMIRegistryServiceMBean {
+  /* RMI Registry host */
+  private String host;
+  /* RMI Registry port */
+  private int port;
+  /* RMI Registry */
+  private Registry registry;
+  /* RMI Server Socket Factory */
+  private RMIServerSocketFactory ssf;
+  /* Whether RMI Registry is started & running */
+  private boolean isRunning;
+
+  /**
+   * Constructor to configure RMI Registry to start using default RMI Registry port:
+   * {@link Registry#REGISTRY_PORT}
+   */
+  public RMIRegistryService() {
+    this(Registry.REGISTRY_PORT);
+  }
+
+  /**
+   * Constructor to configure RMI Registry to start using given RMI Registry port.
+   * 
+   * @param port to run RMI Registry on
+   */
+  public RMIRegistryService(int port) {
+    setPort(port);
+  }
+
+  /**
+   * Constructor to configure RMI Registry to start using given RMI Registry port & host bind
+   * address.
+   * 
+   * @param host to bind RMI Registry to
+   * @param port to run RMI Registry on
+   * 
+   * @throws UnknownHostException if IP Address can not be resolved for the given host string while
+   *         creating the RMIServerSocketFactory
+   */
+  public RMIRegistryService(String host, int port) throws UnknownHostException {
+    setPort(port);
+    setHost(host);
+    if (host != null && !host.trim().equals("")) {
+      ssf = new RMIServerSocketFactoryImpl(host);
+    }
+  }
+
+  /**
+   * Returns the host on which rmiregistry listens for incoming connections
+   *
+   * @return the host on which rmiregistry listens for incoming connections
+   */
+  public String getHost() {
+    return host;
+  }
+
+  /**
+   * Sets the host on which rmiregistry listens for incoming connections
+   * 
+   * @param host the host on which rmiregistry listens for incoming connections
+   */
+  protected void setHost(String host) {
+    if (isRunning()) {
+      throw new IllegalStateException("RMIRegistryService is running, cannot change the host");
+    }
+    this.host = host;
+  }
+
+  /**
+   * Returns the port on which rmiregistry listens for incoming connections
+   * 
+   * @return the port on which rmiregistry listens for incoming connections
+   */
+  public int getPort() {
+    return port;
+  }
+
+  /**
+   * Sets the port on which rmiregistry listens for incoming connections
+   * 
+   * @param port the port on which rmiregistry listens for incoming connections
+   */
+  protected void setPort(int port) {
+    if (isRunning()) {
+      throw new IllegalStateException("RMIRegistryService is running, cannot change the port");
+    }
+    this.port = port;
+  }
+
+  /**
+   * Starts this MBean: rmiregistry can now accept incoming calls
+   * 
+   * @see #stop
+   * @see #isRunning
+   */
+  public synchronized void start() throws RemoteException {
+    if (!isRunning()) {
+      if (ssf != null) {
+        registry = LocateRegistry.createRegistry(port, null, // RMIClientSocketFactory
+            ssf); // RMIServerSocketFactory
+      } else {
+        registry = LocateRegistry.createRegistry(port);
+      }
+
+      isRunning = true;
+    }
+  }
+
+  /**
+   * Returns whether this MBean has been started and not yet stopped.
+   * 
+   * @return whether this MBean has been started and not yet stopped.
+   * @see #start
+   */
+  public synchronized boolean isRunning() {
+    return isRunning;
+  }
+
+  /**
+   * Stops this MBean: rmiregistry cannot accept anymore incoming calls
+   * 
+   * @see #start
+   */
+  public synchronized void stop() throws NoSuchObjectException {
+    if (isRunning()) {
+      isRunning = !UnicastRemoteObject.unexportObject(registry, true);
+    }
+  }
+
+  /**
+   * Returns an array of the names bound in the rmiregistry
+   * 
+   * @return an array of the names bound in the rmiregistry
+   * @see java.rmi.registry.Registry#list()
+   */
+  public String[] list() throws RemoteException {
+    if (!isRunning()) {
+      throw new IllegalStateException("RMIRegistryService is not running");
+    }
+    return registry.list();
+  }
+
+  /**
+   * Removes the binding for the specified <code>name</code> in the rmiregistry
+   * 
+   * @see java.rmi.registry.Registry#unbind(String)
+   */
+  public void unbind(String name) throws RemoteException, NotBoundException {
+    if (!isRunning()) {
+      throw new IllegalStateException("RMIRegistryService is not running");
+    }
+    registry.unbind(name);
+  }
+}
+
+
+/**
+ * Custom implementation of the {@link RMIServerSocketFactory}
+ * 
+ */
+class RMIServerSocketFactoryImpl implements RMIServerSocketFactory {
+  /* IP address to use for creating ServerSocket */
+  private InetAddress bindAddress;
+
+  /**
+   * Constructs a RMIServerSocketFactory. The given rmiBindAddress is used to bind the ServerSockets
+   * created from this factory.
+   * 
+   * @param rmiBindAddress String representation of the address to bind the ServerSockets to
+   * 
+   * @throws UnknownHostException if IP Address can not be resolved for the given host string
+   */
+  /* default */ RMIServerSocketFactoryImpl(String rmiBindAddress) throws UnknownHostException {
+    this.bindAddress = InetAddress.getByName(rmiBindAddress);
+  }
+
+  /**
+   * Create a server socket on the specified port (port 0 indicates an anonymous port).
+   * 
+   * @param port the port number
+   * @return the server socket on the specified port
+   * @exception IOException if an I/O error occurs during server socket creation
+   */
+  public ServerSocket createServerSocket(int port) throws IOException {
+    return new ServerSocket(port, 0/* backlog - for '0' internally uses the default */,
+        bindAddress);
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RMIRegistryServiceMBean.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RMIRegistryServiceMBean.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RMIRegistryServiceMBean.java
new file mode 100644
index 0000000..f9ae8c5
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RMIRegistryServiceMBean.java
@@ -0,0 +1,80 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import java.rmi.NoSuchObjectException;
+import java.rmi.NotBoundException;
+import java.rmi.RemoteException;
+
+/**
+ * This interface is similar to mx4j.tools.naming.NamingServiceMBean. Features that differ are: 1.
+ * This MBean interface additionally provides a way to specify the host that the RMI Registry should
+ * get bound to. 2. Port property can not be changed once set.
+ * 
+ */
+public interface RMIRegistryServiceMBean {
+
+  /**
+   * Returns the host on which rmiregistry listens for incoming connections
+   *
+   * @return the host on which rmiregistry listens for incoming connections
+   */
+  public String getHost();
+
+  /**
+   * Returns the port on which rmiregistry listens for incoming connections
+   * 
+   * @return the port on which rmiregistry listens for incoming connections
+   */
+  public int getPort();
+
+  /**
+   * Returns whether this MBean has been started and not yet stopped.
+   * 
+   * @return whether this MBean has been started and not yet stopped.
+   * @see #start
+   */
+  public boolean isRunning();
+
+  /**
+   * Starts this MBean: rmiregistry can now accept incoming calls
+   * 
+   * @see #stop
+   * @see #isRunning
+   */
+  public void start() throws RemoteException;
+
+  /**
+   * Stops this MBean: rmiregistry cannot accept anymore incoming calls
+   * 
+   * @see #start
+   */
+  public void stop() throws NoSuchObjectException;
+
+  /**
+   * Returns an array of the names bound in the rmiregistry
+   * 
+   * @return an array of the names bound in the rmiregistry
+   * @see java.rmi.registry.Registry#list()
+   */
+  public String[] list() throws RemoteException;
+
+  /**
+   * Removes the binding for the specified <code>name</code> in the rmiregistry
+   * 
+   * @see java.rmi.registry.Registry#unbind(String)
+   */
+  public void unbind(String name) throws RemoteException, NotBoundException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RefreshNotificationType.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RefreshNotificationType.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RefreshNotificationType.java
new file mode 100755
index 0000000..f6633f2
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/RefreshNotificationType.java
@@ -0,0 +1,126 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * Type-safe definition for refresh notifications.
+ *
+ * @since GemFire 3.5
+ *
+ */
+public class RefreshNotificationType implements java.io.Serializable {
+  private static final long serialVersionUID = 4376763592395613794L;
+
+  /** Notify StatisticResource to refresh statistics */
+  public static final RefreshNotificationType STATISTIC_RESOURCE_STATISTICS =
+      new RefreshNotificationType("GemFire.Timer.StatisticResource.statistics.refresh", "refresh");
+
+  /** Notify SystemMember to refresh config */
+  public static final RefreshNotificationType SYSTEM_MEMBER_CONFIG =
+      new RefreshNotificationType("GemFire.Timer.SystemMember.config.refresh", "refresh");
+
+  /** Notification type for the javax.management.Notification */
+  private final transient String type;
+
+  /** Notification msg for the javax.management.Notification */
+  private final transient String msg;
+
+  // The 4 declarations below are necessary for serialization
+  /** int used as ordinal to represent this Scope */
+  public final int ordinal = nextOrdinal++;
+
+  private static int nextOrdinal = 0;
+
+  private static final RefreshNotificationType[] VALUES =
+      {STATISTIC_RESOURCE_STATISTICS, SYSTEM_MEMBER_CONFIG};
+
+  private Object readResolve() throws java.io.ObjectStreamException {
+    return VALUES[ordinal]; // Canonicalize
+  }
+
+  /** Creates a new instance of RefreshNotificationType. */
+  private RefreshNotificationType(String type, String msg) {
+    this.type = type;
+    this.msg = msg;
+  }
+
+  /** Return the RefreshNotificationType represented by specified ordinal */
+  public static RefreshNotificationType fromOrdinal(int ordinal) {
+    return VALUES[ordinal];
+  }
+
+  public String getType() {
+    return this.type;
+  }
+
+  public String getMessage() {
+    return this.msg;
+  }
+
+  /**
+   * Returns a string representation for this notification type.
+   *
+   * @return the type string for this Notification
+   */
+  @Override
+  public String toString() {
+    return this.type;
+  }
+
+  /**
+   * Indicates whether some other object is "equal to" this one.
+   *
+   * @param other the reference object with which to compare.
+   * @return true if this object is the same as the obj argument; false otherwise.
+   */
+  @Override
+  public boolean equals(Object other) {
+    if (other == this)
+      return true;
+    if (other == null)
+      return false;
+    if (!(other instanceof RefreshNotificationType))
+      return false;
+    final RefreshNotificationType that = (RefreshNotificationType) other;
+
+    if (!StringUtils.equals(this.type, that.type))
+      return false;
+    if (!StringUtils.equals(this.msg, that.msg))
+      return false;
+
+    return true;
+  }
+
+  /**
+   * Returns a hash code for the object. This method is supported for the benefit of hashtables such
+   * as those provided by java.util.Hashtable.
+   *
+   * @return the integer 0 if description is null; otherwise a unique integer.
+   */
+  @Override
+  public int hashCode() {
+    int result = 17;
+    final int mult = 37;
+
+    result = mult * result + (this.type == null ? 0 : this.type.hashCode());
+    result = mult * result + (this.msg == null ? 0 : this.msg.hashCode());
+
+    return result;
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatAlertNotification.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatAlertNotification.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatAlertNotification.java
new file mode 100644
index 0000000..534d060
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatAlertNotification.java
@@ -0,0 +1,150 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.Serializable;
+import java.io.IOException;
+
+import org.apache.geode.DataSerializer;
+import org.apache.geode.DataSerializable;
+import org.apache.geode.internal.DataSerializableFixedID;
+import org.apache.geode.internal.Version;
+import org.apache.geode.internal.admin.StatAlert;
+import org.apache.geode.internal.admin.StatAlertDefinition;
+
+/**
+ * Notification to be sent to clients (e.g GFMon2.0 ). It incorporates
+ * 
+ * @see StatAlert raised and also Gemfire member id which raised the alert
+ * 
+ * 
+ * @since GemFire 5.7
+ */
+public class StatAlertNotification extends StatAlert
+    implements Serializable, DataSerializable, DataSerializableFixedID {
+  private static final long serialVersionUID = -1634729103430107871L;
+  private String memberId;
+
+  public StatAlertNotification() {}
+
+  public StatAlertNotification(StatAlert statAlert, String memberId) {
+    this.setDefinitionId(statAlert.getDefinitionId());
+    this.setValues(statAlert.getValues());
+    this.setTime(statAlert.getTime());
+    this.memberId = memberId;
+  }
+
+  public int getDSFID() {
+    return DataSerializableFixedID.STAT_ALERT_NOTIFICATION;
+  }
+
+  /**
+   * @return the memberId
+   */
+  public String getMemberId() {
+    return memberId;
+  }
+
+  /**
+   * 
+   * @param id of gemfire member which raised the alert
+   */
+  public void setMemberId(String id) {
+    memberId = id;
+  }
+
+  /**
+   * @return String representation of this object
+   */
+  @Override
+  public String toString() {
+    StringBuffer buf = new StringBuffer();
+    buf.append("[");
+    for (int i = 0; i < getValues().length; i++) {
+      buf.append(getValues()[i] + ", ");
+    }
+    buf.append("]");
+    return Integer.valueOf(getDefinitionId()) + ":" + buf.toString();
+  }
+
+  /**
+   * The notification is something like this "For Member ID: <ID> [ <StatName> = <Value> .. ]"
+   * 
+   * @param defn {@link StatAlertDefinition}
+   * @return String representation of this object based on {@link StatAlertDefinition}
+   */
+  public String toString(StatAlertDefinition defn) {
+    StringBuffer buf = new StringBuffer();
+    buf.append("For Member ID: ");
+    buf.append(this.memberId);
+    buf.append("\n");
+    buf.append("[ ");
+    for (int i = 0; i < getValues().length; i++) {
+      buf.append(defn.getStatisticInfo()[i].toString() + "=" + getValues()[i] + "\n");
+    }
+    buf.append("]");
+    return getTime().toString() + ":" + buf.toString();
+  }
+
+  @Override
+  public boolean equals(Object object) {
+    if (object != null && !(object instanceof StatAlertNotification)) {
+      return false;
+    }
+
+    StatAlertNotification other = (StatAlertNotification) object;
+
+    int defId = getDefinitionId();
+
+    if (defId != -1 && defId == other.getDefinitionId() && memberId != null
+        && memberId.equals(other.getMemberId())) {
+      return true;
+    }
+
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return memberId.hashCode();
+  }
+
+  public void toData(DataOutput out) throws IOException {
+    // Do not modify StatAlert to allow 57 cacheservers to function with 57+ agent
+    // However, update of a new StatAlertDefn on 57 server from 57+ agent not covered with this
+    DataSerializer.writePrimitiveInt(this.getDefinitionId(), out);
+    DataSerializer.writeDate(this.getTime(), out);
+    DataSerializer.writeObjectArray(this.getValues(), out);
+
+    DataSerializer.writeString(this.memberId, out);
+  }
+
+  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
+    // Do not modify StatAlert to allow 57 cacheservers to function with 57+ agent
+    // However, update of a new StatAlertDefn on 57 server from 57+ agent not covered with this
+    this.setDefinitionId(DataSerializer.readPrimitiveInt(in));
+    this.setTime(DataSerializer.readDate(in));
+    this.setValues((Number[]) DataSerializer.readObjectArray(in));
+
+    this.memberId = DataSerializer.readString(in);
+  }
+
+  @Override
+  public Version[] getSerializationVersions() {
+    return null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatAlertsAggregator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatAlertsAggregator.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatAlertsAggregator.java
new file mode 100644
index 0000000..d97d61e
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/StatAlertsAggregator.java
@@ -0,0 +1,111 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.geode.internal.admin.GemFireVM;
+import org.apache.geode.internal.admin.StatAlert;
+import org.apache.geode.internal.admin.StatAlertDefinition;
+
+/**
+ * This interface represents an Aggregator entity and resides in JMXAgent. Responsibilities are as
+ * follows:
+ * <ol>
+ * <li>set AlertsManager in the newly joined members
+ * <li>create/update/remove alert
+ * <li>manage refresh interval
+ * <li>process notification from members
+ * <li>Aggregate stats & make available for clients thro' JMXAgent
+ * </ol>
+ * 
+ */
+public interface StatAlertsAggregator {
+
+  /**
+   * This method can be used to get an alert definition.
+   * 
+   * @param alertDefinition StatAlertDefinition to retrieve
+   * @return StatAlertDefinition
+   */
+  public StatAlertDefinition getAlertDefinition(StatAlertDefinition alertDefinition);
+
+  /**
+   * This method can be used to retrieve all available stat alert definitions.
+   * 
+   * @return An array of all available StatAlertDefinition objects
+   */
+  public StatAlertDefinition[] getAllStatAlertDefinitions();
+
+  /**
+   * This method can be used to update alert definition for the Stat mentioned. This method should
+   * update the collection maintained at the aggregator and should notify members for the newly
+   * added alert definitions.
+   * <p>
+   * A new alert definition will be created if matching one not found.
+   * 
+   * @param alertDefinition alertDefinition to be updated
+   */
+  public void updateAlertDefinition(StatAlertDefinition alertDefinition);
+
+  /**
+   * This method can be used to remove alert definition for the Stat mentioned.
+   * <p>
+   * This method should update the collection maintained at the aggregator and should notify members
+   * for the newly added alert definitions.
+   * 
+   * @param defId id of the alert definition to be removed
+   */
+  public void removeAlertDefinition(Integer defId);
+
+  /**
+   * Convenience method to check whether an alert definition is created.
+   * 
+   * @param alert alert definition to check whether already created
+   * @return true if the alert definition is already created, false otherwise
+   */
+  public boolean isAlertDefinitionCreated(StatAlertDefinition alert);
+
+  /**
+   * This method can be used to set the AlertManager for the newly joined member VM.
+   * 
+   * @param memberVM Member VM to set AlertsManager for
+   */
+  public void setAlertsManager(GemFireVM memberVM);
+
+  /**
+   * Returns the refresh interval for the Stats in seconds.
+   * 
+   * @return refresh interval for the Stats(in seconds)
+   */
+  public int getRefreshIntervalForStatAlerts();
+
+  /**
+   * This method is used to set the refresh interval for the Stats Alerts in seconds
+   * 
+   * @param refreshInterval refresh interval for the Stats(in seconds)
+   */
+  public void setRefreshIntervalForStatAlerts(int refreshInterval);
+
+  /**
+   * This method can be used to process the notifications sent by the member(s). Actual aggregation
+   * of stats can occur here. The array contains alert objects with alert def. ID & value.
+   * AlertHelper class can be used to retrieve the corresponding alert definition.
+   * 
+   * @param alerts array of Alert class(contains alert def. ID & value)
+   * @param remoteVM
+   */
+  public void processNotifications(StatAlert[] alerts, GemFireVM remoteVM);
+
+  public void processSystemwideNotifications();
+}


[03/50] [abbrv] incubator-geode git commit: Adding my PGP key to KEYS

Posted by kl...@apache.org.
Adding my PGP key to KEYS


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

Branch: refs/heads/feature/GEODE-288
Commit: 06de52736845a434ab0325766fab44506a81df2a
Parents: a847c55
Author: zhouxh <gz...@pivotal.io>
Authored: Tue Oct 25 14:17:26 2016 -0700
Committer: zhouxh <gz...@pivotal.io>
Committed: Tue Oct 25 14:17:26 2016 -0700

----------------------------------------------------------------------
 KEYS | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 128 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/06de5273/KEYS
----------------------------------------------------------------------
diff --git a/KEYS b/KEYS
index cbc5354..183abc1 100644
--- a/KEYS
+++ b/KEYS
@@ -897,3 +897,131 @@ CmrjtFbx4w8QQYkUwvYYtdVWD2JvNnp/eX89ROcaS+TCbLukaC3OphBXvWI3k1BK
 Vb32t+OopTVcELjTjAMBsixx+IaBClvjPXBTuaSXA4S+
 =SSEN
 -----END PGP PUBLIC KEY BLOCK-----
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v2
+
+mQENBFcGu5QBCACdmRgd8tfI7RVBdySyL/z41j+yJXdAak2BPXyVvlKP0FMvb0qB
+U6l8vk89HB+jpr5HtUFn+/rj4HuN8IK2blyn8NkSFCWdxirOZWWhMXyNFZQNJ7O7
++DdR8/ko/5I8RsLQ3cHLrF4e4c3NtAhv1IndFisd+mnalcnhLMIQU3899YC+VK4N
+KkSs9N1WDBtTd/kdr6sRUvkHf5hlICaXxmYwDknJ/jdLOI7bZN90fTWH0dWQNf2p
+6qEJlG/TrcW8IFVVk/eS9lk2eMVpYe8ObOfoF5lxfBqElTuuFOVQ+ermUzrQ+C7j
+HUYRKGsxs13cJXnaq3m2GCFbCuMzsU0aqg99ABEBAAG0J1hpYW9qaWFuIFpob3Ug
+PHpob3UueGlhb2ppYW5AZ21haWwuY29tPokBOQQTAQgAIwUCVwa7lAIbAwcLCQgH
+AwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEHbgUH6u2u49LkEH/3hL5UqceDnOV+2s
+Fx2kiT7L5dYQWHETls8ZFkrpokCHhPt7A/MxYPP06Ohe7q1g8FJhKeQbzXD6FSdq
+ewn2t9DwZN/pIIdPR/6OTgwgwhqeQvdLQIAZBbC3qjIRe0KxJFtxgcBVMXN8aWfa
+iUF/6ir+6bjx6/mtziTI3A/qdO/D8C3TwU2SpqpqLh1N/cTcgU6ZtIk/ZiaL4Eh4
+qIO205p1fvFX6gytrBkX9aBVSMtJFkOCBX/VqkGsrGcDtQYEwNEbI5rVFiYmA5of
+j8VxrSpXXK8eirXcHEzEbW969Wu29GzdhYIipVjVwDwmA+M6Wf6093jI+Y5IrgAf
+jgxhYn6JARwEEAEIAAYFAlcGyHkACgkQ8EzEmalmEzoZCwf/cl37XcJuH29yTzLr
+ApFMNxOEUb9p5wMKMSyEM7NzIMJc9luP2Di1nCZ/Hgp9+cjVFSwQ5eR8s4+y6d3b
+0Fva7QdMit1GLN+F/vV8ln8fql7SYbjhI/Z4yskMl4nvL8DBlPKGHTv5ruXQAmJi
+y50iCoa9wSXeU8ZT5N7g+BsbryRvfdKjYLfSdMUa4YlR/pRVTitivpwcyA4mN0AQ
+27Tb/ygurqHAVNlmgJjX0fowwOUEr1aqgasTRv5meet//utQsiRlIKGF43IMLai0
+dhk+r/EtXIsHaQXmGGpcFhFf0FN18x52A3LXsZTeSELxCXY8YdzhmtJmyRt7H+pe
+vgEPY4kCHAQQAQoABgUCVwa+JAAKCRBETB0goWiNl3uzD/4+8vs9zX89F8o4HMyF
+DpxzgH3etpjM8CScHcNdbVnrcO3OCgGg1nO8HMwRZS6PjIS0FVfl9csNMOZw8/SJ
+FdVz8u2GycyueiRu4SZHA0smu7lZlLNeB1AOqYFmreXbAHLd8LnCxlW4qA5RPtw/
+x0nWVSNJ5zUvJjBXurcDPS/FpcdaTRoK2jkWePddF/c4SBkgc1VARHWhqIuwvohZ
+ifCEeeU11l0Vl4HZCj0hgUUt9gXAcjk4YhCsSba/Cz3ERuxlhRgluvhBYlp+DzHq
+0benTCOSVUywTLUjajxdeV1l0jgH1Ps9Rvq8KYBPyP8PcdONLDIa9VcrhZNHabHN
+SUZRz3hAp/xsDY9oihUCHn1zfGklZRidAorR5FS0UZzFy8PoV6+Mrz2inf1xZapK
+a4bA3A0fYm1z3pXxA7ty6XCtwaQ7Gavs3toAXZWdiTtvqdObjb+3Zmhh1o63BA9t
+wIMi5dGy9/xvlQT7Ah6vWtJwGD45t9MwbRnDdivk0/3EJlZWwVzlHoPfjzUFKo+J
+zpU4cWRljJQPps5EAPFPl/OWx0nHbvrpbBQzc6f+ZbB+LszEetap+xq9yVJbGlXU
+cLr5OSAe0IWwOca5CGXCiO2Rr33jnCjLwshNTsPi4Iqtj+1ZVE75eDDbLXvQL+DF
+YIhA56DNZ8svFfBs34gtrW60fYkCIgQQAQoADAUCVwa/ugWDB4YfgAAKCRAmj1Aw
+i2z43fBJD/4i1ac8VxqMuSiEovEb/b+BbW2hipE6BofLdHIG3pixyo4mWR+EWlCB
+BDP8Vm/TZrnBS4b22K3xui4wR7ReTS5qqifv2LHxUdWMYZIbCGp4M1QbTmtGPvWG
+F6p/cw0lMltX2zTxRf1H/T71xvy8n4s07BZ7i0dgySYyZHDptXkPyZJGHeE1RbFW
+mwvvW3n8q40wETQXXTajIiUJEsDVbqTPTL5dlHrCbIdUXzxB+vkcg8e6sqZAqKJz
+YIaeL7VjbF9vzvcc6nLMa4qrlaBVOFfVrCgA8BL03UOIJ6sTmrXF7p4/qyxc8BIR
+kTQSXBU6t+D9NTXIGZ1VtOxuIIbE5TzzVGGHni/+D3aHhZjI/WHpXjvWgFfd6xY4
+6mVhO2H1pqgnnTqp+P4HCjKmoifUXVdqZnM0KAT2+RmIQ4FTXTZ/anxIIgETXXtF
+UiR9n+lc/P5D25UEj+gL07L+2smb0UYQmPAvCs0gGgyfR+iovOFX4CO9c/UPwnKf
+lPlW1u0nIEBIK6Z0kgsHCEh9H5NE1IV5YUY/2lq8ymAatCIf0+vaeI1b44j15aqd
+f1n/Ddp9eH8WOsicO9E5FJqBaOIGeRcGxkpFeix0HiMq0q5rwoC6M1agSxNdZVWy
+FkQx8r0kIMa28KDvMLFEhiLsc7sEZYHvcy0N5gYtXsu29hqva1XA0IkCIgQQAQoA
+DAUCVwbAUgWDB4YfgAAKCRDg7ynLSKVPhAyAD/9eBoOoc6a9tl7zIzBBlKjHMvFh
+Uv2zDJQpT6bd7HdzNnB9Ja2k72xeOzxdLH+2PU5IO0nrasJQMmvxSYQ4nPg1jWOQ
+hE8TQ061Y2Fbv8Z0eb5HJKcvI74xcseoML4wg15V69XV9768eeQD53jGpLoarbd8
+sNMOn8je6Gp1lGJ2MSxFOiPI2VWCTzc4BHMVv7t8VvQDOgOgEYw5ZhW1U+4spSWi
+45mS4y8V0zaA8x4pULkP1en+x3F8zavKWwJqCAl6zmd5gYtAvfEroXSLE7r/lRwd
+8gHJD/lhUmFLok31c61+a2yz8bDdD26noDorO7O66sYSJowflHsDz5jB9j1/iL3Z
+eHoM0ANLZ8TNHnR/buyiKoUG+BuQCCKBQH00ifqqP7UabLea/Ajbf9hxHGxfjOiA
+EA2Ij7pbYYR39FBdww3QmJxU9MyFL89h8egW5XE7Q73MdCd8WiqrLj4/NYI1Gvht
++5QKR0sY0jtJpX9+YW+8XBb2HwfwIZvmP/H6nyaXPq2uLCMNMMl+HNs4dpM5+1Gz
+dqHoyCpNoY39G3KdxWFe+Cwmf0Jt5JZab4DkRjYSRRkQ3R/lIdDnqPRaa0YConVh
+puywIKjS/yJWC6Sg9m6Wh1uf0IM94d45OGuFV/wDnky6kqnTOOwB5XIjaZvNflIU
+W1zh5l9Eb9fS9g55bokCIgQTAQgADAUCVwa+9AWDB4YfgAAKCRBWSn1JwdVHAe16
+D/9uy0+VEir3BtVuTw/S24cr1aUmaztOzi2unJN04Chd0XWmb5X5a/qaie1Kn7on
+YiyUERdKt6ScOuUEyszsMFukqOqB1HOuJbWzgu33KHNZYnrYEiIPXGxA4vHcYn0m
+SFatwVI+JV699DV1t/rJvhgzmWGtHohY0+oAkd6EFv7IQ1BJ7QGcPg24XViAoZes
+7Irur1USELrE5A4g9dbAeaS5CBZy52o+0MNQNZh2HqhDOOSxT2KT/CFMTQQ+1/GV
+QpbmA2CKQDKuzaMzRaiH3hlMAFc7NDVyTW+kmiKjPY6XddgHzqttZVOt0icijm+s
+9w2CptbasYQsZ/aTUvsoQS+YePthH6nS9G0BM20u21Za1Cpo5SDj2hKByMkBRSPJ
+I773ceeXPSMYePBY7ttBFtD/zzFrJcrNT7BK1FAMq1q3t0OgaZ4MJ/IoqUg6abM5
+UvgU1575c+kUWff+NA6c/XVFtqIubNjaZUfOqbQ9DGEt3jQpovzDlCmGxolGO1cX
+2FZnpOP4FjcqGOiGK0cf2LO+O2zurT1roqlj+FWR9qOho0iJo2RjKpX8cxbeDwNm
+5uv/BsVEXXSGxHjb2vx87+AzkRR9Nu9AOkN7y97mL3QT+onn0MpEzFkOJoTxYI3W
+iTWkmBNU8IoHUqCNkWFxXdWHCH1KAI1ars4KT7A9XDascokCIgQTAQgADAUCVwbA
+uQWDB4YfgAAKCRCE8JcYraLxkA4rEADh0JpNkvttf2VpB27b28v/SHiCUC8I61oL
+YZb7jFumI/8EM9+xbxoJmPrpbLnDS2cqSa6hHIpR4CUUwX4yFLJSvgCXnMJDe2Ud
+2NsWOgWlJkKzdOkjK06ntM+sxP3DWzNU4lX6d37fjEiM5TdAVu1edpGlVJKh6UfD
+raMGLoES0auOMISALN0XquYwuorU4wcxyPfcu3i9FwmZxo+zHqFB7rtTxVS7z/69
+6aUlZzgOcTCQeBHzH6ztPt7sZu1+kSVvbBUEQG8tRu0xYlEHkxqmmWts0yiT4aqd
+FLT/mwy8NcFj6EBizYGxdU3R3KLtOUTnv2cJQcHewmSFSytaeWt6QML0uZt2PyTd
+Co2FwdsZNKPY3eLA4cB+2kbQ6e5Y1n85f2KVnm/cMIWb3gISG0xK6AJGBDYzYBXH
+lYcnICL5hR1vbHVh8LOHal+U9V4PGayD9d/x98iXz6curXOZzmw1hUfoeImJKnmM
+4CmLgI6m6b4hAynTfVK/jIFgJp0gq5pw5+AZu1no42BZEdDWJOzkxSIholXztDaN
+lc0KbWoja4cv2yx+SNkOhwB9mt/M9Kz6C5e/el5o0ZlrYosW1hIi8gIg7fMKDbpb
+u7TGGyRfxHeRWCiMkMeoJPci8KxRI4xERR/+7PaR45X0aEqannHsvule6fYT5d/K
+SV8z08tI4okCIgQTAQoADAUCVwa/gAWDB4YfgAAKCRDI03Bfnb4hdwHAEACV46bE
+8dotDZcDGiULPGKxGVg3d/4KI+sTMPl4TzGdsYQY2aprSRixsMu9qjJaG8P6MVG9
+KUm/DxhwgAQu87DDNrmP5bzRVWio+AmbWzBT7FyTWiXRPWNQvrEgcplvZORziuUh
+DdBKvryNQD0iPyxO2EPTs5vroYa4YIAv3Vlr16JZ1IRfZxJkZq+da2mmDRoFk+LR
+vZSWzkDSLMy5vEoyWaer4MVc/nkn6k+UHKlqQALRdps9QAuikUL4yQUW20y3K8bM
+hfrOGDNEXZSg4W6wjaSVGMpKTu0PE/tP+mbH+FoP1Qg0oUl771cHan2x7WOZ5gqe
+JKSiAb6rDPQNhJjbpftyaYJCMYY5Sw7/ef2aA8X+bmuKqFeW+Yd5IbHQWrecCzqe
+QTO5pZapf+KTj3T9w8pkOFbvzvyIK0zL7m9NIfKBZyCof/XuYbJbbNnFX1VEygfW
+/ghxXtjcMcaBvjvKHxo73SLI/xOc0gObmd+H5pSmzSXLtPCh6n7lnphVSeTIWM/t
+PQzi+s6/4UdMh/NLkUjOVh/2foIF7sflhOifCg+XsX1hmnqNe+5fthxVFIqqGuAn
+sLPdwPSV0SSTLU9z6RfHhNAovRRaQqDpzQP0A8SJf2Fu0HqeaiT569h090svd1O9
+blKijXtwfXToqzqza9drWXnkeVSm3Iwg7E2fKIkCIgQTAQoADAUCVwa/vQWDB4Yf
+gAAKCRA/rHq1u7/feUhFEACgjBD6Nb+6PBY2KVH/glwkQHTwa6PDNsg4NkwwfSdy
+T9k6UvhCx37LB0UP3LC+Z6sQyoDr1IwtavQoLbyJkwZN6Cek3GCOjKQJOpbdSYGF
+/Ef26DZ17qlt+v6hN+jHP0bM16oBuPHucUivY3DvR2ll2/XmD7M9/AbiGkvpMRJ5
+qzdCV9eKrC7nBw+lOrYIURCuvhQpBysw3jrR1GgXXnlhVPw3wOqFhOZJDpY3oMxR
+d1bkomTMnuu1BOmswqsGePUqoApOpAM1t2biEsB+c6wnLjeHvFGWCoFj9H9RqoWB
+rs8LCyQVHc2GQv4yNQE0l05PVaUTOMUTdS45xfnjrWSnIPkoMXTzOreLu+3ttY+m
+GniMi/RMGffWGaF05WlQYUW3tHrVVMmkQrc5pv/6MMpfFcWXSeJcX8nHJQIunbI2
+n3v2y+Yui4WYSpumd652rTa827ETpS9LY36E08CrKVtd6sHzN0SO5t1TPqzcrE8Z
+I87vX5FkJZVhtWfASjG5bc5GMSxQYwsFlY59FtERbu/e+mbNc6JsNYlxC2Zy1V7R
+lHGWVgHhCkg4u3ERnl6HuvRQqwHyeJg+IUk1ENBTPUOlQvbamWPDlIJEHkIkM1Ly
+g19k83aPLJLokh8cxp7U0YcvU6ZlKTgeXmmVJPVvJ0JzoFjGavLHyxxDDZSl1pxm
+X4kCIgQTAQoADAUCVwbBCAWDB4YfgAAKCRAZcAmILC3yrlGsD/sH2YU1EoiD/JbI
+7GTT/fMo6fK6vQzuSSvja79tt+mUmsMoWB02K8rgV9w7Ja6UtnTc3KGE2X6HuaZk
+6whoMX4Djwfpu1eueKEPHNR90qkKInKqyvKGpfvm92puzqz8kIQ0J7Xf4mpLwceh
+XVqnEncVJFHiRgBMFM9fZVQTVQAJdW8CxBIh8UaZ2ttroCUzMCn6vxPp5keuedin
+YTwghfw8dUF+qkK3OduU7lT+OIZ9of+mZjk5NoAEsbi5O8H1YVHVgBQjmT55oVfD
+JXsd9qr7iLJLV5RzTgG8ktSd+oYgmAbg/YLakG6dThmVPORHrh0oiGjUU+gMiUNv
+2ayBr1ymPx0dy/JLQh6H4/0paAzXN/k+l4IROx59iCIbuZ2Eh0cyTeJ+heB3pGMu
+94fb8pNNzuVta3U9g86D5h0b+6RhJKfBzRW6U27c1pGivb37P0AO9CHrXfE7TtkJ
+RSm5T68DXPu5nxRNjMJELry+fh/FXzsWVUEQrH83vjv6frEh9xbYr8HrVgbpNVsI
+69s1FbWo+ecGNHJi5zOuh1tH3ralGn/4mtbWVtMbyf1HiAf12NfHoo4Mrikz1lzl
+xljMc/+eLU5UGQuxQWO/l4zLEQa+FVNfM1gVImASrT/W6bTAjq/fKuKBUFv4CmFP
+An8c4XFhgZzF/BXfOoCAtkNXOMphXLkBDQRXBruUAQgAuY+0pz4kunCLVDpZSH8R
+cKU1QJLqJtvHpAxlY2222//A9zPz6/fm/zj6wfKtGjIaHHIuv4kvDUosDWbQFgVu
+vsALwLd7EfGIjwLiUJVxzf76lY2PDMTbjlXNbhmrIXOTJrtb4ZyTkudSCvc/mzy1
+9rhpY42UbCQcWjBE6UL+3acL4MztgMAPT4iosHqA0OrXqPxf9xAXpDOGfCwyr38x
+Rvs4N597HDjFnIGnMStv3qjwp+7t+3LZmUSJcO/3kiTfA6y2D5QMFSyDMSnP7YWb
+64wO9yZ6l0j2Qd3K2FGBFdSbJBb88gKEMzkMc2G8+HqFw8sQFm+QAF82El4x62xU
+dQARAQABiQEfBBgBCAAJBQJXBruUAhsMAAoJEHbgUH6u2u49hZMH/0IY+2mvdCQT
+1WN4LdoEvHy1ACGlzoJyJolHoh0MFD/lPxEbUP/8irmK9HJEkv/CNdoNYzAQ4uzX
++24en2gK83e1eORNDXlcWfsQK3QsoyffD98tmk/66VMJNjwOvUoN5eiYjMSIuQL3
+ml1nvnsx3TgIWP/1E0vVZ8eyAwd5Ldor0nu8pCaicPgeo07q7/4sb9xWHuKda2Q8
+t+qzsGqoQLPihv3Qx++fQXaJVWUfhkm2kVjr7/dhgHy2uMvp7lzkUEnfTb1uGu05
+J2xcjxdmxDOpFF1aAJar1V22U0m1tnVgLoN0ta6bDPXXMvacx0+VWe8Tgt3SY3/a
+A4DF9y+6usA=
+=O5OI
+-----END PGP PUBLIC KEY BLOCK-----


[28/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java
new file mode 100644
index 0000000..bf2d484
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreHelper.java
@@ -0,0 +1,74 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.io.File;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedLockService;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.internal.Assert;
+
+public class BackupDataStoreHelper {
+
+  public static String LOCK_SERVICE_NAME = BackupDataStoreHelper.class.getSimpleName();
+
+  private static String LOCK_NAME = LOCK_SERVICE_NAME + "_token";
+
+  private static Object LOCK_SYNC = new Object();
+
+  @SuppressWarnings("rawtypes")
+  public static BackupDataStoreResult backupAllMembers(DM dm, Set recipients, File targetDir,
+      File baselineDir) {
+    FlushToDiskRequest.send(dm, recipients);
+
+    boolean abort = true;
+    Map<DistributedMember, Set<PersistentID>> successfulMembers;
+    Map<DistributedMember, Set<PersistentID>> existingDataStores;
+    try {
+      existingDataStores = PrepareBackupRequest.send(dm, recipients);
+      abort = false;
+    } finally {
+      successfulMembers = FinishBackupRequest.send(dm, recipients, targetDir, baselineDir, abort);
+    }
+    return new BackupDataStoreResult(existingDataStores, successfulMembers);
+  }
+
+  private static DistributedLockService getLockService(DM dm) {
+    DistributedLockService dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
+    if (dls == null) {
+      synchronized (LOCK_SYNC) {
+        dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
+        if (dls == null) {
+          // Create the DistributedLockService
+          dls = DistributedLockService.create(LOCK_SERVICE_NAME, dm.getSystem());
+        }
+      }
+    }
+    Assert.assertTrue(dls != null);
+    return dls;
+  }
+
+  public static boolean obtainLock(DM dm) {
+    return getLockService(dm).lock(LOCK_NAME, 0, -1);
+  }
+
+  public static void releaseLock(DM dm) {
+    getLockService(dm).unlock(LOCK_NAME);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java
new file mode 100644
index 0000000..b61e5c8
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupDataStoreResult.java
@@ -0,0 +1,48 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedMember;
+
+public class BackupDataStoreResult {
+
+  private Map<DistributedMember, Set<PersistentID>> existingDataStores;
+
+  private Map<DistributedMember, Set<PersistentID>> successfulMembers;
+
+  public BackupDataStoreResult(Map<DistributedMember, Set<PersistentID>> existingDataStores,
+      Map<DistributedMember, Set<PersistentID>> successfulMembers) {
+    this.existingDataStores = existingDataStores;
+    this.successfulMembers = successfulMembers;
+  }
+
+  public Map<DistributedMember, Set<PersistentID>> getExistingDataStores() {
+    return this.existingDataStores;
+  }
+
+  public Map<DistributedMember, Set<PersistentID>> getSuccessfulMembers() {
+    return this.successfulMembers;
+  }
+
+  public String toString() {
+    return new StringBuilder().append(getClass().getSimpleName()).append("[")
+        .append("existingDataStores=").append(this.existingDataStores)
+        .append("; successfulMembers=").append(this.successfulMembers).append("]").toString();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupStatusImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupStatusImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupStatusImpl.java
new file mode 100644
index 0000000..78736f7
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/BackupStatusImpl.java
@@ -0,0 +1,59 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.geode.internal.admin.api.BackupStatus;
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedMember;
+
+/**
+ * Holds the result of a backup operation.
+ * 
+ *
+ */
+public class BackupStatusImpl implements BackupStatus, Serializable {
+  private static final long serialVersionUID = 3704162840296921840L;
+
+  private Map<DistributedMember, Set<PersistentID>> backedUpDiskStores;
+  private Set<PersistentID> offlineDiskStores;
+
+  public BackupStatusImpl(Map<DistributedMember, Set<PersistentID>> backedUpDiskStores,
+      Set<PersistentID> offlineDiskStores) {
+    super();
+    this.backedUpDiskStores = backedUpDiskStores;
+    this.offlineDiskStores = offlineDiskStores;
+  }
+
+  public Map<DistributedMember, Set<PersistentID>> getBackedUpDiskStores() {
+    return backedUpDiskStores;
+  }
+
+  public Set<PersistentID> getOfflineDiskStores() {
+    return offlineDiskStores;
+  }
+
+  @Override
+  public String toString() {
+    return "BackupStatus[backedUpDiskStores=" + backedUpDiskStores + ", offlineDiskStores="
+        + offlineDiskStores + "]";
+  }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheHealthConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheHealthConfigImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheHealthConfigImpl.java
new file mode 100644
index 0000000..a6c2257
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheHealthConfigImpl.java
@@ -0,0 +1,91 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.CacheHealthConfig;
+
+/**
+ * The implementation of <code>CacheHealthConfig</code>
+ *
+ *
+ * @since GemFire 3.5
+ */
+public abstract class CacheHealthConfigImpl extends MemberHealthConfigImpl
+    implements CacheHealthConfig {
+
+  /**
+   * The maximum number of milliseconds a <code>netSearch</code> operation can take before the cache
+   * member is considered to be unhealthy.
+   */
+  private long maxNetSearchTime = DEFAULT_MAX_NET_SEARCH_TIME;
+
+  /**
+   * The maximum mumber of milliseconds a cache <code>load</code> operation can take before the
+   * cache member is considered to be unhealthy.
+   */
+  private long maxLoadTime = DEFAULT_MAX_LOAD_TIME;
+
+  /** The minimum hit ratio of a healthy cache member. */
+  private double minHitRatio = DEFAULT_MIN_HIT_RATIO;
+
+  /**
+   * The maximum number of entries in the event delivery queue of a healthy cache member.
+   */
+  private long maxEventQueueSize = DEFAULT_MAX_EVENT_QUEUE_SIZE;
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>CacheHealthConfigImpl</code> with the default configuration.
+   */
+  CacheHealthConfigImpl() {
+
+  }
+
+  ////////////////////// Instance Methods /////////////////////
+
+  public long getMaxNetSearchTime() {
+    return this.maxNetSearchTime;
+  }
+
+  public void setMaxNetSearchTime(long maxNetSearchTime) {
+    this.maxNetSearchTime = maxNetSearchTime;
+  }
+
+  public long getMaxLoadTime() {
+    return this.maxLoadTime;
+  }
+
+  public void setMaxLoadTime(long maxLoadTime) {
+    this.maxLoadTime = maxLoadTime;
+  }
+
+  public double getMinHitRatio() {
+    return this.minHitRatio;
+  }
+
+  public void setMinHitRatio(double minHitRatio) {
+    this.minHitRatio = minHitRatio;
+  }
+
+  public long getMaxEventQueueSize() {
+    return this.maxEventQueueSize;
+  }
+
+  public void setMaxEventQueueSize(long maxEventQueueSize) {
+    this.maxEventQueueSize = maxEventQueueSize;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheHealthEvaluator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheHealthEvaluator.java
new file mode 100644
index 0000000..8e30518
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheHealthEvaluator.java
@@ -0,0 +1,306 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.util.List;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.internal.admin.api.CacheHealthConfig;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.internal.OSProcess;
+import org.apache.geode.internal.cache.CacheLifecycleListener;
+import org.apache.geode.internal.cache.CachePerfStats;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+
+/**
+ * Contains the logic for evaluating the health of a GemFire <code>Cache</code> instance according
+ * to the thresholds provided in a {@link CacheHealthConfig}.
+ *
+ *
+ * @since GemFire 3.5
+ */
+class CacheHealthEvaluator extends AbstractHealthEvaluator implements CacheLifecycleListener {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /** The config from which we get the evaulation criteria */
+  private CacheHealthConfig config;
+
+  /** The description of the cache being evaluated */
+  private String description;
+
+  /**
+   * Statistics about the <code>Cache</code> instance. If no cache has been created in this VM, this
+   * field will be <code>null</code>
+   */
+  private CachePerfStats cacheStats;
+
+  /** The previous value of the netsearchTime stat (in nanoseconds) */
+  private long prevNetsearchTime;
+
+  /** The previous value of the netsearchedCompleted stat */
+  private long prevNetsearchesCompleted;
+
+  /** The previous value of the loadTime stat (in nanoseconds) */
+  private long prevLoadTime;
+
+  /** The previous value of the loadedCompleted stat */
+  private long prevLoadsCompleted;
+
+  /** The previous value of the gets stat */
+  private long prevGets;
+
+  ////////////////////// Constructors //////////////////////
+
+  /**
+   * Creates a new <code>CacheHealthEvaluator</code>
+   */
+  CacheHealthEvaluator(GemFireHealthConfig config, DM dm) {
+    super(config, dm);
+
+    this.config = config;
+    InternalDistributedSystem system = dm.getSystem();
+    GemFireCacheImpl cache;
+    try {
+      cache = (GemFireCacheImpl) CacheFactory.getInstance(system);
+
+    } catch (CancelException ex) {
+      // No cache in this VM
+      cache = null;
+    }
+
+    initialize(cache, dm);
+    GemFireCacheImpl.addCacheLifecycleListener(this);
+  }
+
+  //////////////////// Instance Methods ////////////////////
+
+  @Override
+  protected String getDescription() {
+    return this.description;
+  }
+
+  /**
+   * Initializes the state of this evaluator based on the given cache instance.
+   */
+  private void initialize(GemFireCacheImpl cache, DM dm) {
+    StringBuffer sb = new StringBuffer();
+    if (cache != null) {
+      this.cacheStats = cache.getCachePerfStats();
+
+      sb.append("Cache \"");
+      sb.append(cache.getName());
+      sb.append("\"");
+
+    } else {
+      sb.append("No Cache");
+    }
+
+    sb.append(" in member ");
+    sb.append(dm.getId());
+    int pid = OSProcess.getId();
+    if (pid != 0) {
+      sb.append(" with pid ");
+      sb.append(pid);
+    }
+    this.description = sb.toString();
+  }
+
+  public void cacheCreated(GemFireCacheImpl cache) {
+    InternalDistributedSystem system = (InternalDistributedSystem) cache.getDistributedSystem();
+    DM dm = system.getDistributionManager();
+    initialize(cache, dm);
+  }
+
+  /**
+   * Checks to make sure that the average <code>netSearch</code> time during the previous health
+   * check interval is less than the {@linkplain CacheHealthConfig#getMaxNetSearchTime threshold}.
+   * If not, the status is "okay" health.
+   *
+   * @see CachePerfStats#getNetsearchTime
+   * @see CachePerfStats#getNetsearchesCompleted
+   */
+  void checkNetSearchTime(List status) {
+    if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) {
+      return;
+    }
+
+    long deltaNetsearchTime = this.cacheStats.getNetsearchTime() - this.prevNetsearchTime;
+    long deltaNetsearchesCompleted =
+        this.cacheStats.getNetsearchesCompleted() - this.prevNetsearchesCompleted;
+
+    if (deltaNetsearchesCompleted != 0) {
+      long ratio = deltaNetsearchTime / deltaNetsearchesCompleted;
+      ratio /= 1000000;
+      long threshold = this.config.getMaxNetSearchTime();
+
+      if (ratio > threshold) {
+        String s =
+            LocalizedStrings.CacheHealthEvaluator_THE_AVERAGE_DURATION_OF_A_CACHE_NETSEARCH_0_MS_EXCEEDS_THE_THRESHOLD_1_MS
+                .toLocalizedString(new Object[] {ratio, threshold});
+        status.add(okayHealth(s));
+      }
+    }
+  }
+
+  /**
+   * Checks to make sure that the average <code>load</code> time during the previous health check
+   * interval is less than the {@linkplain CacheHealthConfig#getMaxLoadTime threshold}. If not, the
+   * status is "okay" health.
+   *
+   * @see CachePerfStats#getLoadTime
+   * @see CachePerfStats#getLoadsCompleted
+   */
+  void checkLoadTime(List status) {
+    if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) {
+      return;
+    }
+
+    if (!isFirstEvaluation()) {
+      long deltaLoadTime = this.cacheStats.getLoadTime() - this.prevLoadTime;
+      long deltaLoadsCompleted = this.cacheStats.getLoadsCompleted() - this.prevLoadsCompleted;
+
+      if (logger.isDebugEnabled()) {
+        logger.debug("Completed {} loads in {} ms", deltaLoadsCompleted, (deltaLoadTime / 1000000));
+      }
+
+      if (deltaLoadsCompleted != 0) {
+        long ratio = deltaLoadTime / deltaLoadsCompleted;
+        ratio /= 1000000;
+        long threshold = this.config.getMaxLoadTime();
+
+        if (ratio > threshold) {
+          String s =
+              LocalizedStrings.CacheHealthEvaluator_THE_AVERAGE_DURATION_OF_A_CACHE_LOAD_0_MS_EXCEEDS_THE_THRESHOLD_1_MS
+                  .toLocalizedString(new Object[] {ratio, threshold});
+          if (logger.isDebugEnabled()) {
+            logger.debug(s);
+          }
+          status.add(okayHealth(s));
+        }
+      }
+    }
+  }
+
+  /**
+   * Checks to make sure that the cache hit ratio during the previous health check interval is less
+   * than the {@linkplain CacheHealthConfig#getMinHitRatio threshold}. If not, the status is "okay"
+   * health.
+   *
+   * <P>
+   *
+   * The following formula is used to compute the hit ratio:
+   *
+   * <PRE>
+   * hitRatio = (gets - (loadsCompleted + netsearchesCompleted)) / (gets)
+   * </PRE>
+   *
+   *
+   * @see CachePerfStats#getGets
+   * @see CachePerfStats#getLoadsCompleted
+   * @see CachePerfStats#getNetsearchesCompleted
+   */
+  void checkHitRatio(List status) {
+    if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) {
+      return;
+    }
+
+    long deltaGets = this.cacheStats.getGets() - this.prevGets;
+    if (deltaGets != 0) {
+      long deltaLoadsCompleted = this.cacheStats.getLoadsCompleted() - this.prevLoadsCompleted;
+      long deltaNetsearchesCompleted =
+          this.cacheStats.getNetsearchesCompleted() - this.prevNetsearchesCompleted;
+
+      double hits = (deltaGets - (deltaLoadsCompleted + deltaNetsearchesCompleted));
+      double hitRatio = hits / deltaGets;
+      double threshold = this.config.getMinHitRatio();
+      if (hitRatio < threshold) {
+        String s = "The hit ratio of this Cache (" + hitRatio + ") is below the threshold ("
+            + threshold + ")";
+        status.add(okayHealth(s));
+      }
+    }
+  }
+
+  /**
+   * Checks to make sure that the {@linkplain CachePerfStats#getEventQueueSize cache event queue
+   * size} does not exceed the {@linkplain CacheHealthConfig#getMaxEventQueueSize threshold}. If it
+   * does, the status is "okay" health.
+   */
+  void checkEventQueueSize(List status) {
+    if (this.cacheStats == null || isFirstEvaluation() || this.cacheStats.isClosed()) {
+      return;
+    }
+
+    long eventQueueSize = this.cacheStats.getEventQueueSize();
+    long threshold = this.config.getMaxEventQueueSize();
+    if (eventQueueSize > threshold) {
+      String s =
+          LocalizedStrings.CacheHealthEvaluator_THE_SIZE_OF_THE_CACHE_EVENT_QUEUE_0_MS_EXCEEDS_THE_THRESHOLD_1_MS
+              .toLocalizedString(
+                  new Object[] {Long.valueOf(eventQueueSize), Long.valueOf(threshold)});
+      status.add(okayHealth(s));
+    }
+  }
+
+
+  /**
+   * Updates the previous values of statistics
+   */
+  private void updatePrevious() {
+    if (this.cacheStats != null && !this.cacheStats.isClosed()) {
+      this.prevLoadTime = this.cacheStats.getLoadTime();
+      this.prevLoadsCompleted = this.cacheStats.getLoadsCompleted();
+      this.prevNetsearchTime = this.cacheStats.getNetsearchTime();
+      this.prevNetsearchesCompleted = this.cacheStats.getNetsearchesCompleted();
+      this.prevGets = this.cacheStats.getGets();
+
+    } else {
+      this.prevLoadTime = 0L;
+      this.prevLoadsCompleted = 0L;
+      this.prevNetsearchTime = 0L;
+      this.prevNetsearchesCompleted = 0L;
+      this.prevGets = 0L;
+    }
+  }
+
+  @Override
+  protected void check(List status) {
+
+    checkNetSearchTime(status);
+    checkLoadTime(status);
+    checkHitRatio(status);
+    checkEventQueueSize(status);
+
+    updatePrevious();
+  }
+
+  @Override
+  public void close() {
+    GemFireCacheImpl.removeCacheLifecycleListener(this);
+  }
+
+  @Override
+  public void cacheClosed(GemFireCacheImpl cache) {
+    // do nothing
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheServerConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheServerConfigImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheServerConfigImpl.java
new file mode 100644
index 0000000..1eadc79
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheServerConfigImpl.java
@@ -0,0 +1,133 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.CacheServerConfig;
+import org.apache.geode.internal.admin.api.CacheVmConfig;
+import org.apache.geode.internal.admin.GemFireVM;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+/**
+ * An implementation of <code>CacheVmConfig</code>
+ *
+ * @since GemFire 4.0
+ */
+public class CacheServerConfigImpl extends ManagedEntityConfigImpl
+    implements CacheVmConfig, CacheServerConfig {
+
+  /**
+   * Declarative caching XML file that is used to initialize the Cache in the cache server.
+   */
+  private String cacheXMLFile;
+
+  /** Extra classpath for the cache server */
+  private String classpath;
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>CacheServerConfigImpl</code> with the default configuration settings.
+   */
+  public CacheServerConfigImpl() {
+    this.cacheXMLFile = null;
+    this.classpath = null;
+  }
+
+  /**
+   * Creates a new <code>CacheServerConfigImpl</code> for a running cache server.
+   */
+  public CacheServerConfigImpl(GemFireVM vm) {
+    super(vm);
+
+    String name = CACHE_XML_FILE;
+    this.cacheXMLFile = vm.getConfig().getAttribute(name);
+    this.classpath = null;
+  }
+
+  /**
+   * Copy constructor
+   */
+  public CacheServerConfigImpl(CacheServerConfig other) {
+    super(other);
+    this.cacheXMLFile = other.getCacheXMLFile();
+    this.classpath = other.getClassPath();
+  }
+
+  /**
+   * Copy constructor
+   */
+  public CacheServerConfigImpl(CacheVmConfig other) {
+    super(other);
+    this.cacheXMLFile = other.getCacheXMLFile();
+    this.classpath = other.getClassPath();
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  public String getCacheXMLFile() {
+    return this.cacheXMLFile;
+  }
+
+  public void setCacheXMLFile(String cacheXMLFile) {
+    checkReadOnly();
+    this.cacheXMLFile = cacheXMLFile;
+    configChanged();
+  }
+
+  public String getClassPath() {
+    return this.classpath;
+  }
+
+  public void setClassPath(String classpath) {
+    checkReadOnly();
+    this.classpath = classpath;
+    configChanged();
+  }
+
+  @Override
+  public void validate() {
+    super.validate();
+
+    // Nothing to validate really. Cache.xml file could live on
+    // different file system.
+  }
+
+  /**
+   * Currently, listeners are not supported on the locator config.
+   */
+  @Override
+  protected void configChanged() {
+
+  }
+
+  @Override
+  public Object clone() throws CloneNotSupportedException {
+    return new CacheServerConfigImpl((CacheVmConfig) this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.append(super.toString());
+    sb.append(" cacheXMLFile=");
+    sb.append(this.getCacheXMLFile());
+    sb.append(" classPath=");
+    sb.append(this.getClassPath());
+
+    return sb.toString();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheServerImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheServerImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheServerImpl.java
new file mode 100644
index 0000000..f5cb704
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/CacheServerImpl.java
@@ -0,0 +1,196 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.internal.admin.GemFireVM;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.CacheServer;
+import org.apache.geode.internal.admin.api.CacheServerConfig;
+import org.apache.geode.internal.admin.api.CacheVm;
+import org.apache.geode.internal.admin.api.CacheVmConfig;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+import org.apache.geode.internal.admin.api.SystemMemberType;
+import org.apache.geode.internal.admin.remote.RemoteApplicationVM;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+/**
+ * Implements the administrative interface to a cache server.
+ *
+ * @since GemFire 3.5
+ */
+public class CacheServerImpl extends ManagedSystemMemberImpl implements CacheVm, CacheServer {
+
+  /** How many new <code>CacheServer</code>s have been created? */
+  private static int newCacheServers = 0;
+
+  /////////////////////// Instance Fields ///////////////////////
+
+  /** The configuration object for this cache server */
+  private final CacheServerConfigImpl config;
+
+  ///////////////////////// Constructors ////////////////////////
+
+  /**
+   * Creates a new <code>CacheServerImpl</code> that represents a non-existsing (unstarted) cache
+   * server in a given distributed system.
+   */
+  public CacheServerImpl(AdminDistributedSystemImpl system, CacheVmConfig config)
+      throws AdminException {
+
+    super(system, config);
+
+    this.config = (CacheServerConfigImpl) config;
+    this.config.setManagedEntity(this);
+  }
+
+  /**
+   * Creates a new <code>CacheServerImpl</code> that represents an existing dedicated cache server
+   * in a given distributed system.
+   */
+  public CacheServerImpl(AdminDistributedSystemImpl system, GemFireVM vm) throws AdminException {
+
+    super(system, vm);
+    this.config = new CacheServerConfigImpl(vm);
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  @Override
+  public SystemMemberType getType() {
+    return SystemMemberType.CACHE_VM;
+  }
+
+  public String getNewId() {
+    synchronized (CacheServerImpl.class) {
+      return "CacheVm" + (++newCacheServers);
+    }
+  }
+
+  public void start() throws AdminException {
+    if (!needToStart()) {
+      return;
+    }
+
+    this.config.validate();
+    this.controller.start(this);
+    this.config.setManagedEntity(this);
+  }
+
+  public void stop() {
+    if (!needToStop()) {
+      return;
+    }
+
+    this.controller.stop(this);
+    // NOTE: DistributedSystem nodeLeft will then set this.manager to null
+    this.config.setManagedEntity(null);
+  }
+
+  public boolean isRunning() {
+    DM dm = ((AdminDistributedSystemImpl) getDistributedSystem()).getDistributionManager();
+    if (dm == null) {
+      try {
+        return this.controller.isRunning(this);
+      } catch (IllegalStateException e) {
+        return false;
+      }
+    }
+    return ((DistributionManager) dm).getDistributionManagerIdsIncludingAdmin()
+        .contains(getDistributedMember());
+  }
+
+  public CacheServerConfig getConfig() {
+    return this.config;
+  }
+
+  public CacheVmConfig getVmConfig() {
+    return this.config;
+  }
+
+  //////////////////////// Command execution ////////////////////////
+
+  public ManagedEntityConfig getEntityConfig() {
+    return this.getConfig();
+  }
+
+  public String getEntityType() {
+    // Fix bug 32564
+    return "Cache Vm";
+  }
+
+  public String getStartCommand() {
+    StringBuffer sb = new StringBuffer();
+    sb.append(this.controller.getProductExecutable(this, "cacheserver"));
+    sb.append(" start -dir=");
+    sb.append(this.getConfig().getWorkingDirectory());
+
+    String file = this.getConfig().getCacheXMLFile();
+    if (file != null && file.length() > 0) {
+      sb.append(" ");
+      sb.append(CACHE_XML_FILE);
+      sb.append("=");
+      sb.append(file);
+    }
+
+    String classpath = this.getConfig().getClassPath();
+    if (classpath != null && classpath.length() > 0) {
+      sb.append(" -classpath=");
+      sb.append(classpath);
+    }
+
+    appendConfiguration(sb);
+
+    return sb.toString().trim();
+  }
+
+  public String getStopCommand() {
+    StringBuffer sb = new StringBuffer();
+    sb.append(this.controller.getProductExecutable(this, "cacheserver"));
+    sb.append(" stop -dir=");
+    sb.append(this.getConfig().getWorkingDirectory());
+
+    return sb.toString().trim();
+  }
+
+  public String getIsRunningCommand() {
+    StringBuffer sb = new StringBuffer();
+    sb.append(this.controller.getProductExecutable(this, "cacheserver"));
+    sb.append(" status -dir=");
+    sb.append(this.getConfig().getWorkingDirectory());
+
+    return sb.toString().trim();
+  }
+
+  /**
+   * Find whether this server is primary for given client (durableClientId)
+   * 
+   * @param durableClientId - durable-id of the client
+   * @return true if the server is primary for given client
+   * 
+   * @since GemFire 5.6
+   */
+  public boolean isPrimaryForDurableClient(String durableClientId) {
+    RemoteApplicationVM vm = (RemoteApplicationVM) this.getGemFireVM();
+    boolean isPrimary = false;
+    if (vm != null) {
+      isPrimary = vm.isPrimaryForDurableClient(durableClientId);
+    }
+    return isPrimary;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ConfigurationParameterImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ConfigurationParameterImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ConfigurationParameterImpl.java
new file mode 100755
index 0000000..9d94209
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ConfigurationParameterImpl.java
@@ -0,0 +1,282 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+import org.apache.geode.internal.admin.api.UnmodifiableConfigurationException;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+import java.io.File;
+// import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * A single configuration parameter of a system member.
+ *
+ * @since GemFire 3.5
+ *
+ */
+public class ConfigurationParameterImpl implements ConfigurationParameter {
+
+  /** Identifying name of this configuration parameter */
+  protected String name;
+  /** Full description of this configuration parameter */
+  protected String description;
+  /** The current value */
+  protected Object value;
+  /** Class type of the value */
+  protected Class type;
+  /** True if this is modifiable; false if read-only */
+  protected boolean userModifiable;
+  /** List of listeners to notify when value changes */
+  private final List listeners = new ArrayList();
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs new <code>ConfigurationParameterImpl</code>.
+   *
+   * @param name the name of this parameter which cannot change
+   * @param description full description to use
+   * @param value the value of this parameter
+   * @param type the class type of the value
+   * @param userModifiable true if this is modifiable; false if read-only
+   */
+  protected ConfigurationParameterImpl(String name, String description, Object value, Class type,
+      boolean userModifiable) {
+    if (name == null || name.length() == 0) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.ConfigurationParameterImpl_CONFIGURATIONPARAMETER_NAME_MUST_BE_SPECIFIED
+              .toLocalizedString());
+    }
+
+    this.name = name;
+    setInternalState(description, value, type, userModifiable);
+  }
+
+  /**
+   * Constructs new <code>ConfigurationParameterImpl</code>.
+   *
+   * @param name the name of this parameter which cannot change
+   * @param value the value of this parameter
+   */
+  protected ConfigurationParameterImpl(String name, Object value) {
+    if (name == null || name.length() == 0) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.ConfigurationParameterImpl_CONFIGURATIONPARAMETER_NAME_MUST_BE_SPECIFIED
+              .toLocalizedString());
+    }
+
+    this.name = name;
+    setInternalState(name, value, value.getClass(), true);
+  }
+
+  /** Constructor to allow serialization by subclass */
+  protected ConfigurationParameterImpl() {}
+
+  // -------------------------------------------------------------------------
+  // Attribute accessors and mutators
+  // -------------------------------------------------------------------------
+
+  public String getName() {
+    return this.name;
+  }
+
+  public String getDescription() {
+    return this.description;
+  }
+
+  public Object getValue() {
+    return this.value;
+  }
+
+  public String getValueAsString() {
+    if (isString()) {
+      return (String) this.value;
+    } else if (isInetAddress()) {
+      return InetAddressUtil.toString(this.value);
+    } else if (isFile()) {
+      return this.value.toString();
+    } else if (isOctal()) {
+      String strVal = Integer.toOctalString(((Integer) this.value).intValue());
+      if (!strVal.startsWith("0")) {
+        strVal = "0" + strVal;
+      }
+      return strVal;
+    } else if (isArray()) {
+      List list = Arrays.asList((Object[]) this.value);
+      return list.toString();
+    } else {
+      return this.value.toString();
+    }
+  }
+
+  public Class getValueType() {
+    return this.type;
+  }
+
+  public boolean isModifiable() {
+    return this.userModifiable;
+  }
+
+  public boolean isArray() {
+    return "manager-parameters".equals(this.name) || "manager-classpaths".equals(this.name);
+  }
+
+  public boolean isInetAddress() {
+    return java.net.InetAddress.class.isAssignableFrom(this.type);
+  }
+
+  public boolean isFile() {
+    return java.io.File.class.equals(this.type);
+  }
+
+  public boolean isOctal() {
+    return "shared-memory-permissions".equals(this.name);
+  }
+
+  public boolean isString() {
+    return java.lang.String.class.equals(this.type);
+  }
+
+  public void setValue(Object value) throws UnmodifiableConfigurationException {
+    if (!isModifiable()) {
+      throw new UnmodifiableConfigurationException(
+          LocalizedStrings.ConfigurationParameterImpl_0_IS_NOT_A_MODIFIABLE_CONFIGURATION_PARAMETER
+              .toLocalizedString(getName()));
+    }
+    if (value == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.ConfigurationParameterImpl_UNABLE_TO_SET_0_TO_NULL_VALUE
+              .toLocalizedString(getName()));
+    }
+    if (!getValueType().equals(value.getClass())) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.ConfigurationParameterImpl_UNABLE_TO_SET_TYPE_0_WITH_TYPE_1
+              .toLocalizedString(
+                  new Object[] {getValueType().getName(), value.getClass().getName()}));
+    }
+
+    if (value instanceof String && !isString()) {
+      // we need to check what the type should be and convert to it...
+      setValueFromString((String) value);
+    } else {
+      this.value = value;
+    }
+    fireConfigurationParameterValueChanged(this);
+  }
+
+  // -------------------------------------------------------------------------
+  // Operations for handling the registration of listeners
+  // Note: this is only for use within impl pkg and subclass pkgs
+  // -------------------------------------------------------------------------
+
+  /** Adds the listener for any changes to this configuration parameter. */
+  public void addConfigurationParameterListener(ConfigurationParameterListener listener) {
+    if (!this.listeners.contains(listener)) {
+      this.listeners.add(listener);
+    }
+  }
+
+  /** Removes the listener if it's currently registered. */
+  public void removeConfigurationParameterListener(ConfigurationParameterListener listener) {
+    if (this.listeners.contains(listener)) {
+      this.listeners.remove(listener);
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // Implementation methods
+  // -------------------------------------------------------------------------
+
+  protected void setValueFromString(String newValue) {
+    if (newValue == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.ConfigurationParameterImpl_UNABLE_TO_SET_0_TO_NULL_VALUE
+              .toLocalizedString(getName()));
+    }
+
+    if (isInetAddress()) {
+      this.value = InetAddressUtil.toInetAddress(newValue);
+    } else if (isFile()) {
+      this.value = new File(newValue);
+    } else if (isOctal()) {
+      if (!newValue.startsWith("0")) {
+        newValue = "0" + newValue;
+      }
+      this.value = Integer.valueOf(Integer.parseInt(newValue, 8));
+    } else if (isArray()) {
+      // parse it TODO
+      throw new IllegalArgumentException(
+          LocalizedStrings.ConfigurationParameterImpl_SETTING_ARRAY_VALUE_FROM_DELIMITED_STRING_IS_NOT_SUPPORTED
+              .toLocalizedString());
+    } else {
+      this.value = newValue;
+    }
+  }
+
+  /**
+   * Fires changed configuration parameter to registered listeners.
+   *
+   * @param parm the configuration parameter the changed
+   */
+  protected void fireConfigurationParameterValueChanged(ConfigurationParameter parm) {
+    ConfigurationParameterListener[] listeners = (ConfigurationParameterListener[]) this.listeners
+        .toArray(new ConfigurationParameterListener[0]);
+    for (int i = 0; i < listeners.length; i++) {
+      listeners[i].configurationParameterValueChanged(parm);
+    }
+  }
+
+  /**
+   * Sets the internal state of this configuration parameter.
+   *
+   * @param description full description to use
+   * @param value the value of this parameter
+   * @param type the class type of the value
+   * @param userModifiable true if this is modifiable; false if read-only
+   */
+  protected void setInternalState(String description, Object value, Class type,
+      boolean userModifiable) {
+    if (description == null || description.length() == 0) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.ConfigurationParameterImpl_CONFIGURATIONPARAMETER_DESCRIPTION_MUST_BE_SPECIFIED
+              .toLocalizedString());
+    }
+    this.description = description;
+    this.type = type;
+    this.userModifiable = userModifiable;
+
+    if (value == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.ConfigurationParameterImpl_UNABLE_TO_SET_0_TO_NULL_VALUE
+              .toLocalizedString(getName()));
+    }
+
+    this.value = value;
+  }
+
+  @Override
+  public String toString() {
+    return this.name;
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ConfigurationParameterListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ConfigurationParameterListener.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ConfigurationParameterListener.java
new file mode 100755
index 0000000..0b32df0
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ConfigurationParameterListener.java
@@ -0,0 +1,30 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+
+/**
+ * Listens to value changes of a {@link ConfigurationParameter}. This is for internal use only to
+ * allow a {@link SystemMemberImpl} to keep track of configuration changes made through
+ * {@link ConfigurationParameterImpl#setValue}.
+ *
+ * @since GemFire 3.5
+ *
+ */
+public interface ConfigurationParameterListener {
+  public void configurationParameterValueChanged(ConfigurationParameter parm);
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DisabledManagedEntityController.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DisabledManagedEntityController.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DisabledManagedEntityController.java
new file mode 100755
index 0000000..aab92af
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DisabledManagedEntityController.java
@@ -0,0 +1,94 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LogMarker;
+
+/**
+ * This is a disabled implementation of ManagedEntityController for bug #47909.
+ *
+ * The old ManagedEntityController was a concrete class which has been renamed to
+ * ManagedEntityControllerImpl. The build.xml now skips building ManagedEntityControllerImpl. If
+ * ManagedEntityControllerImpl is not found in the classpath then the code uses
+ * DisabledManagedEntityController as a place holder.
+ *
+ */
+class DisabledManagedEntityController implements ManagedEntityController {
+
+  private static final Logger logger = LogService.getLogger();
+
+  private static final String EXCEPTION_MESSAGE =
+      "Local and remote OS command invocations are disabled for the Admin API.";
+
+  DisabledManagedEntityController() {}
+
+  @Override
+  public void start(InternalManagedEntity entity) {
+    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
+      logger.warn(LogMarker.MANAGED_ENTITY, "DisabledManagedEntityController#start {}",
+          EXCEPTION_MESSAGE);
+    }
+    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
+  }
+
+  @Override
+  public void stop(InternalManagedEntity entity) {
+    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
+      logger.warn(LogMarker.MANAGED_ENTITY, "DisabledManagedEntityController#stop {}",
+          EXCEPTION_MESSAGE);
+    }
+    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
+  }
+
+  @Override
+  public boolean isRunning(InternalManagedEntity entity) {
+    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
+      logger.warn(LogMarker.MANAGED_ENTITY, "DisabledManagedEntityController#isRunning {}",
+          EXCEPTION_MESSAGE);
+    }
+    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
+  }
+
+  @Override
+  public String getLog(DistributionLocatorImpl locator) {
+    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
+      logger.warn(LogMarker.MANAGED_ENTITY, "DisabledManagedEntityController#getLog {}",
+          EXCEPTION_MESSAGE);
+    }
+    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
+  }
+
+  @Override
+  public String buildSSLArguments(DistributedSystemConfig config) {
+    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
+      logger.warn(LogMarker.MANAGED_ENTITY, "DisabledManagedEntityController#buildSSLArguments {}",
+          EXCEPTION_MESSAGE);
+    }
+    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
+  }
+
+  @Override
+  public String getProductExecutable(InternalManagedEntity entity, String executable) {
+    if (logger.isTraceEnabled(LogMarker.MANAGED_ENTITY)) {
+      logger.warn(LogMarker.MANAGED_ENTITY,
+          "DisabledManagedEntityController#getProductExecutable {}", EXCEPTION_MESSAGE);
+    }
+    throw new UnsupportedOperationException(EXCEPTION_MESSAGE);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemConfigImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemConfigImpl.java
new file mode 100755
index 0000000..0298c3e
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemConfigImpl.java
@@ -0,0 +1,1114 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionConfigImpl;
+import org.apache.geode.internal.admin.api.AdminXmlException;
+import org.apache.geode.internal.admin.api.CacheServerConfig;
+import org.apache.geode.internal.admin.api.CacheVmConfig;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.DistributionLocator;
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.InternalLogWriter;
+import org.apache.geode.internal.logging.LogConfig;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.LogWriterImpl;
+import org.apache.logging.log4j.Logger;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.*;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+/**
+ * An implementation of the configuration object for an <code>AdminDistributedSystem</code>. After a
+ * config has been used to create an <code>AdminDistributedSystem</code> most of the configuration
+ * attributes cannot be changed. However, some operations (such as getting information about GemFire
+ * managers and distribution locators) are "passed through" to the
+ * <code>AdminDistributedSystem</code> associated with this configuration object.
+ *
+ * @since GemFire 3.5
+ */
+public class DistributedSystemConfigImpl implements DistributedSystemConfig {
+
+  private static final Logger logger = LogService.getLogger();
+
+  private String entityConfigXMLFile = DEFAULT_ENTITY_CONFIG_XML_FILE;
+  private String systemId = DEFAULT_SYSTEM_ID;
+  private String mcastAddress = DEFAULT_MCAST_ADDRESS;
+  private int mcastPort = DEFAULT_MCAST_PORT;
+  private int ackWaitThreshold = DEFAULT_ACK_WAIT_THRESHOLD;
+  private int ackSevereAlertThreshold = DEFAULT_ACK_SEVERE_ALERT_THRESHOLD;
+  private String locators = DEFAULT_LOCATORS;
+  private String bindAddress = DEFAULT_BIND_ADDRESS;
+  private String serverBindAddress = DEFAULT_BIND_ADDRESS;
+  private String remoteCommand = DEFAULT_REMOTE_COMMAND;
+  private boolean disableTcp = DEFAULT_DISABLE_TCP;
+  private boolean enableNetworkPartitionDetection = DEFAULT_ENABLE_NETWORK_PARTITION_DETECTION;
+  private boolean disableAutoReconnect = DEFAULT_DISABLE_AUTO_RECONNECT;
+  private int memberTimeout = DEFAULT_MEMBER_TIMEOUT;
+  private String membershipPortRange = getMembershipPortRangeString(DEFAULT_MEMBERSHIP_PORT_RANGE);
+  private int tcpPort = DEFAULT_TCP_PORT;
+
+  private String logFile = DEFAULT_LOG_FILE;
+  private String logLevel = DEFAULT_LOG_LEVEL;
+  private int logDiskSpaceLimit = DEFAULT_LOG_DISK_SPACE_LIMIT;
+  private int logFileSizeLimit = DEFAULT_LOG_FILE_SIZE_LIMIT;
+  private int refreshInterval = DEFAULT_REFRESH_INTERVAL;
+  private Properties gfSecurityProperties = new Properties();
+
+  /**
+   * Listeners to notify when this DistributedSystemConfig changes
+   */
+  private Set listeners = new HashSet();
+
+  /**
+   * Configs for CacheServers that this system config is aware of
+   */
+  private Set cacheServerConfigs = new HashSet();
+
+  /**
+   * Configs for the managed distribution locators in the distributed system
+   */
+  private Set locatorConfigs = new HashSet();
+
+  /**
+   * The display name of this distributed system
+   */
+  private String systemName = DEFAULT_NAME;
+
+  /**
+   * The admin distributed system object that is configured by this config object.
+   *
+   * @since GemFire 4.0
+   */
+  private AdminDistributedSystemImpl system;
+
+  /**
+   * The GemFire log writer used by the distributed system
+   */
+  private InternalLogWriter logWriter;
+
+  /////////////////////// Static Methods ///////////////////////
+
+  /**
+   * Filters out all properties that are unique to the admin <code>DistributedSystemConfig</code>
+   * that are not present in the internal <code>DistributionConfig</code>.
+   *
+   * @since GemFire 4.0
+   */
+  private static Properties filterOutAdminProperties(Properties props) {
+
+    Properties props2 = new Properties();
+    for (Enumeration names = props.propertyNames(); names.hasMoreElements();) {
+      String name = (String) names.nextElement();
+      if (!(ENTITY_CONFIG_XML_FILE_NAME.equals(name) || REFRESH_INTERVAL_NAME.equals(name)
+          || REMOTE_COMMAND_NAME.equals(name))) {
+        String value = props.getProperty(name);
+        if ((name != null) && (value != null)) {
+          props2.setProperty(name, value);
+        }
+      }
+    }
+
+    return props2;
+  }
+
+  //////////////////////// Constructors ////////////////////////
+
+  /**
+   * Creates a new <code>DistributedSystemConfigImpl</code> based on the configuration stored in a
+   * <code>DistributedSystem</code>'s <code>DistributionConfig</code>.
+   */
+  public DistributedSystemConfigImpl(DistributionConfig distConfig, String remoteCommand) {
+    if (distConfig == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.DistributedSystemConfigImpl_DISTRIBUTIONCONFIG_MUST_NOT_BE_NULL
+              .toLocalizedString());
+    }
+
+    this.mcastAddress = InetAddressUtil.toString(distConfig.getMcastAddress());
+    this.mcastPort = distConfig.getMcastPort();
+    this.locators = distConfig.getLocators();
+    this.membershipPortRange = getMembershipPortRangeString(distConfig.getMembershipPortRange());
+
+    this.systemName = distConfig.getName();
+
+    this.sslEnabled = distConfig.getClusterSSLEnabled();
+    this.sslCiphers = distConfig.getClusterSSLCiphers();
+    this.sslProtocols = distConfig.getClusterSSLProtocols();
+    this.sslAuthenticationRequired = distConfig.getClusterSSLRequireAuthentication();
+
+    this.logFile = distConfig.getLogFile().getPath();
+    this.logLevel = LogWriterImpl.levelToString(distConfig.getLogLevel());
+    this.logDiskSpaceLimit = distConfig.getLogDiskSpaceLimit();
+    this.logFileSizeLimit = distConfig.getLogFileSizeLimit();
+
+    basicSetBindAddress(distConfig.getBindAddress());
+    this.tcpPort = distConfig.getTcpPort();
+
+    this.disableTcp = distConfig.getDisableTcp();
+
+    this.remoteCommand = remoteCommand;
+    this.serverBindAddress = distConfig.getServerBindAddress();
+    this.enableNetworkPartitionDetection = distConfig.getEnableNetworkPartitionDetection();
+    this.memberTimeout = distConfig.getMemberTimeout();
+    this.refreshInterval = DistributedSystemConfig.DEFAULT_REFRESH_INTERVAL;
+    this.gfSecurityProperties = (Properties) distConfig.getSSLProperties().clone();
+  }
+
+  /**
+   * Zero-argument constructor to be used only by subclasses.
+   *
+   * @since GemFire 4.0
+   */
+  protected DistributedSystemConfigImpl() {
+
+  }
+
+  /**
+   * Creates a new <code>DistributedSystemConifgImpl</code> whose configuration is specified by the
+   * given <code>Properties</code> object.
+   */
+  protected DistributedSystemConfigImpl(Properties props) {
+    this(props, false);
+  }
+
+  /**
+   * Creates a new <code>DistributedSystemConifgImpl</code> whose configuration is specified by the
+   * given <code>Properties</code> object.
+   * 
+   * @param props The configuration properties specified by the caller
+   * @param ignoreGemFirePropsFile whether to skip loading distributed system properties from
+   *        gemfire.properties file
+   * 
+   * @since GemFire 6.5
+   */
+  protected DistributedSystemConfigImpl(Properties props, boolean ignoreGemFirePropsFile) {
+    this(new DistributionConfigImpl(filterOutAdminProperties(props), ignoreGemFirePropsFile),
+        DEFAULT_REMOTE_COMMAND);
+    String remoteCommand = props.getProperty(REMOTE_COMMAND_NAME);
+    if (remoteCommand != null) {
+      this.remoteCommand = remoteCommand;
+    }
+
+    String entityConfigXMLFile = props.getProperty(ENTITY_CONFIG_XML_FILE_NAME);
+    if (entityConfigXMLFile != null) {
+      this.entityConfigXMLFile = entityConfigXMLFile;
+    }
+
+    String refreshInterval = props.getProperty(REFRESH_INTERVAL_NAME);
+    if (refreshInterval != null) {
+      try {
+        this.refreshInterval = Integer.parseInt(refreshInterval);
+      } catch (NumberFormatException nfEx) {
+        throw new IllegalArgumentException(
+            LocalizedStrings.DistributedSystemConfigImpl_0_IS_NOT_A_VALID_INTEGER_1
+                .toLocalizedString(new Object[] {refreshInterval, REFRESH_INTERVAL_NAME}));
+      }
+    }
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Returns the <code>LogWriterI18n</code> to be used when administering the distributed system.
+   * Returns null if nothing has been provided via <code>setInternalLogWriter</code>.
+   *
+   * @since GemFire 4.0
+   */
+  public InternalLogWriter getInternalLogWriter() {
+    // LOG: used only for sharing between IDS, AdminDSImpl and AgentImpl -- to prevent multiple
+    // banners, etc.
+    synchronized (this) {
+      return this.logWriter;
+    }
+  }
+
+  /**
+   * Sets the <code>LogWriterI18n</code> to be used when administering the distributed system.
+   */
+  public void setInternalLogWriter(InternalLogWriter logWriter) {
+    // LOG: used only for sharing between IDS, AdminDSImpl and AgentImpl -- to prevent multiple
+    // banners, etc.
+    synchronized (this) {
+      this.logWriter = logWriter;
+    }
+  }
+
+  public LogConfig createLogConfig() {
+    return new LogConfig() {
+      @Override
+      public int getLogLevel() {
+        return LogWriterImpl.levelNameToCode(DistributedSystemConfigImpl.this.getLogLevel());
+      }
+
+      @Override
+      public File getLogFile() {
+        return new File(DistributedSystemConfigImpl.this.getLogFile());
+      }
+
+      @Override
+      public int getLogFileSizeLimit() {
+        return DistributedSystemConfigImpl.this.getLogFileSizeLimit();
+      }
+
+      @Override
+      public int getLogDiskSpaceLimit() {
+        return DistributedSystemConfigImpl.this.getLogDiskSpaceLimit();
+      }
+
+      @Override
+      public String getName() {
+        return DistributedSystemConfigImpl.this.getSystemName();
+      }
+
+      @Override
+      public String toLoggerString() {
+        return DistributedSystemConfigImpl.this.toString();
+      }
+    };
+  }
+
+  /**
+   * Marks this config object as "read only". Attempts to modify a config object will result in a
+   * {@link IllegalStateException} being thrown.
+   *
+   * @since GemFire 4.0
+   */
+  void setDistributedSystem(AdminDistributedSystemImpl system) {
+    this.system = system;
+  }
+
+  /**
+   * Checks to see if this config object is "read only". If it is, then an
+   * {@link IllegalStateException} is thrown.
+   *
+   * @since GemFire 4.0
+   */
+  protected void checkReadOnly() {
+    if (this.system != null) {
+      throw new IllegalStateException(
+          LocalizedStrings.DistributedSystemConfigImpl_A_DISTRIBUTEDSYSTEMCONFIG_OBJECT_CANNOT_BE_MODIFIED_AFTER_IT_HAS_BEEN_USED_TO_CREATE_AN_ADMINDISTRIBUTEDSYSTEM
+              .toLocalizedString());
+    }
+  }
+
+  public String getEntityConfigXMLFile() {
+    return this.entityConfigXMLFile;
+  }
+
+  public void setEntityConfigXMLFile(String xmlFile) {
+    checkReadOnly();
+    this.entityConfigXMLFile = xmlFile;
+    configChanged();
+  }
+
+  /**
+   * Parses the XML configuration file that describes managed entities.
+   *
+   * @throws AdminXmlException If a problem is encountered while parsing the XML file.
+   */
+  private void parseEntityConfigXMLFile() {
+    String fileName = this.entityConfigXMLFile;
+    File xmlFile = new File(fileName);
+    if (!xmlFile.exists()) {
+      if (DEFAULT_ENTITY_CONFIG_XML_FILE.equals(fileName)) {
+        // Default doesn't exist, no big deal
+        return;
+      } else {
+        throw new AdminXmlException(
+            LocalizedStrings.DistributedSystemConfigImpl_ENTITY_CONFIGURATION_XML_FILE_0_DOES_NOT_EXIST
+                .toLocalizedString(fileName));
+      }
+    }
+
+    try {
+      InputStream is = new FileInputStream(xmlFile);
+      try {
+        ManagedEntityConfigXmlParser.parse(is, this);
+      } finally {
+        is.close();
+      }
+    } catch (IOException ex) {
+      throw new AdminXmlException(
+          LocalizedStrings.DistributedSystemConfigImpl_WHILE_PARSING_0.toLocalizedString(fileName),
+          ex);
+    }
+  }
+
+  public String getSystemId() {
+    return this.systemId;
+  }
+
+  public void setSystemId(String systemId) {
+    checkReadOnly();
+    this.systemId = systemId;
+    configChanged();
+  }
+
+  /**
+   * Returns the multicast address for the system
+   */
+  public String getMcastAddress() {
+    return this.mcastAddress;
+  }
+
+  public void setMcastAddress(String mcastAddress) {
+    checkReadOnly();
+    this.mcastAddress = mcastAddress;
+    configChanged();
+  }
+
+  /**
+   * Returns the multicast port for the system
+   */
+  public int getMcastPort() {
+    return this.mcastPort;
+  }
+
+  public void setMcastPort(int mcastPort) {
+    checkReadOnly();
+    this.mcastPort = mcastPort;
+    configChanged();
+  }
+
+  public int getAckWaitThreshold() {
+    return this.ackWaitThreshold;
+  }
+
+  public void setAckWaitThreshold(int seconds) {
+    checkReadOnly();
+    this.ackWaitThreshold = seconds;
+    configChanged();
+  }
+
+  public int getAckSevereAlertThreshold() {
+    return this.ackSevereAlertThreshold;
+  }
+
+  public void setAckSevereAlertThreshold(int seconds) {
+    checkReadOnly();
+    this.ackSevereAlertThreshold = seconds;
+    configChanged();
+  }
+
+  /**
+   * Returns the comma-delimited list of locators for the system
+   */
+  public String getLocators() {
+    return this.locators;
+  }
+
+  public void setLocators(String locators) {
+    checkReadOnly();
+    if (locators == null) {
+      this.locators = "";
+    } else {
+      this.locators = locators;
+    }
+    configChanged();
+  }
+
+  /**
+   * Returns the value for membership-port-range
+   *
+   * @return the value for the Distributed System property membership-port-range
+   */
+  public String getMembershipPortRange() {
+    return this.membershipPortRange;
+  }
+
+  /**
+   * Sets the Distributed System property membership-port-range
+   *
+   * @param membershipPortRangeStr the value for membership-port-range given as two numbers
+   *        separated by a minus sign.
+   */
+  public void setMembershipPortRange(String membershipPortRangeStr) {
+    /*
+     * FIXME: Setting attributes in DistributedSystemConfig has no effect on DistributionConfig
+     * which is actually used for connection with DS. This is true for all such attributes. Should
+     * be addressed in the Admin Revamp if we want these 'set' calls to affect anything. Then we can
+     * use the validation code in DistributionConfigImpl code.
+     */
+    checkReadOnly();
+    if (membershipPortRangeStr == null) {
+      this.membershipPortRange = getMembershipPortRangeString(DEFAULT_MEMBERSHIP_PORT_RANGE);
+    } else {
+      try {
+        if (validateMembershipRange(membershipPortRangeStr)) {
+          this.membershipPortRange = membershipPortRangeStr;
+        } else {
+          throw new IllegalArgumentException(
+              LocalizedStrings.DistributedSystemConfigImpl_INVALID_VALUE_FOR_MEMBERSHIP_PORT_RANGE
+                  .toLocalizedString(
+                      new Object[] {membershipPortRangeStr, MEMBERSHIP_PORT_RANGE_NAME}));
+        }
+      } catch (Exception e) {
+        if (logger.isDebugEnabled()) {
+          logger.debug(e.getMessage(), e);
+        }
+      }
+    }
+  }
+
+  public void setTcpPort(int port) {
+    checkReadOnly();
+    this.tcpPort = port;
+    configChanged();
+  }
+
+  public int getTcpPort() {
+    return this.tcpPort;
+  }
+
+  /**
+   * Validates the given string - which is expected in the format as two numbers separated by a
+   * minus sign - in to an integer array of length 2 with first element as lower end & second
+   * element as upper end of the range.
+   *
+   * @param membershipPortRange membership-port-range given as two numbers separated by a minus
+   *        sign.
+   * @return true if the membership-port-range string is valid, false otherwise
+   */
+  private boolean validateMembershipRange(String membershipPortRange) {
+    int[] range = null;
+    if (membershipPortRange != null && membershipPortRange.trim().length() > 0) {
+      String[] splitted = membershipPortRange.split("-");
+      range = new int[2];
+      range[0] = Integer.parseInt(splitted[0].trim());
+      range[1] = Integer.parseInt(splitted[1].trim());
+      // NumberFormatException if any could be thrown
+
+      if (range[0] < 0 || range[0] >= range[1] || range[1] < 0 || range[1] > 65535) {
+        range = null;
+      }
+    }
+    return range != null;
+  }
+
+  /**
+   * @return the String representation of membershipPortRange with lower & upper limits of the port
+   *         range separated by '-' e.g. 1-65535
+   */
+  private static String getMembershipPortRangeString(int[] membershipPortRange) {
+    String membershipPortRangeString = "";
+    if (membershipPortRange != null && membershipPortRange.length == 2) {
+      membershipPortRangeString = membershipPortRange[0] + "-" + membershipPortRange[1];
+    }
+
+    return membershipPortRangeString;
+  }
+
+  public String getBindAddress() {
+    return this.bindAddress;
+  }
+
+  public void setBindAddress(String bindAddress) {
+    checkReadOnly();
+    basicSetBindAddress(bindAddress);
+    configChanged();
+  }
+
+  public String getServerBindAddress() {
+    return this.serverBindAddress;
+  }
+
+  public void setServerBindAddress(String bindAddress) {
+    checkReadOnly();
+    basicSetServerBindAddress(bindAddress);
+    configChanged();
+  }
+
+  public boolean getDisableTcp() {
+    return this.disableTcp;
+  }
+
+  public void setDisableTcp(boolean flag) {
+    checkReadOnly();
+    disableTcp = flag;
+    configChanged();
+  }
+
+  public void setEnableNetworkPartitionDetection(boolean newValue) {
+    checkReadOnly();
+    this.enableNetworkPartitionDetection = newValue;
+    configChanged();
+  }
+
+  public boolean getEnableNetworkPartitionDetection() {
+    return this.enableNetworkPartitionDetection;
+  }
+
+  public void setDisableAutoReconnect(boolean newValue) {
+    checkReadOnly();
+    this.disableAutoReconnect = newValue;
+    configChanged();
+  }
+
+  public boolean getDisableAutoReconnect() {
+    return this.disableAutoReconnect;
+  }
+
+  public int getMemberTimeout() {
+    return this.memberTimeout;
+  }
+
+  public void setMemberTimeout(int value) {
+    checkReadOnly();
+    this.memberTimeout = value;
+    configChanged();
+  }
+
+  private void basicSetBindAddress(String bindAddress) {
+    if (!validateBindAddress(bindAddress)) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.DistributedSystemConfigImpl_INVALID_BIND_ADDRESS_0
+              .toLocalizedString(bindAddress));
+    }
+    this.bindAddress = bindAddress;
+  }
+
+  private void basicSetServerBindAddress(String bindAddress) {
+    if (!validateBindAddress(bindAddress)) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.DistributedSystemConfigImpl_INVALID_BIND_ADDRESS_0
+              .toLocalizedString(bindAddress));
+    }
+    this.serverBindAddress = bindAddress;
+  }
+
+  /**
+   * Returns the remote command setting to use for remote administration
+   */
+  public String getRemoteCommand() {
+    return this.remoteCommand;
+  }
+
+  /**
+   * Sets the remote command for this config object. This attribute may be modified after this
+   * config object has been used to create an admin distributed system.
+   */
+  public void setRemoteCommand(String remoteCommand) {
+    if (!ALLOW_ALL_REMOTE_COMMANDS) {
+      checkRemoteCommand(remoteCommand);
+    }
+    this.remoteCommand = remoteCommand;
+    configChanged();
+  }
+
+  private static final boolean ALLOW_ALL_REMOTE_COMMANDS =
+      Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "admin.ALLOW_ALL_REMOTE_COMMANDS");
+  private static final String[] LEGAL_REMOTE_COMMANDS = {"rsh", "ssh"};
+  private static final String ILLEGAL_REMOTE_COMMAND_RSH_OR_SSH =
+      "Allowed remote commands include \"rsh {HOST} {CMD}\" or \"ssh {HOST} {CMD}\" with valid rsh or ssh switches. Invalid: ";
+
+  private final void checkRemoteCommand(final String remoteCommand) {
+    if (remoteCommand == null || remoteCommand.isEmpty()) {
+      return;
+    }
+    final String command = remoteCommand.toLowerCase().trim();
+    if (!command.contains("{host}") || !command.contains("{cmd}")) {
+      throw new IllegalArgumentException(ILLEGAL_REMOTE_COMMAND_RSH_OR_SSH + remoteCommand);
+    }
+
+    final StringTokenizer tokenizer = new StringTokenizer(command, " ");
+    final ArrayList<String> array = new ArrayList<String>();
+    for (int i = 0; tokenizer.hasMoreTokens(); i++) {
+      String string = tokenizer.nextToken();
+      if (i == 0) {
+        // first element must be rsh or ssh
+        boolean found = false;
+        for (int j = 0; j < LEGAL_REMOTE_COMMANDS.length; j++) {
+          if (string.contains(LEGAL_REMOTE_COMMANDS[j])) {
+            // verify command is at end of string
+            if (!(string.endsWith(LEGAL_REMOTE_COMMANDS[j])
+                || string.endsWith(LEGAL_REMOTE_COMMANDS[j] + ".exe"))) {
+              throw new IllegalArgumentException(ILLEGAL_REMOTE_COMMAND_RSH_OR_SSH + remoteCommand);
+            }
+            found = true;
+          }
+        }
+        if (!found) {
+          throw new IllegalArgumentException(ILLEGAL_REMOTE_COMMAND_RSH_OR_SSH + remoteCommand);
+        }
+      } else {
+        final boolean isSwitch = string.startsWith("-");
+        final boolean isHostOrCmd = string.equals("{host}") || string.equals("{cmd}");
+
+        // additional elements must be switches or values-for-switches or {host} or user@{host} or
+        // {cmd}
+        if (!isSwitch && !isHostOrCmd) {
+          final String previous =
+              (array == null || array.isEmpty()) ? null : array.get(array.size() - 1);
+          final boolean isValueForSwitch = previous != null && previous.startsWith("-");
+          final boolean isHostWithUser = string.contains("@") && string.endsWith("{host}");
+
+          if (!(isValueForSwitch || isHostWithUser)) {
+            throw new IllegalArgumentException(ILLEGAL_REMOTE_COMMAND_RSH_OR_SSH + remoteCommand);
+          }
+        }
+      }
+      array.add(string);
+    }
+  }
+
+  public String getSystemName() {
+    return this.systemName;
+  }
+
+  public void setSystemName(final String systemName) {
+    checkReadOnly();
+    this.systemName = systemName;
+    configChanged();
+  }
+
+  /**
+   * Returns an array of configurations for statically known CacheServers
+   *
+   * @since GemFire 4.0
+   */
+  public CacheServerConfig[] getCacheServerConfigs() {
+    return (CacheServerConfig[]) this.cacheServerConfigs
+        .toArray(new CacheServerConfig[this.cacheServerConfigs.size()]);
+  }
+
+  public CacheVmConfig[] getCacheVmConfigs() {
+    return (CacheVmConfig[]) this.cacheServerConfigs
+        .toArray(new CacheVmConfig[this.cacheServerConfigs.size()]);
+  }
+
+  /**
+   * Creates the configuration for a CacheServer
+   *
+   * @since GemFire 4.0
+   */
+  public CacheServerConfig createCacheServerConfig() {
+    CacheServerConfig config = new CacheServerConfigImpl();
+    addCacheServerConfig(config);
+    return config;
+  }
+
+  public CacheVmConfig createCacheVmConfig() {
+    return (CacheVmConfig) createCacheServerConfig();
+  }
+
+  /**
+   * Adds the configuration for a CacheServer
+   *
+   * @since GemFire 4.0
+   */
+  private void addCacheServerConfig(CacheServerConfig managerConfig) {
+    checkReadOnly();
+
+    if (managerConfig == null)
+      return;
+    for (Iterator iter = this.cacheServerConfigs.iterator(); iter.hasNext();) {
+      CacheServerConfigImpl impl = (CacheServerConfigImpl) iter.next();
+      if (impl.equals(managerConfig)) {
+        return;
+      }
+    }
+    this.cacheServerConfigs.add(managerConfig);
+    configChanged();
+  }
+
+  /**
+   * Removes the configuration for a CacheServer
+   *
+   * @since GemFire 4.0
+   */
+  public void removeCacheServerConfig(CacheServerConfig managerConfig) {
+    removeCacheVmConfig((CacheVmConfig) managerConfig);
+  }
+
+  public void removeCacheVmConfig(CacheVmConfig managerConfig) {
+    checkReadOnly();
+    this.cacheServerConfigs.remove(managerConfig);
+    configChanged();
+  }
+
+  /**
+   * Returns the configurations of all managed distribution locators
+   */
+  public DistributionLocatorConfig[] getDistributionLocatorConfigs() {
+    if (this.system != null) {
+      DistributionLocator[] locators = this.system.getDistributionLocators();
+      DistributionLocatorConfig[] configs = new DistributionLocatorConfig[locators.length];
+      for (int i = 0; i < locators.length; i++) {
+        configs[i] = locators[i].getConfig();
+      }
+      return configs;
+
+    } else {
+      Object[] array = new DistributionLocatorConfig[this.locatorConfigs.size()];
+      return (DistributionLocatorConfig[]) this.locatorConfigs.toArray(array);
+    }
+  }
+
+  /**
+   * Creates the configuration for a DistributionLocator
+   */
+  public DistributionLocatorConfig createDistributionLocatorConfig() {
+    checkReadOnly();
+    DistributionLocatorConfig config = new DistributionLocatorConfigImpl();
+    addDistributionLocatorConfig(config);
+    return config;
+  }
+
+  /**
+   * Adds the configuration for a DistributionLocator
+   */
+  private void addDistributionLocatorConfig(DistributionLocatorConfig config) {
+    checkReadOnly();
+    this.locatorConfigs.add(config);
+    configChanged();
+  }
+
+  /**
+   * Removes the configuration for a DistributionLocator
+   */
+  public void removeDistributionLocatorConfig(DistributionLocatorConfig config) {
+    checkReadOnly();
+    this.locatorConfigs.remove(config);
+    configChanged();
+  }
+
+  /**
+   * Validates the bind address. The address may be a host name or IP address, but it must not be
+   * empty and must be usable for creating an InetAddress. Cannot have a leading '/' (which
+   * InetAddress.toString() produces).
+   *
+   * @param bindAddress host name or IP address to validate
+   */
+  public static boolean validateBindAddress(String bindAddress) {
+    if (bindAddress == null || bindAddress.length() == 0)
+      return true;
+    if (InetAddressUtil.validateHost(bindAddress) == null)
+      return false;
+    return true;
+  }
+
+  public synchronized void configChanged() {
+    ConfigListener[] clients = null;
+    synchronized (this.listeners) {
+      clients = (ConfigListener[]) listeners.toArray(new ConfigListener[this.listeners.size()]);
+    }
+    for (int i = 0; i < clients.length; i++) {
+      try {
+        clients[i].configChanged(this);
+      } catch (Exception e) {
+        logger.warn(e.getMessage(), e);
+      }
+    }
+  }
+
+  /**
+   * Registers listener for notification of changes in this config.
+   */
+  public void addListener(ConfigListener listener) {
+    synchronized (this.listeners) {
+      this.listeners.add(listener);
+    }
+  }
+
+  /**
+   * Removes previously registered listener of this config.
+   */
+  public void removeListener(ConfigListener listener) {
+    synchronized (this.listeners) {
+      this.listeners.remove(listener);
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // SSL support...
+  // -------------------------------------------------------------------------
+  private boolean sslEnabled = DistributionConfig.DEFAULT_SSL_ENABLED;
+  private String sslProtocols = DistributionConfig.DEFAULT_SSL_PROTOCOLS;
+  private String sslCiphers = DistributionConfig.DEFAULT_SSL_CIPHERS;
+  private boolean sslAuthenticationRequired = DistributionConfig.DEFAULT_SSL_REQUIRE_AUTHENTICATION;
+  private Properties sslProperties = new Properties();
+
+  public boolean isSSLEnabled() {
+    return this.sslEnabled;
+  }
+
+  public void setSSLEnabled(boolean enabled) {
+    checkReadOnly();
+    this.sslEnabled = enabled;
+    configChanged();
+  }
+
+  public String getSSLProtocols() {
+    return this.sslProtocols;
+  }
+
+  public void setSSLProtocols(String protocols) {
+    checkReadOnly();
+    this.sslProtocols = protocols;
+    configChanged();
+  }
+
+  public String getSSLCiphers() {
+    return this.sslCiphers;
+  }
+
+  public void setSSLCiphers(String ciphers) {
+    checkReadOnly();
+    this.sslCiphers = ciphers;
+    configChanged();
+  }
+
+  public boolean isSSLAuthenticationRequired() {
+    return this.sslAuthenticationRequired;
+  }
+
+  public void setSSLAuthenticationRequired(boolean authRequired) {
+    checkReadOnly();
+    this.sslAuthenticationRequired = authRequired;
+    configChanged();
+  }
+
+  public Properties getSSLProperties() {
+    return this.sslProperties;
+  }
+
+  public void setSSLProperties(Properties sslProperties) {
+    checkReadOnly();
+    this.sslProperties = sslProperties;
+    if (this.sslProperties == null) {
+      this.sslProperties = new Properties();
+    }
+    configChanged();
+  }
+
+  public void addSSLProperty(String key, String value) {
+    checkReadOnly();
+    this.sslProperties.put(key, value);
+    configChanged();
+  }
+
+  public void removeSSLProperty(String key) {
+    checkReadOnly();
+    this.sslProperties.remove(key);
+    configChanged();
+  }
+
+  /**
+   * @return the gfSecurityProperties
+   * @since GemFire 6.6.3
+   */
+  public Properties getGfSecurityProperties() {
+    return gfSecurityProperties;
+  }
+
+  public String getLogFile() {
+    return this.logFile;
+  }
+
+  public void setLogFile(String logFile) {
+    checkReadOnly();
+    this.logFile = logFile;
+    configChanged();
+  }
+
+  public String getLogLevel() {
+    return this.logLevel;
+  }
+
+  public void setLogLevel(String logLevel) {
+    checkReadOnly();
+    this.logLevel = logLevel;
+    configChanged();
+  }
+
+  public int getLogDiskSpaceLimit() {
+    return this.logDiskSpaceLimit;
+  }
+
+  public void setLogDiskSpaceLimit(int limit) {
+    checkReadOnly();
+    this.logDiskSpaceLimit = limit;
+    configChanged();
+  }
+
+  public int getLogFileSizeLimit() {
+    return this.logFileSizeLimit;
+  }
+
+  public void setLogFileSizeLimit(int limit) {
+    checkReadOnly();
+    this.logFileSizeLimit = limit;
+    configChanged();
+  }
+
+  /**
+   * Returns the refreshInterval in seconds
+   */
+  public int getRefreshInterval() {
+    return this.refreshInterval;
+  }
+
+  /**
+   * Sets the refreshInterval in seconds
+   */
+  public void setRefreshInterval(int timeInSecs) {
+    checkReadOnly();
+    this.refreshInterval = timeInSecs;
+    configChanged();
+  }
+
+  /**
+   * Makes sure that the mcast port and locators are correct and consistent.
+   *
+   * @throws IllegalArgumentException If configuration is not valid
+   */
+  public void validate() {
+    if (this.getMcastPort() < MIN_MCAST_PORT || this.getMcastPort() > MAX_MCAST_PORT) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.DistributedSystemConfigImpl_MCASTPORT_MUST_BE_AN_INTEGER_INCLUSIVELY_BETWEEN_0_AND_1
+              .toLocalizedString(
+                  new Object[] {Integer.valueOf(MIN_MCAST_PORT), Integer.valueOf(MAX_MCAST_PORT)}));
+    }
+
+    // disabled in 5.1 - multicast and locators can be used together
+    // if (!DEFAULT_LOCATORS.equals(this.getLocators()) &&
+    // this.mcastPort > 0) {
+    // throw new IllegalArgumentException(
+    // "mcastPort must be zero when locators are specified");
+    // }
+
+    LogWriterImpl.levelNameToCode(this.logLevel);
+
+    if (this.logFileSizeLimit < MIN_LOG_FILE_SIZE_LIMIT
+        || this.logFileSizeLimit > MAX_LOG_FILE_SIZE_LIMIT) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.DistributedSystemConfigImpl_LOGFILESIZELIMIT_MUST_BE_AN_INTEGER_BETWEEN_0_AND_1
+              .toLocalizedString(new Object[] {Integer.valueOf(MIN_LOG_FILE_SIZE_LIMIT),
+                  Integer.valueOf(MAX_LOG_FILE_SIZE_LIMIT)}));
+    }
+
+    if (this.logDiskSpaceLimit < MIN_LOG_DISK_SPACE_LIMIT
+        || this.logDiskSpaceLimit > MAX_LOG_DISK_SPACE_LIMIT) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.DistributedSystemConfigImpl_LOGDISKSPACELIMIT_MUST_BE_AN_INTEGER_BETWEEN_0_AND_1
+              .toLocalizedString(new Object[] {Integer.valueOf(MIN_LOG_DISK_SPACE_LIMIT),
+                  Integer.valueOf(MAX_LOG_DISK_SPACE_LIMIT)}));
+    }
+
+    parseEntityConfigXMLFile();
+  }
+
+  /**
+   * Makes a deep copy of this config object.
+   */
+  @Override
+  public Object clone() throws CloneNotSupportedException {
+    DistributedSystemConfigImpl other = (DistributedSystemConfigImpl) super.clone();
+    other.system = null;
+    other.cacheServerConfigs = new HashSet();
+    other.locatorConfigs = new HashSet();
+
+    DistributionLocatorConfig[] myLocators = this.getDistributionLocatorConfigs();
+    for (int i = 0; i < myLocators.length; i++) {
+      DistributionLocatorConfig locator = myLocators[i];
+      other.addDistributionLocatorConfig((DistributionLocatorConfig) locator.clone());
+    }
+
+    CacheServerConfig[] myCacheServers = this.getCacheServerConfigs();
+    for (int i = 0; i < myCacheServers.length; i++) {
+      CacheServerConfig locator = myCacheServers[i];
+      other.addCacheServerConfig((CacheServerConfig) locator.clone());
+    }
+
+    return other;
+  }
+
+  @Override
+  public String toString() {
+    StringBuffer buf = new StringBuffer(1000);
+    String lf = System.getProperty("line.separator");
+    if (lf == null)
+      lf = ",";
+
+    buf.append("DistributedSystemConfig(");
+    buf.append(lf);
+    buf.append("  system-name=");
+    buf.append(String.valueOf(this.systemName));
+    buf.append(lf);
+    buf.append("  " + MCAST_ADDRESS + "=");
+    buf.append(String.valueOf(this.mcastAddress));
+    buf.append(lf);
+    buf.append("  " + MCAST_PORT + "=");
+    buf.append(String.valueOf(this.mcastPort));
+    buf.append(lf);
+    buf.append("  " + LOCATORS + "=");
+    buf.append(String.valueOf(this.locators));
+    buf.append(lf);
+    buf.append("  " + MEMBERSHIP_PORT_RANGE_NAME + "=");
+    buf.append(getMembershipPortRange());
+    buf.append(lf);
+    buf.append("  " + BIND_ADDRESS + "=");
+    buf.append(String.valueOf(this.bindAddress));
+    buf.append(lf);
+    buf.append("  " + TCP_PORT + "=" + this.tcpPort);
+    buf.append(lf);
+    buf.append("  " + DISABLE_TCP + "=");
+    buf.append(String.valueOf(this.disableTcp));
+    buf.append(lf);
+    buf.append("  " + DISABLE_AUTO_RECONNECT + "=");
+    buf.append(String.valueOf(this.disableAutoReconnect));
+    buf.append(lf);
+    buf.append("  " + REMOTE_COMMAND_NAME + "=");
+    buf.append(String.valueOf(this.remoteCommand));
+    buf.append(lf);
+    buf.append("  " + CLUSTER_SSL_ENABLED + "=");
+    buf.append(String.valueOf(this.sslEnabled));
+    buf.append(lf);
+    buf.append("  " + CLUSTER_SSL_CIPHERS + "=");
+    buf.append(String.valueOf(this.sslCiphers));
+    buf.append(lf);
+    buf.append("  " + CLUSTER_SSL_PROTOCOLS + "=");
+    buf.append(String.valueOf(this.sslProtocols));
+    buf.append(lf);
+    buf.append("  " + CLUSTER_SSL_REQUIRE_AUTHENTICATION + "=");
+    buf.append(String.valueOf(this.sslAuthenticationRequired));
+    buf.append(lf);
+    buf.append("  " + LOG_FILE_NAME + "=");
+    buf.append(String.valueOf(this.logFile));
+    buf.append(lf);
+    buf.append("  " + LOG_LEVEL_NAME + "=");
+    buf.append(String.valueOf(this.logLevel));
+    buf.append(lf);
+    buf.append("  " + LOG_DISK_SPACE_LIMIT_NAME + "=");
+    buf.append(String.valueOf(this.logDiskSpaceLimit));
+    buf.append(lf);
+    buf.append("  " + LOG_FILE_SIZE_LIMIT_NAME + "=");
+    buf.append(String.valueOf(this.logFileSizeLimit));
+    buf.append(lf);
+    buf.append("  " + REFRESH_INTERVAL_NAME + "=");
+    buf.append(String.valueOf(this.refreshInterval));
+    buf.append(")");
+    return buf.toString();
+  }
+}
+



[10/50] [abbrv] incubator-geode git commit: [GEODE-2037] Update pulse documentation links

Posted by kl...@apache.org.
[GEODE-2037] Update pulse documentation links


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

Branch: refs/heads/feature/GEODE-288
Commit: 69a0877abf1c789d58913cfb152f85ac5ba9d965
Parents: f73a4e3
Author: Anthony Baker <ab...@apache.org>
Authored: Wed Oct 26 07:59:42 2016 -0700
Committer: Anthony Baker <ab...@apache.org>
Committed: Wed Oct 26 10:14:11 2016 -0700

----------------------------------------------------------------------
 geode-pulse/src/main/webapp/DataBrowser.html                 | 2 +-
 geode-pulse/src/main/webapp/MemberDetails.html               | 2 +-
 geode-pulse/src/main/webapp/QueryStatistics.html             | 2 +-
 geode-pulse/src/main/webapp/clusterDetail.html               | 2 +-
 geode-pulse/src/main/webapp/properties/gemfire.properties    | 2 +-
 geode-pulse/src/main/webapp/properties/gemfire_en.properties | 2 +-
 geode-pulse/src/main/webapp/regionDetail.html                | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69a0877a/geode-pulse/src/main/webapp/DataBrowser.html
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/DataBrowser.html b/geode-pulse/src/main/webapp/DataBrowser.html
index 165fa6f..1695a83 100644
--- a/geode-pulse/src/main/webapp/DataBrowser.html
+++ b/geode-pulse/src/main/webapp/DataBrowser.html
@@ -137,7 +137,7 @@
 	        </div>
 				</div>
 				<div class="left headerTopSeperator"></div>
-	      <div class="left"><a target="_blank" href="http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks">Help</a></div>
+	      <div class="left"><a target="_blank" href="http://geode.apache.org/docs/guide/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks">Help</a></div>
 	      <div class="left headerTopSeperator"></div>
 	      <div class="left headerTopLinks welcomeLabelPRZero">Welcome</div>
 	      <div class="left headerTopLinks textbold font-size12" id="userName"></div>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69a0877a/geode-pulse/src/main/webapp/MemberDetails.html
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/MemberDetails.html b/geode-pulse/src/main/webapp/MemberDetails.html
index b416926..1ce2a4c 100644
--- a/geode-pulse/src/main/webapp/MemberDetails.html
+++ b/geode-pulse/src/main/webapp/MemberDetails.html
@@ -128,7 +128,7 @@
       
       </div>
       <div class="left headerTopSeperator"></div>
-      <div class="left"><a data-prod-custom="pulse-help-custom" target="_blank" href="http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks" class="left headerTopLinks">Help</a></div>
+      <div class="left"><a data-prod-custom="pulse-help-custom" target="_blank" href="http://geode.apache.org/docs/guide/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks" class="left headerTopLinks">Help</a></div>
       <div class="left headerTopSeperator"></div>
       <div class="left headerTopLinks welcomeLabelPRZero">Welcome</div>
       <div class="left headerTopLinks textbold font-size12" id="userName"></div>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69a0877a/geode-pulse/src/main/webapp/QueryStatistics.html
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/QueryStatistics.html b/geode-pulse/src/main/webapp/QueryStatistics.html
index 07f61c6..21ece3f 100644
--- a/geode-pulse/src/main/webapp/QueryStatistics.html
+++ b/geode-pulse/src/main/webapp/QueryStatistics.html
@@ -150,7 +150,7 @@
 				<div class="left headerTopSeperator"></div>
 				<div class="left">
 					<a data-prod-custom="pulse-help-custom" target="_blank"
-						href="http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html"
+						href="http://geode.apache.org/docs/guide/tools_modules/pulse/chapter_overview.html"
 						class="left headerTopLinks">Help</a>
 				</div>
 				<div class="left headerTopSeperator"></div>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69a0877a/geode-pulse/src/main/webapp/clusterDetail.html
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/clusterDetail.html b/geode-pulse/src/main/webapp/clusterDetail.html
index 211e366..0b1f562 100644
--- a/geode-pulse/src/main/webapp/clusterDetail.html
+++ b/geode-pulse/src/main/webapp/clusterDetail.html
@@ -118,7 +118,7 @@
         </div>
       </div>
       <div class="left headerTopSeperator"></div>
-      <div class="left"><a data-prod-custom="pulse-help-custom" target="_blank" href="http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks" class="left headerTopLinks">Help</a></div>
+      <div class="left"><a data-prod-custom="pulse-help-custom" target="_blank" href="http://geode.apache.org/docs/guide/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks" class="left headerTopLinks">Help</a></div>
       <div class="left headerTopSeperator"></div>
       <div class="left headerTopLinks welcomeLabelPRZero">Welcome</div>
       <div class="left headerTopLinks textbold font-size12" id="userName"></div>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69a0877a/geode-pulse/src/main/webapp/properties/gemfire.properties
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/properties/gemfire.properties b/geode-pulse/src/main/webapp/properties/gemfire.properties
index 17e2259..db6f881 100644
--- a/geode-pulse/src/main/webapp/properties/gemfire.properties
+++ b/geode-pulse/src/main/webapp/properties/gemfire.properties
@@ -23,7 +23,7 @@ pulse-writes-custom=Writes
 pulse-reads-custom=Reads
 pulse-monitoring-custom=images/pulse-monitoring.png
 pulse-aboutimg-custom=images/about-geode.png
-pulse-help-custom=http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html
+pulse-help-custom=http://geode.apache.org/docs/guide/tools_modules/pulse/chapter_overview.html
 pulse-about-custom=The Pulse tool monitors Apache Geode system in real time. It provides health information, detailed operational and configuration data, system alerts, throughput performance and statistics for system members and connected clients.
 pulse-regionstableCaps-custom=Regions
 pulse-rtSummaryBySize-custom=Regions Summary - By Entry Count

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69a0877a/geode-pulse/src/main/webapp/properties/gemfire_en.properties
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/properties/gemfire_en.properties b/geode-pulse/src/main/webapp/properties/gemfire_en.properties
index 17e2259..db6f881 100644
--- a/geode-pulse/src/main/webapp/properties/gemfire_en.properties
+++ b/geode-pulse/src/main/webapp/properties/gemfire_en.properties
@@ -23,7 +23,7 @@ pulse-writes-custom=Writes
 pulse-reads-custom=Reads
 pulse-monitoring-custom=images/pulse-monitoring.png
 pulse-aboutimg-custom=images/about-geode.png
-pulse-help-custom=http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html
+pulse-help-custom=http://geode.apache.org/docs/guide/tools_modules/pulse/chapter_overview.html
 pulse-about-custom=The Pulse tool monitors Apache Geode system in real time. It provides health information, detailed operational and configuration data, system alerts, throughput performance and statistics for system members and connected clients.
 pulse-regionstableCaps-custom=Regions
 pulse-rtSummaryBySize-custom=Regions Summary - By Entry Count

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/69a0877a/geode-pulse/src/main/webapp/regionDetail.html
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/regionDetail.html b/geode-pulse/src/main/webapp/regionDetail.html
index 98404cb..0323cd1 100644
--- a/geode-pulse/src/main/webapp/regionDetail.html
+++ b/geode-pulse/src/main/webapp/regionDetail.html
@@ -210,7 +210,7 @@
         <!-- Version Details Popup -->
       </div>
       <div class="left headerTopSeperator"></div>
-      <div class="left"><a data-prod-custom="pulse-help-custom"  target="_blank" href="http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks">Help</a></div>
+      <div class="left"><a data-prod-custom="pulse-help-custom"  target="_blank" href="http://geode.apache.org/docs/guide/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks">Help</a></div>
       <div class="left headerTopSeperator"></div>
       <div class="left headerTopLinks welcomeLabelPRZero">Welcome</div>
       <div class="left headerTopLinks textbold font-size12" id="userName"></div>


[15/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/package.html
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/package.html b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/package.html
new file mode 100755
index 0000000..ab335d1
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/package.html
@@ -0,0 +1,166 @@
+<!--
+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.
+-->
+<HTML>
+<BODY>
+
+<P>Contains the implementation of the external JMX APIs from
+<a href="{@docRoot}/org/apache/geode/internal/admin/api/jmx/package-summary.html#package_description">org.apache.geode.internal.admin.api.jmx</a>.</P>
+
+<H2>JMX Support in GemFire</H2>
+
+Our goal was to provide JMX administrative support in GemFire.  The design was influenced by these important factors:
+<p>
+<ul>
+<li/>1) Requirement to not impact performance of the product
+<li/>2) Desire to introduce JMX without altering the existing product or the management console
+<li/>3) Similar functionality already existed in the console and the internal.admin pkg which the console uses
+<li/>4) Requirement to also introduce a simple and usable Admin API which or may not be related to JMX
+</ul>
+
+From a functional stand point, the JMX support was supposed to provide most of the same administrative and operational monitoring that the console already provides.  In some cases we limited the functionality due to security concerns and in others because it was hard to express the features as JMX beans.  The JMX Agent also provides some functionality (such as Health monitoring) that is not currently in the console.
+<p>
+The Agent communicates with the distributed system using the same distribution manager {@link org.apache.geode.distributed.internal.DistributionManager} as the console uses and thus has the same requirements that determine what distributed system it can manage.  Although the Console currently supports managing multiple distributed systems, we decided that a given Agent should only be able to manage a single system.  We have not tested the use of more than one Agent for the same system, however nothing currently prohibits this.
+<p>
+We decided to develop a simple public Admin API which in essence wraps the internal.admin API that the Console currently uses extensively.  The Admin API also contains implementations of new functionality not in internal.admin.  Our JMX support is an extension to this Admin API.  In an overly simplified view, the GemFire JMX MBeans are ModelMBeans that manage instances of the Admin API objects housed in the Agent's MBeanServer.
+<p>
+The selected architecture consists of a Daemon Agent, which exists in a separate VM that GemFire does not depend on.  This Agent hosts an MBeanServer, instances of any and all MBeans registered for managing a GemFire distributed system, and server connectors/adaptors that various types of clients can connect to.
+<p>
+The two server connectors we selected are the HttpAdaptor and the RMI Connector.  The HttpAdaptor provides an HTML user interface of all MBeans in the MBeanServer.  Although this generic UI is not as rich as an RMI client (or the GemFire Console) could be, it provides a functional and easy to use UI with no development required.  The JMX Remote specification details the standard connectors.  Although the HttpAdaptor is not required by this Sun spec. it is included in some form with all JMX implementations that I investigated.  It should be noted that our JMX Agent currently starts up the HttpAdaptor, but not the RMI Connector.  The latter is deferred as later work since some form of client must be developed for testing.  Further research may also uncover a generic, configurable open-source RMI client for JMX.  The GemFire Console could in theory be reworked as an RMI Connector client, but this is not currently planned.
+<p>
+Two open-source JMX implementations made it to our final review for consideration: <a href="http://www.xmojo.org">XMOJO</a> and <a href="http://www.mx4j.org">MX4J</a>.  The decision to go with MX4J was based mainly on our perceptions of MX4J being more active and widespread in use.  Additionally, XMOJO is associated with <a href="http://www.adventnet.com/">AdventNet</a> which produces commercial products.  This made MX4J seem more true to open-source and safer from corporate tampering.
+<p>
+ModelMBeans are very dynamic and capable of managing aggregate resources.  Use of a ModelMBean entails specifying meta-data to an instance of javax.management.modelmbean.RequiredModelMBean.  This meta-data identifies the manageble resource(s) which can consist of a single object, or many objects, including those in one VM or in any number of distributed VMs.  We decided to subclass classes in the Admin API in order to massage them a little and make them easier to use as a managed resource by the ModelMBean.  For example, org.apache.geode.internal.admin.api.GemFireManager represents a type of member in a GemFire system which manages shared memory.  When an MBean is registered for managing the GemFireManager, the JMX Agent instantiates a "JMX friendlier" subclass: org.apache.geode.internal.admin.api.jmx.impl.GemFireMangerJmxImpl.  Comparison of this class with the non-JMX super class org.apache.geode.internal.admin.api.impl.GemFireManagerImpl will illustrate what "JMX friendly" means 
 better than trying to explain it here...
+<p>
+One standard approach to defining a ModelMBean is to programmatically
+build the necessary meta-data.  The folks on the Tomcat approach
+developed a better solution... an XML definition file which Jakarta
+Commons-Modeler parses to create the meta-data objects required to
+definie the ModelMBean.  We currently have our XML descriptor file at
+org.apache.geode.internal.admin.api.jmx.mbeans-descriptors.xml.
+Commons-Modeler can be found at <A href="http://jakarta.apache.org/commons/modeler">http://jakarta.apache.org/commons/modeler/</A>
+<p>
+Here's a quick run-down of the Admin and JMX pkgs in GemFire...
+<p>
+<b>org.apache.geode.internal.admin.api</b>
+<ul>
+<li/>interfaces describing GemFire entities and resources for managing or monitoring
+</ul>
+<p>
+<b>org.apache.geode.internal.admin.api.impl</b>
+<ul>
+<li/>implementations of the admin pkg which could be used to managing GemFire
+<li/>recommendation is to create one set on non-JMX unit tests for these and then wrap that unit test within another test that is specific to its use in JMX
+</ul>
+<p>
+<b>org.apache.geode.internal.admin.api.jmx</b>
+<ul>
+<li/>Commons-Modeler descriptor file mbeans-descriptors.xml
+<li/>AgentMBean - non-required interface that simply represents a public documentation of what the Agent does
+<li/>VersionMBean and Version - unused (but functional) examples of a standard MBean (other MBeans as defined in mbeans-descriptors.xml also provide version info)
+</ul>
+<p>
+<b>org.apache.geode.internal.internal.admin.api.jmx.impl</b>
+<ul>
+<li/>subclasses of org.apache.geode.internal.admin.api.impl classes that use JMX services, implement ManagedResource, register ModelMBeans to manage themselves, and other JMX related details
+<li/>ManagedResource - simple interface we use to create a more uniform approach in using JMX
+<li/>Agent - application with main, registers HttpAdaptor, acts as a factory to DistributedSystemJmxImpl (which is the entry point to using JMX with a GemFire system)
+<li/>AgentConfig - configuration for Agent that reads/writes to a properties file
+<li/>MBeanUtil - utility class with static methods for defining MBeans, registering for timer-based refresh notifications, and lots of other JMX stuff
+<li/>StatisticAttributeInfo and ConfigAttributeInfo - these are the results of refactoring common code from some of the JmxImpl classes that required runtime dynamic (ie, not known at design time) MBean attributes
+<li/>SpecManagedBean - subclass of part of Commons-Modeler, this class acts as a workaround for a bug in Commons-Modeler (I hope to remove this after working with Jakarta-Commons to correct the bug)
+<li/>AgentPrintStream - this is a hack workaround for suppressing warnings from Xalan that derive from a purported incompatibility between the XSLT sheets in MX4J and the version of Xalan in JDK1.4.2 - experts with Xalan recommend upgrading to the very latest version of Xalan which is not currently desired for GemFire
+</ul>
+<p>
+<h3>Some caveats, workarounds, and GemFire bugs to be aware of:</h3>
+<p>
+1) MX4J uses XSLT style sheets that are intended to work with the latest version of Xalan.  JDK1.4.2 bundles an older version of Xalan which generates warnings.
+<p>
+2) MX4J's implementation of javax.management.modelmbean.RequiredModelMBean contains a bug such that any return type defined as an array of some object results in it attempting to Class.forName the class name with the "[]" still in the name of the class.  Our current workaround is to return java.lang.Object where we'd like to return an array of some non-primitive type.  I hope to look at this closer and work with MX4J to correct it (unless that latest code base at MX4J already has a fix).
+<p>
+3) Our MBeans currently have some return types of Admin interfaces and GemFire MBean types.  This is not recommended.  The correct approach is to return javax.management.ObjectName or an array of ObjectName so that remotability is not broken.  We have a bug filed to correct this in GemFire.
+<p>
+4) Commons-Modeler provides a simple, incomplete implementation of ModelMBean called org.apache.commons.modeler.BaseModelMBean. We decided to use the standard RequiredModelMBean which all JMX implementations are required to supply.  The JMX spec details several "managed resource types" that a ModelMBean can support.  ObjectReference is the type that both MX4J's RequiredModelMBean and Modeler's BaseModelMBean support.  However, MX4J is more strict in it's interpretation of the spec which spells it out as "ObjectReference".  Modeler's BaseModelMBean performs no enforcement and simply assumes it is managing type ObjectReference.  Modeler has a bug in org.apache.commons.modeler.ManagedBean because it specifies "objectReference" which is the incorrect case in comparison to the specification.  I intend to work with the Jakarta-Commons folks to change this to comply with the spec.  The Modeler will use BaseModelMBean by default even though it is actually depending on a JMX implementation s
 uch as MX4J or XMOJO.  org.apache.geode.internal.admin.api.jmx.impl.MBeanUtil tells Modeler to use RequiredModelMBean instead and also uses org.apache.geode.internal.admin.api.jmx.imipl.SpecManagedBean as a workaround to the whole "objectReference" issue.  You could feasibly use org.apache.commons.modeler.BaseModelMBean or RequiredModelMBean.
+<p>
+
+<h3>Capabilities currently supported in GemFire via JMX:</h3>
+<ul>
+<li/>1) View overall system and its settings and start/stop all members
+<li/>2) View all managers and applications
+<li/>3) View and modify config (includes optional use of JMX Timer service to auto-refresh)
+<li/>4) View any statistics (includes optional use of JMX Timer service to auto-refresh)
+<li/>5) View member's cache and its statistics
+<li/>6) View a cache's region and its attributes, statistics, but not the data
+<li/>7) Health monitoring (ask David W. for more info... I haven't had a chance to look at this yet)
+<li/>8) Create, start, and stop managers
+</ul>
+<p>
+<h3>TODO:</h3>
+<ul>
+<li/>1) Creation and control of Locators
+<li/>2) Enable the RMI Connector and build tests
+<li/>3) Bind Address support (bug 30898)
+<li/>4) SSL Configuration support
+<li/>5) JMX Connector security
+<li/>6) more thorough automated tests!!
+<li/>7) Documentation of use w/ built-in Connectors (RMI and HTTP)
+<li/>8) Documentation of use w/ AdventNet SNMP Adaptor
+<li/>9) Documentation of use w/ selected commercial management products
+<li/>10) Determine high-availability requirements if any (mentioned by Jags)
+</ul>
+See also <a href="#deferred_ops">deferred backlog from Hardening/Operations sprint</a>
+<p>
+It's very easy to use the JMX Monitor service to monitor an MBean's attribute and fire JMX Notifications.  Statistics and Config Parameters are "MBean attributes".
+
+<p>
+<h3>Using Third Party Management Consoles/Tools</h3>
+There is information on <a href="http://www.adventnet.com/">AdventNet's website</a> detailing the use of their <a href="http://www.adventnet.com/products/snmpadaptor/index.html">SNMP Adaptor</a> to enable connectivity to <a href="http://www.openview.hp.com/">HP OpenView</a>, <a href="http://www.ibm.com/software/tivoli/">IBM Tivoli</a>, <a href="http://www3.ca.com/solutions/solution.asp?id=315">CA Unicenter</a>, and other SNMP managers.
+<p>
+Aside from using AdventNet's SNMP Adaptor, HPOpenView is the first I've seen of the big players offering what appears to be a way to plug our JMX support into their product for management of GemFire.  I haven't had a chance to look at it yet.  Most likely their <a href="http://www.openview.hp.com/products/spi/">SPI</a> supports writing a small amount of glue code to have their console become an RMI client to our JMX VM (which is essentially an MBeanServer "server" that hosts our MBeans).  I think it's unlikely that such vendors would want to support hosting of third party MBeans and the classpath/versioning headaches involved in that.  The JMX Remote specification really is meant to cover how such console's would perform the remote connections to custom MBeans in external VMs/products.  It is likely that the other management tool vendors such as Tivoli have a similar SPI available or in the works.
+<p>
+See HP Dev Resource Central's page on <a href="http://devresource.hp.com/jmx.htm">JMX</a> for info and links on using JMX to integrate with HP OpenView.  You can also sign up for <a href="http://www.hpdev.com/.docs/pg/5">HP Developer News</a>
+<p>
+<h3><a name="deferred_ops">Deferred Backlog from Hardening/Operations Sprint</a></h3>
+Note: some of these tasks may no longer be worded properly or even needed...
+<ul>
+<li/>Provide a consolidated view of all cache Regions via JMX
+<li/>Send an alert upon system failure, communication failure, etc.
+<li/>Monitor cache system failures, comm failures, loader failures, etc via JMX
+<li/>Detect/handle stuck shared memory locks via JMX
+<li/>Provide a "combination view" (distributed system-wide) of certain statistics via JMX
+<li/>Integrate with Tivoli and produce a document
+<li/>Test managing caches via JMX with a large number of Regions, Entries, etc.
+<li/>Create XDoclet module to auto-generate mbeans-descriptors.xml (Note: we're using JavaDoc 1.4.2 which is incompatible with XDoclet; Sun intends to restore compatibility in the next version of JavaDoc)
+<li/>Investigate AdventNet's JMX administration console
+<li/>View percentage of VM memory used by a Cache via JMX
+<li/>Investigate modifying the GemFire Console to use JMX
+<li/>Investigate providing secure management via JMX
+<li/>Document security usage for JMX management
+<li/>Investigate managing GemFire via BMC Patrol
+<li/>Investigate managing GemFire via HP OpenView
+<li/>Investigate managing GemFire via UniCenter
+<li/>Submit fix to Jakrta Commons-Modeler for ObjectReference fix in ManagedBean
+<li/>Submit fix to MX4J for classload error in RequiredModelMBean
+<li/>Enable the RMI Connector (currently commented out in Agent)
+<li/>Create tests for RMI Connector
+<li/>Document and JavaDoc usage of the RMI Connector
+<li/>Add support to MBeanUtil to determine which MBeanServer the Agent is in
+<li/>Correlate information from GemFire MBeans with MBeans from other products
+<li/>Test deploying GemFire MBeans into other products' MBean containers
+</ul>
+
+</BODY>
+</HTML>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/package.html
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/package.html b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/package.html
new file mode 100755
index 0000000..acbefa8
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/package.html
@@ -0,0 +1,28 @@
+<!--
+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.
+-->
+<HTML>
+<BODY>
+
+<P>Provides administrative access to a GemFire distributed system via
+the Java Management Extensions (JMX).</P>
+
+<P>Click <A href="doc-files/mbeans-descriptions.html">here</A> for a
+description of the attributes, operations, and notifications of the
+GemFire JMX MBeans.</P>
+
+</BODY>
+</HTML>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/package.html
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/package.html b/geode-core/src/main/java/org/apache/geode/internal/admin/api/package.html
new file mode 100644
index 0000000..db66a34
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/package.html
@@ -0,0 +1,78 @@
+<!--
+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.
+-->
+<HTML>
+<BODY>
+
+<P>Provides an API for administering various GemFire components such
+as a GemFire distributed
+system, and processes that host GemFire Caches.</P>
+
+<H3>Administration of a GemFire Distributed System</H3>
+
+The Admin API provides interfaces for administrative control, 
+monitoring, and custom management of a GemFire system.
+<P>
+The {@link org.apache.geode.internal.admin.api.AdminDistributedSystemFactory}
+is the starting point.  It creates an instance of
+<code>AdminDistributedSystem</code> that administers the distributed
+system to which a VM is {@linkplain
+org.apache.geode.distributed.DistributedSystem connected}.
+<P>
+<pre><code>
+DistributedSystem connection = DistributedSystem.connect(new Properties());
+AdminDistributedSystem system = 
+    AdminDistributedSystemFactory.getDistributedSystem(connection);
+system.connect(new File("admin.log"), "info");
+</code></pre>
+<P>
+This {@link org.apache.geode.internal.admin.api.AdminDistributedSystem}
+interface exposes methods for such tasks as connecting to the system,
+merging system logs, getting administrative interfaces to 
+applications that host GemFire Caches.
+
+<H3>Monitoring the Health of GemFire</H3>
+
+<P>The {@link org.apache.geode.internal.admin.api.GemFireHealth} interface
+allows the overall health of GemFire to be monitored.
+<code>GemFireHealth</code> monitors the behavior the members of a
+distributed system namely 
+application VMs that may host {@link org.apache.geode.cache.Cache
+cache} instances.  There are three levels of health: {@linkplain
+org.apache.geode.internal.admin.api.GemFireHealth#GOOD_HEALTH good health} that
+indicates that all GemFire components are behaving reasonably,
+{@linkplain org.apache.geode.internal.admin.api.GemFireHealth#OKAY_HEALTH okay
+health} that indicates that one or more GemFire components is slightly
+unhealthy and may need some attention, and {@linkplain
+org.apache.geode.internal.admin.api.GemFireHealth#POOR_HEALTH poor health} that
+indicates that a GemFire component is unhealthy and needs immediate
+attention.</P>
+
+<P>Because each GemFire application has its own definition of what it
+means to be "healthy", the metrics that are used to determine health
+are configurable.  {@link
+org.apache.geode.internal.admin.api.GemFireHealthConfig} provides methods for
+configuring how the health of {@linkplain
+org.apache.geode.internal.admin.api.DistributedSystemHealthConfig the
+distributed system},
+{@linkplain org.apache.geode.internal.admin.api.CacheHealthConfig members that
+host Cache instances}, and {@linkplain
+org.apache.geode.internal.admin.api.MemberHealthConfig individual members} of
+the distributed system.  <code>GemFireHealthConfig</code> also allows
+you to configure how often GemFire's health is evaluated.</P>
+
+</BODY>
+</HTML>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AddHealthListenerRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AddHealthListenerRequest.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AddHealthListenerRequest.java
index 5993d6b..a5291cf 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AddHealthListenerRequest.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AddHealthListenerRequest.java
@@ -17,7 +17,7 @@
 package org.apache.geode.internal.admin.remote;
 
 import org.apache.geode.*;
-import org.apache.geode.admin.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
 import org.apache.geode.distributed.internal.*;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 // import org.apache.geode.internal.*;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AddHealthListenerResponse.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AddHealthListenerResponse.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AddHealthListenerResponse.java
index 8b960ab..3ad94bd 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AddHealthListenerResponse.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AddHealthListenerResponse.java
@@ -17,7 +17,7 @@
 package org.apache.geode.internal.admin.remote;
 
 // import org.apache.geode.*;
-import org.apache.geode.admin.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
 // import org.apache.geode.internal.*;
 // import org.apache.geode.internal.admin.*;
 import org.apache.geode.distributed.internal.*;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRegion.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRegion.java
index 6999bb1..5d87977 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRegion.java
@@ -17,11 +17,10 @@
 package org.apache.geode.internal.admin.remote;
 
 // import org.apache.geode.*;
-import org.apache.geode.admin.RuntimeAdminException;
+import org.apache.geode.internal.admin.api.RuntimeAdminException;
 import org.apache.geode.cache.*;
 import org.apache.geode.cache.query.SelectResults;
 import org.apache.geode.cache.snapshot.RegionSnapshotService;
-import org.apache.geode.internal.cache.snapshot.RegionSnapshotServiceImpl;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 // import org.apache.geode.internal.*;
 // import org.apache.geode.internal.admin.*;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRequest.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRequest.java
index 6c82b56..77e3b1f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRequest.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRequest.java
@@ -24,7 +24,7 @@ import java.io.IOException;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.DataSerializer;
-import org.apache.geode.admin.RuntimeAdminException;
+import org.apache.geode.internal.admin.api.RuntimeAdminException;
 import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.distributed.internal.PooledDistributionMessage;
 import org.apache.geode.distributed.internal.ReplyException;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminWaiters.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminWaiters.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminWaiters.java
index 258faa5..0913d89 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminWaiters.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminWaiters.java
@@ -20,8 +20,8 @@ import java.util.Set;
 
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.admin.OperationCancelledException;
-import org.apache.geode.admin.RuntimeAdminException;
+import org.apache.geode.internal.admin.api.OperationCancelledException;
+import org.apache.geode.internal.admin.api.RuntimeAdminException;
 import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.distributed.internal.ReplyProcessor21;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertLevelChangeMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertLevelChangeMessage.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertLevelChangeMessage.java
index c3a293f..d7a6df2 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertLevelChangeMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertLevelChangeMessage.java
@@ -21,7 +21,7 @@ import java.io.IOException;
 import org.apache.geode.distributed.internal.SerialDistributionMessage;
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.admin.AlertLevel;
+import org.apache.geode.internal.admin.api.AlertLevel;
 import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.internal.admin.Alert;
 import org.apache.geode.internal.i18n.LocalizedStrings;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertListenerMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertListenerMessage.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertListenerMessage.java
index 4f0e9ce..5a25a45 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertListenerMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertListenerMessage.java
@@ -17,7 +17,7 @@
 package org.apache.geode.internal.admin.remote;
 
 import org.apache.geode.*;
-import org.apache.geode.admin.AlertLevel;
+import org.apache.geode.internal.admin.api.AlertLevel;
 import org.apache.geode.distributed.internal.*;
 // import org.apache.geode.internal.*;
 import org.apache.geode.internal.admin.*;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertsNotificationMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertsNotificationMessage.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertsNotificationMessage.java
index 2a6c652..2313e0e 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertsNotificationMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AlertsNotificationMessage.java
@@ -19,8 +19,8 @@ import java.io.DataOutput;
 import java.io.IOException;
 
 import org.apache.geode.DataSerializer;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
-import org.apache.geode.admin.jmx.internal.StatAlertsAggregator;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.jmx.impl.StatAlertsAggregator;
 import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.distributed.internal.PooledDistributionMessage;
 import org.apache.geode.internal.admin.StatAlert;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/FetchHealthDiagnosisRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/FetchHealthDiagnosisRequest.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/FetchHealthDiagnosisRequest.java
index 09369ba..5a50e41 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/FetchHealthDiagnosisRequest.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/FetchHealthDiagnosisRequest.java
@@ -19,7 +19,7 @@ package org.apache.geode.internal.admin.remote;
 import org.apache.geode.distributed.internal.*;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.*;
-import org.apache.geode.admin.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealth;
 import java.io.*;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/FetchHealthDiagnosisResponse.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/FetchHealthDiagnosisResponse.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/FetchHealthDiagnosisResponse.java
index 0f44767..f344b40 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/FetchHealthDiagnosisResponse.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/FetchHealthDiagnosisResponse.java
@@ -17,7 +17,7 @@
 package org.apache.geode.internal.admin.remote;
 
 import org.apache.geode.*;
-import org.apache.geode.admin.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealth;
 // import org.apache.geode.internal.*;
 // import org.apache.geode.internal.admin.*;
 import org.apache.geode.distributed.internal.*;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/HealthListenerMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/HealthListenerMessage.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/HealthListenerMessage.java
index 653cf6a..7bc3f49 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/HealthListenerMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/HealthListenerMessage.java
@@ -19,7 +19,7 @@ package org.apache.geode.internal.admin.remote;
 import org.apache.geode.distributed.internal.*;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.*;
-import org.apache.geode.admin.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealth;
 // import org.apache.geode.internal.*;
 // import org.apache.geode.internal.admin.*;
 import java.io.*;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RefreshMemberSnapshotRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RefreshMemberSnapshotRequest.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RefreshMemberSnapshotRequest.java
index 5b04bbd..62a3313 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RefreshMemberSnapshotRequest.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RefreshMemberSnapshotRequest.java
@@ -16,11 +16,13 @@
 package org.apache.geode.internal.admin.remote;
 
 import org.apache.geode.distributed.internal.*;
+import org.apache.geode.internal.admin.api.GemFireMemberStatus;
+
 import java.io.*;
 
 /**
  * A message that is sent to a particular distribution manager to get its current
- * {@link org.apache.geode.admin.GemFireMemberStatus}
+ * {@link GemFireMemberStatus}
  * 
  */
 public class RefreshMemberSnapshotRequest extends AdminRequest {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RefreshMemberSnapshotResponse.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RefreshMemberSnapshotResponse.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RefreshMemberSnapshotResponse.java
index d7a910b..d0b47ae 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RefreshMemberSnapshotResponse.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RefreshMemberSnapshotResponse.java
@@ -20,7 +20,7 @@ import java.io.DataOutput;
 import java.io.IOException;
 
 import org.apache.geode.DataSerializer;
-import org.apache.geode.admin.GemFireMemberStatus;
+import org.apache.geode.internal.admin.api.GemFireMemberStatus;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.internal.DistributionManager;
@@ -29,7 +29,7 @@ import org.apache.geode.internal.cache.GemFireCacheImpl;
 
 /**
  * A message that is sent to a particular distribution manager to get its current
- * {@link org.apache.geode.admin.GemFireMemberStatus}.
+ * {@link GemFireMemberStatus}.
  * 
  */
 public class RefreshMemberSnapshotResponse extends AdminResponse {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RegionAdminRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RegionAdminRequest.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RegionAdminRequest.java
index f66ecf2..9689563 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RegionAdminRequest.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RegionAdminRequest.java
@@ -17,15 +17,13 @@
 package org.apache.geode.internal.admin.remote;
 
 import org.apache.geode.*;
-// import org.apache.geode.admin.OperationCancelledException;
-import org.apache.geode.admin.RegionNotFoundException;
+import org.apache.geode.internal.admin.api.RegionNotFoundException;
 import org.apache.geode.cache.*;
 // import org.apache.geode.internal.*;
 // import org.apache.geode.internal.cache.*;
 // import org.apache.geode.distributed.internal.*;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.i18n.LocalizedStrings;
-// import org.apache.geode.internal.admin.*;
 import java.io.*;
 // import java.util.*;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RegionSubRegionsSizeResponse.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RegionSubRegionsSizeResponse.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RegionSubRegionsSizeResponse.java
index ba4d848..38a00e9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RegionSubRegionsSizeResponse.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RegionSubRegionsSizeResponse.java
@@ -23,7 +23,7 @@ import java.util.Set;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.DataSerializer;
-import org.apache.geode.admin.RegionSubRegionSnapshot;
+import org.apache.geode.internal.admin.api.RegionSubRegionSnapshot;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.Region;
 import org.apache.geode.distributed.DistributedSystem;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGemFireVM.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGemFireVM.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGemFireVM.java
index d5ff401..0909b31 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGemFireVM.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGemFireVM.java
@@ -20,17 +20,16 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Properties;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 
 import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.GemFireHealth;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.admin.GemFireMemberStatus;
-import org.apache.geode.admin.OperationCancelledException;
-import org.apache.geode.admin.RegionSubRegionSnapshot;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.GemFireMemberStatus;
+import org.apache.geode.internal.admin.api.OperationCancelledException;
+import org.apache.geode.internal.admin.api.RegionSubRegionSnapshot;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.distributed.internal.DistributionMessage;
@@ -424,9 +423,9 @@ public abstract class RemoteGemFireVM implements GemFireVM {
   }
 
   /**
-   * Returns the runtime {@link org.apache.geode.admin.GemFireMemberStatus} from the vm The idea is
-   * this snapshot is similar to stats that represent the current state of a running VM. However,
-   * this is a bit higher level than a stat
+   * Returns the runtime {@link GemFireMemberStatus} from the vm The idea is this snapshot is
+   * similar to stats that represent the current state of a running VM. However, this is a bit
+   * higher level than a stat
    */
   public GemFireMemberStatus getSnapshot() {
     RefreshMemberSnapshotResponse response =
@@ -435,8 +434,8 @@ public abstract class RemoteGemFireVM implements GemFireVM {
   }
 
   /**
-   * Returns the runtime {@link org.apache.geode.admin.RegionSubRegionSnapshot} from the vm The idea
-   * is this snapshot is quickly salvageable to present a cache's region's info
+   * Returns the runtime {@link RegionSubRegionSnapshot} from the vm The idea is this snapshot is
+   * quickly salvageable to present a cache's region's info
    */
   public RegionSubRegionSnapshot getRegionSnapshot() {
     RegionSubRegionsSizeResponse response =

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java
index e23f2d2..2920f20 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java
@@ -17,8 +17,8 @@ package org.apache.geode.internal.admin.remote;
 import org.apache.geode.CancelException;
 import org.apache.geode.IncompatibleSystemException;
 import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.OperationCancelledException;
-import org.apache.geode.admin.RuntimeAdminException;
+import org.apache.geode.internal.admin.api.OperationCancelledException;
+import org.apache.geode.internal.admin.api.RuntimeAdminException;
 import org.apache.geode.distributed.DistributedSystemDisconnectedException;
 import org.apache.geode.distributed.internal.*;
 import org.apache.geode.distributed.internal.InternalDistributedSystem.DisconnectListener;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/statalerts/StatisticInfoImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/statalerts/StatisticInfoImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/statalerts/StatisticInfoImpl.java
index 84702f8..6fd83ad 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/statalerts/StatisticInfoImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/statalerts/StatisticInfoImpl.java
@@ -24,7 +24,7 @@ import org.apache.geode.StatisticDescriptor;
 import org.apache.geode.Statistics;
 import org.apache.geode.StatisticsFactory;
 import org.apache.geode.StatisticsType;
-import org.apache.geode.admin.Statistic;
+import org.apache.geode.internal.admin.api.Statistic;
 
 /**
  * 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
index d9d572c..2aeef7c 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
@@ -82,7 +82,7 @@ import org.apache.geode.GemFireConfigException;
 import org.apache.geode.InternalGemFireError;
 import org.apache.geode.LogWriter;
 import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.internal.SystemMemberCacheEventProcessor;
+import org.apache.geode.internal.admin.api.impl.SystemMemberCacheEventProcessor;
 import org.apache.geode.cache.AttributesFactory;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheClosedException;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
index 360c6a9..5c744db 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
@@ -62,7 +62,7 @@ import org.apache.geode.InternalGemFireError;
 import org.apache.geode.InternalGemFireException;
 import org.apache.geode.LogWriter;
 import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.internal.SystemMemberCacheEventProcessor;
+import org.apache.geode.internal.admin.api.impl.SystemMemberCacheEventProcessor;
 import org.apache.geode.cache.AttributesMutator;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheClosedException;
@@ -154,7 +154,6 @@ import org.apache.geode.internal.HeapDataOutputStream;
 import org.apache.geode.internal.InternalStatisticsDisabledException;
 import org.apache.geode.internal.NanoTimer;
 import org.apache.geode.internal.Version;
-import org.apache.geode.internal.admin.ClientHealthMonitoringRegion;
 import org.apache.geode.internal.cache.AbstractRegionMap.ARMLockTestHook;
 import org.apache.geode.internal.cache.CacheDistributionAdvisor.CacheProfile;
 import org.apache.geode.internal.cache.DiskInitFile.DiskRegionFlag;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteFetchEntryMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteFetchEntryMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteFetchEntryMessage.java
index ea26745..93b77de 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteFetchEntryMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/RemoteFetchEntryMessage.java
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.DataSerializable;
 import org.apache.geode.DataSerializer;
-import org.apache.geode.admin.OperationCancelledException;
+import org.apache.geode.internal.admin.api.OperationCancelledException;
 import org.apache.geode.cache.CacheException;
 import org.apache.geode.cache.EntryNotFoundException;
 import org.apache.geode.cache.Region;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntryMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntryMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntryMessage.java
index ae2ce37..ed34203 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntryMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/FetchEntryMessage.java
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.DataSerializer;
 import org.apache.geode.InternalGemFireError;
-import org.apache.geode.admin.OperationCancelledException;
+import org.apache.geode.internal.admin.api.OperationCancelledException;
 import org.apache.geode.cache.CacheException;
 import org.apache.geode.cache.EntryNotFoundException;
 import org.apache.geode.cache.TransactionException;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/cache/properties.html
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/properties.html b/geode-core/src/main/java/org/apache/geode/internal/cache/properties.html
index 1f9db63..e14195d 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/properties.html
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/properties.html
@@ -81,7 +81,7 @@ bound)"
 <p>
 <em>Integer</em> (default is 60000)
 <p>
-See <code>org.apache.geode.admin.internal.AdminDistributedSystemImpl#TIMEOUT_MS</code>.
+See <code>org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl#TIMEOUT_MS</code>.
 <p>
 TBA
 </dd>
@@ -1662,11 +1662,11 @@ Clear pdxType ids when client disconnects from servers
 <p>
 <em>Boolean</em> (default is false)
 <p>
-See <code>org.apache.geode.admin.GemFireMonitorService#processGetValCommand</code>.
+See <code>org.apache.geode.internal.admin.api.GemFireMonitorService#processGetValCommand</code>.
 <p>
-See <code>org.apache.geode.admin.remote.RemoteCacheInfo.RemoteCacheInfo(GemFireCache)</code>.
+See <code>org.apache.geode.internal.admin.remote.RemoteCacheInfo.RemoteCacheInfo(GemFireCache)</code>.
 <p>
-See <code>org.apache.geode.admin.remote.RootRegionResponse#create(DistributionManager, InternalDistributedMember)</code>.
+See <code>org.apache.geode.internal.admin.remote.RootRegionResponse#create(DistributionManager, InternalDistributedMember)</code>.
 <p>
 See <code>org.apache.geode.internal.cache.PartitionedRegionDataStore#createBucketRegion(int)</code>.
 <p>
@@ -1936,7 +1936,7 @@ Timeout to set for client function execution
 <p>
 <em>String</em> (default is unset, to use System.out)
 <p>
-See <code>org.apache.geode.admin.GemFireClientAdminTool#logFileName</code>.
+See <code>org.apache.geode.internal.admin.api.GemFireClientAdminTool#logFileName</code>.
 <p>
 This is a file name.
 <p>
@@ -2464,7 +2464,7 @@ TBA
 <p>
 <em>Long</em> (default is 5000)
 <p>
-See <code>org.apache.geode.admin.GemFireClientAdminTool#_statusPollingDelay</code>.
+See <code>org.apache.geode.internal.admin.api.GemFireClientAdminTool#_statusPollingDelay</code>.
 <p>
 Units are in milliseconds.
 <p>
@@ -2593,7 +2593,7 @@ TBA
 <p>
 <em>Boolean</em>
 <p>
-See <code>org.apache.geode.admin.jmx.internal.AgentImpl#checkDebug</code>.
+See <code>org.apache.geode.internal.admin.api.jmx.impl.AgentImpl#checkDebug</code>.
 <p>
 <pre>
   Enables mx4j tracing if Agent debugging is enabled.
@@ -2609,7 +2609,7 @@ TBA
 <p>
 <em>String</em>
 <p>
-See <code>org.apache.geode.admin.jmx.internal.AgentConfigImpl#retrievePropertyFile</code>.
+See <code>org.apache.geode.internal.admin.api.jmx.impl.AgentConfigImpl#retrievePropertyFile</code>.
 <p>
 <pre>
    The <code>propertyFile</code> is the name of the property file that will 
@@ -2799,7 +2799,7 @@ TBA
 <p>
 <em>String</em> (default is org.apache.commons.logging.impl.SimpleLog)
 <p>
-See <code>org.apache.geode.admin.jmx.internal.AgentImpl class init</code>.
+See <code>org.apache.geode.internal.admin.api.jmx.impl.AgentImpl class init</code>.
 <p>
 This is the name of a class.
 <p>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java
index 5a3c002..c43fd61 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java
@@ -20,7 +20,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.Set;
 
-import org.apache.geode.admin.RegionNotFoundException;
+import org.apache.geode.internal.admin.api.RegionNotFoundException;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.snapshot.CacheSnapshotService;
 import org.apache.geode.cache.snapshot.RegionSnapshotService;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
index a3ba102..00c2532 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
@@ -77,7 +77,7 @@ import org.apache.logging.log4j.Logger;
 import org.apache.geode.GemFireConfigException;
 import org.apache.geode.SystemConnectException;
 import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.internal.InetAddressUtil;
+import org.apache.geode.internal.admin.api.impl.InetAddressUtil;
 import org.apache.geode.cache.wan.GatewaySender;
 import org.apache.geode.cache.wan.GatewayTransportFilter;
 import org.apache.geode.distributed.ClientSocketFactory;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
index 3016277..16bf111 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java
@@ -42,8 +42,8 @@ import javax.management.ObjectName;
 
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.admin.internal.BackupDataStoreHelper;
-import org.apache.geode.admin.internal.BackupDataStoreResult;
+import org.apache.geode.internal.admin.api.impl.BackupDataStoreHelper;
+import org.apache.geode.internal.admin.api.impl.BackupDataStoreResult;
 import org.apache.geode.cache.persistence.PersistentID;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.internal.DM;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommands.java
index 505b6a8..382f411 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommands.java
@@ -35,8 +35,8 @@ import java.util.Set;
 
 import org.apache.geode.GemFireIOException;
 import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.BackupStatus;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.BackupStatus;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheExistsException;
 import org.apache.geode.cache.CacheFactory;
@@ -54,13 +54,11 @@ import org.apache.geode.internal.cache.DiskStoreImpl;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.execute.AbstractExecution;
 import org.apache.geode.internal.cache.partitioned.ColocatedRegionDetails;
-import org.apache.geode.internal.cache.persistence.PersistentMemberID;
 import org.apache.geode.internal.cache.persistence.PersistentMemberPattern;
 import org.apache.geode.internal.lang.ClassUtils;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.management.DistributedSystemMXBean;
 import org.apache.geode.management.ManagementService;
-import org.apache.geode.management.PersistentMemberDetails;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/package.html
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/package.html b/geode-core/src/main/java/org/apache/geode/package.html
index d7613e3..271a40d 100644
--- a/geode-core/src/main/java/org/apache/geode/package.html
+++ b/geode-core/src/main/java/org/apache/geode/package.html
@@ -21,7 +21,7 @@ limitations under the License.
 concurrent distributed {@linkplain org.apache.geode.cache.Cache caching}
 with {@linkplain org.apache.geode.cache.CacheEvent cache event} delivery,
 <a href="{@docRoot}/org/apache/geode/cache/query/package-summary.html#package_description">OQL querying</a>, and
-<a href="{@docRoot}/org/apache/geode/admin/package-summary.html#package_description">remote cache administration</a>, built using a {@linkplain
+<a href="{@docRoot}/org/apache/geode/internal/admin/api/package-summary.html#package_description">remote cache administration</a>, built using a {@linkplain
 org.apache.geode.distributed.DistributedSystem} which includes a
 {@linkplain org.apache.geode.distributed.DistributedLockService}.
 </P>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/internal/doc-files/mbeans-descriptors.dtd
----------------------------------------------------------------------
diff --git a/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/internal/doc-files/mbeans-descriptors.dtd b/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/internal/doc-files/mbeans-descriptors.dtd
new file mode 100644
index 0000000..7c41bc2
--- /dev/null
+++ b/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/internal/doc-files/mbeans-descriptors.dtd
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+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.
+-->
+
+<!--
+     DTD for the Model MBeans Configuration File
+
+     To support validation of your configuration file, include the following
+     DOCTYPE element at the beginning (after the "xml" declaration):
+
+     <!DOCTYPE mbeans-descriptors PUBLIC
+      "-//Apache Software Foundation//DTD Model MBeans Configuration File"
+      "http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd">
+
+-->
+
+
+<!-- ========== Defined Types ============================================= -->
+
+
+<!-- A "Boolean" is the string representation of a boolean (true or false)
+     variable.
+-->
+<!ENTITY % Boolean "(true|false|yes|no)">
+
+
+<!-- A "ClassName" is the fully qualified name of a Java class that is
+     instantiated to provide the functionality of the enclosing element.
+-->
+<!ENTITY % ClassName "CDATA">
+
+
+<!-- A "MethodName" is the name of a constructor or method, which must
+     be legal according to the syntax requirements of the Java language.
+-->
+<!ENTITY % MethodName "CDATA">
+
+
+<!-- A "VariableName" is the name of a variable or parameter, which must
+     be legal according to the syntax requirements of the Java language.
+-->
+<!ENTITY % VariableName "CDATA">
+
+
+<!-- ========== Element Definitions ======================================= -->
+
+
+<!-- The "mbeans-descriptors" element is the root of the configuration file
+     hierarchy, and contains nested elements for all of the other
+     configuration settings.  Remaining element definitions are listed
+     in alphabetical order.
+-->
+<!ELEMENT mbeans-descriptors (mbean*)>
+<!ATTLIST mbeans-descriptors id          ID             #IMPLIED>
+
+
+<!-- The "attribute" element describes a JavaBeans property of an MBean.
+     The following attributes are supported:
+
+     description      Human-readable description of this attribute.
+
+     displayName      Display name of this attribute.
+
+     getMethod        Name of the property getter method, if it does
+                      not follow standard JavaBeans naming patterns.
+
+     is               Boolean value indicating whether or not this
+                      attribute is a boolean with an "is" getter method.
+                      By default, this is set to "false".
+
+     name             Name of this JavaBeans property, conforming to
+                      standard naming design patterns.
+
+     readable         Boolean value indicating whether or not this
+                      attribute is readable by management applications.
+                      By default, this is set to "true".
+
+     setMethod        Name of the property setter method, if it does
+                      not follow standard JavaBeans naming patterns.
+
+     type             Fully qualified Java class name of this attribute.
+
+     writeable        Boolean value indicating whether or not this
+                      attribute is writeable by management applications.
+                      By default, this is set to "true".
+-->
+<!ELEMENT attribute (descriptor?)>
+<!ATTLIST attribute         id           ID             #IMPLIED>
+<!ATTLIST attribute         description  CDATA          #IMPLIED>
+<!ATTLIST attribute         displayName  CDATA          #IMPLIED>
+<!ATTLIST attribute         getMethod    %MethodName;   #IMPLIED>
+<!ATTLIST attribute         is           %Boolean;      #IMPLIED>
+<!ATTLIST attribute         name         %VariableName; #IMPLIED>
+<!ATTLIST attribute         readable     %Boolean;      #IMPLIED>
+<!ATTLIST attribute         setMethod    %MethodName;   #IMPLIED>
+<!ATTLIST attribute         type         %ClassName;    #IMPLIED>
+<!ATTLIST attribute         writeable    %Boolean;      #IMPLIED>
+
+
+<!-- The "constructor" element describes a public constructor for the
+     underlying actual class.  It may contain nested "parameter" elements
+     for the various arguments to this constructor.  The following attributes
+     are supported:
+
+     displayName      Display name of this constructor.
+
+     name             Name of this constructor (by Java convention, this must
+                      be the same as the base class name).
+-->
+<!ELEMENT constructor (descriptor?, parameter*)>
+<!ATTLIST constructor       id           ID             #IMPLIED>
+<!ATTLIST constructor       displayName  CDATA          #IMPLIED>
+<!ATTLIST constructor       name         %VariableName; #IMPLIED>
+
+
+<!-- The "descriptor" element groups a set of descriptor fields whose
+     values will be included in the Descriptor for the corresponding
+     metatdata info classes.
+-->
+<!ELEMENT descriptor (field*)>
+<!ATTLIST descriptor        id           ID             #IMPLIED>
+
+
+<!-- The "field" element represents a single name/value pair that will
+     be included in the Descriptor corresponding to our enclosing
+     "descriptor" element.  The following attributes are supported:
+
+     name             Field name of the field to be included
+
+     value            Field value of the field to be included
+                      (will be stored as a String)
+-->
+<!ELEMENT field EMPTY>
+<!ATTLIST field             id           ID             #IMPLIED>
+<!ATTLIST field             name         CDATA          #REQUIRED>
+<!ATTLIST field             value        CDATA          #REQUIRED>
+
+
+
+<!-- The "mbean" element describes a particular JMX ModelMBean implementation,
+     including the information necessary to construct the corresponding
+     ModelMBeanInfo structures.  The following attributes are supported:
+
+     className        Fully qualified Java class name of the ModelMBean
+                      implementation class.  If not specified, the standard
+                      implementation provided by JMX will be utilized.
+
+     description      Human-readable description of this managed bean.
+
+     domain           The JMX MBeanServer domain in which the ModelMBean
+                      created by this managed bean should be registered,
+                      when creating its ObjectName.
+
+     group            Optional name of a "grouping classification" that can
+                      be used to select groups of similar MBean implementation
+                      classes.
+
+     name             Unique name of this MBean (normally corresponds to the
+                      base class name of the corresponding server component).
+
+     type             Fully qualified Java class name of the underlying
+                      managed resource implementation class.
+-->
+<!ELEMENT mbean (descriptor?, attribute*, constructor*, notification*, operation*)>
+<!ATTLIST mbean             id           ID             #IMPLIED>
+<!ATTLIST mbean             className    %ClassName;    #IMPLIED>
+<!ATTLIST mbean             description  CDATA          #IMPLIED>
+<!ATTLIST mbean             domain       CDATA          #IMPLIED>
+<!ATTLIST mbean             group        CDATA          #IMPLIED>
+<!ATTLIST mbean             name         %MethodName;   #IMPLIED>
+<!ATTLIST mbean             type         %ClassName;    #IMPLIED>
+
+
+<!-- The "notification" element describes the notification types that are
+     generated by a particular managed bean.  The following attributes
+     are supported:
+
+     description      Human-readable description of these notification events.
+
+     name             Name of this set of notification event types.
+-->
+<!ELEMENT notification (descriptor?, notification-type*)>
+<!ATTLIST notification      id           ID             #IMPLIED>
+<!ATTLIST notification      description  CDATA          #IMPLIED>
+<!ATTLIST notification      name         %VariableName; #IMPLIED>
+
+
+<!-- The nested content of the "notification-type" element is the event string
+     of an event that can be emitted by this MBean.
+-->
+<!ELEMENT notification-type (#PCDATA)>
+<!ATTLIST notification-type id           ID             #IMPLIED>
+
+
+<!-- The "operation" element describes a the signature of a public method
+     that is accessible to management applications.  The following attributes
+     are supported:
+
+     description      Human-readable description of this operation.
+
+     impact           Indication of the impact of this method:
+                      ACTION (write like), ACTION-INFO (write+read like)
+                      INFO (read like), or UNKNOWN.
+
+     name             Name of this public method.
+
+     returnType       Fully qualified Java class name of the return
+                      type of this method.
+-->
+<!ELEMENT operation   (descriptor?, parameter*)>
+<!ATTLIST operation         id           ID             #IMPLIED>
+<!ATTLIST operation         description  CDATA          #IMPLIED>
+<!ATTLIST operation         impact       CDATA          #IMPLIED>
+<!ATTLIST operation         name         %VariableName; #IMPLIED>
+<!ATTLIST operation         returnType   %ClassName;    #IMPLIED>
+
+
+<!-- The "parameter" element describes a single argument that will be passed
+     to a constructor or operation.  The following attributes are supported:
+
+     description      Human-readable description of this parameter.
+
+     name             Java language name of this parameter.
+
+     type             Fully qualified Java class name of this parameter.
+-->
+<!ELEMENT parameter EMPTY>
+<!ATTLIST parameter         id           ID             #IMPLIED>
+<!ATTLIST parameter         description  CDATA          #IMPLIED>
+<!ATTLIST parameter         name         %VariableName; #IMPLIED>
+<!ATTLIST parameter         type         %ClassName;    #IMPLIED>
+
+


[50/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
GEODE-288: move admin packages to internal

* org.apache.geode.admin (old Admin API) moves to
org.apache.geode.internal.admin.api

* org.apache.geode.admin.internal (old Amin API implementation)
moves to org.apache.geode.internal.admin.api.impl

* org.apache.geode.admin.jmx (old JMX API) moves to
org.apache.geode.internal.admin.api.jmx

* org.apache.geode.admin.jmx.internal (old JMX API implementation)
moves to org.apache.geode.internal.admin.api.jmx.impl


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

Branch: refs/heads/feature/GEODE-288
Commit: 20a32286bbfa79d91f0ab18a885b06667547849b
Parents: f02ea36
Author: Kirk Lund <kl...@apache.org>
Authored: Wed Oct 26 15:10:49 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Wed Oct 26 16:52:33 2016 -0700

----------------------------------------------------------------------
 geode-core/build.gradle                         |    1 -
 .../java/org/apache/geode/DataSerializer.java   |    2 +-
 .../org/apache/geode/admin/AdminConfig.java     |  148 --
 .../geode/admin/AdminDistributedSystem.java     |  434 ----
 .../admin/AdminDistributedSystemFactory.java    |  148 --
 .../org/apache/geode/admin/AdminException.java  |   81 -
 .../apache/geode/admin/AdminXmlException.java   |   44 -
 .../main/java/org/apache/geode/admin/Alert.java |   53 -
 .../java/org/apache/geode/admin/AlertLevel.java |  168 --
 .../org/apache/geode/admin/AlertListener.java   |   30 -
 .../org/apache/geode/admin/BackupStatus.java    |   46 -
 .../geode/admin/CacheDoesNotExistException.java |   80 -
 .../apache/geode/admin/CacheHealthConfig.java   |  151 --
 .../org/apache/geode/admin/CacheServer.java     |   43 -
 .../apache/geode/admin/CacheServerConfig.java   |   50 -
 .../java/org/apache/geode/admin/CacheVm.java    |   35 -
 .../org/apache/geode/admin/CacheVmConfig.java   |   51 -
 .../geode/admin/ConfigurationParameter.java     |   72 -
 .../geode/admin/DistributedSystemConfig.java    |  626 -----
 .../admin/DistributedSystemHealthConfig.java    |   74 -
 .../apache/geode/admin/DistributionLocator.java |   45 -
 .../geode/admin/DistributionLocatorConfig.java  |   81 -
 .../org/apache/geode/admin/GemFireHealth.java   |  209 --
 .../apache/geode/admin/GemFireHealthConfig.java |   54 -
 .../apache/geode/admin/GemFireMemberStatus.java |  670 -----
 .../org/apache/geode/admin/ManagedEntity.java   |  100 -
 .../apache/geode/admin/ManagedEntityConfig.java |   88 -
 .../apache/geode/admin/MemberHealthConfig.java  |  142 -
 .../admin/OperationCancelledException.java      |   47 -
 .../geode/admin/RegionNotFoundException.java    |   39 -
 .../geode/admin/RegionSubRegionSnapshot.java    |  183 --
 .../geode/admin/RuntimeAdminException.java      |   48 -
 .../java/org/apache/geode/admin/Statistic.java  |   64 -
 .../apache/geode/admin/StatisticResource.java   |   82 -
 .../org/apache/geode/admin/SystemMember.java    |  145 --
 .../geode/admin/SystemMemberBridgeServer.java   |  307 ---
 .../apache/geode/admin/SystemMemberCache.java   |  183 --
 .../geode/admin/SystemMemberCacheEvent.java     |   33 -
 .../geode/admin/SystemMemberCacheListener.java  |   76 -
 .../geode/admin/SystemMemberCacheServer.java    |  308 ---
 .../apache/geode/admin/SystemMemberRegion.java  |  314 ---
 .../geode/admin/SystemMemberRegionEvent.java    |   31 -
 .../apache/geode/admin/SystemMemberType.java    |  150 --
 .../geode/admin/SystemMembershipEvent.java      |   42 -
 .../geode/admin/SystemMembershipListener.java   |   59 -
 .../UnmodifiableConfigurationException.java     |   81 -
 .../admin/internal/AbstractHealthEvaluator.java |  170 --
 .../internal/AdminDistributedSystemImpl.java    | 2400 -----------------
 .../admin/internal/BackupDataStoreHelper.java   |   74 -
 .../admin/internal/BackupDataStoreResult.java   |   48 -
 .../geode/admin/internal/BackupStatusImpl.java  |   59 -
 .../admin/internal/CacheHealthConfigImpl.java   |   91 -
 .../admin/internal/CacheHealthEvaluator.java    |  306 ---
 .../admin/internal/CacheServerConfigImpl.java   |  133 -
 .../geode/admin/internal/CacheServerImpl.java   |  190 --
 .../internal/ConfigurationParameterImpl.java    |  282 --
 .../ConfigurationParameterListener.java         |   30 -
 .../DisabledManagedEntityController.java        |   94 -
 .../internal/DistributedSystemConfigImpl.java   | 1109 --------
 .../DistributedSystemHealthConfigImpl.java      |   53 -
 .../DistributedSystemHealthEvaluator.java       |  167 --
 .../DistributedSystemHealthMonitor.java         |  461 ----
 .../internal/DistributionLocatorConfigImpl.java |  187 --
 .../admin/internal/DistributionLocatorImpl.java |  329 ---
 .../EnabledManagedEntityController.java         |  385 ---
 .../admin/internal/FinishBackupRequest.java     |  173 --
 .../admin/internal/FinishBackupResponse.java    |   76 -
 .../admin/internal/FlushToDiskRequest.java      |   94 -
 .../admin/internal/FlushToDiskResponse.java     |   43 -
 .../admin/internal/GemFireHealthConfigImpl.java |   80 -
 .../admin/internal/GemFireHealthEvaluator.java  |  182 --
 .../geode/admin/internal/GemFireHealthImpl.java |  511 ----
 .../geode/admin/internal/InetAddressUtil.java   |  201 --
 .../admin/internal/InternalManagedEntity.java   |   96 -
 .../geode/admin/internal/LogCollator.java       |  121 -
 .../admin/internal/ManagedEntityConfigImpl.java |  256 --
 .../admin/internal/ManagedEntityConfigXml.java  |  169 --
 .../ManagedEntityConfigXmlGenerator.java        |  364 ---
 .../internal/ManagedEntityConfigXmlParser.java  |  587 -----
 .../admin/internal/ManagedEntityController.java |   66 -
 .../ManagedEntityControllerFactory.java         |   63 -
 .../admin/internal/ManagedSystemMemberImpl.java |  258 --
 .../admin/internal/MemberHealthConfigImpl.java  |   95 -
 .../admin/internal/MemberHealthEvaluator.java   |  247 --
 .../admin/internal/PrepareBackupRequest.java    |  133 -
 .../admin/internal/PrepareBackupResponse.java   |   80 -
 .../geode/admin/internal/StatisticImpl.java     |   92 -
 .../admin/internal/StatisticResourceImpl.java   |  177 --
 .../internal/SystemMemberBridgeServerImpl.java  |  234 --
 .../internal/SystemMemberCacheEventImpl.java    |   54 -
 .../SystemMemberCacheEventProcessor.java        |  146 --
 .../admin/internal/SystemMemberCacheImpl.java   |  303 ---
 .../geode/admin/internal/SystemMemberImpl.java  |  487 ----
 .../internal/SystemMemberRegionEventImpl.java   |   56 -
 .../admin/internal/SystemMemberRegionImpl.java  |  371 ---
 .../internal/SystemMembershipEventImpl.java     |   67 -
 .../apache/geode/admin/internal/package.html    |   53 -
 .../java/org/apache/geode/admin/jmx/Agent.java  |  145 --
 .../org/apache/geode/admin/jmx/AgentConfig.java |  844 ------
 .../apache/geode/admin/jmx/AgentFactory.java    |   48 -
 .../internal/AdminDistributedSystemJmxImpl.java | 2279 -----------------
 .../admin/jmx/internal/AgentConfigImpl.java     | 1915 --------------
 .../geode/admin/jmx/internal/AgentImpl.java     | 1624 ------------
 .../geode/admin/jmx/internal/AgentLauncher.java |  918 -------
 .../admin/jmx/internal/CacheServerJmxImpl.java  |  590 -----
 .../admin/jmx/internal/ConfigAttributeInfo.java |   66 -
 .../internal/ConfigurationParameterJmxImpl.java |  163 --
 .../DistributedSystemHealthConfigJmxImpl.java   |   99 -
 .../internal/DistributionLocatorJmxImpl.java    |  183 --
 .../admin/jmx/internal/DynamicManagedBean.java  |  143 --
 .../internal/GemFireHealthConfigJmxImpl.java    |  211 --
 .../jmx/internal/GemFireHealthJmxImpl.java      |  171 --
 .../admin/jmx/internal/GenerateMBeanHTML.java   |  502 ----
 .../geode/admin/jmx/internal/MBeanUtil.java     |  767 ------
 .../admin/jmx/internal/MX4JModelMBean.java      | 1232 ---------
 .../jmx/internal/MX4JServerSocketFactory.java   |  136 -
 .../geode/admin/jmx/internal/MailManager.java   |  327 ---
 .../admin/jmx/internal/ManagedResource.java     |   74 -
 .../admin/jmx/internal/ManagedResourceType.java |  204 --
 .../jmx/internal/MemberInfoWithStatsMBean.java  | 1347 ----------
 .../admin/jmx/internal/RMIRegistryService.java  |  221 --
 .../jmx/internal/RMIRegistryServiceMBean.java   |   80 -
 .../jmx/internal/RefreshNotificationType.java   |  126 -
 .../jmx/internal/StatAlertNotification.java     |  150 --
 .../jmx/internal/StatAlertsAggregator.java      |  111 -
 .../jmx/internal/StatisticAttributeInfo.java    |   71 -
 .../jmx/internal/StatisticResourceJmxImpl.java  |  344 ---
 .../SystemMemberBridgeServerJmxImpl.java        |  123 -
 .../jmx/internal/SystemMemberCacheJmxImpl.java  |  445 ----
 .../admin/jmx/internal/SystemMemberJmx.java     |  459 ----
 .../admin/jmx/internal/SystemMemberJmxImpl.java |  541 ----
 .../jmx/internal/SystemMemberRegionJmxImpl.java |  128 -
 .../geode/admin/jmx/internal/package.html       |  166 --
 .../org/apache/geode/admin/jmx/package.html     |   28 -
 .../java/org/apache/geode/admin/package.html    |   78 -
 .../main/java/org/apache/geode/cache/Cache.java |    5 +-
 .../ConflictingPersistentDataException.java     |    1 -
 .../geode/cache/persistence/PersistentID.java   |    2 +-
 .../RevokedPersistentDataException.java         |    2 +-
 .../geode/distributed/DistributedSystem.java    |   37 +-
 .../internal/DistributionManager.java           |    2 +-
 .../distributed/internal/HealthMonitor.java     |    2 +-
 .../distributed/internal/HealthMonitorImpl.java |    6 +-
 .../internal/InternalDistributedSystem.java     |    5 +-
 .../org/apache/geode/internal/DSFIDFactory.java |   19 +-
 .../apache/geode/internal/MigrationServer.java  |    2 +-
 .../org/apache/geode/internal/SystemAdmin.java  |    6 +-
 .../internal/admin/ClientMembershipMessage.java |    2 +-
 .../apache/geode/internal/admin/GemFireVM.java  |   25 +-
 .../geode/internal/admin/HealthListener.java    |    5 +-
 .../geode/internal/admin/StatAlertsManager.java |    2 +-
 .../geode/internal/admin/api/AdminConfig.java   |  148 ++
 .../admin/api/AdminDistributedSystem.java       |  433 ++++
 .../api/AdminDistributedSystemFactory.java      |  148 ++
 .../internal/admin/api/AdminException.java      |   81 +
 .../internal/admin/api/AdminXmlException.java   |   44 +
 .../apache/geode/internal/admin/api/Alert.java  |   53 +
 .../geode/internal/admin/api/AlertLevel.java    |  168 ++
 .../geode/internal/admin/api/AlertListener.java |   30 +
 .../geode/internal/admin/api/BackupStatus.java  |   46 +
 .../admin/api/CacheDoesNotExistException.java   |   80 +
 .../internal/admin/api/CacheHealthConfig.java   |  151 ++
 .../geode/internal/admin/api/CacheServer.java   |   43 +
 .../internal/admin/api/CacheServerConfig.java   |   50 +
 .../geode/internal/admin/api/CacheVm.java       |   35 +
 .../geode/internal/admin/api/CacheVmConfig.java |   51 +
 .../admin/api/ConfigurationParameter.java       |   72 +
 .../admin/api/DistributedSystemConfig.java      |  625 +++++
 .../api/DistributedSystemHealthConfig.java      |   74 +
 .../internal/admin/api/DistributionLocator.java |   45 +
 .../admin/api/DistributionLocatorConfig.java    |   81 +
 .../geode/internal/admin/api/GemFireHealth.java |  209 ++
 .../internal/admin/api/GemFireHealthConfig.java |   54 +
 .../internal/admin/api/GemFireMemberStatus.java |  670 +++++
 .../geode/internal/admin/api/ManagedEntity.java |  100 +
 .../internal/admin/api/ManagedEntityConfig.java |   88 +
 .../internal/admin/api/MemberHealthConfig.java  |  142 +
 .../admin/api/OperationCancelledException.java  |   47 +
 .../admin/api/RegionNotFoundException.java      |   39 +
 .../admin/api/RegionSubRegionSnapshot.java      |  183 ++
 .../admin/api/RuntimeAdminException.java        |   48 +
 .../geode/internal/admin/api/Statistic.java     |   64 +
 .../internal/admin/api/StatisticResource.java   |   82 +
 .../geode/internal/admin/api/SystemMember.java  |  144 ++
 .../admin/api/SystemMemberBridgeServer.java     |  307 +++
 .../internal/admin/api/SystemMemberCache.java   |  183 ++
 .../admin/api/SystemMemberCacheEvent.java       |   33 +
 .../admin/api/SystemMemberCacheListener.java    |   76 +
 .../admin/api/SystemMemberCacheServer.java      |  308 +++
 .../internal/admin/api/SystemMemberRegion.java  |  314 +++
 .../admin/api/SystemMemberRegionEvent.java      |   31 +
 .../internal/admin/api/SystemMemberType.java    |  150 ++
 .../admin/api/SystemMembershipEvent.java        |   42 +
 .../admin/api/SystemMembershipListener.java     |   59 +
 .../api/UnmodifiableConfigurationException.java |   81 +
 .../admin/api/impl/AbstractHealthEvaluator.java |  170 ++
 .../api/impl/AdminDistributedSystemImpl.java    | 2418 ++++++++++++++++++
 .../admin/api/impl/BackupDataStoreHelper.java   |   74 +
 .../admin/api/impl/BackupDataStoreResult.java   |   48 +
 .../admin/api/impl/BackupStatusImpl.java        |   59 +
 .../admin/api/impl/CacheHealthConfigImpl.java   |   91 +
 .../admin/api/impl/CacheHealthEvaluator.java    |  306 +++
 .../admin/api/impl/CacheServerConfigImpl.java   |  133 +
 .../admin/api/impl/CacheServerImpl.java         |  196 ++
 .../api/impl/ConfigurationParameterImpl.java    |  282 ++
 .../impl/ConfigurationParameterListener.java    |   30 +
 .../impl/DisabledManagedEntityController.java   |   94 +
 .../api/impl/DistributedSystemConfigImpl.java   | 1114 ++++++++
 .../impl/DistributedSystemHealthConfigImpl.java |   53 +
 .../impl/DistributedSystemHealthEvaluator.java  |  167 ++
 .../impl/DistributedSystemHealthMonitor.java    |  461 ++++
 .../api/impl/DistributionLocatorConfigImpl.java |  187 ++
 .../admin/api/impl/DistributionLocatorImpl.java |  329 +++
 .../impl/EnabledManagedEntityController.java    |  385 +++
 .../admin/api/impl/FinishBackupRequest.java     |  173 ++
 .../admin/api/impl/FinishBackupResponse.java    |   76 +
 .../admin/api/impl/FlushToDiskRequest.java      |   94 +
 .../admin/api/impl/FlushToDiskResponse.java     |   43 +
 .../admin/api/impl/GemFireHealthConfigImpl.java |   80 +
 .../admin/api/impl/GemFireHealthEvaluator.java  |  182 ++
 .../admin/api/impl/GemFireHealthImpl.java       |  514 ++++
 .../admin/api/impl/InetAddressUtil.java         |  201 ++
 .../admin/api/impl/InternalManagedEntity.java   |   96 +
 .../internal/admin/api/impl/LogCollator.java    |  121 +
 .../admin/api/impl/ManagedEntityConfigImpl.java |  254 ++
 .../admin/api/impl/ManagedEntityConfigXml.java  |  170 ++
 .../impl/ManagedEntityConfigXmlGenerator.java   |  371 +++
 .../api/impl/ManagedEntityConfigXmlParser.java  |  591 +++++
 .../admin/api/impl/ManagedEntityController.java |   66 +
 .../impl/ManagedEntityControllerFactory.java    |   63 +
 .../admin/api/impl/ManagedSystemMemberImpl.java |  258 ++
 .../admin/api/impl/MemberHealthConfigImpl.java  |   95 +
 .../admin/api/impl/MemberHealthEvaluator.java   |  248 ++
 .../admin/api/impl/PrepareBackupRequest.java    |  133 +
 .../admin/api/impl/PrepareBackupResponse.java   |   80 +
 .../internal/admin/api/impl/StatisticImpl.java  |   93 +
 .../admin/api/impl/StatisticResourceImpl.java   |  177 ++
 .../api/impl/SystemMemberBridgeServerImpl.java  |  234 ++
 .../api/impl/SystemMemberCacheEventImpl.java    |   55 +
 .../impl/SystemMemberCacheEventProcessor.java   |  146 ++
 .../admin/api/impl/SystemMemberCacheImpl.java   |  310 +++
 .../admin/api/impl/SystemMemberImpl.java        |  490 ++++
 .../api/impl/SystemMemberRegionEventImpl.java   |   57 +
 .../admin/api/impl/SystemMemberRegionImpl.java  |  372 +++
 .../api/impl/SystemMembershipEventImpl.java     |   68 +
 .../geode/internal/admin/api/impl/package.html  |   53 +
 .../geode/internal/admin/api/jmx/Agent.java     |  145 ++
 .../internal/admin/api/jmx/AgentConfig.java     |  844 ++++++
 .../internal/admin/api/jmx/AgentFactory.java    |   47 +
 .../jmx/impl/AdminDistributedSystemJmxImpl.java | 2289 +++++++++++++++++
 .../admin/api/jmx/impl/AgentConfigImpl.java     | 1911 ++++++++++++++
 .../internal/admin/api/jmx/impl/AgentImpl.java  | 1624 ++++++++++++
 .../admin/api/jmx/impl/AgentLauncher.java       |  918 +++++++
 .../admin/api/jmx/impl/CacheServerJmxImpl.java  |  588 +++++
 .../admin/api/jmx/impl/ConfigAttributeInfo.java |   66 +
 .../jmx/impl/ConfigurationParameterJmxImpl.java |  164 ++
 .../DistributedSystemHealthConfigJmxImpl.java   |   98 +
 .../jmx/impl/DistributionLocatorJmxImpl.java    |  163 ++
 .../admin/api/jmx/impl/DynamicManagedBean.java  |  143 ++
 .../jmx/impl/GemFireHealthConfigJmxImpl.java    |  211 ++
 .../api/jmx/impl/GemFireHealthJmxImpl.java      |  171 ++
 .../admin/api/jmx/impl/GenerateMBeanHTML.java   |  501 ++++
 .../internal/admin/api/jmx/impl/MBeanUtil.java  |  765 ++++++
 .../admin/api/jmx/impl/MX4JModelMBean.java      | 1232 +++++++++
 .../api/jmx/impl/MX4JServerSocketFactory.java   |  136 +
 .../admin/api/jmx/impl/MailManager.java         |  327 +++
 .../admin/api/jmx/impl/ManagedResource.java     |   74 +
 .../admin/api/jmx/impl/ManagedResourceType.java |  215 ++
 .../api/jmx/impl/MemberInfoWithStatsMBean.java  | 1355 ++++++++++
 .../admin/api/jmx/impl/RMIRegistryService.java  |  221 ++
 .../api/jmx/impl/RMIRegistryServiceMBean.java   |   80 +
 .../api/jmx/impl/RefreshNotificationType.java   |  126 +
 .../api/jmx/impl/StatAlertNotification.java     |  150 ++
 .../api/jmx/impl/StatAlertsAggregator.java      |  111 +
 .../api/jmx/impl/StatisticAttributeInfo.java    |   71 +
 .../api/jmx/impl/StatisticResourceJmxImpl.java  |  342 +++
 .../impl/SystemMemberBridgeServerJmxImpl.java   |  124 +
 .../api/jmx/impl/SystemMemberCacheJmxImpl.java  |  443 ++++
 .../admin/api/jmx/impl/SystemMemberJmx.java     |  466 ++++
 .../admin/api/jmx/impl/SystemMemberJmxImpl.java |  538 ++++
 .../api/jmx/impl/SystemMemberRegionJmxImpl.java |  128 +
 .../internal/admin/api/jmx/impl/package.html    |  166 ++
 .../geode/internal/admin/api/jmx/package.html   |   28 +
 .../geode/internal/admin/api/package.html       |   78 +
 .../admin/remote/AddHealthListenerRequest.java  |    2 +-
 .../admin/remote/AddHealthListenerResponse.java |    2 +-
 .../internal/admin/remote/AdminRegion.java      |    3 +-
 .../internal/admin/remote/AdminRequest.java     |    2 +-
 .../internal/admin/remote/AdminWaiters.java     |    4 +-
 .../admin/remote/AlertLevelChangeMessage.java   |    2 +-
 .../admin/remote/AlertListenerMessage.java      |    2 +-
 .../admin/remote/AlertsNotificationMessage.java |    4 +-
 .../remote/FetchHealthDiagnosisRequest.java     |    2 +-
 .../remote/FetchHealthDiagnosisResponse.java    |    2 +-
 .../admin/remote/HealthListenerMessage.java     |    2 +-
 .../remote/RefreshMemberSnapshotRequest.java    |    4 +-
 .../remote/RefreshMemberSnapshotResponse.java   |    4 +-
 .../admin/remote/RegionAdminRequest.java        |    4 +-
 .../remote/RegionSubRegionsSizeResponse.java    |    2 +-
 .../internal/admin/remote/RemoteGemFireVM.java  |   23 +-
 .../admin/remote/RemoteGfManagerAgent.java      |    4 +-
 .../admin/statalerts/StatisticInfoImpl.java     |    2 +-
 .../geode/internal/cache/GemFireCacheImpl.java  |    2 +-
 .../geode/internal/cache/LocalRegion.java       |    3 +-
 .../internal/cache/RemoteFetchEntryMessage.java |    2 +-
 .../cache/partitioned/FetchEntryMessage.java    |    2 +-
 .../apache/geode/internal/cache/properties.html |   18 +-
 .../snapshot/CacheSnapshotServiceImpl.java      |    2 +-
 .../geode/internal/net/SocketCreator.java       |    2 +-
 .../internal/beans/DistributedSystemBridge.java |    4 +-
 .../cli/commands/DiskStoreCommands.java         |    6 +-
 .../src/main/java/org/apache/geode/package.html |    2 +-
 .../internal/doc-files/mbeans-descriptors.dtd   |  247 ++
 .../geode/admin/api/jmx/mbeans-descriptors.xml  | 1452 +++++++++++
 .../internal/doc-files/mbeans-descriptors.dtd   |  247 --
 .../geode/admin/jmx/mbeans-descriptors.xml      | 1452 -----------
 .../org/apache/geode/admin/AdminTestHelper.java |   43 -
 .../apache/geode/admin/AlertLevelJUnitTest.java |   63 -
 .../BindDistributedSystemJUnitTest.java         |   84 -
 .../internal/CacheHealthEvaluatorJUnitTest.java |  199 --
 .../internal/DistributedSystemTestCase.java     |   64 -
 .../admin/internal/HealthEvaluatorTestCase.java |   71 -
 .../MemberHealthEvaluatorJUnitTest.java         |   96 -
 .../query/dunit/QueryUsingPoolDUnitTest.java    |   27 +-
 .../ConsoleDistributionManagerDUnitTest.java    |    3 +-
 .../internal/DistributionManagerDUnitTest.java  |   12 +-
 .../geode/internal/AvailablePortJUnitTest.java  |    2 +-
 .../internal/admin/api/AdminTestHelper.java     |   44 +
 .../internal/admin/api/AlertLevelJUnitTest.java |   64 +
 .../impl/BindDistributedSystemJUnitTest.java    |   86 +
 .../api/impl/CacheHealthEvaluatorJUnitTest.java |  200 ++
 .../api/impl/DistributedSystemTestCase.java     |   64 +
 .../admin/api/impl/HealthEvaluatorTestCase.java |   72 +
 .../impl/MemberHealthEvaluatorJUnitTest.java    |   96 +
 .../geode/internal/cache/BackupDUnitTest.java   |    8 +-
 .../cache/IncrementalBackupDUnitTest.java       |   12 +-
 ...tentColocatedPartitionedRegionDUnitTest.java |    5 +-
 .../PersistentPartitionedRegionTestBase.java    |   10 +-
 .../cache/partitioned/ShutdownAllDUnitTest.java |    8 +-
 .../PersistentRecoveryOrderDUnitTest.java       |    8 +-
 .../beans/DistributedSystemBridgeJUnitTest.java |    6 +-
 .../internal/JUnit4DistributedTestCase.java     |    3 +-
 .../sanctionedDataSerializables.txt             |   64 +-
 .../codeAnalysis/sanctionedSerializables.txt    |   63 +-
 ...downAllPersistentGatewaySenderDUnitTest.java |    8 +-
 gradle/rat.gradle                               |    2 +-
 346 files changed, 38075 insertions(+), 38058 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/build.gradle
----------------------------------------------------------------------
diff --git a/geode-core/build.gradle b/geode-core/build.gradle
index 067bafc..6669b27 100755
--- a/geode-core/build.gradle
+++ b/geode-core/build.gradle
@@ -170,7 +170,6 @@ jar {
   
   exclude 'org/apache/geode/management/internal/web/**'
   exclude 'org/apache/geode/internal/i18n/StringIdResourceBundle_ja.txt'
-  exclude 'org/apache/geode/admin/doc-files/ds4_0.dtd'
 }
 
 task webJar (type: Jar, dependsOn: classes) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/DataSerializer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/DataSerializer.java b/geode-core/src/main/java/org/apache/geode/DataSerializer.java
index 29b20a2..7801cac 100644
--- a/geode-core/src/main/java/org/apache/geode/DataSerializer.java
+++ b/geode-core/src/main/java/org/apache/geode/DataSerializer.java
@@ -46,7 +46,7 @@ import java.util.concurrent.ConcurrentMap;
 
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.admin.RegionNotFoundException;
+import org.apache.geode.internal.admin.api.RegionNotFoundException;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.Region;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/AdminConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/AdminConfig.java b/geode-core/src/main/java/org/apache/geode/admin/AdminConfig.java
deleted file mode 100755
index 7a4bd6a..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/AdminConfig.java
+++ /dev/null
@@ -1,148 +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.admin;
-
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.Date;
-
-
-/**
- * AdminConfig loads/stores the member information list. The list contains all of the members being
- * monitored.
- *
- * Config must be of the format:
- * <p>
- * <li>Name=What you want displayed as a name for the instance
- * <li>Type=SERVER|CLIENT
- * <li>Host=A valid hostname or IP Address where the instance is running
- * <li>Port=The port you are using to open the monitor port for the instance
- * 
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class AdminConfig {
-  // Name, Type, Host, Port
-  public static Entry[] loadConfig(File file) throws IOException {
-
-    // Place all lines into stack
-    ArrayList entryList = new ArrayList();
-    FileReader reader = null;
-    BufferedReader fileReader = null;
-    try {
-      reader = new FileReader(file);
-      fileReader = new BufferedReader(reader);
-      // Read the first line.
-      String line = fileReader.readLine();
-
-      while (line != null) {
-        line = line.trim();
-
-        // Replace tabs with spaces
-        line = line.replace('\t', ' ');
-
-        // Skip all empty and comment lines
-        if (line.length() != 0 && line.startsWith("#") == false) {
-          try {
-            entryList.add(new Entry(line));
-          } catch (Exception ex) {
-            // ignore - drop any lines that are not valid
-          }
-        }
-        line = fileReader.readLine();
-      }
-    } finally {
-      if (fileReader != null) {
-        fileReader.close();
-      }
-      if (reader != null) {
-        reader.close();
-      }
-    }
-
-    return (Entry[]) entryList.toArray(new Entry[0]);
-  }
-
-  public static void storeConfig(File file, AdminConfig.Entry entries[]) throws IOException {
-    FileOutputStream fos = null;
-    PrintStream ps = null;
-    try {
-      fos = new FileOutputStream(file);
-      ps = new PrintStream(fos);
-
-      // Header
-      ps.print("#");
-      ps.println(
-          LocalizedStrings.AdminConfig_THIS_FILE_IS_GENERATED_BY_ADMINCONSOLE_EDIT_AS_YOU_WISH_BUT_IT_WILL_BE_OVERWRITTEN_IF_IT_IS_MODIFIED_IN_ADMINCONSOLE
-              .toLocalizedString());
-      ps.println("#");
-      ps.println(LocalizedStrings.AdminConfig_MODIFIED_0.toLocalizedString(new Date()));
-      ps.println("#");
-      ps.println("# Name, Type, Host, Port");
-      ps.println("#");
-      int len = entries.length;
-      for (int i = 0; i < len; i++) {
-        ps.println(entries[i].toString());
-      }
-      ps.flush();
-    } finally {
-      if (ps != null) {
-        ps.close();
-      }
-      if (fos != null) {
-        fos.close();
-      }
-    }
-  }
-
-
-  public static class Entry {
-    public String name;
-    public String type;
-    public String host;
-    public int port;
-
-    public Entry(String line) {
-      // Split
-      String split[] = line.split(",");
-
-      // Convert line to parameters
-      name = split[0].trim();
-      type = split[1].trim();
-      host = split[2].trim();
-      port = Integer.parseInt(split[3]);
-    }
-
-    public Entry(String name, String type, String host, int port) {
-      this.name = name;
-      this.type = type;
-      this.host = host;
-      this.port = port;
-    }
-
-    @Override // GemStoneAddition
-    public String toString() {
-      return name + "," + type + "," + host + "," + port;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystem.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystem.java
deleted file mode 100755
index cd4dc7e..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystem.java
+++ /dev/null
@@ -1,434 +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.admin;
-
-import org.apache.geode.LogWriter;
-import org.apache.geode.cache.DataPolicy;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-
-import java.io.File;
-import java.net.InetAddress;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
-/**
- * Administrative interface for managing an entire GemFire distributed system. This interface should
- * not be confused with {@link org.apache.geode.distributed.DistributedSystem DistributedSystem}
- * that represents a connection to a GemFire distributed system.
- *
- * @see AdminDistributedSystemFactory
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface AdminDistributedSystem {
-
-  /**
-   * Retrieves the unique id for this system.
-   */
-  public String getId();
-
-  /**
-   * Retrieves display friendly name for this system. If this administrative VM defined an optional
-   * name for its connection to the distributed system, that name will be returned. Otherwise the
-   * returned value will be {@link org.apache.geode.admin.AdminDistributedSystem#getId}.
-   */
-  public String getName();
-
-  /**
-   * Retrieves the remote command and formatting this system should use to access and/or manipulate
-   * resources on remote machines.
-   */
-  public String getRemoteCommand();
-
-  /**
-   * Sets the remote command and formatting this system should use to access and/or manipulate
-   * resources on remote machines.
-   */
-  public void setRemoteCommand(String remoteCommand);
-
-  /**
-   * Sets the lowest level of alert that should be delivered to the {@link AlertListener}s
-   * registered on this <code>AdminDistributedSystem</code>. The default level is
-   * {@link AlertLevel#WARNING}.
-   */
-  public void setAlertLevel(AlertLevel level);
-
-  /**
-   * Returns the lowest level of alerts that should be delivered to the {@link AlertListener}s
-   * registered on this <code>AdminDistributedSystem</code>.
-   *
-   * @see #setAlertLevel
-   */
-  public AlertLevel getAlertLevel();
-
-  /**
-   * Sets the lowest level of alert that should be delivered to the {@link AlertListener}s
-   * registered on this <code>AdminDistributedSystem</code>. The default level is
-   * {@link AlertLevel#WARNING}.
-   */
-  public void setAlertLevelAsString(String level);
-
-  /**
-   * Returns the lowest level of alerts that should be delivered to the {@link AlertListener}s
-   * registered on this <code>AdminDistributedSystem</code>.
-   *
-   * @see #setAlertLevelAsString
-   */
-  public String getAlertLevelAsString();
-
-  /**
-   * Registers an <code>AlertListener</code> that will receive all alerts that are at or above the
-   * {@linkplain #setAlertLevel alert level}.
-   */
-  public void addAlertListener(AlertListener listener);
-
-  /**
-   * Unregisters an <code>AlertListener</code>
-   */
-  public void removeAlertListener(AlertListener listener);
-
-  /**
-   * Retrieves the multicast address in use by this system.
-   */
-  public String getMcastAddress();
-
-  /**
-   * Retrieves the multicast port in use by this system.
-   */
-  public int getMcastPort();
-
-  /**
-   * Retrieves comma-delimited list locators to be used if multi-cast port is zero. Format of each
-   * locators must be host[port].
-   */
-  public String getLocators();
-
-  /**
-   * Returns true if this system has enabled the use of multicast for communications
-   */
-  public boolean isMcastEnabled();
-
-  /**
-   * Returns true if any members of this system are currently running.
-   */
-  public boolean isRunning();
-
-  /**
-   * Returns <code>true</code> if this is currently connected to the system.
-   */
-  public boolean isConnected();
-
-  /**
-   * Starts all managed entities that are not currently running.
-   *
-   * @throws AdminException If a problem is encountered while starting the managed entities.
-   */
-  public void start() throws AdminException;
-
-  /**
-   * Stops all managed entities that are currently running.
-   *
-   * @throws AdminException If a problem is encountered while starting the managed entities.
-   */
-  public void stop() throws AdminException;
-
-  /**
-   * Merges and returns all system logs as a single formatted log.
-   */
-  public String displayMergedLogs();
-
-  /**
-   * Retrieves the license information for this installation of GemFire.
-   *
-   * @deprecated Removed licensing in 8.0.
-   */
-  public java.util.Properties getLicense();
-
-  /**
-   * Creates a new <code>DistributionLocator</code> that is ready to
-   * {@linkplain DistributionLocator#getConfig configure} and {@linkplain #start start}.
-   *
-   * <P>
-   *
-   * It is presumed that the newly-added locator is used to discover members of the distributed
-   * system. That is, the host/port of the new locator is appended to the {@link #getLocators
-   * locators} attribute of this <code>AdminDistributedSystem</code>.
-   */
-  public DistributionLocator addDistributionLocator();
-
-  /**
-   * Returns array of <code>DistributionLocator</code>s administered by this
-   * <code>AdminDistributedSystem</code>.
-   */
-  public DistributionLocator[] getDistributionLocators();
-
-  /**
-   * Retrieves SystemMember instances for every application that is running and currently connection
-   * to this system. Note that this list does not include dedicated {@linkplain #getCacheVms cache
-   * server vms}.
-   */
-  public SystemMember[] getSystemMemberApplications() throws org.apache.geode.admin.AdminException;
-
-  /**
-   * Display in readable format the latest Alert in this distributed system.
-   */
-  public String getLatestAlert();
-
-  /**
-   * Returns an object for monitoring the health of GemFire.
-   */
-  public GemFireHealth getGemFireHealth();
-
-  /**
-   * Connects to the distributed system. This method will return immediately after spawning a
-   * background thread that connects to the distributed system. As a result, a
-   * <code>AdminDistributedSystem</code> can be "connected" to before any members of the system have
-   * been started or have been seen. The {@link #waitToBeConnected} method will wait for the
-   * connection to be made.
-   *
-   * @see #isConnected
-   * @see #isRunning
-   * @see #waitToBeConnected
-   */
-  public void connect();
-
-  /**
-   * Wait for up to a given number of milliseconds for the connection to the distributed system to
-   * be made.
-   *
-   * @param timeout The number of milliseconds to wait for the connection to to be made.
-   *
-   * @return Whether or not the connection was made. <code>false</code>, if the method times out
-   *
-   * @throws InterruptedException If the thread invoking this method is interrupted while waiting.
-   * @throws IllegalStateException If {@link #connect} has not yet been called.
-   */
-  public boolean waitToBeConnected(long timeout) throws InterruptedException;
-
-  /**
-   * Disconnects from the distributed system.
-   */
-  public void disconnect();
-
-  /** Returns this system's configuration . */
-  public DistributedSystemConfig getConfig();
-
-  /**
-   * Registers a listener that receives callbacks when a member joins or leaves the distributed
-   * system.
-   */
-  public void addMembershipListener(SystemMembershipListener listener);
-
-  /**
-   * Unregisters a membership listener
-   *
-   * @see #addMembershipListener
-   */
-  public void removeMembershipListener(SystemMembershipListener listener);
-
-  /**
-   * Registers a cache event listener. Does nothing if the listener is already registered. The
-   * listeners are called in the order they are registered.
-   * 
-   * @param listener the listener to register.
-   * @since GemFire 5.0
-   */
-  public void addCacheListener(SystemMemberCacheListener listener);
-
-  /**
-   * Unregisters a cache listener. Does nothing if the listener is not registered.
-   * 
-   * @param listener the listener to unregister.
-   * @since GemFire 5.0
-   */
-  public void removeCacheListener(SystemMemberCacheListener listener);
-
-  /**
-   * Creates a new cache server that is ready to {@linkplain CacheServerConfig configure} and
-   * {@linkplain #start start}.
-   *
-   * @since GemFire 4.0
-   * @deprecated as of 5.7 use {@link #addCacheVm} instead.
-   */
-  @Deprecated
-  public CacheServer addCacheServer() throws AdminException;
-
-  /**
-   * Returns all of the dedicated cache server members of the distributed system. Because they are
-   * not managed entities, application VMs that host a server cache are not included in the array.
-   *
-   * @since GemFire 4.0
-   * @deprecated as of 5.7 use {@link #getCacheVms} instead.
-   */
-  @Deprecated
-  public CacheServer[] getCacheServers() throws AdminException;
-
-  /**
-   * Returns all the cache server members of the distributed system which are hosting a client queue
-   * for the particular durable-client having the given durableClientId
-   * 
-   * @param durableClientId - durable-id of the client
-   * @return array of CacheServer(s) having the queue for the durable client
-   * @throws AdminException
-   *
-   * @since GemFire 5.6
-   */
-  public CacheServer[] getCacheServers(String durableClientId) throws AdminException;
-
-  /**
-   * Creates a new cache vm that is ready to {@linkplain CacheVmConfig configure} and
-   * {@linkplain #start start}.
-   *
-   * @since GemFire 5.7
-   */
-  public CacheVm addCacheVm() throws AdminException;
-
-  /**
-   * Returns all of the dedicated cache server vm members of the distributed system. Because they
-   * are not managed entities, application VMs that host a server cache are not included in the
-   * array.
-   *
-   * @since GemFire 5.7
-   */
-  public CacheVm[] getCacheVms() throws AdminException;
-
-  /**
-   * Returns the administrative SystemMember specified by the
-   * {@link org.apache.geode.distributed.DistributedMember}.
-   *
-   * @param distributedMember the distributed member to lookup
-   * @return administrative SystemMember for that distributed member
-   * @since GemFire 5.0
-   */
-  public SystemMember lookupSystemMember(DistributedMember distributedMember) throws AdminException;
-
-  /**
-   * Indicate to the distributed system that persistent files have been lost. When a member recovers
-   * from a set of persistent files, it will wait for other members that were also persisting the
-   * same region to start up. If the persistent files for those other members were lost, this method
-   * can be used to tell the remaining members to stop waiting for the lost data.
-   * 
-   * @param host The host of the member whose files were lost.
-   * @param directory The directory where those files resided.
-   * @since GemFire 6.5
-   * @deprecated use {@link #revokePersistentMember(UUID)} instead
-   */
-  public void revokePersistentMember(InetAddress host, String directory) throws AdminException;
-
-  /**
-   * Indicate to the distributed system that persistent files have been lost. When a member recovers
-   * from a set of persistent files, it will wait for other members that were also persisting the
-   * same region to start up. If the persistent files for those other members were lost, this method
-   * can be used to tell the remaining members to stop waiting for the lost data.
-   * 
-   * @param diskStoreID The unique id of the disk store which you are revoking. The unique id can be
-   *        discovered from {@link #getMissingPersistentMembers()}
-   * 
-   * @since GemFire 7.0
-   */
-  public void revokePersistentMember(UUID diskStoreID) throws AdminException;
-
-  /**
-   * Retrieve the set of persistent files that the existing members are waiting for. See
-   * {@link AdminDistributedSystem#revokePersistentMember(InetAddress, String)}
-   * 
-   * @return The persistent members that were known to the existing persistent members, when the
-   *         existing members were last online.
-   * @throws AdminException
-   * @since GemFire 6.5
-   * 
-   */
-  public Set<PersistentID> getMissingPersistentMembers() throws AdminException;
-
-  /**
-   * Shuts down all the members of the distributed system with a cache that the admin member is
-   * connected to, excluding the stand-alone locators. Calling this method will ensure that regions
-   * with the {@link DataPolicy#PERSISTENT_PARTITION} to be shutdown in a way which allows for a
-   * faster recovery when the members are restarted.
-   * 
-   * Killing individual members can lead to inconsistencies in the members persistent data, which
-   * gemfire repairs on startup. Calling shutDownAllMembers makes sure that the persistent files are
-   * consistent on shutdown, which makes recovery faster.
-   * 
-   * This is equivalent to calling shutDownAllMembers(0);
-   * 
-   * @return The set of members that were shutdown
-   * @since GemFire 6.5
-   */
-  public Set<DistributedMember> shutDownAllMembers() throws AdminException;
-
-  /**
-   * Shuts down all the members of the distributed system with a cache that the admin member is
-   * connected to, excluding the stand-alone locators. Calling this method will ensure that regions
-   * with the {@link DataPolicy#PERSISTENT_PARTITION} to be shutdown in a way which allows for a
-   * faster recovery when the members are restarted.
-   * 
-   * Killing individual members can lead to inconsistencies in the members persistent data, which
-   * gemfire repairs on startup. Calling shutDownAllMembers makes sure that the persistent files are
-   * consistent on shutdown, which makes recovery faster.
-   * 
-   * @param timeout The amount of time to wait (in milliseconds) for the shutdown all to complete.
-   * @return The set of members that were shutdown, or null if the timeout is exceeded.
-   * 
-   * @since GemFire 6.5
-   */
-  public Set<DistributedMember> shutDownAllMembers(long timeout) throws AdminException;
-
-  /**
-   * Backup the persistent files for all of the members of the distributed system that the admin
-   * member is connected to.
-   * 
-   * @param targetDir The directory where each member's backup should be placed.
-   * 
-   * @return The status of the backup, which includes the set of members that were backed up and the
-   *         set of members that were known to be offline at the time of backup.
-   * @since GemFire 6.5
-   */
-  public BackupStatus backupAllMembers(File targetDir) throws AdminException;
-
-  /**
-   * Incrementally backup the persistent files for all of the members of the distributed system that
-   * the admin member is connected to. Only new operation log files since the previous backup will
-   * be copied during this backup. The generated restore script will reference and copy operation
-   * log files from the previous backup.
-   * 
-   * @param targetDir The directory where each member's backup should be placed.
-   * @param baselineDir The directory of a previous backup. If this parameter is null or the
-   *        directory does not exist (on a member by member basis) a full backup will be performed
-   *        for the member.
-   * 
-   * @return The status of the backup, which includes the set of members that were backed up and the
-   *         set of members that were known to be offline at the time of backup.
-   * @since GemFire 6.5
-   */
-  public BackupStatus backupAllMembers(File targetDir, File baselineDir) throws AdminException;
-
-  /**
-   * Compact the persistent files for all of the members of the distributed system that the admin
-   * member connected to.
-   * 
-   * This is equivalent to calling {DiskStore#forceCompaction} on all members.
-   * 
-   * @return The set of members that compacted their disk stores.
-   * @since GemFire 6.5
-   */
-  public Map<DistributedMember, Set<PersistentID>> compactAllDiskStores() throws AdminException;
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystemFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystemFactory.java b/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystemFactory.java
deleted file mode 100755
index 60a8722..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/AdminDistributedSystemFactory.java
+++ /dev/null
@@ -1,148 +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.admin;
-
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
-import org.apache.geode.admin.internal.DistributedSystemConfigImpl;
-import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.DistributionConfigImpl;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.i18n.LogWriterI18n;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LocalLogWriter;
-
-import java.util.Properties;
-
-/**
- * Factory for creating GemFire administration entities.
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class AdminDistributedSystemFactory {
-
-  /**
-   * Sets the address this VM should bind to when connecting to the distributed system. This
-   * involves a system property, so using this option will limit all connections to distributed
-   * systems to this one network interface.
-   * <p>
-   * Using a null or empty bindAddress will clear the usage of this option and connections to
-   * distributed systems will return to using all available network interfaces.
-   * <p>
-   * This method always throws UnsupportedOperationException because it is now deprecated and is
-   * unsafe to use. Please use {@link DistributedSystemConfig#setBindAddress} instead.
-   *
-   * @param bindAddress machine name or IP address to bind to
-   * @throws UnsupportedOperationException because of deprecation
-   * @deprecated Use {@link DistributedSystemConfig#setBindAddress} instead.
-   */
-  @Deprecated
-  public static void bindToAddress(String bindAddress) {
-    throw new UnsupportedOperationException(
-        LocalizedStrings.AdminDistributedSystemFactory_PLEASE_USE_DISTRIBUTEDSYSTEMCONFIGSETBINDADDRESS_INSTEAD
-            .toLocalizedString());
-  }
-
-  /**
-   * Defines a "default" distributed system configuration based on VM system properties and the
-   * content of <code>gemfire.properties</code>. The
-   * {@linkplain DistributedSystemConfig#DEFAULT_REMOTE_COMMAND} default remote command is used.
-   *
-   * @see DistributedSystem#connect
-   */
-  public static DistributedSystemConfig defineDistributedSystem() {
-    DistributionConfig dc = new DistributionConfigImpl(new Properties());
-
-    String remoteCommand = DistributedSystemConfig.DEFAULT_REMOTE_COMMAND;
-    return new DistributedSystemConfigImpl(dc, remoteCommand);
-  }
-
-  /**
-   * Call this method with a value of <code>true</code> to dedicate the VM to GemFire administration
-   * only. Default is <code>false</code>.
-   * <p>
-   * This method <em>must</em> be called before calling {@link AdminDistributedSystem#connect}. It
-   * <em>must</em> also be called before {@link DistributedSystem#connect} is when creating a
-   * colocated distributed system.
-   * <p>
-   * Once it has been enabled be careful to only use GemFire APIs from the
-   * <code>org.apache.geode.admin</code> package. In particular do not create a
-   * {@link org.apache.geode.cache.Cache} or a normal {@link DistributedSystem}.
-   * 
-   * @param adminOnly <code>true</code> if this VM should be limited to administration APIs;
-   *        <code>false</code> if this VM should allow all GemFire APIs.
-   * @throws IllegalStateException if a {@link DistributedSystem} or {@link AdminDistributedSystem}
-   *         connection already exists.
-   * 
-   * @since GemFire 5.7
-   */
-  public static void setEnableAdministrationOnly(boolean adminOnly) {
-    InternalDistributedSystem.setEnableAdministrationOnly(adminOnly);
-  }
-
-  /**
-   * Defines a distributed system configuration for administering the distributed system to which
-   * this VM is currently connected. The <code>DistributedSystem</code> is used to configure the
-   * discovery mechanism (multicast or locators), bind address, SSL attributes, as well as the
-   * logger of the <code>DistributedSystemConfig</code>. Note that the distributed system will not
-   * be able to be administered until the {@link AdminDistributedSystem#connect connect} method is
-   * invoked.
-   *
-   * @param system A connection to the distributed system
-   * @param remoteCommand The shell command that is used to launch processes that run on remote
-   *        machines. If <code>null</code>, then the
-   *        {@linkplain DistributedSystemConfig#DEFAULT_REMOTE_COMMAND default} will be used.
-   *
-   * @since GemFire 4.0
-   */
-  public static DistributedSystemConfig defineDistributedSystem(DistributedSystem system,
-      String remoteCommand) throws AdminException {
-
-    InternalDistributedSystem internal = (InternalDistributedSystem) system;
-    if (remoteCommand == null) {
-      remoteCommand = DistributedSystemConfig.DEFAULT_REMOTE_COMMAND;
-    }
-
-    DistributedSystemConfigImpl impl =
-        new DistributedSystemConfigImpl(internal.getConfig(), remoteCommand);
-    return impl;
-  }
-
-  /**
-   * Returns the distributed system for administrative monitoring and managing. You must then call
-   * {@link AdminDistributedSystem#connect} before interacting with the actual system.
-   *
-   * @param config configuration definition of the system to administer
-   * @return administrative interface for a distributed system
-   */
-  public static AdminDistributedSystem getDistributedSystem(DistributedSystemConfig config) {
-    return new AdminDistributedSystemImpl((DistributedSystemConfigImpl) config);
-  }
-
-  /**
-   * Returns a default GemFire LogWriterI18n for logging. This LogWriterI18n will log to standard
-   * out.
-   *
-   * @return a GemFire LogWriterI18n for logging
-   */
-  public static LogWriterI18n getLogWriter() {
-    return new LocalLogWriter(DistributionConfig.DEFAULT_LOG_LEVEL);
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/AdminException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/AdminException.java b/geode-core/src/main/java/org/apache/geode/admin/AdminException.java
deleted file mode 100755
index 92b5e47..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/AdminException.java
+++ /dev/null
@@ -1,81 +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.admin;
-
-import org.apache.geode.GemFireCheckedException;
-
-/**
- * An <code>AdminException</code> is thrown when administration or monitoring of GemFire fails.
- *
- * @since GemFire 3.5
- *
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class AdminException extends GemFireCheckedException {
-  private static final long serialVersionUID = 879398950879472021L;
-
-  /**
-   * Constructs a new exception with <code>null</code> as its detail message. The cause is not
-   * initialized, and may subsequently be initialized by a call to {@link Throwable#initCause}.
-   */
-  public AdminException() {
-    super();
-  }
-
-  /**
-   * Constructs a new exception with the specified detail message. The cause is not initialized, and
-   * may subsequently be initialized by a call to {@link Throwable#initCause}.
-   *
-   * @param message the detail message. The detail message is saved for later retrieval by the
-   *        {@link #getMessage()} method.
-   */
-  public AdminException(String message) {
-    super(message);
-  }
-
-  /**
-   * Constructs a new exception with the specified detail message and cause.
-   * <p>
-   * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically
-   * incorporated in this exception's detail message.
-   *
-   * @param message the detail message (which is saved for later retrieval by the
-   *        {@link #getMessage()} method).
-   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
-   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
-   *        unknown.)
-   */
-  public AdminException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  /**
-   * Constructs a new exception with the specified cause. The detail message will be
-   * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail
-   * message of <tt>cause</tt>). This constructor is useful for exceptions that are little more than
-   * wrappers for other throwables (for example, {@link java.security.PrivilegedActionException}).
-   *
-   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
-   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
-   *        unknown.)
-   */
-  public AdminException(Throwable cause) {
-    super(cause);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/AdminXmlException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/AdminXmlException.java b/geode-core/src/main/java/org/apache/geode/admin/AdminXmlException.java
deleted file mode 100644
index ff1b48e..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/AdminXmlException.java
+++ /dev/null
@@ -1,44 +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.admin;
-
-/**
- * Thrown when a problem is encountered while working with admin-related XML data.
- *
- * @see DistributedSystemConfig#getEntityConfigXMLFile
- *
- * @since GemFire 4.0
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class AdminXmlException extends RuntimeAdminException {
-  private static final long serialVersionUID = -6848726449157550169L;
-
-  /**
-   * Creates a new <code>AdminXmlException</code> with the given descriptive message.
-   */
-  public AdminXmlException(String s) {
-    super(s);
-  }
-
-  /**
-   * Creates a new <code>AdminXmlException</code> with the given descriptive message and cause.
-   */
-  public AdminXmlException(String s, Throwable cause) {
-    super(s, cause);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/Alert.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/Alert.java b/geode-core/src/main/java/org/apache/geode/admin/Alert.java
deleted file mode 100755
index 44c373e..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/Alert.java
+++ /dev/null
@@ -1,53 +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.admin;
-
-/**
- * An administration alert that is issued by a member of a GemFire distributed system. It is similar
- * to a {@linkplain org.apache.geode.i18n.LogWriterI18n log message}.
- *
- * @see AlertListener
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface Alert {
-
-  /** The level at which this alert is issued */
-  public AlertLevel getLevel();
-
-  /**
-   * The member of the distributed system that issued the alert, or null if the issuer is no longer
-   * a member of the distributed system.
-   */
-  public SystemMember getSystemMember();
-
-  /**
-   * The name of the {@linkplain org.apache.geode.distributed.DistributedSystem#getName distributed
-   * system}) through which the alert was issued.
-   */
-  public String getConnectionName();
-
-  /** The id of the source of the alert (such as a thread in a VM) */
-  public String getSourceId();
-
-  /** The alert's message */
-  public String getMessage();
-
-  /** The time at which the alert was issued */
-  public java.util.Date getDate();
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/AlertLevel.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/AlertLevel.java b/geode-core/src/main/java/org/apache/geode/admin/AlertLevel.java
deleted file mode 100755
index 2fdcef8..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/AlertLevel.java
+++ /dev/null
@@ -1,168 +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.admin;
-
-import org.apache.geode.internal.admin.Alert;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-/**
- * Type-safe enumeration for {@link org.apache.geode.admin.Alert Alert} level.
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class AlertLevel implements java.io.Serializable {
-  private static final long serialVersionUID = -4752438966587392126L;
-
-  public static final AlertLevel WARNING = new AlertLevel(Alert.WARNING, "WARNING");
-  public static final AlertLevel ERROR = new AlertLevel(Alert.ERROR, "ERROR");
-  public static final AlertLevel SEVERE = new AlertLevel(Alert.SEVERE, "SEVERE");
-
-  public static final AlertLevel OFF = new AlertLevel(Alert.OFF, "OFF");
-
-  /** The severity level of this AlertLevel. Greater is more severe. */
-  private final transient int severity;
-
-  /** The name of this AlertLevel. */
-  private final transient String name;
-
-  // The 4 declarations below are necessary for serialization
-  /** int used as ordinal to represent this AlertLevel */
-  public final int ordinal = nextOrdinal++;
-
-  private static int nextOrdinal = 0;
-
-  private static final AlertLevel[] VALUES = {WARNING, ERROR, SEVERE, OFF};
-
-  private Object readResolve() throws java.io.ObjectStreamException {
-    return VALUES[ordinal]; // Canonicalize
-  }
-
-  /** Creates a new instance of AlertLevel. */
-  private AlertLevel(int severity, String name) {
-    this.severity = severity;
-    this.name = name;
-  }
-
-  /** Return the AlertLevel represented by specified ordinal */
-  public static AlertLevel fromOrdinal(int ordinal) {
-    return VALUES[ordinal];
-  }
-
-  /**
-   * Returns the <code>AlertLevel</code> for the given severity
-   *
-   * @throws IllegalArgumentException If there is no alert level with the given
-   *         <code>severity</code>
-   */
-  public static AlertLevel forSeverity(int severity) {
-    switch (severity) {
-      case Alert.WARNING:
-        return AlertLevel.WARNING;
-      case Alert.ERROR:
-        return AlertLevel.ERROR;
-      case Alert.SEVERE:
-        return AlertLevel.SEVERE;
-      case Alert.OFF:
-        return AlertLevel.OFF;
-      default:
-        throw new IllegalArgumentException(LocalizedStrings.AlertLevel_UNKNOWN_ALERT_SEVERITY_0
-            .toLocalizedString(Integer.valueOf(severity)));
-    }
-  }
-
-  /**
-   * Returns the <code>AlertLevel</code> with the given name
-   *
-   * @throws IllegalArgumentException If there is no alert level named <code>name</code>
-   */
-  public static AlertLevel forName(String name) {
-    for (int i = 0; i < VALUES.length; i++) {
-      AlertLevel level = VALUES[i];
-      if (level.getName().equalsIgnoreCase(name)) {
-        return level;
-      }
-    }
-
-    throw new IllegalArgumentException(
-        LocalizedStrings.AlertLevel_THERE_IS_NO_ALERT_LEVEL_0.toLocalizedString(name));
-  }
-
-  public int getSeverity() {
-    return this.severity;
-  }
-
-  public String getName() {
-    return this.name;
-  }
-
-  public static AlertLevel[] values() {
-    return VALUES;
-  }
-
-  /**
-   * Returns a string representation for this alert level.
-   *
-   * @return the name of this alert level
-   */
-  @Override
-  public String toString() {
-    return this.name /* + "=" + this.severity */;
-  }
-
-  /**
-   * Indicates whether some other object is "equal to" this one.
-   *
-   * @param other the reference object with which to compare.
-   * @return true if this object is the same as the obj argument; false otherwise.
-   */
-  @Override
-  public boolean equals(Object other) {
-    if (other == this)
-      return true;
-    if (other == null)
-      return false;
-    if (!(other instanceof AlertLevel))
-      return false;
-    final AlertLevel that = (AlertLevel) other;
-
-    if (this.severity != that.severity)
-      return false;
-    if (this.name != null && !this.name.equals(that.name))
-      return false;
-
-    return true;
-  }
-
-  /**
-   * Returns a hash code for the object. This method is supported for the benefit of hashtables such
-   * as those provided by java.util.Hashtable.
-   *
-   * @return the integer 0 if description is null; otherwise a unique integer.
-   */
-  @Override
-  public int hashCode() {
-    int result = 17;
-    final int mult = 37;
-
-    result = mult * result + this.severity;
-    result = mult * result + (this.name == null ? 0 : this.name.hashCode());
-
-    return result;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/AlertListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/AlertListener.java b/geode-core/src/main/java/org/apache/geode/admin/AlertListener.java
deleted file mode 100755
index 247f4d0..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/AlertListener.java
+++ /dev/null
@@ -1,30 +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.admin;
-
-/**
- * A listener whose callback methods are invoked when an {@link Alert} is received.
- * 
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface AlertListener extends java.util.EventListener {
-
-  /**
-   * Invoked when an <code>Alert</code> is received.
-   */
-  public void alert(Alert alert);
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/BackupStatus.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/BackupStatus.java b/geode-core/src/main/java/org/apache/geode/admin/BackupStatus.java
deleted file mode 100644
index c696b07..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/BackupStatus.java
+++ /dev/null
@@ -1,46 +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.admin;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-
-/**
- * The status of a backup operation, returned by
- * {@link AdminDistributedSystem#backupAllMembers(java.io.File,java.io.File)}.
- * 
- * @since GemFire 6.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface BackupStatus {
-
-  /**
-   * Returns a map of disk stores that were successfully backed up. The key is an online distributed
-   * member. The value is the set of disk stores on that distributed member.
-   */
-  Map<DistributedMember, Set<PersistentID>> getBackedUpDiskStores();
-
-  /**
-   * Returns the set of disk stores that were known to be offline at the time of the backup. These
-   * members were not backed up. If this set is not empty the backup may not contain a complete
-   * snapshot of any partitioned regions in the distributed system.
-   */
-  Set<PersistentID> getOfflineDiskStores();
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/CacheDoesNotExistException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/CacheDoesNotExistException.java b/geode-core/src/main/java/org/apache/geode/admin/CacheDoesNotExistException.java
deleted file mode 100644
index 338061e..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/CacheDoesNotExistException.java
+++ /dev/null
@@ -1,80 +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.admin;
-
-/**
- * An <code>CacheDoesNotExistException</code> is thrown when an attempt is made to get a cache and
- * one does not exist.
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class CacheDoesNotExistException extends AdminException {
-  private static final long serialVersionUID = -1639933911265729978L;
-
-  /**
-   * Constructs a new exception with <code>null</code> as its detail message. The cause is not
-   * initialized, and may subsequently be initialized by a call to {@link Throwable#initCause}.
-   */
-  public CacheDoesNotExistException() {
-    super();
-  }
-
-  /**
-   * Constructs a new exception with the specified detail message. The cause is not initialized, and
-   * may subsequently be initialized by a call to {@link Throwable#initCause}.
-   *
-   * @param message the detail message. The detail message is saved for later retrieval by the
-   *        {@link #getMessage()} method.
-   */
-  public CacheDoesNotExistException(String message) {
-    super(message);
-  }
-
-  /**
-   * Constructs a new exception with the specified detail message and cause.
-   * <p>
-   * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically
-   * incorporated in this exception's detail message.
-   *
-   * @param message the detail message (which is saved for later retrieval by the
-   *        {@link #getMessage()} method).
-   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
-   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
-   *        unknown.)
-   */
-  public CacheDoesNotExistException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  /**
-   * Constructs a new exception with the specified cause and a detail message of
-   * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail
-   * message of <tt>cause</tt>). This constructor is useful for exceptions that are little more than
-   * wrappers for other throwables (for example, {@link java.security.PrivilegedActionException}).
-   *
-   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
-   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
-   *        unknown.)
-   */
-  public CacheDoesNotExistException(Throwable cause) {
-    super(cause);
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/CacheHealthConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/CacheHealthConfig.java b/geode-core/src/main/java/org/apache/geode/admin/CacheHealthConfig.java
deleted file mode 100644
index 9f99309..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/CacheHealthConfig.java
+++ /dev/null
@@ -1,151 +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.admin;
-
-/**
- * Provides configuration information relating to the health of a member of a GemFire distributed
- * system that hosts a GemFire {@link org.apache.geode.cache.Cache Cache}.
- *
- * <P>
- *
- * If any of the following criteria is true, then a cache member is considered to be in
- * {@link GemFireHealth#OKAY_HEALTH OKAY_HEALTH}.
- *
- * <UL>
- *
- * <LI><code>netSearch</code> operations take {@linkplain #getMaxNetSearchTime too long} to
- * complete.</LI>
- *
- * <LI>Cache <code>load</code> operations take {@linkplain #getMaxLoadTime too long} to
- * complete.</LI>
- *
- * <LI>The overall cache {@link #getMinHitRatio hitRatio} is too small</LI>
- *
- * <LI>The number of entries in the Cache {@link #getMaxEventQueueSize event delivery queue} is too
- * large.</LI>
- * 
- * <LI>If one of the regions is configured with {@link org.apache.geode.cache.LossAction#FULL_ACCESS
- * FULL_ACCESS} on role loss.</LI>
- *
- * </UL>
- *
- * If any of the following criteria is true, then a cache member is considered to be in
- * {@link GemFireHealth#POOR_HEALTH POOR_HEALTH}.
- * 
- * <UL>
- * 
- * <LI>If one of the regions is configured with {@link org.apache.geode.cache.LossAction#NO_ACCESS
- * NO_ACCESS} on role loss.</LI>
- * 
- * <LI>If one of the regions is configured with
- * {@link org.apache.geode.cache.LossAction#LIMITED_ACCESS LIMITED_ACCESS} on role loss.</LI>
- * 
- * </UL>
- * 
- * <UL>
- *
- * </UL>
- *
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface CacheHealthConfig {
-
-  /**
-   * The default maximum number of milliseconds a <code>netSearch</code> operation can take before
-   * the cache member is considered to be unhealthy.
-   */
-  public static final long DEFAULT_MAX_NET_SEARCH_TIME = 60 * 1000;
-
-  /**
-   * The default maximum mumber of milliseconds a cache <code>load</code> operation can take before
-   * the cache member is considered to be unhealthy.
-   */
-  public static final long DEFAULT_MAX_LOAD_TIME = 60 * 1000;
-
-  /** The default minimum hit ratio of a healthy cache member. */
-  public static final double DEFAULT_MIN_HIT_RATIO = 0.0;
-
-  /**
-   * The default maximum number of entries in the event delivery queue of a healthy cache member.
-   */
-  public static final long DEFAULT_MAX_EVENT_QUEUE_SIZE = 1000;
-
-  /////////////////////// Instance Methods ///////////////////////
-
-  /**
-   * Returns the maximum number of milliseconds a <code>netSearch</code> operation can take before
-   * the cache member is considered to be unhealthy.
-   *
-   * @see #DEFAULT_MAX_NET_SEARCH_TIME
-   */
-  public long getMaxNetSearchTime();
-
-  /**
-   * Sets the maximum number of milliseconds a <code>netSearch</code> operation can take before the
-   * cache member is considered to be unhealthy.
-   *
-   * @see #getMaxNetSearchTime
-   */
-  public void setMaxNetSearchTime(long maxNetSearchTime);
-
-  /**
-   * Returns the maximum mumber of milliseconds a cache <code>load</code> operation can take before
-   * the cache member is considered to be unhealthy.
-   *
-   * @see #DEFAULT_MAX_LOAD_TIME
-   */
-  public long getMaxLoadTime();
-
-  /**
-   * Sets the maximum mumber of milliseconds a cache <code>load</code> operation can take before the
-   * cache member is considered to be unhealthy.
-   *
-   * @see #getMaxLoadTime
-   */
-  public void setMaxLoadTime(long maxLoadTime);
-
-  /**
-   * Returns the minimum hit ratio of a healthy cache member.
-   *
-   * @see #DEFAULT_MIN_HIT_RATIO
-   */
-  public double getMinHitRatio();
-
-  /**
-   * Sets the minimum hit ratio of a healthy cache member.
-   *
-   * @see #getMinHitRatio
-   */
-  public void setMinHitRatio(double minHitRatio);
-
-  /**
-   * Returns the maximum number of entries in the event delivery queue of a healthy cache member.
-   *
-   * @see #DEFAULT_MAX_EVENT_QUEUE_SIZE
-   */
-  public long getMaxEventQueueSize();
-
-  /**
-   * Sets the maximum number of entries in the event delivery queue of a healthy cache member.
-   *
-   * @see #getMaxEventQueueSize
-   */
-  public void setMaxEventQueueSize(long maxEventQueueSize);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/CacheServer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/CacheServer.java b/geode-core/src/main/java/org/apache/geode/admin/CacheServer.java
deleted file mode 100644
index a229281..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/CacheServer.java
+++ /dev/null
@@ -1,43 +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.admin;
-
-/**
- * A dedicated cache server VM that is managed by the administration API.
- *
- * @since GemFire 4.0
- * @deprecated as of 5.7 use {@link CacheVm} instead.
- */
-@Deprecated
-public interface CacheServer extends SystemMember, ManagedEntity {
-  /**
-   * Returns the configuration of this cache vm
-   * 
-   * @deprecated as of 5.7 use {@link CacheVm#getVmConfig} instead.
-   */
-  @Deprecated
-  public CacheServerConfig getConfig();
-
-  /**
-   * Find whether this server is primary for given client (durableClientId)
-   * 
-   * @param durableClientId - durable-id of the client
-   * @return true if the server is primary for given client
-   * 
-   * @since GemFire 5.6
-   */
-  public boolean isPrimaryForDurableClient(String durableClientId);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/CacheServerConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/CacheServerConfig.java b/geode-core/src/main/java/org/apache/geode/admin/CacheServerConfig.java
deleted file mode 100644
index 389d6bc..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/CacheServerConfig.java
+++ /dev/null
@@ -1,50 +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.admin;
-
-/**
- * Configuration for a GemFire cache server that is managed by the administration API. The cache
- * server may or may not be running.
- *
- * @see AdminDistributedSystem#addCacheServer()
- *
- * @since GemFire 4.0
- * @deprecated as of 5.7 use {@link CacheVmConfig} instead.
- */
-@Deprecated
-public interface CacheServerConfig extends CacheVmConfig {
-  /**
-   * Returns the <code>cache.xml</code> declarative caching initialization file used to configure
-   * this cache server VM. By default, a cache server VM is started without an XML file.
-   */
-  public String getCacheXMLFile();
-
-  /**
-   * Sets the <code>cache.xml</code> declarative caching initialization file used to configure this
-   * cache server VM.
-   */
-  public void setCacheXMLFile(String cacheXml);
-
-  /**
-   * Returns the location(s) of user classes (such as cache loaders) required by the cache server
-   * VM.
-   */
-  public String getClassPath();
-
-  /**
-   * Sets the location(s) of user classes (such as cache loaders) required by the cache server VM.
-   */
-  public void setClassPath(String classpath);
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/CacheVm.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/CacheVm.java b/geode-core/src/main/java/org/apache/geode/admin/CacheVm.java
deleted file mode 100755
index 30d8701..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/CacheVm.java
+++ /dev/null
@@ -1,35 +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.admin;
-
-/**
- * A dedicated cache server VM that is managed by the administration API.
- * <p>
- * Note that this may not represent an instance of
- * {@link org.apache.geode.cache.server.CacheServer}. It is possible for a cache VM to be started
- * but for it not to listen for client connections in which case it is not a
- * {@link org.apache.geode.cache.server.CacheServer} but is an instance of this interface.
- *
- * @since GemFire 5.7
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface CacheVm extends SystemMember, ManagedEntity {
-  /**
-   * Returns the configuration of this cache vm
-   */
-  public CacheVmConfig getVmConfig();
-}



[09/50] [abbrv] incubator-geode git commit: [GEODE-2037] Update documentation links

Posted by kl...@apache.org.
[GEODE-2037] Update documentation links

Fix README.md, geode-examples/README.md, and the website releases
page to point to documentation hosted on the geode website


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

Branch: refs/heads/feature/GEODE-288
Commit: f73a4e3fd941715de6547c66875bebbf2db29d6e
Parents: f6b534d
Author: Anthony Baker <ab...@apache.org>
Authored: Wed Oct 26 07:40:29 2016 -0700
Committer: Anthony Baker <ab...@apache.org>
Committed: Wed Oct 26 10:14:11 2016 -0700

----------------------------------------------------------------------
 README.md                                      | 4 ++--
 geode-examples/README.md                       | 4 ++--
 geode-site/website/content/releases/index.html | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f73a4e3f/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index eee17fc..4ca2416 100644
--- a/README.md
+++ b/README.md
@@ -94,7 +94,7 @@ Apache Geode applications can be written in these client technologies:
 
 * Java using the Geode client API or embedded using the Geode peer API
 * [Spring Data GemFire](http://projects.spring.io/spring-data-gemfire/) or [Spring Cache](http://docs.spring.io/spring/docs/current/spring-framework-reference/html/cache.html)
-* [Python](https://github.com/gemfire/py-gemfire-rest)
-* [REST](http://geode.docs.pivotal.io/docs/rest_apps/book_intro.html)
+* [REST](http://geode.apache.org/docs/guide/rest_apps/chapter_overview.html)
 * [memcached](https://cwiki.apache.org/confluence/display/GEODE/Moving+from+memcached+to+gemcached)
+* [Python](https://github.com/gemfire/py-gemfire-rest)
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f73a4e3f/geode-examples/README.md
----------------------------------------------------------------------
diff --git a/geode-examples/README.md b/geode-examples/README.md
index 1d4eafb..83fd93d 100644
--- a/geode-examples/README.md
+++ b/geode-examples/README.md
@@ -16,9 +16,9 @@ All examples:
 
 ### Installation and a Tutorial for Beginners
 
-*  [How to Install](http://geode.docs.pivotal.io/docs/getting_started/installation/install_standalone.html)
+*  [How to Install](http://geode.apache.org/docs/guide/getting_started/installation/install_standalone.html)
 *  Set a `GEODE_HOME` environment variable to point to the root directory of the installation; this directory contains `bin/`. For those that have built from source, it will be the `geode-assembly/build/install/apache-geode` directory.
-*  If desired run the tutorial: [Apache Geode in 15 minutes or Less](http://geode.docs.pivotal.io/docs/getting_started/15_minute_quickstart_gfsh.html)
+*  If desired run the tutorial: [Apache Geode in 15 minutes or Less](http://geode.apache.org/docs/guide/getting_started/15_minute_quickstart_gfsh.html)
 
 ### Basics
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f73a4e3f/geode-site/website/content/releases/index.html
----------------------------------------------------------------------
diff --git a/geode-site/website/content/releases/index.html b/geode-site/website/content/releases/index.html
index 63f685e..7056640 100644
--- a/geode-site/website/content/releases/index.html
+++ b/geode-site/website/content/releases/index.html
@@ -268,7 +268,7 @@ under the License. -->
     			<p>
 					Alternatively, you can verify the MD5 signature on the files. A Unix program called md5 or md5sum is included in many Unix distributions. It is also available as part of <a href="http://www.gnu.org/software/textutils/textutils.html">GNU Textutils</a>. Windows users can get binary md5 programs from <a href="http://www.fourmilab.ch/md5/">here</a>, <a href="http://www.pc-tools.net/win32/md5sums/">here</a>, or <a href="http://www.slavasoft.com/fsum/">here</a>.
 				<p>
-					If you want to build directly from source, instructions are within the User Documentation in the <a href="http://geode.docs.pivotal.io/docs/getting_started/installation/install_standalone.html">How to Install</a> subsection.
+					If you want to build directly from source, instructions are within the User Documentation in the <a href="http://geode.apache.org/docs/guide/getting_started/installation/install_standalone.html">How to Install</a> subsection.
 				</p>
 			</div>
 		</div>


[19/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java
new file mode 100644
index 0000000..23e9038
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthConfigJmxImpl.java
@@ -0,0 +1,211 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.impl.GemFireHealthConfigImpl;
+
+/**
+ * The JMX "managed resource" that represents the configuration for the health of GemFire.
+ * Basically, it provides the behavior of <code>GemFireHealthConfigImpl</code>, but does some JMX
+ * stuff like registering beans with the agent.
+ *
+ * <P>
+ *
+ * Unlike other <code>ManagedResource</code>s this class cannot simply subclass
+ * <code>GemFireHealthImpl</code> because it instances are serialized and sent to other VMs. This is
+ * problematic because the other VMs most likely do not have JMX classes like
+ * <code>ModelMBean</code> on their classpaths. So, instead we delegate all of the
+ * <code>GemFireHealthConfig</code> behavior to another object which IS serialized.
+ *
+ * @see GemFireHealthJmxImpl#createDistributedSystemHealthConfig
+ *
+ *
+ * @since GemFire 3.5
+ */
+@edu.umd.cs.findbugs.annotations.SuppressWarnings(
+    justification = "This class is deprecated. Also, any further changes so close to the release is inadvisable.")
+public class GemFireHealthConfigJmxImpl
+    implements GemFireHealthConfig, ManagedResource, java.io.Serializable {
+
+  private static final long serialVersionUID = 1482719647163239953L;
+
+  /** The <code>GemFireHealth</code> that we help configure */
+  private GemFireHealth health;
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  /** The delegate that contains the real config state */
+  private GemFireHealthConfig delegate;
+
+  /** The object name of this managed resource */
+  private ObjectName objectName;
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>GemFireHealthConfigJmxImpl</code> that configures the health monitoring of
+   * components running on the given host.
+   */
+  GemFireHealthConfigJmxImpl(GemFireHealthJmxImpl health, String hostName) throws AdminException {
+
+    this.delegate = new GemFireHealthConfigImpl(hostName);
+    this.health = health;
+    this.mbeanName = new StringBuffer().append(MBEAN_NAME_PREFIX).append("GemFireHealthConfig,id=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(health.getDistributedSystem().getId()))
+        .append(",host=")
+        .append((hostName == null ? "default" : MBeanUtil.makeCompliantMBeanNameProperty(hostName)))
+        .toString();
+    this.objectName = MBeanUtil.createMBean(this);
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Applies the changes made to this config back to the health monitor.
+   *
+   * @see GemFireHealth#setDistributedSystemHealthConfig
+   */
+  public void applyChanges() {
+    String hostName = this.getHostName();
+    if (hostName == null) {
+      this.health.setDefaultGemFireHealthConfig(this);
+
+    } else {
+      this.health.setGemFireHealthConfig(hostName, this);
+    }
+  }
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.GEMFIRE_HEALTH_CONFIG;
+  }
+
+  /**
+   * Replace this object with the delegate that can be properly serialized.
+   */
+  public Object writeReplace() {
+    return this.delegate;
+  }
+
+  ////////////////////// MemberHealthConfig //////////////////////
+
+  public long getMaxVMProcessSize() {
+    return delegate.getMaxVMProcessSize();
+  }
+
+  public void setMaxVMProcessSize(long size) {
+    delegate.setMaxVMProcessSize(size);
+  }
+
+  public long getMaxMessageQueueSize() {
+    return delegate.getMaxMessageQueueSize();
+  }
+
+  public void setMaxMessageQueueSize(long maxMessageQueueSize) {
+    delegate.setMaxMessageQueueSize(maxMessageQueueSize);
+  }
+
+  public long getMaxReplyTimeouts() {
+    return delegate.getMaxReplyTimeouts();
+  }
+
+  public void setMaxReplyTimeouts(long maxReplyTimeouts) {
+    delegate.setMaxReplyTimeouts(maxReplyTimeouts);
+  }
+
+  public double getMaxRetransmissionRatio() {
+    return delegate.getMaxRetransmissionRatio();
+  }
+
+  public void setMaxRetransmissionRatio(double ratio) {
+    delegate.setMaxRetransmissionRatio(ratio);
+  }
+
+  ////////////////////// CacheHealthConfig //////////////////////
+
+  public long getMaxNetSearchTime() {
+    return delegate.getMaxNetSearchTime();
+  }
+
+  public void setMaxNetSearchTime(long maxNetSearchTime) {
+    delegate.setMaxNetSearchTime(maxNetSearchTime);
+  }
+
+  public long getMaxLoadTime() {
+    return delegate.getMaxLoadTime();
+  }
+
+  public void setMaxLoadTime(long maxLoadTime) {
+    delegate.setMaxLoadTime(maxLoadTime);
+  }
+
+  public double getMinHitRatio() {
+    return delegate.getMinHitRatio();
+  }
+
+  public void setMinHitRatio(double minHitRatio) {
+    delegate.setMinHitRatio(minHitRatio);
+  }
+
+  public long getMaxEventQueueSize() {
+    return delegate.getMaxEventQueueSize();
+  }
+
+  public void setMaxEventQueueSize(long maxEventQueueSize) {
+    delegate.setMaxEventQueueSize(maxEventQueueSize);
+  }
+
+  ////////////////////// GemFireHealthConfig //////////////////////
+
+  public String getHostName() {
+    return delegate.getHostName();
+  }
+
+  public void setHealthEvaluationInterval(int interval) {
+    delegate.setHealthEvaluationInterval(interval);
+  }
+
+  public int getHealthEvaluationInterval() {
+    return delegate.getHealthEvaluationInterval();
+  }
+
+  public void cleanupResource() {}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthJmxImpl.java
new file mode 100644
index 0000000..fcff9be
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GemFireHealthJmxImpl.java
@@ -0,0 +1,171 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.DistributedSystemHealthConfig;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.RuntimeAdminException;
+import org.apache.geode.internal.admin.api.impl.GemFireHealthImpl;
+import org.apache.geode.internal.admin.GfManagerAgent;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+// import org.apache.commons.modeler.ManagedBean;
+
+/**
+ * The JMX "managed resource" that represents the health of GemFire. Basically, it provides the
+ * behavior of <code>GemFireHealthImpl</code>, but does some JMX stuff like registering beans with
+ * the agent.
+ *
+ * @see AdminDistributedSystemJmxImpl#createGemFireHealth
+ *
+ *
+ * @since GemFire 3.5
+ */
+public class GemFireHealthJmxImpl extends GemFireHealthImpl implements ManagedResource {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  /** The object name of the MBean created for this managed resource */
+  private final ObjectName objectName;
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>GemFireHealthJmxImpl</code> that monitors the health of the given
+   * distributed system and uses the given JMX agent.
+   */
+  GemFireHealthJmxImpl(GfManagerAgent agent, AdminDistributedSystemJmxImpl system)
+      throws AdminException {
+
+    super(agent, system);
+    this.mbeanName = new StringBuffer().append(MBEAN_NAME_PREFIX).append("GemFireHealth,id=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(system.getId())).toString();
+    this.objectName = MBeanUtil.createMBean(this);
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  public String getHealthStatus() {
+    return getHealth().toString();
+  }
+
+  public ObjectName manageGemFireHealthConfig(String hostName) throws MalformedObjectNameException {
+    try {
+      GemFireHealthConfig config = getGemFireHealthConfig(hostName);
+      GemFireHealthConfigJmxImpl jmx = (GemFireHealthConfigJmxImpl) config;
+      return new ObjectName(jmx.getMBeanName());
+    } // catch (AdminException e) { logWriter.warning(e); throw e; }
+    catch (RuntimeException e) {
+      logger.warn(e.getMessage(), e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logger.error(e.getMessage(), e);
+      throw e;
+    }
+  }
+
+  /**
+   * Creates a new {@link DistributedSystemHealthConfigJmxImpl}
+   */
+  @Override
+  protected DistributedSystemHealthConfig createDistributedSystemHealthConfig() {
+
+    try {
+      return new DistributedSystemHealthConfigJmxImpl(this);
+
+    } catch (AdminException ex) {
+      throw new RuntimeAdminException(
+          LocalizedStrings.GemFireHealthJmxImpl_WHILE_GETTING_THE_DISTRIBUTEDSYSTEMHEALTHCONFIG
+              .toLocalizedString(),
+          ex);
+    }
+  }
+
+  /**
+   * Creates a new {@link GemFireHealthConfigJmxImpl}
+   */
+  @Override
+  protected GemFireHealthConfig createGemFireHealthConfig(String hostName) {
+
+    try {
+      return new GemFireHealthConfigJmxImpl(this, hostName);
+
+    } catch (AdminException ex) {
+      throw new RuntimeAdminException(
+          LocalizedStrings.GemFireHealthJmxImpl_WHILE_GETTING_THE_GEMFIREHEALTHCONFIG
+              .toLocalizedString(),
+          ex);
+    }
+  }
+
+  /**
+   * Ensures that the three primary Health MBeans are registered and returns their ObjectNames.
+   */
+  protected void ensureMBeansAreRegistered() {
+    MBeanUtil.ensureMBeanIsRegistered(this);
+    MBeanUtil.ensureMBeanIsRegistered((ManagedResource) this.defaultConfig);
+    MBeanUtil.ensureMBeanIsRegistered((ManagedResource) this.dsHealthConfig);
+  }
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.GEMFIRE_HEALTH;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public void cleanupResource() {
+    close();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GenerateMBeanHTML.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GenerateMBeanHTML.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GenerateMBeanHTML.java
new file mode 100644
index 0000000..75c718e
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/GenerateMBeanHTML.java
@@ -0,0 +1,501 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.geode.internal.ClassPathLoader;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import org.xml.sax.*;
+import org.xml.sax.helpers.DefaultHandler;
+import java.io.*;
+
+/**
+ * A tool that reads the XML description of MBeans used with the Jakarta Commons Modeler and
+ * generates an HTML file that documents each MBean.
+ *
+ * @since GemFire 3.5
+ */
+public class GenerateMBeanHTML extends DefaultHandler {
+
+  /** The location of the DTD for the MBean descriptions */
+  private static final String DTD_LOCATION =
+      "/org/apache/geode/internal/admin/api/jmx/impl/doc-files/mbeans-descriptors.dtd";
+
+  // /** The system id of MBean description's DTD */
+  // private static final String SYSTEM_ID =
+  // "http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd";
+
+  // /** The public id for the DTD */
+  // private static final String PUBLIC_ID =
+  // "-//Apache Software Foundation//DTD Model MBeans Configuration File";
+
+  /** The name of the "mbean-descriptors" element */
+  private static final String MBEANS_DESCRIPTORS = "mbeans-descriptors";
+
+  /** The name of the "mbean" element */
+  private static final String MBEAN = "mbean";
+
+  /** The name of the "name" attribute */
+  private static final String NAME = "name";
+
+  /** The name of the "description" attribute */
+  private static final String DESCRIPTION = "description";
+
+  /** The name of the "type" attribute */
+  private static final String TYPE = "type";
+
+  /** The name of the "attribute" element */
+  private static final String ATTRIBUTE = "attribute";
+
+  /** The name of the "writeable" attribute */
+  private static final String WRITEABLE = "writeable";
+
+  /** The name of the "operation" element */
+  private static final String OPERATION = "operation";
+
+  /** The name of the "returnType" attribute */
+  private static final String RETURN_TYPE = "returnType";
+
+  /** The name of the "paremeter" element */
+  private static final String PARAMETER = "parameter";
+
+  /** The name of the "notification" element */
+  private static final String NOTIFICATION = "notification";
+
+  // /** The name of the "description" element */
+  // private static final String DESCRIPTOR = "descriptor";
+
+  /** The name of the "field" element */
+  private static final String FIELD = "field";
+
+  /** The name of the "value" attribute */
+  private static final String VALUE = "value";
+
+  ////////////////////// Instance Fields ///////////////////////
+
+  /** Where the generated HTML data is written */
+  private PrintWriter pw;
+
+  /** Have we seen attributes for the current MBean? */
+  private boolean seenAttribute = false;
+
+  /** Have we seen operations for the current MBean? */
+  private boolean seenOperation = false;
+
+  /** Have we seen notifications for the current MBean? */
+  private boolean seenNotifications = false;
+
+  /////////////////////// Static Methods ///////////////////////
+
+  /**
+   * Converts data from the given <code>InputStream</code> into HTML that is written to the given
+   * <code>PrintWriter</code>
+   */
+  private static void convert(InputStream in, PrintWriter out) throws Exception {
+
+    SAXParserFactory factory = SAXParserFactory.newInstance();
+    factory.setValidating(true);
+    SAXParser parser = factory.newSAXParser();
+    DefaultHandler handler = new GenerateMBeanHTML(out);
+    parser.parse(in, handler);
+  }
+
+  //////////////////////// Constructors ////////////////////////
+
+  /**
+   * Creates a new <code>GenerateMBeanHTML</code> that writes to the given <code>PrintWriter</code>.
+   */
+  private GenerateMBeanHTML(PrintWriter pw) {
+    this.pw = pw;
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Given a public id, attempt to resolve it to a DTD. Returns an <code>InputSoure</code> for the
+   * DTD.
+   */
+  @Override
+  public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
+
+    if (publicId == null || systemId == null) {
+      throw new SAXException(LocalizedStrings.GenerateMBeanHTML_PUBLIC_ID_0_SYSTEM_ID_1
+          .toLocalizedString(new Object[] {publicId, systemId}));
+    }
+
+    // Figure out the location for the publicId.
+    String location = DTD_LOCATION;
+
+    InputSource result;
+    // if (location != null) (cannot be null)
+    {
+      InputStream stream = ClassPathLoader.getLatest().getResourceAsStream(getClass(), location);
+      if (stream != null) {
+        result = new InputSource(stream);
+      } else {
+        throw new SAXNotRecognizedException(
+            LocalizedStrings.GenerateMBeanHTML_DTD_NOT_FOUND_0.toLocalizedString(location));
+      }
+
+      // } else {
+      // throw new
+      // SAXNotRecognizedException(LocalizedStrings.GenerateMBeanHTML_COULD_NOT_FIND_DTD_FOR_0_1.toLocalizedString(new
+      // Object[] {publicId, systemId}));
+    }
+
+    return result;
+  }
+
+  /**
+   * Warnings are ignored
+   */
+  @Override
+  public void warning(SAXParseException ex) throws SAXException {
+
+  }
+
+  /**
+   * Rethrow the <code>SAXParseException</code>
+   */
+  @Override
+  public void error(SAXParseException ex) throws SAXException {
+    throw ex;
+  }
+
+  /**
+   * Rethrow the <code>SAXParseException</code>
+   */
+  @Override
+  public void fatalError(SAXParseException ex) throws SAXException {
+    throw ex;
+  }
+
+  /**
+   * Starts the HTML document
+   */
+  private void startMBeansDescriptors() {
+    pw.println("<HTML>");
+    pw.println("<HEAD>");
+    pw.println("<TITLE>GemFire MBeans Interface</TITLE>");
+    pw.println("</HEAD>");
+    pw.println("");
+    pw.println("<h1>GemFire Management Beans</h1>");
+    pw.println("");
+    pw.println("<P>This document describes the attributes, operations,");
+    pw.println("and notifications of the GemFire Administration");
+    pw.println("Management Beans (MBeans).</P>");
+    pw.println("");
+  }
+
+  /**
+   * Ends the HTML document
+   */
+  private void endMBeansDescriptors() {
+    pw.println("</HTML>");
+  }
+
+  /**
+   * Generates a heading and a table declaration for an MBean
+   */
+  private void startMBean(Attributes atts) {
+    String name = atts.getValue(NAME);
+    /* String description = */ atts.getValue(DESCRIPTION);
+    pw.println("<h2><b>" + name + "</b> MBean</h2>");
+    pw.println("<table border=\"0\" cellpadding=\"3\">");
+    pw.println("<tr valign=\"top\">");
+    pw.println("  <th align=\"left\">Description:</th>");
+    pw.println("  <td colspan=\"4\">GemFire distributed system</td>");
+    pw.println("</tr>");
+  }
+
+  /**
+   * Ends the MBean table
+   */
+  private void endMBean() {
+    this.seenAttribute = false;
+    this.seenOperation = false;
+    this.seenNotifications = false;
+
+    pw.println("</table>");
+    pw.println("");
+
+    pw.println("<P></P>");
+    pw.println("");
+  }
+
+  /**
+   * Generates a table row for an MBean attribute
+   */
+  private void startAttribute(Attributes atts) {
+    if (!this.seenAttribute) {
+      // Print header row
+      pw.println("<tr valign=\"top\">");
+      pw.println("  <th align=\"left\">Attributes</th>");
+      pw.println("  <th align=\"left\" colspan=\"2\">Name</th>");
+      pw.println("  <th align=\"left\">Type</th>");
+      pw.println("  <th align=\"left\">Description</th>");
+      pw.println("  <th align=\"left\">Writable</th>");
+      pw.println("</tr>");
+
+    }
+
+    this.seenAttribute = true;
+
+    String name = atts.getValue(NAME);
+    String description = atts.getValue(DESCRIPTION);
+    String type = atts.getValue(TYPE);
+    String writeable = atts.getValue(WRITEABLE);
+
+    pw.println("<tr valign=\"top\">");
+    pw.println("  <td></td>");
+    pw.println("  <td colspan=\"2\">" + name + "</td>");
+    pw.println("  <td>" + type + "</td>");
+    pw.println("  <td>" + description + "</td>");
+    pw.println("  <td>" + writeable + "</td>");
+    pw.println("</tr>");
+  }
+
+  /**
+   * Generates a table row for an MBean operation
+   */
+  private void startOperation(Attributes atts) {
+    if (!this.seenOperation) {
+      if (!this.seenAttribute) {
+        pw.println("<tr valign=\"top\">");
+        pw.println("  <th align=\"left\">Operations</th>");
+        pw.println("  <th align=\"left\" colspan=\"2\">Name</th>");
+        pw.println("  <th align=\"left\">Type</th>");
+        pw.println("  <th align=\"left\">Description</th>");
+        pw.println("  <th align=\"left\"></th>");
+        pw.println("</tr>");
+
+      } else {
+        String title = "Operations and Parameters";
+        pw.println("<tr valign=\"top\">");
+        pw.println("  <th align=\"left\" colspan=\"6\">" + title + "</th>");
+        pw.println("</tr>");
+      }
+    }
+
+    this.seenOperation = true;
+
+    String name = atts.getValue(NAME);
+    String type = atts.getValue(RETURN_TYPE);
+    String description = atts.getValue(DESCRIPTION);
+
+    pw.println("<tr valign=\"top\">");
+    pw.println("  <td></td>");
+    pw.println("  <td colspan=\"2\">" + name + "</td>");
+    pw.println("  <td>" + type + "</td>");
+    pw.println("  <td colspan=\"2\">" + description + "</td>");
+    pw.println("</tr>");
+
+  }
+
+  /**
+   * Generates a table row for the parameter of an MBean operation
+   */
+  private void startParameter(Attributes atts) {
+    String name = atts.getValue(NAME);
+    String description = atts.getValue(DESCRIPTION);
+    String type = atts.getValue(TYPE);
+
+    pw.println("<tr valign=\"top\">");
+    pw.println("  <td></td>");
+    pw.println("  <td width=\"10\"></td>");
+    pw.println("  <td>" + name + "</td>");
+    pw.println("  <td>" + type + "</td>");
+    pw.println("  <td colspan=\"2\">" + description + "</td>");
+    pw.println("</tr>");
+  }
+
+  /**
+   * Generates a row in a table for an MBean notification
+   */
+  private void startNotification(Attributes atts) {
+    if (!this.seenNotifications) {
+      if (!this.seenAttribute && !this.seenOperation) {
+        pw.println("<tr valign=\"top\">");
+        pw.println("  <th align=\"left\">Notifications</th>");
+        pw.println("  <th align=\"left\" colspan=\"2\">Name</th>");
+        pw.println("  <th align=\"left\">Type</th>");
+        pw.println("  <th align=\"left\">Description</th>");
+        pw.println("  <th align=\"left\"></th>");
+        pw.println("</tr>");
+        pw.println("</tr>");
+
+      } else {
+        pw.println("<tr valign=\"top\">");
+        pw.println("  <th align=\"left\" colspan=\"6\">Notifications and Fields</th>");
+        pw.println("</tr>");
+      }
+    }
+
+    this.seenNotifications = true;
+
+    String name = atts.getValue(NAME);
+    String description = atts.getValue(DESCRIPTION);
+
+    pw.println("<tr valign=\"top\">");
+    pw.println("  <td></td>");
+    pw.println("  <td colspan=\"3\">" + name + "</td>");
+    pw.println("  <td colspan=\"3\">" + description + "</td>");
+    pw.println("</tr>");
+
+  }
+
+  /**
+   * Generates a table row for a descriptor field
+   */
+  private void startField(Attributes atts) {
+    String name = atts.getValue(NAME);
+    String value = atts.getValue(VALUE);
+
+    pw.println("<tr valign=\"top\">");
+    pw.println("  <td></td>");
+    pw.println("  <td width=\"10\"></td>");
+    pw.println("  <td colspan=\"2\">" + name + "</td>");
+    pw.println("  <td colspan=\"2\">" + value + "</td>");
+    pw.println("</tr>");
+
+  }
+
+  @Override
+  public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
+      throws SAXException {
+
+    if (qName.equals(MBEANS_DESCRIPTORS)) {
+      startMBeansDescriptors();
+
+    } else if (qName.equals(MBEAN)) {
+      startMBean(atts);
+
+    } else if (qName.equals(ATTRIBUTE)) {
+      startAttribute(atts);
+
+    } else if (qName.equals(OPERATION)) {
+      startOperation(atts);
+
+    } else if (qName.equals(PARAMETER)) {
+      startParameter(atts);
+
+    } else if (qName.equals(NOTIFICATION)) {
+      startNotification(atts);
+
+    } else if (qName.equals(FIELD)) {
+      startField(atts);
+    }
+
+  }
+
+
+  @Override
+  public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+
+    if (qName.equals(MBEANS_DESCRIPTORS)) {
+      endMBeansDescriptors();
+
+    } else if (qName.equals(MBEAN)) {
+      endMBean();
+    }
+
+  }
+
+  ////////// Inherited methods that don't do anything //////////
+
+  @Override
+  public void characters(char[] ch, int start, int length) throws SAXException {
+
+  }
+
+  @Override
+  public void setDocumentLocator(Locator locator) {}
+
+  @Override
+  public void startDocument() throws SAXException {}
+
+  @Override
+  public void endDocument() throws SAXException {}
+
+  @Override
+  public void startPrefixMapping(String prefix, String uri) throws SAXException {}
+
+  @Override
+  public void endPrefixMapping(String prefix) throws SAXException {}
+
+  @Override
+  public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {}
+
+  @Override
+  public void processingInstruction(String target, String data) throws SAXException {}
+
+  @Override
+  public void skippedEntity(String name) throws SAXException {}
+
+  //////////////////////// Main Program ////////////////////////
+
+  // private static final PrintStream out = System.out;
+  private static final PrintStream err = System.err;
+
+  /**
+   * Prints usage information about this program
+   */
+  private static void usage(String s) {
+    err.println("\n** " + s + "\n");
+    err.println("usage: java GenerateMBeanHTML xmlFile htmlFile");
+    err.println("");
+    err.println("Converts an MBeans description XML file into an HTML");
+    err.println("file suitable for documentation");
+
+    err.println("");
+
+    System.exit(1);
+  }
+
+  public static void main(String[] args) throws Exception {
+    String xmlFileName = null;
+    String htmlFileName = null;
+
+    for (int i = 0; i < args.length; i++) {
+      if (xmlFileName == null) {
+        xmlFileName = args[i];
+
+      } else if (htmlFileName == null) {
+        htmlFileName = args[i];
+
+      } else {
+        usage("Extraneous command line argument: " + args[i]);
+      }
+    }
+
+    if (xmlFileName == null) {
+      usage("Missing XML file name");
+
+    } else if (htmlFileName == null) {
+      usage("Missing HTML file name");
+    }
+
+    File xmlFile = new File(xmlFileName);
+    if (!xmlFile.exists()) {
+      usage("XML file \"" + xmlFile + "\" does not exist");
+    }
+
+    File htmlFile = new File(htmlFileName);
+    convert(new FileInputStream(xmlFile), new PrintWriter(new FileWriter(htmlFile), true));
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MBeanUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MBeanUtil.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MBeanUtil.java
new file mode 100755
index 0000000..bad36f0
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MBeanUtil.java
@@ -0,0 +1,765 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import java.net.URL;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.JMException;
+import javax.management.JMRuntimeException;
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.MBeanServerNotification;
+import javax.management.MalformedObjectNameException;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+import javax.management.timer.TimerMBean;
+
+import org.apache.commons.modeler.ManagedBean;
+import org.apache.commons.modeler.Registry;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.RuntimeAdminException;
+import org.apache.geode.internal.ClassPathLoader;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+
+/**
+ * Common support for MBeans and {@link ManagedResource}s. Static loading of this class creates the
+ * MBeanServer and Modeler Registry.
+ *
+ * @since GemFire 3.5
+ *
+ */
+public class MBeanUtil {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /** The default MBeanServer domain name is "GemFire" */
+  private static final String DEFAULT_DOMAIN = "GemFire";
+
+  /** MBean Name for refreshTimer */
+  private static String REFRESH_TIMER_NAME = DEFAULT_DOMAIN + ":type=RefreshTimer";
+
+  /* indicates whether the mbeanServer, registry & refreshTimer are started */
+  private static boolean isStarted;
+
+  /** The Commons-Modeler configuration registry for our managed beans */
+  private static Registry registry;
+
+  /** The <code>MBeanServer</code> for this application */
+  private static MBeanServer mbeanServer;
+
+  /** MBean name of the Timer which handles refresh notifications */
+  private static ObjectName refreshTimerObjectName;
+
+  /** Actual TimerMBean responsible for refresh notifications */
+  private static TimerMBean refreshTimer;
+
+  /**
+   * Map of ObjectNames to current timerNotificationIds
+   * <p>
+   * map: key=ObjectName, value=map: key=RefreshNotificationType, value=timerNotificationId
+   */
+  private static Map<NotificationListener, Map<RefreshNotificationType, Integer>> refreshClients =
+      new HashMap<NotificationListener, Map<RefreshNotificationType, Integer>>();
+
+  /** key=ObjectName, value=ManagedResource */
+  private final static Map<ObjectName, ManagedResource> managedResources =
+      new HashMap<ObjectName, ManagedResource>();
+
+  static {
+    try {
+      refreshTimerObjectName = ObjectName.getInstance(REFRESH_TIMER_NAME);
+    } catch (Exception e) {
+      logStackTrace(Level.ERROR, e);
+    }
+  }
+
+  /**
+   * Initializes Mbean Server, Registry, Refresh Timer & registers Server Notification Listener.
+   * 
+   * @return reference to the mbeanServer
+   */
+  static MBeanServer start() {
+    if (!isStarted) {
+      mbeanServer = createMBeanServer();
+      registry = createRegistry();
+
+      registerServerNotificationListener();
+      createRefreshTimer();
+      isStarted = true;
+    }
+
+    return mbeanServer;
+  }
+
+  /**
+   * Stops Registry, Refresh Timer. Releases Mbean Server after.
+   */
+  static void stop() {
+    if (isStarted) {
+      stopRefreshTimer();
+
+      registry.stop();
+      registry = null;
+      releaseMBeanServer();// makes mbeanServer null
+      isStarted = false;
+    }
+  }
+
+  /**
+   * Create and configure (if necessary) and return the <code>MBeanServer</code> with which we will
+   * be registering our <code>ModelMBean</code> implementations.
+   *
+   * @see javax.management.MBeanServer
+   */
+  static synchronized MBeanServer createMBeanServer() {
+    if (mbeanServer == null) {
+      mbeanServer = MBeanServerFactory.createMBeanServer(DEFAULT_DOMAIN);
+    }
+    return mbeanServer;
+  }
+
+  /**
+   * Create and configure (if necessary) and return the Commons-Modeler registry of managed object
+   * descriptions.
+   *
+   * @see org.apache.commons.modeler.Registry
+   */
+  static synchronized Registry createRegistry() {
+    if (registry == null) {
+      try {
+        registry = Registry.getRegistry(null, null);
+        if (mbeanServer == null) {
+          throw new IllegalStateException(
+              LocalizedStrings.MBeanUtil_MBEAN_SERVER_NOT_INITIALIZED_YET.toLocalizedString());
+        }
+        registry.setMBeanServer(mbeanServer);
+
+        String mbeansResource =
+            getOSPath("/org/apache/geode/internal/admin/api/jmx/mbeans-descriptors.xml");
+        // System.out.println(LocalizedStrings.MBeanUtil_LOADING_RESOURCE_0.toLocalizedString(mbeansResource));
+
+        URL url = ClassPathLoader.getLatest().getResource(MBeanUtil.class, mbeansResource);
+        raiseOnFailure(url != null, LocalizedStrings.MBeanUtil_FAILED_TO_FIND_0
+            .toLocalizedString(new Object[] {mbeansResource}));
+        registry.loadMetadata(url);
+
+        // simple test to make sure the xml was actually loaded and is valid...
+        String[] test = registry.findManagedBeans();
+        raiseOnFailure(test != null && test.length > 0, LocalizedStrings.MBeanUtil_FAILED_TO_LOAD_0
+            .toLocalizedString(new Object[] {mbeansResource}));
+      } catch (Exception e) {
+        logStackTrace(Level.WARN, e);
+        throw new RuntimeAdminException(
+            LocalizedStrings.MBeanUtil_FAILED_TO_GET_MBEAN_REGISTRY.toLocalizedString(), e);
+      }
+    }
+    return registry;
+  }
+
+  /**
+   * Creates and registers a <code>ModelMBean</code> for the specified <code>ManagedResource</code>.
+   * State changing callbacks into the <code>ManagedResource</code> will also be made.
+   *
+   * @param resource the ManagedResource to create a managing MBean for
+   *
+   * @return The object name of the newly-created MBean
+   *
+   * @see ManagedResource#setModelMBean
+   */
+  static ObjectName createMBean(ManagedResource resource) {
+    return createMBean(resource, lookupManagedBean(resource));
+  }
+
+  /**
+   * Creates and registers a <code>ModelMBean</code> for the specified <code>ManagedResource</code>.
+   * State changing callbacks into the <code>ManagedResource</code> will also be made.
+   *
+   * @param resource the ManagedResource to create a managing MBean for
+   * @param managed the ManagedBean definition to create the MBean with
+   * @see ManagedResource#setModelMBean
+   */
+  static ObjectName createMBean(ManagedResource resource, ManagedBean managed) {
+
+    try {
+      DynamicManagedBean mb = new DynamicManagedBean(managed);
+      resource.setModelMBean(mb.createMBean(resource));
+
+      // create the ObjectName and register the MBean...
+      final ObjectName objName;
+      try {
+        objName = ObjectName.getInstance(resource.getMBeanName());
+      } catch (MalformedObjectNameException e) {
+        throw new MalformedObjectNameException(LocalizedStrings.MBeanUtil_0_IN_1
+            .toLocalizedString(new Object[] {e.getMessage(), resource.getMBeanName()}));
+      }
+
+      synchronized (MBeanUtil.class) {
+        // Only register a bean once. Otherwise, you risk race
+        // conditions with things like the RMI connector accessing it.
+
+        if (mbeanServer != null && !mbeanServer.isRegistered(objName)) {
+          mbeanServer.registerMBean(resource.getModelMBean(), objName);
+          synchronized (managedResources) {
+            managedResources.put(objName, resource);
+          }
+        }
+      }
+      return objName;
+    } catch (java.lang.Exception e) {
+      throw new RuntimeAdminException(LocalizedStrings.MBeanUtil_FAILED_TO_CREATE_MBEAN_FOR_0
+          .toLocalizedString(new Object[] {resource.getMBeanName()}), e);
+    }
+  }
+
+  /**
+   * Ensures that an MBean is registered for the specified <code>ManagedResource</code>. If an MBean
+   * cannot be found in the <code>MBeanServer</code>, then this creates and registers a
+   * <code>ModelMBean</code>. State changing callbacks into the <code>ManagedResource</code> will
+   * also be made.
+   *
+   * @param resource the ManagedResource to create a managing MBean for
+   *
+   * @return The object name of the MBean that manages the ManagedResource
+   *
+   * @see ManagedResource#setModelMBean
+   */
+  static ObjectName ensureMBeanIsRegistered(ManagedResource resource) {
+    try {
+      ObjectName objName = ObjectName.getInstance(resource.getMBeanName());
+      synchronized (MBeanUtil.class) {
+        if (mbeanServer != null && !mbeanServer.isRegistered(objName)) {
+          return createMBean(resource);
+        }
+      }
+      raiseOnFailure(mbeanServer.isRegistered(objName),
+          LocalizedStrings.MBeanUtil_COULDNT_FIND_MBEAN_REGISTERED_WITH_OBJECTNAME_0
+              .toLocalizedString(new Object[] {objName.toString()}));
+      return objName;
+    } catch (java.lang.Exception e) {
+      throw new RuntimeAdminException(e);
+    }
+  }
+
+  /**
+   * Retrieves the <code>ManagedBean</code> configuration from the Registry for the specified
+   * <code>ManagedResource</code>
+   *
+   * @param resource the ManagedResource to find the configuration for
+   */
+  static ManagedBean lookupManagedBean(ManagedResource resource) {
+    // find the registry defn for our MBean...
+    ManagedBean managed = null;
+    if (registry != null) {
+      managed = registry.findManagedBean(resource.getManagedResourceType().getClassTypeName());
+    } else {
+      throw new IllegalArgumentException(
+          LocalizedStrings.MBeanUtil_MANAGEDBEAN_IS_NULL.toLocalizedString());
+    }
+
+    if (managed == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.MBeanUtil_MANAGEDBEAN_IS_NULL.toLocalizedString());
+    }
+
+    // customize the defn...
+    managed.setClassName("MX4JModelMBean");
+
+    return managed;
+  }
+
+  /**
+   * Registers a refresh notification for the specified client MBean. Specifying zero for the
+   * refreshInterval disables notification for the refresh client. Note: this does not currently
+   * support remote connections.
+   *
+   * @param client client to listen for refresh notifications
+   * @param userData userData to register with the Notification
+   * @param type refresh notification type the client will use
+   * @param refreshInterval the seconds between refreshes
+   */
+  static void registerRefreshNotification(NotificationListener client, Object userData,
+      RefreshNotificationType type, int refreshInterval) {
+    if (client == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.MBeanUtil_NOTIFICATIONLISTENER_IS_REQUIRED.toLocalizedString());
+    }
+    if (type == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.MBeanUtil_REFRESHNOTIFICATIONTYPE_IS_REQUIRED.toLocalizedString());
+    }
+    if (refreshTimerObjectName == null || refreshTimer == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.MBeanUtil_REFRESHTIMER_HAS_NOT_BEEN_PROPERLY_INITIALIZED
+              .toLocalizedString());
+    }
+
+    try {
+      // get the notifications for the specified client...
+      Map<RefreshNotificationType, Integer> notifications = null;
+      synchronized (refreshClients) {
+        notifications = (Map<RefreshNotificationType, Integer>) refreshClients.get(client);
+      }
+
+      if (notifications == null) {
+        // If refreshInterval is being set to zero and notifications is removed return
+        if (refreshInterval <= 0) {
+          return;
+        }
+
+        // never registered before, so add client...
+        notifications = new HashMap<RefreshNotificationType, Integer>();
+        synchronized (refreshClients) {
+          refreshClients.put(client, notifications);
+        }
+        validateRefreshTimer();
+        try {
+          // register client as a listener with MBeanServer...
+          mbeanServer.addNotificationListener(refreshTimerObjectName, // timer to listen to
+              client, // the NotificationListener object
+              null, // optional NotificationFilter TODO: convert to using
+              new Object() // not used but null throws IllegalArgumentException
+          );
+        } catch (InstanceNotFoundException e) {
+          // should not happen since we already checked refreshTimerObjectName
+          logStackTrace(Level.WARN, e,
+              LocalizedStrings.MBeanUtil_COULD_NOT_FIND_REGISTERED_REFRESHTIMER_INSTANCE
+                  .toLocalizedString());
+        }
+      }
+
+      // TODO: change to manipulating timer indirectly thru mserver...
+
+      // check for pre-existing refresh notification entry...
+      Integer timerNotificationId = (Integer) notifications.get(type);
+      if (timerNotificationId != null) {
+        try {
+          // found one, so let's remove it...
+          refreshTimer.removeNotification(timerNotificationId);
+        } catch (InstanceNotFoundException e) {
+          // that's ok cause we just wanted to remove it anyway
+        } finally {
+          // null out the map entry for that notification type...
+          notifications.put(type, null);
+        }
+      }
+
+      if (refreshInterval > 0) {
+        // add notification to the refresh timer...
+        timerNotificationId = refreshTimer.addNotification(type.getType(), // type
+            type.getMessage(), // message = "refresh"
+            userData, // userData
+            new Date(System.currentTimeMillis() + refreshInterval * 1000), // first occurence
+            refreshInterval * 1000); // period to repeat
+
+        // put an entry into the map for the listener...
+        notifications.put(type, timerNotificationId);
+      } else {
+        // do nothing! refreshInterval must be over 0 to do anything...
+      }
+    } catch (java.lang.RuntimeException e) {
+      logStackTrace(Level.WARN, e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (java.lang.Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      logStackTrace(Level.ERROR, e);
+      throw e;
+    }
+  }
+
+  /**
+   * Verifies a refresh notification for the specified client MBean. If notification is not
+   * registered, then returns a false
+   *
+   * @param client client to listen for refresh notifications
+   * @param type refresh notification type the client will use
+   *
+   * @return isRegistered boolean indicating if a notification is registered
+   */
+  static boolean isRefreshNotificationRegistered(NotificationListener client,
+      RefreshNotificationType type) {
+    boolean isRegistered = false;
+
+    // get the notifications for the specified client...
+    Map<RefreshNotificationType, Integer> notifications = null;
+    synchronized (refreshClients) {
+      notifications = (Map<RefreshNotificationType, Integer>) refreshClients.get(client);
+    }
+
+    // never registered before if null ...
+    if (notifications != null) {
+      // check for pre-existing refresh notification entry...
+      Integer timerNotificationId = notifications.get(type);
+      if (timerNotificationId != null) {
+        isRegistered = true;
+      }
+    }
+
+    return isRegistered;
+  }
+
+  /**
+   * Validates refreshTimer has been registered without problems and attempts to re-register if
+   * there is a problem.
+   */
+  static void validateRefreshTimer() {
+    if (refreshTimerObjectName == null || refreshTimer == null) {
+      // if (refreshTimerObjectName == null) System.out.println("refreshTimerObjectName is null");
+      // if (refreshTimer == null) System.out.println("refreshTimer is null");
+      // System.out.println("[validateRefreshTimer] createRefreshTimer");
+      createRefreshTimer();
+    }
+
+    raiseOnFailure(refreshTimer != null, "Failed to validate Refresh Timer");
+
+    if (mbeanServer != null && !mbeanServer.isRegistered(refreshTimerObjectName)) {
+      // System.out.println("[validateRefreshTimer] registerMBean");
+      try {
+        mbeanServer.registerMBean(refreshTimer, refreshTimerObjectName);
+      } catch (JMException e) {
+        logStackTrace(Level.WARN, e);
+      } catch (JMRuntimeException e) {
+        logStackTrace(Level.WARN, e);
+      }
+    }
+  }
+
+  /**
+   * Initializes the timer for sending refresh notifications.
+   */
+  static void createRefreshTimer() {
+    try {
+      refreshTimer = new javax.management.timer.Timer();
+      mbeanServer.registerMBean(refreshTimer, refreshTimerObjectName);
+
+      refreshTimer.start();
+    } catch (JMException e) {
+      logStackTrace(Level.WARN, e,
+          LocalizedStrings.MBeanUtil_FAILED_TO_CREATE_REFRESH_TIMER.toLocalizedString());
+    } catch (JMRuntimeException e) {
+      logStackTrace(Level.WARN, e,
+          LocalizedStrings.MBeanUtil_FAILED_TO_CREATE_REFRESH_TIMER.toLocalizedString());
+    } catch (Exception e) {
+      logStackTrace(Level.WARN, e,
+          LocalizedStrings.MBeanUtil_FAILED_TO_CREATE_REFRESH_TIMER.toLocalizedString());
+    }
+  }
+
+  /**
+   * Initializes the timer for sending refresh notifications.
+   */
+  static void stopRefreshTimer() {
+    try {
+      if (refreshTimer != null && mbeanServer != null) {
+        mbeanServer.unregisterMBean(refreshTimerObjectName);
+
+        refreshTimer.stop();
+      }
+    } catch (JMException e) {
+      logStackTrace(Level.WARN, e);
+    } catch (JMRuntimeException e) {
+      logStackTrace(Level.WARN, e);
+    } catch (Exception e) {
+      logStackTrace(Level.DEBUG, e, "Failed to stop refresh timer for MBeanUtil");
+    }
+  }
+
+  /**
+   * Return a String that been modified to be compliant as a property of an ObjectName.
+   * <p>
+   * The property name of an ObjectName may not contain any of the following characters: <b><i>: , =
+   * * ?</i></b>
+   * <p>
+   * This method will replace the above non-compliant characters with a dash: <b><i>-</i></b>
+   * <p>
+   * If value is empty, this method will return the string "nothing".
+   * <p>
+   * Note: this is <code>public</code> because certain tests call this from outside of the package.
+   * TODO: clean this up
+   *
+   * @param value the potentially non-compliant ObjectName property
+   * @return the value modified to be compliant as an ObjectName property
+   */
+  public static String makeCompliantMBeanNameProperty(String value) {
+    value = value.replace(':', '-');
+    value = value.replace(',', '-');
+    value = value.replace('=', '-');
+    value = value.replace('*', '-');
+    value = value.replace('?', '-');
+    if (value.length() < 1) {
+      value = "nothing";
+    }
+    return value;
+  }
+
+  /**
+   * Unregisters all GemFire MBeans and then releases the MBeanServer for garbage collection.
+   */
+  static void releaseMBeanServer() {
+    try {
+      // unregister all GemFire mbeans...
+      Iterator iter = mbeanServer.queryNames(null, null).iterator();
+      while (iter.hasNext()) {
+        ObjectName name = (ObjectName) iter.next();
+        if (name.getDomain().startsWith(DEFAULT_DOMAIN)) {
+          unregisterMBean(name);
+        }
+      }
+
+      // last, release the mbean server...
+      MBeanServerFactory.releaseMBeanServer(mbeanServer);
+      mbeanServer = null;
+    } catch (JMRuntimeException e) {
+      logStackTrace(Level.WARN, e);
+    }
+    /*
+     * See #42391. Cleaning up the static maps which might be still holding references to
+     * ManagedResources
+     */
+    synchronized (MBeanUtil.managedResources) {
+      MBeanUtil.managedResources.clear();
+    }
+    synchronized (refreshClients) {
+      refreshClients.clear();
+    }
+    /*
+     * See #42391. Cleaning up the static maps which might be still holding references to
+     * ManagedResources
+     */
+    synchronized (MBeanUtil.managedResources) {
+      MBeanUtil.managedResources.clear();
+    }
+    synchronized (refreshClients) {
+      refreshClients.clear();
+    }
+  }
+
+  /**
+   * Returns true if a MBean with given ObjectName is registered.
+   * 
+   * @param objectName ObjectName to use for checking if MBean is registered
+   * @return true if MBeanServer is not null & MBean with given ObjectName is registered with the
+   *         MBeanServer
+   */
+  static boolean isRegistered(ObjectName objectName) {
+    return mbeanServer != null && mbeanServer.isRegistered(objectName);
+  }
+
+  /**
+   * Unregisters the identified MBean if it's registered.
+   */
+  static void unregisterMBean(ObjectName objectName) {
+    try {
+      if (mbeanServer != null && mbeanServer.isRegistered(objectName)) {
+        mbeanServer.unregisterMBean(objectName);
+      }
+    } catch (MBeanRegistrationException e) {
+      logStackTrace(Level.WARN, null,
+          LocalizedStrings.MBeanUtil_FAILED_WHILE_UNREGISTERING_MBEAN_WITH_OBJECTNAME_0
+              .toLocalizedString(new Object[] {objectName}));
+    } catch (InstanceNotFoundException e) {
+      logStackTrace(Level.WARN, null,
+          LocalizedStrings.MBeanUtil_WHILE_UNREGISTERING_COULDNT_FIND_MBEAN_WITH_OBJECTNAME_0
+              .toLocalizedString(new Object[] {objectName}));
+    } catch (JMRuntimeException e) {
+      logStackTrace(Level.WARN, null,
+          LocalizedStrings.MBeanUtil_COULD_NOT_UNREGISTER_MBEAN_WITH_OBJECTNAME_0
+              .toLocalizedString(new Object[] {objectName}));
+    }
+  }
+
+  static void unregisterMBean(ManagedResource resource) {
+    if (resource != null) {
+      unregisterMBean(resource.getObjectName());
+
+      // call cleanup on managedResource here and not rely on listener
+      // since it is possible that notification listener not deliver
+      // all notifications of un-registration. If resource is
+      // cleaned here, another call from the listener should be as good as a no-op
+      cleanupResource(resource);
+    }
+  }
+
+  // cleanup resource
+  private static void cleanupResource(ManagedResource resource) {
+    synchronized (MBeanUtil.managedResources) {
+      MBeanUtil.managedResources.remove(resource.getObjectName());
+    }
+    resource.cleanupResource();
+
+    // get the notifications for the specified client...
+    Map<RefreshNotificationType, Integer> notifications = null;
+    synchronized (refreshClients) {
+      notifications = (Map<RefreshNotificationType, Integer>) refreshClients.remove(resource);
+    }
+
+    // never registered before if null ...
+    // Also as of current, there is ever only 1 Notification type per
+    // MBean, so we do need need a while loop here
+    if (notifications != null) {
+
+      // Fix for findbugs reported inefficiency with keySet().
+      Set<Map.Entry<RefreshNotificationType, Integer>> entries = notifications.entrySet();
+
+      for (Map.Entry<RefreshNotificationType, Integer> e : entries) {
+        Integer timerNotificationId = e.getValue();
+        if (null != timerNotificationId) {
+          try {
+            // found one, so let's remove it...
+            refreshTimer.removeNotification(timerNotificationId);
+          } catch (InstanceNotFoundException xptn) {
+            // that's ok cause we just wanted to remove it anyway
+            logStackTrace(Level.DEBUG, xptn);
+          }
+        }
+      }
+
+      try {
+        if (mbeanServer != null && mbeanServer.isRegistered(refreshTimerObjectName)) {
+          // remove client as a listener with MBeanServer...
+          mbeanServer.removeNotificationListener(refreshTimerObjectName, // timer to listen to
+              (NotificationListener) resource // the NotificationListener object
+          );
+        }
+      } catch (ListenerNotFoundException xptn) {
+        // should not happen since we already checked refreshTimerObjectName
+        logStackTrace(Level.WARN, null, xptn.getMessage());
+      } catch (InstanceNotFoundException xptn) {
+        // should not happen since we already checked refreshTimerObjectName
+        logStackTrace(Level.WARN, null,
+            LocalizedStrings.MBeanUtil_WHILE_UNREGISTERING_COULDNT_FIND_MBEAN_WITH_OBJECTNAME_0
+                .toLocalizedString(new Object[] {refreshTimerObjectName}));
+      }
+    }
+  }
+
+  // ----- borrowed the following from RemoteCommand -----
+  /** Translates the path between Windows and UNIX. */
+  static String getOSPath(String path) {
+    if (pathIsWindows(path)) {
+      return path.replace('/', '\\');
+    } else {
+      return path.replace('\\', '/');
+    }
+  }
+
+  /** Returns true if the path is on Windows. */
+  static boolean pathIsWindows(String path) {
+    if (path != null && path.length() > 1) {
+      return (Character.isLetter(path.charAt(0)) && path.charAt(1) == ':')
+          || (path.startsWith("//") || path.startsWith("\\\\"));
+    }
+    return false;
+  }
+
+  static void registerServerNotificationListener() {
+    if (mbeanServer == null) {
+      return;
+    }
+    try {
+      // the MBeanServerDelegate name is spec'ed as the following...
+      ObjectName delegate = ObjectName.getInstance("JMImplementation:type=MBeanServerDelegate");
+      mbeanServer.addNotificationListener(delegate, new NotificationListener() {
+        public void handleNotification(Notification notification, Object handback) {
+          MBeanServerNotification serverNotification = (MBeanServerNotification) notification;
+          if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION
+              .equals(serverNotification.getType())) {
+            ObjectName objectName = serverNotification.getMBeanName();
+            synchronized (MBeanUtil.managedResources) {
+              Object entry = MBeanUtil.managedResources.get(objectName);
+              if (entry == null)
+                return;
+              if (!(entry instanceof ManagedResource)) {
+                throw new ClassCastException(LocalizedStrings.MBeanUtil_0_IS_NOT_A_MANAGEDRESOURCE
+                    .toLocalizedString(new Object[] {entry.getClass().getName()}));
+              }
+              ManagedResource resource = (ManagedResource) entry;
+              {
+                // call cleanup on managedResource
+                cleanupResource(resource);
+              }
+            }
+          }
+        }
+      }, null, null);
+    } catch (JMException e) {
+      logStackTrace(Level.WARN, e,
+          LocalizedStrings.MBeanUtil_FAILED_TO_REGISTER_SERVERNOTIFICATIONLISTENER
+              .toLocalizedString());
+    } catch (JMRuntimeException e) {
+      logStackTrace(Level.WARN, e,
+          LocalizedStrings.MBeanUtil_FAILED_TO_REGISTER_SERVERNOTIFICATIONLISTENER
+              .toLocalizedString());
+    }
+  }
+
+  /**
+   * Logs the stack trace for the given Throwable if logger is initialized else prints the stack
+   * trace using System.out.
+   * 
+   * @param level severity level to log at
+   * @param throwable Throwable to log stack trace for
+   */
+  public static void logStackTrace(Level level, Throwable throwable) {
+    logStackTrace(level, throwable, null);
+  }
+
+  /**
+   * Logs the stack trace for the given Throwable if logger is initialized else prints the stack
+   * trace using System.out.
+   * 
+   * @param level severity level to log at
+   * @param throwable Throwable to log stack trace for
+   * @param message user friendly error message to show
+   */
+  public static void logStackTrace(Level level, Throwable throwable, String message) {
+    logger.log(level, message, throwable);
+  }
+
+  /**
+   * Raises RuntimeAdminException with given 'message' if given 'condition' is false.
+   * 
+   * @param condition condition to evaluate
+   * @param message failure message
+   */
+  private static void raiseOnFailure(boolean condition, String message) {
+    if (!condition) {
+      throw new RuntimeAdminException(message);
+    }
+  }
+}
+


[48/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java b/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java
deleted file mode 100644
index 19f89b2..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/RegionSubRegionSnapshot.java
+++ /dev/null
@@ -1,183 +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.admin;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.geode.DataSerializable;
-import org.apache.geode.DataSerializer;
-import org.apache.geode.cache.Region;
-import org.apache.geode.i18n.LogWriterI18n;
-import org.apache.geode.internal.cache.PartitionedRegion;
-
-/**
- * Class <code>RegionSubRegionSnapshot</code> provides information about <code>Region</code>s. This
- * also provides the information about sub regions This class is used by the monitoring tool.
- * 
- * 
- * @since GemFire 5.7
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class RegionSubRegionSnapshot implements DataSerializable {
-  private static final long serialVersionUID = -8052137675270041871L;
-
-  public RegionSubRegionSnapshot() {
-    this.parent = null;
-    this.subRegionSnapshots = new HashSet();
-  }
-
-  public RegionSubRegionSnapshot(Region reg) {
-    this();
-    this.name = reg.getName();
-    if (reg instanceof PartitionedRegion) {
-      PartitionedRegion p_reg = (PartitionedRegion) reg;
-      this.entryCount = p_reg.entryCount(true);
-    } else {
-      this.entryCount = reg.entrySet().size();
-    }
-    final LogWriterI18n logger = reg.getCache().getLoggerI18n();
-    if ((logger != null) && logger.fineEnabled()) {
-      logger.fine("RegionSubRegionSnapshot Region entry count =" + this.entryCount + " for region ="
-          + this.name);
-    }
-  }
-
-  /**
-   * add the snapshot of sub region
-   * 
-   * @param snap snapshot of sub region
-   * @return true if operation is successful
-   */
-  public boolean addSubRegion(RegionSubRegionSnapshot snap) {
-    if (subRegionSnapshots.contains(snap)) {
-      return true;
-    }
-
-    if (subRegionSnapshots.add(snap)) {
-      snap.setParent(this);
-      return true;
-    }
-
-    return false;
-  }
-
-  /**
-   * @return get entry count of region
-   */
-  public final int getEntryCount() {
-    return entryCount;
-  }
-
-  /**
-   * @param entryCount entry count of region
-   */
-  public final void setEntryCount(int entryCount) {
-    this.entryCount = entryCount;
-  }
-
-  /**
-   * @return name of region
-   */
-  public final String getName() {
-    return name;
-  }
-
-  /**
-   * @param name name of region
-   */
-  public final void setName(String name) {
-    this.name = name;
-  }
-
-  /**
-   * @return subRegionSnapshots of all the sub regions
-   */
-  public final Set getSubRegionSnapshots() {
-    return subRegionSnapshots;
-  }
-
-  /**
-   * @param subRegionSnapshots subRegionSnapshots of all the sub regions
-   */
-  public final void setSubRegionSnapshots(Set subRegionSnapshots) {
-    this.subRegionSnapshots = subRegionSnapshots;
-  }
-
-  /**
-   * @return snapshot of parent region
-   */
-  public final RegionSubRegionSnapshot getParent() {
-    return parent;
-  }
-
-  /**
-   * @param parent snapshot of parent region
-   */
-  public final void setParent(RegionSubRegionSnapshot parent) {
-    this.parent = parent;
-  }
-
-  /**
-   * 
-   * @return full path of region
-   */
-  public String getFullPath() {
-    return (getParent() == null ? "/" : getParent().getFullPath()) + getName() + "/";
-  }
-
-  public void toData(DataOutput out) throws IOException {
-    DataSerializer.writeString(this.name, out);
-    out.writeInt(this.entryCount);
-    DataSerializer.writeHashSet((HashSet) this.subRegionSnapshots, out);
-  }
-
-  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
-    this.name = DataSerializer.readString(in);
-    this.entryCount = in.readInt();
-    this.subRegionSnapshots = DataSerializer.readHashSet(in);
-    for (Iterator iter = this.subRegionSnapshots.iterator(); iter.hasNext();) {
-      ((RegionSubRegionSnapshot) iter.next()).setParent(this);
-    }
-  }
-
-  @Override
-  public String toString() {
-    String toStr = "RegionSnapshot [" + "path=" + this.getFullPath() + ",parent="
-        + (this.parent == null ? "null" : this.parent.name) + ", entryCount=" + this.entryCount
-        + ", subRegionCount=" + this.subRegionSnapshots.size() + "<<";
-
-    for (Iterator iter = subRegionSnapshots.iterator(); iter.hasNext();) {
-      toStr = toStr + ((RegionSubRegionSnapshot) iter.next()).getName() + ", ";
-    }
-
-    toStr = toStr + ">>" + "]";
-    return toStr;
-  }
-
-  protected String name;
-
-  protected int entryCount;
-
-  protected RegionSubRegionSnapshot parent;
-
-  protected Set subRegionSnapshots;
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/RuntimeAdminException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/RuntimeAdminException.java b/geode-core/src/main/java/org/apache/geode/admin/RuntimeAdminException.java
deleted file mode 100755
index 359033b..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/RuntimeAdminException.java
+++ /dev/null
@@ -1,48 +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.admin;
-
-/**
- * A <code>RuntimeAdminException</code> is thrown when a runtime errors occurs during administration
- * or monitoring of GemFire.
- *
- * @since GemFire 3.5
- *
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class RuntimeAdminException extends org.apache.geode.GemFireException {
-
-  private static final long serialVersionUID = -7512771113818634005L;
-
-  public RuntimeAdminException() {
-    super();
-  }
-
-  public RuntimeAdminException(String message) {
-    super(message);
-  }
-
-  public RuntimeAdminException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  public RuntimeAdminException(Throwable cause) {
-    super(cause);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/Statistic.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/Statistic.java b/geode-core/src/main/java/org/apache/geode/admin/Statistic.java
deleted file mode 100755
index 428281a..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/Statistic.java
+++ /dev/null
@@ -1,64 +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.admin;
-
-/**
- * Interface to represent a single statistic of a <code>StatisticResource</code>
- *
- * @since GemFire 3.5
- *
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface Statistic extends java.io.Serializable {
-
-  /**
-   * Gets the identifying name of this statistic.
-   *
-   * @return the identifying name of this statistic
-   */
-  public String getName();
-
-  /**
-   * Gets the value of this statistic as a <code>java.lang.Number</code>.
-   *
-   * @return the value of this statistic
-   */
-  public Number getValue();
-
-  /**
-   * Gets the unit of measurement (if any) this statistic represents.
-   *
-   * @return the unit of measurement (if any) this statistic represents
-   */
-  public String getUnits();
-
-  /**
-   * Returns true if this statistic represents a numeric value which always increases.
-   *
-   * @return true if this statistic represents a value which always increases
-   */
-  public boolean isCounter();
-
-  /**
-   * Gets the full description of this statistic.
-   *
-   * @return the full description of this statistic
-   */
-  public String getDescription();
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/StatisticResource.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/StatisticResource.java b/geode-core/src/main/java/org/apache/geode/admin/StatisticResource.java
deleted file mode 100755
index 1300c6a..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/StatisticResource.java
+++ /dev/null
@@ -1,82 +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.admin;
-
-/**
- * Adminitrative interface for monitoring a statistic resource in a GemFire system member. A
- * resource is comprised of one or many <code>Statistics</code>.
- *
- * @since GemFire 3.5
- *
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface StatisticResource {
-
-  /**
-   * Gets the identifying name of this resource.
-   *
-   * @return the identifying name of this resource
-   */
-  public String getName();
-
-  /**
-   * Gets the full description of this resource.
-   *
-   * @return the full description of this resource
-   */
-  public String getDescription();
-
-  /**
-   * Gets the classification type of this resource.
-   *
-   * @return the classification type of this resource
-   * @since GemFire 5.0
-   */
-  public String getType();
-
-  /**
-   * Returns a display string of the {@link SystemMember} owning this resource.
-   *
-   * @return a display string of the owning {@link SystemMember}
-   */
-  public String getOwner();
-
-  /**
-   * Returns an ID that uniquely identifies the resource within the {@link SystemMember} it belongs
-   * to.
-   *
-   * @return unique id within the owning {@link SystemMember}
-   */
-  public long getUniqueId();
-
-  /**
-   * Returns a read-only array of every {@link Statistic} in this resource.
-   *
-   * @return read-only array of every {@link Statistic} in this resource
-   */
-  public Statistic[] getStatistics();
-
-  /**
-   * Refreshes the values of every {@link Statistic} in this resource by retrieving them from the
-   * member's VM.
-   *
-   * @throws org.apache.geode.admin.AdminException if unable to refresh statistic values
-   */
-  public void refresh() throws org.apache.geode.admin.AdminException;
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/SystemMember.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMember.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMember.java
deleted file mode 100755
index ffd3f06..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/SystemMember.java
+++ /dev/null
@@ -1,145 +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.admin;
-
-import org.apache.geode.distributed.DistributedMember;
-
-import java.net.InetAddress;
-
-/**
- * Administrative interface for monitoring a GemFire system member.
- *
- * @since GemFire 3.5
- *
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface SystemMember {
-
-  /** Gets the {@link AdminDistributedSystem} this member belongs to. */
-  public AdminDistributedSystem getDistributedSystem();
-
-  /**
-   * Gets identifying name of this member. For applications this is the string form of
-   * {@link #getDistributedMember}. For cache servers it is a unique cache server string.
-   */
-  public String getId();
-
-  /**
-   * Retrieves display friendly name for this member. If this member defined an optional name for
-   * its connection to the distributed system, that name will be returned. Otherwise the returned
-   * value will be {@link org.apache.geode.admin.SystemMember#getId}.
-   *
-   * @see org.apache.geode.distributed.DistributedSystem#connect
-   * @see org.apache.geode.distributed.DistributedSystem#getName
-   */
-  public String getName();
-
-  /** Gets the type of {@link SystemMemberType} this member is. */
-  public SystemMemberType getType();
-
-  /** Gets host name of the machine this member resides on. */
-  public String getHost();
-
-  /** Gets the host of this member as an <code>java.net.InetAddress<code>. */
-  public InetAddress getHostAddress();
-
-  /** Retrieves the log for this member. */
-  public String getLog();
-
-  /**
-   * Returns the GemFire license this member is using.
-   *
-   * @deprecated Removed licensing in 8.0.
-   */
-  @Deprecated
-  public java.util.Properties getLicense();
-
-  /** Returns this member's GemFire version information. */
-  public String getVersion();
-
-  /**
-   * Gets the configuration parameters for this member.
-   */
-  public ConfigurationParameter[] getConfiguration();
-
-  /**
-   * Sets the configuration of this member. The argument is an array of any and all configuration
-   * parameters that are to be updated in the member.
-   * <p>
-   * The entire array of configuration parameters is then returned.
-   *
-   * @param parms subset of the configuration parameters to be changed
-   * @return all configuration parameters including those that were changed
-   * @throws org.apache.geode.admin.AdminException if this fails to make the configuration changes
-   */
-  public ConfigurationParameter[] setConfiguration(ConfigurationParameter[] parms)
-      throws org.apache.geode.admin.AdminException;
-
-  /** Refreshes this member's configuration from the member or it's properties */
-  public void refreshConfig() throws org.apache.geode.admin.AdminException;
-
-  /**
-   * Retrieves this members statistic resources. If the member is not running then an empty array is
-   * returned.
-   *
-   * @param statisticsTypeName String ame of the Statistics Type
-   * @return array of runtime statistic resources owned by this member
-   * @since GemFire 5.7
-   */
-  public StatisticResource[] getStat(String statisticsTypeName)
-      throws org.apache.geode.admin.AdminException;
-
-  /**
-   * Retrieves this members statistic resources. If the member is not running then an empty array is
-   * returned. All Stats are returned
-   *
-   * @return array of runtime statistic resources owned by this member
-   */
-  public StatisticResource[] getStats() throws org.apache.geode.admin.AdminException;
-
-  /**
-   * Returns whether or not this system member hosts a GemFire {@link org.apache.geode.cache.Cache
-   * Cache}.
-   *
-   * @see #getCache
-   */
-  public boolean hasCache() throws org.apache.geode.admin.AdminException;
-
-  /**
-   * Returns an object that provides admin access to this member's cache. If the member currently
-   * has no cache then <code>null</code> is returned.
-   */
-  public SystemMemberCache getCache() throws org.apache.geode.admin.AdminException;
-
-  /**
-   * Returns the names of the membership roles filled by this member.
-   *
-   * @return array of string membership role names
-   * @since GemFire 5.0
-   */
-  public String[] getRoles();
-
-  /**
-   * Returns the {@link org.apache.geode.distributed.DistributedMember} that represents this system
-   * member.
-   *
-   * @return DistributedMember instance representing this system member
-   * @since GemFire 5.0
-   */
-  public DistributedMember getDistributedMember();
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/SystemMemberBridgeServer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberBridgeServer.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberBridgeServer.java
deleted file mode 100644
index 7a1fb1a..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberBridgeServer.java
+++ /dev/null
@@ -1,307 +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.admin;
-
-import org.apache.geode.cache.server.ServerLoadProbe;
-
-/**
- * Administrative interface that represents a CacheServer that serves the contents of a system
- * member's cache.
- *
- * @see SystemMemberCache#addCacheServer
- *
- * @since GemFire 4.0
- * @deprecated as of 5.7 use {@link SystemMemberCacheServer} instead.
- */
-@Deprecated
-public interface SystemMemberBridgeServer {
-
-  /**
-   * Returns the port on which this bridge server listens for bridge clients to connect.
-   */
-  public int getPort();
-
-  /**
-   * Sets the port on which this bridge server listens for bridge clients to connect.
-   *
-   * @throws AdminException If this bridge server is running
-   */
-  public void setPort(int port) throws AdminException;
-
-  /**
-   * Starts this bridge server. Once the server is running, its configuration cannot be changed.
-   *
-   * @throws AdminException If an error occurs while starting the bridge server
-   */
-  public void start() throws AdminException;
-
-  /**
-   * Returns whether or not this bridge server is running
-   */
-  public boolean isRunning();
-
-  /**
-   * Stops this bridge server. Note that the <code>BridgeServer</code> can be reconfigured and
-   * restarted if desired.
-   */
-  public void stop() throws AdminException;
-
-  /**
-   * Updates the information about this bridge server.
-   */
-  public void refresh();
-
-  /**
-   * Returns a string representing the ip address or host name that this server will listen on.
-   * 
-   * @return the ip address or host name that this server is to listen on
-   * @since GemFire 5.7
-   */
-  public String getBindAddress();
-
-  /**
-   * Sets the ip address or host name that this server is to listen on for client connections.
-   * <p>
-   * Setting a specific bind address will cause the bridge server to always use this address and
-   * ignore any address specified by "server-bind-address" or "bind-address" in the
-   * <code>gemfire.properties</code> file (see
-   * {@link org.apache.geode.distributed.DistributedSystem} for a description of these properties).
-   * <p>
-   * A <code>null</code> value will be treated the same as the default "".
-   * <p>
-   * The default value does not override the gemfire.properties. If you wish to override the
-   * properties and want to have your server bind to all local addresses then use this string
-   * <code>"0.0.0.0"</code>.
-   * 
-   * @param address the ip address or host name that this server is to listen on
-   * @throws AdminException if this bridge server is running
-   * @since GemFire 5.7
-   */
-  public void setBindAddress(String address) throws AdminException;
-
-  /**
-   * Returns a string representing the ip address or host name that server locators will tell
-   * clients that this server is listening on.
-   * 
-   * @return the ip address or host name to give to clients so they can connect to this server
-   * @since GemFire 5.7
-   */
-  public String getHostnameForClients();
-
-  /**
-   * Sets the ip address or host name that this server is to listen on for client connections.
-   * <p>
-   * Setting a specific hostname-for-clients will cause server locators to use this value when
-   * telling clients how to connect to this server.
-   * <p>
-   * The default value causes the bind-address to be given to clients
-   * <p>
-   * A <code>null</code> value will be treated the same as the default "".
-   * 
-   * @param name the ip address or host name that will be given to clients so they can connect to
-   *        this server
-   * @throws AdminException if this bridge server is running
-   * @since GemFire 5.7
-   */
-  public void setHostnameForClients(String name) throws AdminException;
-
-  /**
-   * Sets whether or not this bridge server should notify clients based on key subscription.
-   *
-   * If false, then an update to any key on the server causes an update to be sent to all clients.
-   * This update does not push the actual data to the clients. Instead, it causes the client to
-   * locally invalidate or destroy the corresponding entry. The next time the client requests the
-   * key, it goes to the bridge server for the value.
-   *
-   * If true, then an update to any key on the server causes an update to be sent to only those
-   * clients who have registered interest in that key. Other clients are not notified of the change.
-   * In addition, the actual value is pushed to the client. The client does not need to request the
-   * new value from the bridge server.
-   * 
-   * @throws AdminException if this bridge server is running
-   * @since GemFire 5.7
-   */
-  public void setNotifyBySubscription(boolean b) throws AdminException;
-
-  /**
-   * Answers whether or not this bridge server should notify clients based on key subscription.
-   * 
-   * @since GemFire 5.7
-   */
-  public boolean getNotifyBySubscription();
-
-  /**
-   * Sets the buffer size in bytes of the socket connection for this <code>BridgeServer</code>. The
-   * default is 32768 bytes.
-   *
-   * @param socketBufferSize The size in bytes of the socket buffer
-   * @throws AdminException if this bridge server is running
-   * @since GemFire 5.7
-   */
-  public void setSocketBufferSize(int socketBufferSize) throws AdminException;
-
-  /**
-   * Returns the configured buffer size of the socket connection for this <code>BridgeServer</code>.
-   * The default is 32768 bytes.
-   * 
-   * @return the configured buffer size of the socket connection for this <code>BridgeServer</code>
-   * @since GemFire 5.7
-   */
-  public int getSocketBufferSize();
-
-  /**
-   * Sets the maximum amount of time between client pings. This value is used by the
-   * <code>ClientHealthMonitor</code> to determine the health of this <code>BridgeServer</code>'s
-   * clients. The default is 60000 ms.
-   *
-   * @param maximumTimeBetweenPings The maximum amount of time between client pings
-   * @throws AdminException if this bridge server is running
-   * @since GemFire 5.7
-   */
-  public void setMaximumTimeBetweenPings(int maximumTimeBetweenPings) throws AdminException;
-
-  /**
-   * Returns the maximum amount of time between client pings. This value is used by the
-   * <code>ClientHealthMonitor</code> to determine the health of this <code>BridgeServer</code>'s
-   * clients. The default is 60000 ms.
-   * 
-   * @return the maximum amount of time between client pings.
-   * @since GemFire 5.7
-   */
-  public int getMaximumTimeBetweenPings();
-
-  /**
-   * Returns the maximum allowed client connections
-   * 
-   * @since GemFire 5.7
-   */
-  public int getMaxConnections();
-
-  /**
-   * Sets the maxium number of client connections allowed. When the maximum is reached the server
-   * will stop accepting connections.
-   * 
-   * @throws AdminException if this bridge server is running
-   * @since GemFire 5.7
-   */
-  public void setMaxConnections(int maxCons) throws AdminException;
-
-  /**
-   * Returns the maxium number of threads allowed in this server to service client requests. The
-   * default of <code>0</code> causes the server to dedicate a thread for every client connection.
-   * 
-   * @since GemFire 5.7
-   */
-  public int getMaxThreads();
-
-  /**
-   * Sets the maxium number of threads allowed in this server to service client requests. The
-   * default of <code>0</code> causes the server to dedicate a thread for every client connection.
-   * 
-   * @throws AdminException if this bridge server is running
-   * @since GemFire 5.7
-   */
-  public void setMaxThreads(int maxThreads) throws AdminException;
-
-  /**
-   * Returns the maximum number of messages that can be enqueued in a client-queue.
-   * 
-   * @since GemFire 5.7
-   */
-  public int getMaximumMessageCount();
-
-  /**
-   * Sets maximum number of messages that can be enqueued in a client-queue.
-   * 
-   * @throws AdminException if this bridge server is running
-   * @since GemFire 5.7
-   */
-  public void setMaximumMessageCount(int maxMessageCount) throws AdminException;
-
-  /**
-   * Returns the time (in seconds ) after which a message in the client queue will expire.
-   * 
-   * @since GemFire 5.7
-   */
-  public int getMessageTimeToLive();
-
-  /**
-   * Sets the time (in seconds ) after which a message in the client queue will expire.
-   * 
-   * @throws AdminException if this bridge server is running
-   * @since GemFire 5.7
-   */
-  public void setMessageTimeToLive(int messageTimeToLive) throws AdminException;
-
-  /**
-   * Sets the list of server groups this bridge server will belong to. By default bridge servers
-   * belong to the default global server group which all bridge servers always belong to.
-   * 
-   * @param groups possibly empty array of <code>String</code> where each string is a server groups
-   *        that this bridge server will be a member of.
-   * @throws AdminException if this bridge server is running
-   * @since GemFire 5.7
-   */
-  public void setGroups(String[] groups) throws AdminException;
-
-  /**
-   * Returns the list of server groups that this bridge server belongs to.
-   * 
-   * @return a possibly empty array of <code>String</code>s where each string is a server group.
-   *         Modifying this array will not change the server groups that this bridge server belongs
-   *         to.
-   * @since GemFire 5.7
-   */
-  public String[] getGroups();
-
-  /**
-   * Get a description of the load probe for this bridge server. {@link ServerLoadProbe} for details
-   * on the load probe.
-   * 
-   * @return the load probe used by this bridge server.
-   * @since GemFire 5.7
-   */
-  public String getLoadProbe();
-
-  /**
-   * Set the load probe for this bridge server. See {@link ServerLoadProbe} for details on how to
-   * implement a load probe.
-   * 
-   * The load probe should implement DataSerializable if it is used with this interface, because it
-   * will be sent to the remote VM.
-   * 
-   * @param loadProbe the load probe to use for this bridge server.
-   * @throws AdminException if the bridge server is running
-   * @since GemFire 5.7
-   */
-  public void setLoadProbe(ServerLoadProbe loadProbe) throws AdminException;
-
-  /**
-   * Get the frequency in milliseconds to poll the load probe on this bridge server.
-   * 
-   * @return the frequency in milliseconds that we will poll the load probe.
-   */
-  public long getLoadPollInterval();
-
-  /**
-   * Set the frequency in milliseconds to poll the load probe on this bridge server
-   * 
-   * @param loadPollInterval the frequency in milliseconds to poll the load probe. Must be greater
-   *        than 0.
-   * @throws AdminException if the bridge server is running
-   */
-  public void setLoadPollInterval(long loadPollInterval) throws AdminException;
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCache.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCache.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCache.java
deleted file mode 100644
index 8517fd0..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCache.java
+++ /dev/null
@@ -1,183 +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.admin;
-
-import org.apache.geode.cache.RegionAttributes;
-
-/**
- * Administrative interface that represent's the {@link SystemMember}'s view of its
- * {@link org.apache.geode.cache.Cache}.
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface SystemMemberCache {
-  // attributes
-  /**
-   * The name of the cache.
-   */
-  public String getName();
-
-  /**
-   * Value that uniquely identifies an instance of a cache for a given member.
-   */
-  public int getId();
-
-  /**
-   * Indicates if this cache has been closed.
-   * 
-   * @return true, if this cache is closed; false, otherwise
-   */
-  public boolean isClosed();
-
-  /**
-   * Gets the number of seconds a cache operation will wait to obtain a distributed lock lease.
-   */
-  public int getLockTimeout();
-
-  /**
-   * Sets the number of seconds a cache operation may wait to obtain a distributed lock lease before
-   * timing out.
-   *
-   * @throws AdminException If a problem is encountered while setting the lock timeout
-   *
-   * @see org.apache.geode.cache.Cache#setLockTimeout
-   */
-  public void setLockTimeout(int seconds) throws AdminException;
-
-  /**
-   * Gets the length, in seconds, of distributed lock leases obtained by this cache.
-   */
-  public int getLockLease();
-
-  /**
-   * Sets the length, in seconds, of distributed lock leases obtained by this cache.
-   *
-   * @throws AdminException If a problem is encountered while setting the lock lease
-   *
-   * @see org.apache.geode.cache.Cache#setLockLease
-   */
-  public void setLockLease(int seconds) throws AdminException;
-
-  /**
-   * Gets the number of seconds a cache {@link org.apache.geode.cache.Region#get(Object) get}
-   * operation can spend searching for a value before it times out. The search includes any time
-   * spent loading the object. When the search times out it causes the get to fail by throwing an
-   * exception.
-   */
-  public int getSearchTimeout();
-
-  /**
-   * Sets the number of seconds a cache get operation can spend searching for a value.
-   *
-   * @throws AdminException If a problem is encountered while setting the search timeout
-   *
-   * @see org.apache.geode.cache.Cache#setSearchTimeout
-   */
-  public void setSearchTimeout(int seconds) throws AdminException;
-
-  /**
-   * Returns number of seconds since this member's cache has been created. Returns <code>-1</code>
-   * if this member does not have a cache or its cache has been closed.
-   */
-  public int getUpTime();
-
-  /**
-   * Returns the names of all the root regions currently in this cache.
-   */
-  public java.util.Set getRootRegionNames();
-
-  // operations
-
-  /**
-   * Returns statistics related to this cache's performance.
-   */
-  public Statistic[] getStatistics();
-
-  /**
-   * Return the existing region (or subregion) with the specified path that already exists in the
-   * cache. Whether or not the path starts with a forward slash it is interpreted as a full path
-   * starting at a root.
-   *
-   * @param path the path to the region
-   * @return the Region or null if not found
-   * @throws IllegalArgumentException if path is null, the empty string, or "/"
-   */
-  public SystemMemberRegion getRegion(String path) throws AdminException;
-
-  /**
-   * Creates a VM root <code>Region</code> in this cache.
-   *
-   * @param name The name of the region to create
-   * @param attrs The attributes of the root region
-   *
-   * @throws AdminException If the region cannot be created
-   *
-   * @since GemFire 4.0
-   * @deprecated as of GemFire 5.0, use {@link #createRegion} instead
-   */
-  @Deprecated
-  public SystemMemberRegion createVMRegion(String name, RegionAttributes attrs)
-      throws AdminException;
-
-  /**
-   * Creates a root <code>Region</code> in this cache.
-   *
-   * @param name The name of the region to create
-   * @param attrs The attributes of the root region
-   *
-   * @throws AdminException If the region cannot be created
-   *
-   * @since GemFire 5.0
-   */
-  public SystemMemberRegion createRegion(String name, RegionAttributes attrs) throws AdminException;
-
-  /**
-   * Updates the state of this cache instance. Note that once a cache instance is closed refresh
-   * will never change the state of that instance.
-   */
-  public void refresh();
-
-  /**
-   * Adds a new, unstarted cache server that will serve the contents of this cache to clients.
-   *
-   * @see org.apache.geode.cache.Cache#addCacheServer
-   *
-   * @since GemFire 5.7
-   */
-  public SystemMemberCacheServer addCacheServer() throws AdminException;
-
-  /**
-   * Returns the cache servers that run in this member's VM. Note that this list will not be updated
-   * until {@link #refresh} is called.
-   *
-   * @see org.apache.geode.cache.Cache#getCacheServers
-   *
-   * @since GemFire 5.7
-   */
-  public SystemMemberCacheServer[] getCacheServers() throws AdminException;
-
-  /**
-   * Returns whether or not this cache acts as a server. This method will always return
-   * <code>true</code> for the <code>SystemMemberCache</code> obtained from a {@link CacheServer}.
-   * Note that this value will not be updated until {@link #refresh} is invoked.
-   *
-   * @since GemFire 4.0
-   */
-  public boolean isServer() throws AdminException;
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheEvent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheEvent.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheEvent.java
deleted file mode 100644
index d26ee40..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheEvent.java
+++ /dev/null
@@ -1,33 +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.admin;
-
-import org.apache.geode.cache.Operation;
-
-/**
- * An event that describes an operation on a cache. Instances of this are delivered to a
- * {@link SystemMemberCacheListener} when a a cache is created or closed.
- *
- * @since GemFire 5.0
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface SystemMemberCacheEvent extends SystemMembershipEvent {
-  /**
-   * Returns the actual operation that caused this event.
-   */
-  public Operation getOperation();
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheListener.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheListener.java
deleted file mode 100644
index 4008bdf..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheListener.java
+++ /dev/null
@@ -1,76 +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.admin;
-
-import org.apache.geode.cache.*;
-
-/**
- * A listener whose callback methods can be used to track the lifecycle of {@link Cache caches} and
- * {@link Region regions} in the GemFire distributed system.
- *
- * @see AdminDistributedSystem#addCacheListener
- * @see AdminDistributedSystem#removeCacheListener
- *
- * @since GemFire 5.0
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface SystemMemberCacheListener {
-
-  /**
-   * Invoked after a region is created in any node of distributed system.
-   * 
-   * @param event describes the region that was created.
-   * @see CacheFactory#create
-   * @see Cache#createRegion
-   * @see Region#createSubregion
-   */
-  public void afterRegionCreate(SystemMemberRegionEvent event);
-
-  /**
-   * Invoked when a region is destroyed or closed in any node of distributed system.
-   * 
-   * @param event describes the region that was lost. The operation on this event can be used to
-   *        determine the actual operation that caused the loss. Note that {@link Cache#close()}
-   *        invokes this callback with <code>Operation.CACHE_CLOSE</code> for each region in the
-   *        closed cache and it invokes {@link #afterCacheClose}.
-   * 
-   * @see Cache#close()
-   * @see Region#close
-   * @see Region#localDestroyRegion()
-   * @see Region#destroyRegion()
-   */
-  public void afterRegionLoss(SystemMemberRegionEvent event);
-
-  /**
-   * Invoked after a cache is created in any node of a distributed system. Note that this callback
-   * will be done before any regions are created in the cache.
-   * 
-   * @param event describes the member that created the cache.
-   * @see CacheFactory#create
-   */
-  public void afterCacheCreate(SystemMemberCacheEvent event);
-
-  /**
-   * Invoked after a cache is closed in any node of a distributed system. This callback is done
-   * after those done for each region in the cache. This callback is not done if the distributed
-   * member that has a cache crashes.
-   * 
-   * @param event describes the member that closed its cache.
-   * @see Cache#close()
-   */
-  public void afterCacheClose(SystemMemberCacheEvent event);
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheServer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheServer.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheServer.java
deleted file mode 100755
index edfa356..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberCacheServer.java
+++ /dev/null
@@ -1,308 +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.admin;
-
-import org.apache.geode.cache.server.ServerLoadProbe;
-
-/**
- * Administrative interface that represents a {@link org.apache.geode.cache.server.CacheServer
- * CacheServer} that serves the contents of a system member's cache to clients.
- *
- * @see SystemMemberCache#addCacheServer
- *
- * @since GemFire 5.7
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface SystemMemberCacheServer {
-
-  /**
-   * Returns the port on which this cache server listens for clients to connect.
-   */
-  public int getPort();
-
-  /**
-   * Sets the port on which this cache server listens for clients to connect.
-   *
-   * @throws AdminException If this cache server is running
-   */
-  public void setPort(int port) throws AdminException;
-
-  /**
-   * Starts this cache server. Once the server is running, its configuration cannot be changed.
-   *
-   * @throws AdminException If an error occurs while starting the cache server
-   */
-  public void start() throws AdminException;
-
-  /**
-   * Returns whether or not this cache server is running
-   */
-  public boolean isRunning();
-
-  /**
-   * Stops this cache server. Note that the <code>CacheServer</code> can be reconfigured and
-   * restarted if desired.
-   */
-  public void stop() throws AdminException;
-
-  /**
-   * Updates the information about this cache server.
-   */
-  public void refresh();
-
-  /**
-   * Returns a string representing the ip address or host name that this server will listen on.
-   * 
-   * @return the ip address or host name that this server is to listen on
-   * @since GemFire 5.7
-   */
-  public String getBindAddress();
-
-  /**
-   * Sets the ip address or host name that this server is to listen on for client connections.
-   * <p>
-   * Setting a specific bind address will cause the cache server to always use this address and
-   * ignore any address specified by "server-bind-address" or "bind-address" in the
-   * <code>gemfire.properties</code> file (see
-   * {@link org.apache.geode.distributed.DistributedSystem} for a description of these properties).
-   * <p>
-   * A <code>null</code> value will be treated the same as the default "".
-   * <p>
-   * The default value does not override the gemfire.properties. If you wish to override the
-   * properties and want to have your server bind to all local addresses then use this string
-   * <code>"0.0.0.0"</code>.
-   * 
-   * @param address the ip address or host name that this server is to listen on
-   * @throws AdminException if this cache server is running
-   * @since GemFire 5.7
-   */
-  public void setBindAddress(String address) throws AdminException;
-
-  /**
-   * Returns a string representing the ip address or host name that server locators will tell
-   * clients that this server is listening on.
-   * 
-   * @return the ip address or host name to give to clients so they can connect to this server
-   * @since GemFire 5.7
-   */
-  public String getHostnameForClients();
-
-  /**
-   * Sets the ip address or host name that this server is to listen on for client connections.
-   * <p>
-   * Setting a specific hostname-for-clients will cause server locators to use this value when
-   * telling clients how to connect to this server.
-   * <p>
-   * The default value causes the bind-address to be given to clients
-   * <p>
-   * A <code>null</code> value will be treated the same as the default "".
-   * 
-   * @param name the ip address or host name that will be given to clients so they can connect to
-   *        this server
-   * @throws AdminException if this cache server is running
-   * @since GemFire 5.7
-   */
-  public void setHostnameForClients(String name) throws AdminException;
-
-  /**
-   * Sets whether or not this cache server should notify clients based on key subscription.
-   *
-   * If false, then an update to any key on the server causes an update to be sent to all clients.
-   * This update does not push the actual data to the clients. Instead, it causes the client to
-   * locally invalidate or destroy the corresponding entry. The next time the client requests the
-   * key, it goes to the cache server for the value.
-   *
-   * If true, then an update to any key on the server causes an update to be sent to only those
-   * clients who have registered interest in that key. Other clients are not notified of the change.
-   * In addition, the actual value is pushed to the client. The client does not need to request the
-   * new value from the cache server.
-   * 
-   * @throws AdminException if this cache server is running
-   * @since GemFire 5.7
-   */
-  public void setNotifyBySubscription(boolean b) throws AdminException;
-
-  /**
-   * Answers whether or not this cache server should notify clients based on key subscription.
-   * 
-   * @since GemFire 5.7
-   */
-  public boolean getNotifyBySubscription();
-
-  /**
-   * Sets the buffer size in bytes of the socket connection for this <code>CacheServer</code>. The
-   * default is 32768 bytes.
-   *
-   * @param socketBufferSize The size in bytes of the socket buffer
-   * @throws AdminException if this cache server is running
-   * @since GemFire 5.7
-   */
-  public void setSocketBufferSize(int socketBufferSize) throws AdminException;
-
-  /**
-   * Returns the configured buffer size of the socket connection for this <code>CacheServer</code>.
-   * The default is 32768 bytes.
-   * 
-   * @return the configured buffer size of the socket connection for this <code>CacheServer</code>
-   * @since GemFire 5.7
-   */
-  public int getSocketBufferSize();
-
-  /**
-   * Sets the maximum amount of time between client pings. This value is used by the
-   * <code>ClientHealthMonitor</code> to determine the health of this <code>CacheServer</code>'s
-   * clients. The default is 60000 ms.
-   *
-   * @param maximumTimeBetweenPings The maximum amount of time between client pings
-   * @throws AdminException if this cache server is running
-   * @since GemFire 5.7
-   */
-  public void setMaximumTimeBetweenPings(int maximumTimeBetweenPings) throws AdminException;
-
-  /**
-   * Returns the maximum amount of time between client pings. This value is used by the
-   * <code>ClientHealthMonitor</code> to determine the health of this <code>CacheServer</code>'s
-   * clients. The default is 60000 ms.
-   * 
-   * @return the maximum amount of time between client pings.
-   * @since GemFire 5.7
-   */
-  public int getMaximumTimeBetweenPings();
-
-  /**
-   * Returns the maximum allowed client connections
-   * 
-   * @since GemFire 5.7
-   */
-  public int getMaxConnections();
-
-  /**
-   * Sets the maxium number of client connections allowed. When the maximum is reached the server
-   * will stop accepting connections.
-   * 
-   * @throws AdminException if this cache server is running
-   * @since GemFire 5.7
-   */
-  public void setMaxConnections(int maxCons) throws AdminException;
-
-  /**
-   * Returns the maxium number of threads allowed in this server to service client requests. The
-   * default of <code>0</code> causes the server to dedicate a thread for every client connection.
-   * 
-   * @since GemFire 5.7
-   */
-  public int getMaxThreads();
-
-  /**
-   * Sets the maxium number of threads allowed in this server to service client requests. The
-   * default of <code>0</code> causes the server to dedicate a thread for every client connection.
-   * 
-   * @throws AdminException if this cache server is running
-   * @since GemFire 5.7
-   */
-  public void setMaxThreads(int maxThreads) throws AdminException;
-
-  /**
-   * Returns the maximum number of messages that can be enqueued in a client-queue.
-   * 
-   * @since GemFire 5.7
-   */
-  public int getMaximumMessageCount();
-
-  /**
-   * Sets maximum number of messages that can be enqueued in a client-queue.
-   * 
-   * @throws AdminException if this cache server is running
-   * @since GemFire 5.7
-   */
-  public void setMaximumMessageCount(int maxMessageCount) throws AdminException;
-
-  /**
-   * Returns the time (in seconds ) after which a message in the client queue will expire.
-   * 
-   * @since GemFire 5.7
-   */
-  public int getMessageTimeToLive();
-
-  /**
-   * Sets the time (in seconds ) after which a message in the client queue will expire.
-   * 
-   * @throws AdminException if this cache server is running
-   * @since GemFire 5.7
-   */
-  public void setMessageTimeToLive(int messageTimeToLive) throws AdminException;
-
-  /**
-   * Sets the list of server groups this cache server will belong to. By default cache servers
-   * belong to the default global server group which all cache servers always belong to.
-   * 
-   * @param groups possibly empty array of <code>String</code> where each string is a server groups
-   *        that this cache server will be a member of.
-   * @throws AdminException if this cache server is running
-   * @since GemFire 5.7
-   */
-  public void setGroups(String[] groups) throws AdminException;
-
-  /**
-   * Returns the list of server groups that this cache server belongs to.
-   * 
-   * @return a possibly empty array of <code>String</code>s where each string is a server group.
-   *         Modifying this array will not change the server groups that this cache server belongs
-   *         to.
-   * @since GemFire 5.7
-   */
-  public String[] getGroups();
-
-  /**
-   * Get a description of the load probe for this cache server. {@link ServerLoadProbe} for details
-   * on the load probe.
-   * 
-   * @return the load probe used by this cache server.
-   * @since GemFire 5.7
-   */
-  public String getLoadProbe();
-
-  /**
-   * Set the load probe for this cache server. See {@link ServerLoadProbe} for details on how to
-   * implement a load probe.
-   * 
-   * The load probe should implement DataSerializable if it is used with this interface, because it
-   * will be sent to the remote VM.
-   * 
-   * @param loadProbe the load probe to use for this cache server.
-   * @throws AdminException if the cache server is running
-   * @since GemFire 5.7
-   */
-  public void setLoadProbe(ServerLoadProbe loadProbe) throws AdminException;
-
-  /**
-   * Get the frequency in milliseconds to poll the load probe on this cache server.
-   * 
-   * @return the frequency in milliseconds that we will poll the load probe.
-   */
-  public long getLoadPollInterval();
-
-  /**
-   * Set the frequency in milliseconds to poll the load probe on this cache server
-   * 
-   * @param loadPollInterval the frequency in milliseconds to poll the load probe. Must be greater
-   *        than 0.
-   * @throws AdminException if the cache server is running
-   */
-  public void setLoadPollInterval(long loadPollInterval) throws AdminException;
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/SystemMemberRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberRegion.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberRegion.java
deleted file mode 100644
index d26ce39..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberRegion.java
+++ /dev/null
@@ -1,314 +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.admin;
-
-import org.apache.geode.cache.*;
-import java.io.File;
-
-/**
- * Administrative interface that represent's the {@link SystemMember}'s view of one of its cache's
- * {@link org.apache.geode.cache.Region}s. If the region in the remote system member is closed or
- * destroyed, the methods of <code>SystemMemberRegion</code> will throw
- * {@link RegionNotFoundException}.
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface SystemMemberRegion {
-  // attributes
-  /**
-   * Returns the name that identifies this region in its cache.
-   *
-   * @see org.apache.geode.cache.Region#getName
-   */
-  public String getName();
-
-  /**
-   * Returns the full path name that identifies this region in its cache.
-   *
-   * @see org.apache.geode.cache.Region#getFullPath
-   */
-  public String getFullPath();
-
-  /**
-   * Returns the names of all the subregions of this region.
-   */
-  public java.util.Set getSubregionNames();
-
-  /**
-   * Returns the full path of each of the subregions of this region. These paths are suitable for
-   * use with {@link SystemMemberCache#getRegion}.
-   */
-  public java.util.Set getSubregionFullPaths();
-
-  /**
-   * Returns a description of any user attribute associated with this region. The description
-   * includes the classname of the user attribute object as well as its <code>toString</code>
-   * representation.
-   */
-  public String getUserAttribute();
-
-  /**
-   * Returns a description of any CacheLoader associated with this region.
-   */
-  public String getCacheLoader();
-
-  /**
-   * Returns a description of any CacheWriter associated with this region.
-   */
-  public String getCacheWriter();
-
-  /**
-   * Returns the <code>EvictionAttributes</code> that configure how entries in the the region are
-   * evicted
-   */
-  public EvictionAttributes getEvictionAttributes();
-
-  /**
-   * Returns a description of the CacheListener in this region's attributes. If there is more than 1
-   * CacheListener defined for a region this method will return the description of the 1st
-   * CacheListener returned from {@link #getCacheListeners}
-   * 
-   * @deprecated as of 6.0 use getCacheListeners() instead
-   */
-  @Deprecated
-  public String getCacheListener();
-
-  /**
-   * This method will return an empty array if there are no CacheListeners defined on the region. If
-   * there are one or more than 1 CacheListeners defined, this method will return an array which has
-   * the names of all the CacheListeners
-   * 
-   * @return String[] the region's <code>CacheListeners</code> as a String array
-   * @since GemFire 6.0
-   */
-  public String[] getCacheListeners();
-
-  /**
-   * Returns the KeyConstraint in this region's attributes.
-   */
-  public String getKeyConstraint();
-
-  /**
-   * Returns the ValueConstraint in this region's attributes.
-   */
-  public String getValueConstraint();
-
-  /**
-   * Returns the RegionTimeToLive time limit in this region's attributes.
-   */
-  public int getRegionTimeToLiveTimeLimit();
-
-  /**
-   * Returns the RegionTimeToLive action in this region's attributes.
-   */
-  public ExpirationAction getRegionTimeToLiveAction();
-
-  /**
-   * Returns the EntryTimeToLive time limit in this region's attributes.
-   */
-  public int getEntryTimeToLiveTimeLimit();
-
-  /**
-   * Returns the EntryTimeToLive action in this region's attributes.
-   */
-  public ExpirationAction getEntryTimeToLiveAction();
-
-  /**
-   * string describing the CustomExpiry for entry-time-to-live
-   * 
-   * @return the CustomExpiry for entry-time-to-live
-   */
-  public String getCustomEntryTimeToLive();
-
-  /**
-   * Returns the RegionIdleTimeout time limit in this region's attributes.
-   */
-  public int getRegionIdleTimeoutTimeLimit();
-
-  /**
-   * Returns the RegionIdleTimeout action in this region's attributes.
-   */
-  public ExpirationAction getRegionIdleTimeoutAction();
-
-  /**
-   * Returns the EntryIdleTimeout time limit in this region's attributes.
-   */
-  public int getEntryIdleTimeoutTimeLimit();
-
-  /**
-   * Returns the EntryIdleTimeout action in this region's attributes.
-   */
-  public ExpirationAction getEntryIdleTimeoutAction();
-
-  /**
-   * string describing the CustomExpiry for entry-idle-timeout
-   * 
-   * @return the CustomExpiry for entry-idle-timeout
-   */
-  public String getCustomEntryIdleTimeout();
-
-  /**
-   * Returns the MirrorType in this region's attributes.
-   * 
-   * @deprecated as of 5.0, you should use getDataPolicy instead
-   */
-  @Deprecated
-  public MirrorType getMirrorType();
-
-  /**
-   * Returns the DataPolicy in this region's attributes.
-   */
-  public DataPolicy getDataPolicy();
-
-  /**
-   * 
-   * /** Returns the Scope in this region's attributes.
-   */
-  public Scope getScope();
-
-  /**
-   * Returns the InitialCapacity in this region's attributes.
-   */
-  public int getInitialCapacity();
-
-  /**
-   * Returns the LoadFactor in this region's attributes.
-   */
-  public float getLoadFactor();
-
-  /**
-   * Returns the ConcurrencyLevel in this region's attributes.
-   */
-  public int getConcurrencyLevel();
-
-  /**
-   * Returns whether or not conflicting concurrent operations on this region are prevented
-   */
-  public boolean getConcurrencyChecksEnabled();
-
-  /**
-   * Returns the StatisticsEnabled in this region's attributes.
-   */
-  public boolean getStatisticsEnabled();
-
-  /**
-   * Returns whether or not a persistent backup should be made of the region (as opposed to just
-   * writing the overflow data to disk).
-   */
-  public boolean getPersistBackup();
-
-  /**
-   * Returns the <code>DiskWriteAttributes</code> that configure how the region is written to disk.
-   */
-  public DiskWriteAttributes getDiskWriteAttributes();
-
-  /**
-   * Returns the directories to which the region's data are written. If multiple directories are
-   * used, GemFire will attempt to distribute the data evenly amongst them.
-   */
-  public File[] getDiskDirs();
-
-  /**
-   * Returns the number of entries currently in this region.
-   */
-  public int getEntryCount();
-
-  /**
-   * Returns the number of subregions currently in this region.
-   */
-  public int getSubregionCount();
-
-  /**
-   * Returns the LastModifiedTime obtained from this region's statistics.
-   */
-  public long getLastModifiedTime();
-
-  /**
-   * Returns the LastAccessedTime obtained from this region's statistics.
-   */
-  public long getLastAccessedTime();
-
-  /**
-   * Returns the HitCount obtained from this region's statistics.
-   */
-  public long getHitCount();
-
-  /**
-   * Returns the MissCount obtained from this region's statistics.
-   */
-  public long getMissCount();
-
-  /**
-   * Returns the HitRatio obtained from this region's statistics.
-   */
-  public float getHitRatio();
-
-  /**
-   * Returns whether or not acks are sent after an update is processed.
-   * 
-   * @return False if acks are sent after updates are processed; true if acks are sent before
-   *         updates are processed.
-   *
-   * @since GemFire 4.1
-   */
-  public boolean getEarlyAck();
-
-  // operations
-  /**
-   * Updates the state of this region instance. Note that once a cache instance is closed refresh
-   * will never change the state of its regions.
-   */
-  public void refresh();
-
-  /**
-   * Creates a subregion of this region.
-   *
-   * @param name The name of the region to create
-   * @param attrs The attributes of the root region
-   *
-   * @throws AdminException If the region cannot be created
-   *
-   * @since GemFire 4.0
-   */
-  public SystemMemberRegion createSubregion(String name, RegionAttributes attrs)
-      throws AdminException;
-
-  /**
-   * Returns the <code>MembershipAttributes</code> that configure required roles for reliable access
-   * to the region.
-   * 
-   * @deprecated this API is scheduled to be removed
-   */
-  public MembershipAttributes getMembershipAttributes();
-
-  /**
-   * Returns the <code>SubscriptionAttributes</code> for the region.
-   * 
-   * @since GemFire 5.0
-   */
-  public SubscriptionAttributes getSubscriptionAttributes();
-
-  /**
-   * Returns the <code>PartitionAttributes</code> for the region.
-   * 
-   * @since GemFire 5.7
-   */
-  public PartitionAttributes getPartitionAttributes();
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/SystemMemberRegionEvent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberRegionEvent.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberRegionEvent.java
deleted file mode 100644
index 27ee8ae..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberRegionEvent.java
+++ /dev/null
@@ -1,31 +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.admin;
-
-/**
- * An event that describes an operation on a region. Instances of this are delivered to a
- * {@link SystemMemberCacheListener} when a a region comes or goes.
- *
- * @since GemFire 5.0
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface SystemMemberRegionEvent extends SystemMemberCacheEvent {
-  /**
-   * Returns the full path of the region the event was done on.
-   */
-  public String getRegionPath();
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/SystemMemberType.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberType.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMemberType.java
deleted file mode 100755
index c95d32e..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/SystemMemberType.java
+++ /dev/null
@@ -1,150 +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.admin;
-
-// import java.io.*;
-
-/**
- * Type-safe definition for system members.
- *
- * @since GemFire 3.5
- *
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class SystemMemberType implements java.io.Serializable {
-  private static final long serialVersionUID = 3284366994485749302L;
-
-  /** GemFire shared-memory manager connected to the distributed system */
-  public static final SystemMemberType MANAGER = new SystemMemberType("GemFireManager");
-
-  /** Application connected to the distributed system */
-  public static final SystemMemberType APPLICATION = new SystemMemberType("Application");
-
-  /** GemFire Cache VM connected to the distributed system */
-  public static final SystemMemberType CACHE_VM = new SystemMemberType("CacheVm");
-
-  /**
-   * GemFire Cache Server connected to the distributed system
-   * 
-   * @deprecated as of 5.7 use {@link #CACHE_VM} instead.
-   */
-  @Deprecated
-  public static final SystemMemberType CACHE_SERVER = CACHE_VM;
-
-
-  /** The display-friendly name of this system member type. */
-  private final transient String name;
-
-  // The 4 declarations below are necessary for serialization
-  /** int used as ordinal to represent this Scope */
-  public final int ordinal = nextOrdinal++;
-
-  private static int nextOrdinal = 0;
-
-  private static final SystemMemberType[] VALUES = {MANAGER, APPLICATION, CACHE_VM};
-
-  private Object readResolve() throws java.io.ObjectStreamException {
-    return VALUES[ordinal]; // Canonicalize
-  }
-
-  /** Creates a new instance of SystemMemberType. */
-  private SystemMemberType(String name) {
-    this.name = name;
-  }
-
-  /** Return the SystemMemberType represented by specified ordinal */
-  public static SystemMemberType fromOrdinal(int ordinal) {
-    return VALUES[ordinal];
-  }
-
-  public String getName() {
-    return this.name;
-  }
-
-  /** Return whether this is <code>MANAGER</code>. */
-  public boolean isManager() {
-    return this.equals(MANAGER);
-  }
-
-  /** Return whether this is <code>APPLICATION</code>. */
-  public boolean isApplication() {
-    return this.equals(APPLICATION);
-  }
-
-  /**
-   * Return whether this is <code>CACHE_SERVER</code>.
-   * 
-   * @deprecated as of 5.7 use {@link #isCacheVm} instead.
-   */
-  @Deprecated
-  public boolean isCacheServer() {
-    return isCacheVm();
-  }
-
-  /**
-   * Return whether this is <code>CACHE_VM</code>.
-   */
-  public boolean isCacheVm() {
-    return this.equals(CACHE_VM);
-  }
-
-  /**
-   * Returns a string representation for this system member type.
-   *
-   * @return the name of this system member type
-   */
-  @Override
-  public String toString() {
-    return this.name;
-  }
-
-  /**
-   * Indicates whether some other object is "equal to" this one.
-   *
-   * @param other the reference object with which to compare.
-   * @return true if this object is the same as the obj argument; false otherwise.
-   */
-  @Override
-  public boolean equals(Object other) {
-    if (other == this)
-      return true;
-    if (other == null)
-      return false;
-    if (!(other instanceof SystemMemberType))
-      return false;
-    final SystemMemberType that = (SystemMemberType) other;
-    if (this.ordinal != that.ordinal)
-      return false;
-    return true;
-  }
-
-  /**
-   * Returns a hash code for the object. This method is supported for the benefit of hashtables such
-   * as those provided by java.util.Hashtable.
-   *
-   * @return the integer 0 if description is null; otherwise a unique integer.
-   */
-  @Override
-  public int hashCode() {
-    int result = 17;
-    final int mult = 37;
-    result = mult * result + this.ordinal;
-    return result;
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipEvent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipEvent.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipEvent.java
deleted file mode 100644
index d7850b4..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipEvent.java
+++ /dev/null
@@ -1,42 +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.admin;
-
-import org.apache.geode.distributed.DistributedMember;
-
-/**
- * An event that describes the distributed member originated this event. Instances of this are
- * delivered to a {@link SystemMembershipListener} when a member has joined or left the distributed
- * system.
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface SystemMembershipEvent {
-  /**
-   * Returns the distributed member as a String.
-   */
-  public String getMemberId();
-
-  /**
-   * Returns the {@link DistributedMember} that this event originated in.
-   * 
-   * @return the member that performed the operation that originated this event.
-   * @since GemFire 5.0
-   */
-  public DistributedMember getDistributedMember();
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipListener.java b/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipListener.java
deleted file mode 100644
index eed5578..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/SystemMembershipListener.java
+++ /dev/null
@@ -1,59 +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.admin;
-
-/**
- * A listener whose callback methods are invoked when members join or leave the GemFire distributed
- * system.
- *
- * @see AdminDistributedSystem#addMembershipListener
- *
- * @since GemFire 3.5
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface SystemMembershipListener {
-
-  /**
-   * Invoked when a member has joined the distributed system
-   */
-  public void memberJoined(SystemMembershipEvent event);
-
-  /**
-   * Invoked when a member has gracefully left the distributed system. This occurs when the member
-   * took action to remove itself from the distributed system.
-   */
-  public void memberLeft(SystemMembershipEvent event);
-
-  /**
-   * Invoked when a member has unexpectedly left the distributed system. This occurs when a member
-   * is forcibly removed from the distributed system by another process, such as from <a
-   * href=../distributed/DistributedSystem.html#member-timeout> failure detection</a>, or <a
-   * href=../distributed/DistributedSystem.html#enable-network-partition-detection> network
-   * partition detection</a> processing.
-   */
-  public void memberCrashed(SystemMembershipEvent event);
-
-  // /**
-  // * Invoked when a member broadcasts an informational message.
-  // *
-  // * @see org.apache.geode.distributed.DistributedSystem#fireInfoEvent
-  // *
-  // * @since GemFire 4.0
-  // */
-  // public void memberInfo(SystemMembershipEvent event);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/UnmodifiableConfigurationException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/UnmodifiableConfigurationException.java b/geode-core/src/main/java/org/apache/geode/admin/UnmodifiableConfigurationException.java
deleted file mode 100755
index 758dbd7..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/UnmodifiableConfigurationException.java
+++ /dev/null
@@ -1,81 +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.admin;
-
-/**
- * An <code>UnmodifiableConfigurationException</code> is thrown when an attempt is made to modify
- * the value of an unmodifiable {@link ConfigurationParameter}.
- *
- * @since GemFire 3.5
- *
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class UnmodifiableConfigurationException extends AdminException {
-  private static final long serialVersionUID = -7653547392992060646L;
-
-  /**
-   * Constructs a new exception with <code>null</code> as its detail message. The cause is not
-   * initialized, and may subsequently be initialized by a call to {@link Throwable#initCause}.
-   */
-  public UnmodifiableConfigurationException() {
-    super();
-  }
-
-  /**
-   * Constructs a new exception with the specified detail message. The cause is not initialized, and
-   * may subsequently be initialized by a call to {@link Throwable#initCause}.
-   *
-   * @param message the detail message. The detail message is saved for later retrieval by the
-   *        {@link #getMessage()} method.
-   */
-  public UnmodifiableConfigurationException(String message) {
-    super(message);
-  }
-
-  /**
-   * Constructs a new exception with the specified detail message and cause.
-   * <p>
-   * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically
-   * incorporated in this exception's detail message.
-   *
-   * @param message the detail message (which is saved for later retrieval by the
-   *        {@link #getMessage()} method).
-   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
-   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
-   *        unknown.)
-   */
-  public UnmodifiableConfigurationException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  /**
-   * Constructs a new exception with the specified cause and a detail message of
-   * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail
-   * message of <tt>cause</tt>). This constructor is useful for exceptions that are little more than
-   * wrappers for other throwables (for example, {@link java.security.PrivilegedActionException}).
-   *
-   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
-   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
-   *        unknown.)
-   */
-  public UnmodifiableConfigurationException(Throwable cause) {
-    super(cause);
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/AbstractHealthEvaluator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/AbstractHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/admin/internal/AbstractHealthEvaluator.java
deleted file mode 100644
index 57b42a8..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/AbstractHealthEvaluator.java
+++ /dev/null
@@ -1,170 +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.admin.internal;
-
-import java.util.List;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.admin.GemFireHealth;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.distributed.internal.DM;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-
-/**
- * The abstract superclass of all GemFire health evaluators. Basically, this class specifies what
- * the health evaluators need and what they should do.
- *
- * <P>
- *
- * Note that evaluators never reside in the administration VM, they only in member VMs. They are not
- * <code>Serializable</code> and aren't meant to be.
- *
- *
- * @since GemFire 3.5
- */
-public abstract class AbstractHealthEvaluator {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /**
-   * The number of times this evaluator has been evaluated. Certain checks are not made the first
-   * time an evaluation occurs.
-   */
-  private int numEvaluations;
-
-  ////////////////////// Constructors //////////////////////
-
-  /**
-   * Creates a new <code>AbstractHealthEvaluator</code> with the given
-   * <code>GemFireHealthConfig</code> and <code>DistributionManager</code>.
-   *
-   * Originally, this method took an <code>InternalDistributedSystem</code>, but we found there were
-   * race conditions during initialization. Namely, that a <code>DistributionMessage</code> can be
-   * processed before the <code>InternalDistributedSystem</code>'s <code>DistributionManager</code>
-   * is set.
-   */
-  protected AbstractHealthEvaluator(GemFireHealthConfig config, DM dm) {
-    this.numEvaluations = 0;
-  }
-
-  ///////////////////// Instance Methods /////////////////////
-
-  /**
-   * Evaluates the health of a component of a GemFire distributed system.
-   *
-   * @param status A list of {@link AbstractHealthEvaluator.HealthStatus HealthStatus} objects that
-   *        is populated when ill health is detected.
-   */
-  public final void evaluate(List status) {
-    this.numEvaluations++;
-    check(status);
-  }
-
-  /**
-   * Checks the health of a component of a GemFire distributed system.
-   *
-   * @see #evaluate
-   */
-  protected abstract void check(List status);
-
-  /**
-   * Returns whether or not this is the first evaluation
-   */
-  protected final boolean isFirstEvaluation() {
-    return this.numEvaluations <= 1;
-  }
-
-  /**
-   * A factory method that creates a {@link AbstractHealthEvaluator.HealthStatus HealthStats} with
-   * {@linkplain GemFireHealth#OKAY_HEALTH okay} status.
-   */
-  protected HealthStatus okayHealth(String diagnosis) {
-    logger.info(LocalizedMessage.create(LocalizedStrings.AbstractHealthEvaluator_OKAY_HEALTH__0,
-        diagnosis));
-    return new HealthStatus(GemFireHealth.OKAY_HEALTH, diagnosis);
-  }
-
-  /**
-   * A factory method that creates a {@link AbstractHealthEvaluator.HealthStatus HealthStats} with
-   * {@linkplain GemFireHealth#POOR_HEALTH poor} status.
-   */
-  protected HealthStatus poorHealth(String diagnosis) {
-    logger.info(LocalizedMessage.create(LocalizedStrings.AbstractHealthEvaluator_POOR_HEALTH__0,
-        diagnosis));
-    return new HealthStatus(GemFireHealth.POOR_HEALTH, diagnosis);
-  }
-
-  /**
-   * Returns a <code>String</code> describing the component whose health is evaluated by this
-   * evaluator.
-   */
-  protected abstract String getDescription();
-
-  /**
-   * Closes this evaluator and releases all of its resources
-   */
-  abstract void close();
-
-  /////////////////////// Inner Classes //////////////////////
-
-  /**
-   * Represents the health of a GemFire component.
-   */
-  public class HealthStatus {
-    /** The health of a GemFire component */
-    private GemFireHealth.Health healthCode;
-
-    /** The diagnosis of the illness */
-    private String diagnosis;
-
-    ////////////////////// Constructors //////////////////////
-
-    /**
-     * Creates a new <code>HealthStatus</code> with the give <code>health</code> code and
-     * <code>dianosis</code> message.
-     *
-     * @see GemFireHealth#OKAY_HEALTH
-     * @see GemFireHealth#POOR_HEALTH
-     */
-    HealthStatus(GemFireHealth.Health healthCode, String diagnosis) {
-      this.healthCode = healthCode;
-      this.diagnosis = "[" + AbstractHealthEvaluator.this.getDescription() + "] " + diagnosis;
-    }
-
-    ///////////////////// Instance Methods /////////////////////
-
-    /**
-     * Returns the health code
-     *
-     * @see GemFireHealth#OKAY_HEALTH
-     * @see GemFireHealth#POOR_HEALTH
-     */
-    public GemFireHealth.Health getHealthCode() {
-      return this.healthCode;
-    }
-
-    /**
-     * Returns the diagnosis prepended with a description of the component that is ill.
-     */
-    public String getDiagnosis() {
-      return this.diagnosis;
-    }
-
-  }
-
-}



[02/50] [abbrv] incubator-geode git commit: GEODE-17: mark deprecated security configurations

Posted by kl...@apache.org.
GEODE-17: mark deprecated security configurations


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

Branch: refs/heads/feature/GEODE-288
Commit: a847c550bfe3b3387f3c023ce56eee63d353c062
Parents: ddc3268
Author: Jinmei Liao <ji...@pivotal.io>
Authored: Tue Oct 25 10:00:50 2016 -0700
Committer: Jinmei Liao <ji...@pivotal.io>
Committed: Tue Oct 25 13:58:54 2016 -0700

----------------------------------------------------------------------
 .../apache/geode/distributed/ConfigurationProperties.java | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a847c550/geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java b/geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java
index 38bec6f..c58a398 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java
@@ -1439,10 +1439,14 @@ public interface ConfigurationProperties {
   String SECURITY_PREFIX = "security-";
   /**
    * The static String definition of the <i>"security-client-accessor"</i> property
+   *
+   * @deprecated since Geode 1.0, use security-manager
    */
   String SECURITY_CLIENT_ACCESSOR = SECURITY_PREFIX + "client-accessor";
   /**
    * The static String definition of the <i>"security-client-accessor-pp"</i> property
+   *
+   * @deprecated since Geode 1.0, use security-post-processor
    */
   String SECURITY_CLIENT_ACCESSOR_PP = SECURITY_PREFIX + "client-accessor-pp";
   /**
@@ -1474,6 +1478,8 @@ public interface ConfigurationProperties {
 
   /**
    * The static String definition of the <i>"security-client-authenticator"</i> property
+   *
+   * @deprecated since Geode 1.0, use security-manager
    */
   String SECURITY_CLIENT_AUTHENTICATOR = SECURITY_PREFIX + "client-authenticator";
   /**
@@ -1497,10 +1503,14 @@ public interface ConfigurationProperties {
   String SECURITY_LOG_LEVEL = SECURITY_PREFIX + "log-level";
   /**
    * The static String definition of the <i>"security-peer-auth-init"</i> property
+   *
+   * @deprecated since Geode 1.0. use security-username and security-password
    */
   String SECURITY_PEER_AUTH_INIT = SECURITY_PREFIX + "peer-auth-init";
   /**
    * The static String definition of the <i>"security-peer-authenticator"</i> property
+   *
+   * @deprecated since Geode 1.0, use security-manager
    */
   String SECURITY_PEER_AUTHENTICATOR = SECURITY_PREFIX + "peer-authenticator";
   /**


[39/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java
deleted file mode 100644
index e55c3f1..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java
+++ /dev/null
@@ -1,1624 +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.admin.jmx.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.rmi.server.RMIClientSocketFactory;
-import java.rmi.server.RMIServerSocketFactory;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.Notification;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.management.OperationsException;
-import javax.management.ReflectionException;
-import javax.management.modelmbean.ModelMBean;
-import javax.management.remote.JMXConnectionNotification;
-import javax.management.remote.JMXConnectorServer;
-import javax.management.remote.JMXConnectorServerFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.rmi.RMIConnectorServer;
-import javax.rmi.ssl.SslRMIClientSocketFactory;
-
-import mx4j.tools.adaptor.http.HttpAdaptor;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.GemFireException;
-import org.apache.geode.GemFireIOException;
-import org.apache.geode.LogWriter;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.AdminDistributedSystem;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.jmx.Agent;
-import org.apache.geode.admin.jmx.AgentConfig;
-import org.apache.geode.admin.jmx.AgentFactory;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.i18n.StringId;
-import org.apache.geode.internal.Banner;
-import org.apache.geode.internal.GemFireVersion;
-import org.apache.geode.internal.admin.remote.TailLogResponse;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.InternalLogWriter;
-import org.apache.geode.internal.logging.LogConfig;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.LogWriterFactory;
-import org.apache.geode.internal.logging.LoggingThreadGroup;
-import org.apache.geode.internal.logging.log4j.AlertAppender;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.geode.internal.logging.log4j.LogMarker;
-import org.apache.geode.internal.logging.log4j.LogWriterAppender;
-import org.apache.geode.internal.logging.log4j.LogWriterAppenders;
-
-/**
- * The GemFire JMX Agent provides the ability to administrate one GemFire distributed system via
- * JMX.
- *
- * @since GemFire 3.5
- */
-public class AgentImpl implements org.apache.geode.admin.jmx.Agent,
-    org.apache.geode.admin.jmx.internal.ManagedResource {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /**
-   * MX4J HttpAdaptor only supports "basic" as an authentication method. Enabling HttpAdaptor
-   * authentication ({@link AgentConfig#HTTP_AUTHENTICATION_ENABLED_NAME}) causes the browser to
-   * require a login with username ({@link AgentConfig#HTTP_AUTHENTICATION_USER_NAME}) and password
-   * ({@link AgentConfig#HTTP_AUTHENTICATION_PASSWORD_NAME}).
-   */
-  private static final String MX4J_HTTPADAPTOR_BASIC_AUTHENTICATION = "basic";
-
-  /** JMX Service URL template for JMX/RMI Connector Server */
-  private static final String JMX_SERVICE_URL = "service:jmx:rmi://{0}:{1}/jndi/rmi://{2}:{3}{4}";
-
-  /**
-   * Set third-party logging configration: MX4J, Jakarta Commons-Logging.
-   */
-  static {
-    checkDebug();
-    String commonsLog = System.getProperty("org.apache.commons.logging.log");
-    if (commonsLog == null || commonsLog.length() == 0) {
-      System.setProperty("org.apache.commons.logging.log",
-          "org.apache.commons.logging.impl.SimpleLog");
-    }
-  }
-
-  /** Enables mx4j tracing if Agent debugging is enabled. */
-  private static void checkDebug() {
-    try {
-      if (Boolean.getBoolean("gfAgentDebug")) {
-        mx4j.log.Log.setDefaultPriority(mx4j.log.Logger.TRACE); // .DEBUG
-      }
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Throwable t) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      /* ignore */
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // Member variables
-  // -------------------------------------------------------------------------
-
-  /** This Agent's log writer */
-  private LogWriterAppender logWriterAppender;
-  private InternalLogWriter logWriter;
-
-  /** This Agent's JMX http adaptor from MX4J */
-  private HttpAdaptor httpAdaptor;
-
-  /** This Agent's RMI Connector Server from MX4J */
-  private JMXConnectorServer rmiConnector;
-
-  /** The name of the MBean manages this resource */
-  private final String mbeanName;
-
-  /** The ObjectName of the MBean that manages this resource */
-  private final ObjectName objectName;
-
-  /** The actual ModelMBean that manages this resource */
-  private ModelMBean modelMBean;
-
-  /** The configuration for this Agent */
-  private final AgentConfigImpl agentConfig;
-
-  /**
-   * The <code>AdminDistributedSystem</code> this Agent is currently connected to or
-   * <code>null</code>
-   */
-  private AdminDistributedSystem system;
-
-  /** The agent's configuration file */
-  private String propertyFile;
-
-  /**
-   * A lock object to guard the Connect and Disconnect calls being made on the agent for connections
-   * to the DS
-   **/
-  private Object CONN_SYNC = new Object();
-
-  protected MemberInfoWithStatsMBean memberInfoWithStatsMBean;
-
-  private MBeanServer mBeanServer;
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs a new Agent using the specified configuration.
-   *
-   * @param agentConfig instance of configuration for Agent
-   * @throws org.apache.geode.admin.AdminException TODO-javadocs
-   * @throws IllegalArgumentException if agentConfig is null
-   */
-  public AgentImpl(AgentConfigImpl agentConfig) throws AdminException, IllegalArgumentException {
-    addShutdownHook();
-    if (agentConfig == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.AgentImpl_AGENTCONFIG_MUST_NOT_BE_NULL.toLocalizedString());
-    }
-    this.agentConfig = (AgentConfigImpl) agentConfig;
-    this.mbeanName = MBEAN_NAME_PREFIX + MBeanUtil.makeCompliantMBeanNameProperty("Agent");
-
-    try {
-      this.objectName = new ObjectName(this.mbeanName);
-    } catch (MalformedObjectNameException ex) {
-      String s = LocalizedStrings.AgentImpl_WHILE_CREATING_OBJECTNAME_0
-          .toLocalizedString(new Object[] {this.mbeanName});
-      throw new AdminException(s, ex);
-    }
-
-    this.propertyFile = this.agentConfig.getPropertyFile().getAbsolutePath();
-
-    // bind address only affects how the Agent VM connects to the system...
-    // It should be set only once in the agent lifecycle
-    this.agentConfig.setBindAddress(getBindAddress());
-
-    // LOG: create LogWriterAppender and LogWriterLogger
-    initLogWriter();
-
-    mBeanServer = MBeanUtil.start();
-
-    MBeanUtil.createMBean(this);
-
-    initializeHelperMbean();
-  }
-
-  private void initializeHelperMbean() {
-    try {
-      memberInfoWithStatsMBean = new MemberInfoWithStatsMBean(this);
-
-      MBeanServer mbs = getMBeanServer();
-      mbs.registerMBean(memberInfoWithStatsMBean, memberInfoWithStatsMBean.getObjectName());
-      /*
-       * We are not re-throwing these exceptions as failure create/register the GemFireTypesWrapper
-       * will not stop the Agent from working. But we are logging it as it could be an indication of
-       * some problem. Also not creating Localized String for the exception.
-       */
-    } catch (OperationsException e) {
-      logger.info(LocalizedMessage
-          .create(LocalizedStrings.AgentImpl_FAILED_TO_INITIALIZE_MEMBERINFOWITHSTATSMBEAN), e);
-    } catch (MBeanRegistrationException e) {
-      logger.info(LocalizedMessage
-          .create(LocalizedStrings.AgentImpl_FAILED_TO_INITIALIZE_MEMBERINFOWITHSTATSMBEAN), e);
-    } catch (AdminException e) {
-      logger.info(LocalizedMessage
-          .create(LocalizedStrings.AgentImpl_FAILED_TO_INITIALIZE_MEMBERINFOWITHSTATSMBEAN), e);
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // Public operations
-  // -------------------------------------------------------------------------
-
-  public AgentConfig getConfig() {
-    return this.agentConfig;
-  }
-
-  public AdminDistributedSystem getDistributedSystem() {
-    return this.system;
-  }
-
-  /**
-   * Persists the current Agent configuration to its property file.
-   *
-   * @throws GemFireIOException if unable to persist the configuration to props
-   * @see #getPropertyFile
-   */
-  public void saveProperties() {
-    throw new GemFireIOException("saveProperties is no longer supported for security reasons");
-  }
-
-  /**
-   * Starts the jmx agent
-   */
-  public void start() {
-    checkDebug();
-
-    this.agentConfig.validate();
-
-    if (mBeanServer == null) {
-      mBeanServer = MBeanUtil.start();
-    }
-
-    try {
-      startHttpAdaptor();
-    } catch (StartupException e) {
-      AlertAppender.getInstance().shuttingDown();
-      LogWriterAppenders.stop(LogWriterAppenders.Identifier.MAIN);
-      LogWriterAppenders.destroy(LogWriterAppenders.Identifier.MAIN);
-      throw e;
-    }
-
-    try {
-      startRMIConnectorServer();
-    } catch (StartupException e) {
-      stopHttpAdaptor();
-      AlertAppender.getInstance().shuttingDown();
-      LogWriterAppenders.stop(LogWriterAppenders.Identifier.MAIN);
-      LogWriterAppenders.destroy(LogWriterAppenders.Identifier.MAIN);
-      throw e;
-    }
-
-    try {
-      startSnmpAdaptor();
-    } catch (StartupException e) {
-      stopRMIConnectorServer();
-      stopHttpAdaptor();
-      AlertAppender.getInstance().shuttingDown();
-      LogWriterAppenders.stop(LogWriterAppenders.Identifier.MAIN);
-      LogWriterAppenders.destroy(LogWriterAppenders.Identifier.MAIN);
-      throw e;
-    }
-
-    if (this.agentConfig.getAutoConnect()) {
-      try {
-        connectToSystem();
-        /*
-         * Call Agent.stop() if connectToSystem() fails. This should clean up agent-DS connection &
-         * stop all the HTTP/RMI/SNMP adapters started earlier.
-         */
-      } catch (AdminException ex) {
-        logger.error(LocalizedMessage.create(LocalizedStrings.AgentImpl_AUTO_CONNECT_FAILED__0,
-            ex.getMessage()));
-        this.stop();
-        throw new StartupException(ex);
-      } catch (MalformedObjectNameException ex) {
-        StringId autoConnectFailed = LocalizedStrings.AgentImpl_AUTO_CONNECT_FAILED__0;
-        logger.error(LocalizedMessage.create(autoConnectFailed, ex.getMessage()));
-        this.stop();
-        throw new StartupException(new AdminException(
-            autoConnectFailed.toLocalizedString(new Object[] {ex.getMessage()}), ex));
-      }
-    } // getAutoConnect
-
-    logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_GEMFIRE_JMX_AGENT_IS_RUNNING));
-    LogWriterAppenders.startupComplete(LogWriterAppenders.Identifier.MAIN);
-
-    if (memberInfoWithStatsMBean == null) {
-      initializeHelperMbean();
-    }
-  }
-
-  /**
-   * Deregisters everything this Agent registered and releases the MBeanServer.
-   */
-  public void stop() {
-    try {
-      logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_STOPPING_JMX_AGENT));
-      AlertAppender.getInstance().shuttingDown();
-      LogWriterAppenders.stop(LogWriterAppenders.Identifier.MAIN);
-
-      // stop the GemFire Distributed System
-      stopDistributedSystem();
-
-      // stop all JMX Adaptors and Connectors...
-      stopHttpAdaptor();
-      stopRMIConnectorServer();
-      memberInfoWithStatsMBean = null;
-      stopSnmpAdaptor();
-
-      // release the MBeanServer for cleanup...
-      MBeanUtil.stop();
-      mBeanServer = null;
-
-      // remove the register shutdown hook which disconnects the Agent from the Distributed System
-      // upon JVM shutdown
-      removeShutdownHook();
-
-      logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_AGENT_HAS_STOPPED));
-    } finally {
-      LogWriterAppenders.destroy(LogWriterAppenders.Identifier.MAIN);
-      LoggingThreadGroup.cleanUpThreadGroups(); // bug35388 - logwriters accumulate, causing mem
-                                                // leak
-    }
-
-  }
-
-  private void stopDistributedSystem() {
-    // disconnect from the distributed system...
-    try {
-      disconnectFromSystem();
-    } catch (Exception e) {
-      // disconnectFromSystem already prints any Exceptions
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also catch VirtualMachineError (see above).
-      // However, there is _still_ a possibility that you are dealing with a cascading error
-      // condition,
-      // so you also need to check to see if the JVM is still usable:
-      SystemFailure.checkFailure();
-    }
-  }
-
-  public ObjectName manageDistributedSystem() throws MalformedObjectNameException {
-    synchronized (CONN_SYNC) {
-      if (isConnected()) {
-        return ((AdminDistributedSystemJmxImpl) this.system).getObjectName();
-      }
-      return null;
-    }
-  }
-
-  /**
-   * Connects to the DistributedSystem currently described by this Agent's attributes for
-   * administration and monitoring.
-   *
-   * @return the object name of the system that the Agent is now connected to
-   */
-  @edu.umd.cs.findbugs.annotations.SuppressWarnings(
-      value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD",
-      justification = "This is only a style warning.")
-  public ObjectName connectToSystem() throws AdminException, MalformedObjectNameException {
-    synchronized (CONN_SYNC) {
-      try {
-        if (isConnected()) {
-          return ((AdminDistributedSystemJmxImpl) this.system).getObjectName();
-        }
-
-        DistributionManager.isDedicatedAdminVM = true;
-
-        AdminDistributedSystemJmxImpl systemJmx = (AdminDistributedSystemJmxImpl) this.system;
-        if (systemJmx == null) {
-          systemJmx = (AdminDistributedSystemJmxImpl) createDistributedSystem(this.agentConfig);
-          this.system = systemJmx;
-        }
-        systemJmx.connect(this.logWriter);
-
-        return new ObjectName(systemJmx.getMBeanName());
-      } catch (AdminException e) {
-        logger.warn(e.getMessage(), e);
-        throw e;
-      } catch (RuntimeException e) {
-        logger.warn(e.getMessage(), e);
-        throw e;
-      } catch (VirtualMachineError err) {
-        SystemFailure.initiateFailure(err);
-        // If this ever returns, rethrow the error. We're poisoned
-        // now, so don't let this thread continue.
-        throw err;
-      } catch (Error e) {
-        // Whenever you catch Error or Throwable, you must also
-        // catch VirtualMachineError (see above). However, there is
-        // _still_ a possibility that you are dealing with a cascading
-        // error condition, so you also need to check to see if the JVM
-        // is still usable:
-        SystemFailure.checkFailure();
-        logger.error(e.getMessage(), e);
-        throw e;
-      }
-    }
-  }
-
-  /**
-   * Disconnects from the current DistributedSystem (if connected to one).
-   */
-  @edu.umd.cs.findbugs.annotations.SuppressWarnings(
-      value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD",
-      justification = "This is only a style warning.")
-  public void disconnectFromSystem() {
-    synchronized (CONN_SYNC) {
-      try {
-        if (this.system == null || !this.system.isConnected()) {
-          return;
-        }
-        ((AdminDistributedSystemJmxImpl) this.system).disconnect();
-        // this.system = null;
-      } catch (RuntimeException e) {
-        logger.warn(e.getMessage(), e);
-        throw e;
-      } catch (VirtualMachineError err) {
-        SystemFailure.initiateFailure(err);
-        // If this ever returns, rethrow the error. We're poisoned
-        // now, so don't let this thread continue.
-        throw err;
-      } catch (Error e) {
-        // Whenever you catch Error or Throwable, you must also
-        // catch VirtualMachineError (see above). However, there is
-        // _still_ a possibility that you are dealing with a cascading
-        // error condition, so you also need to check to see if the JVM
-        // is still usable:
-        SystemFailure.checkFailure();
-        logger.warn(e.getMessage(), e);
-        throw e;
-      } finally {
-        DistributionManager.isDedicatedAdminVM = false;
-      }
-    }
-  }
-
-  /**
-   * Retrieves a displayable snapshot of this Agent's log.
-   *
-   * @return snapshot of the current log
-   */
-  public String getLog() {
-    String childTail = tailFile(this.logWriterAppender.getChildLogFile());
-    String mainTail = tailFile(new File(this.agentConfig.getLogFile()));
-    if (childTail == null && mainTail == null) {
-      return LocalizedStrings.AgentImpl_NO_LOG_FILE_CONFIGURED_LOG_MESSAGES_WILL_BE_DIRECTED_TO_STDOUT
-          .toLocalizedString();
-    } else {
-      StringBuffer result = new StringBuffer();
-      if (mainTail != null) {
-        result.append(mainTail);
-      }
-      if (childTail != null) {
-        result
-            .append("\n" + LocalizedStrings.AgentImpl_TAIL_OF_CHILD_LOG.toLocalizedString() + "\n");
-        result.append(childTail);
-      }
-      return result.toString();
-    }
-  }
-
-  /**
-   * Retrieves display-friendly GemFire version information.
-   */
-  public String getVersion() {
-    return GemFireVersion.asString();
-  }
-
-  // -------------------------------------------------------------------------
-  // Public attribute accessors/mutators
-  // -------------------------------------------------------------------------
-
-  /** Returns true if this Agent is currently connected to a system. */
-  public boolean isConnected() {
-    boolean result = false;
-    synchronized (CONN_SYNC) {
-      result = ((this.system != null) && this.system.isConnected());
-    }
-    return result;
-  }
-
-  /**
-   * Gets the agent's property file. This is the file it will use when saving its configuration. It
-   * was also used when the agent started to initialize its configuration.
-   * 
-   * @return the agent's property file
-   */
-  public String getPropertyFile() {
-    return this.propertyFile;
-  }
-
-  /**
-   * Sets the agent's property file.
-   *
-   * @param value the name of the file to save the agent properties in.
-   * @throws IllegalArgumentException if the specified file is a directory.
-   * @throws IllegalArgumentException if the specified file's parent is not an existing directory.
-   */
-  public void setPropertyFile(String value) {
-    File f = (new File(value)).getAbsoluteFile();
-    if (f.isDirectory()) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.AgentImpl_THE_FILE_0_IS_A_DIRECTORY.toLocalizedString(f));
-    }
-    File parent = f.getParentFile();
-    if (parent != null) {
-      if (!parent.isDirectory()) {
-        throw new IllegalArgumentException(
-            LocalizedStrings.AgentImpl_THE_DIRECTORY_0_DOES_NOT_EXIST.toLocalizedString(parent));
-      }
-    }
-    this.propertyFile = f.getPath();
-  }
-
-  /**
-   * Gets the mcastAddress of the distributed system that this Agent is managing.
-   *
-   * @return The mcastAddress value
-   */
-  public String getMcastAddress() {
-    return this.agentConfig.getMcastAddress();
-  }
-
-  /**
-   * Sets the mcastAddress of the distributed system that this Agent is managing.
-   *
-   * @param mcastAddress The new mcastAddress value
-   */
-  public void setMcastAddress(String mcastAddress) {
-    this.agentConfig.setMcastAddress(mcastAddress);
-  }
-
-  /**
-   * Gets the mcastPort of the distributed system that this Agent is managing.
-   *
-   * @return The mcastPort value
-   */
-  public int getMcastPort() {
-    return this.agentConfig.getMcastPort();
-  }
-
-  /**
-   * Sets the mcastPort of the distributed system that this Agent is managing.
-   *
-   * @param mcastPort The new mcastPort value
-   */
-  public void setMcastPort(int mcastPort) {
-    this.agentConfig.setMcastPort(mcastPort);
-  }
-
-  /**
-   * Gets the locators of the distributed system that this Agent is managing.
-   * <p>
-   * Format is a comma-delimited list of "host[port]" entries.
-   *
-   * @return The locators value
-   */
-  public String getLocators() {
-    return this.agentConfig.getLocators();
-  }
-
-  /**
-   * Sets the locators of the distributed system that this Agent is managing.
-   * <p>
-   * Format is a comma-delimited list of "host[port]" entries.
-   *
-   * @param locators The new locators value
-   */
-  public void setLocators(String locators) {
-    this.agentConfig.setLocators(locators);
-  }
-
-  /**
-   * Gets the membership UDP port range in the distributed system that this Agent is monitoring.
-   * <p>
-   * This range is given as two numbers separated by a minus sign like "min-max"
-   *
-   * @return membership UDP port range
-   */
-  public String getMembershipPortRange() {
-    return this.agentConfig.getMembershipPortRange();
-  }
-
-  /**
-   * Sets the membership UDP port range in the distributed system that this Agent is monitoring.
-   * <p>
-   * This range is given as two numbers separated by a minus sign like "min-max"
-   *
-   * @param membershipPortRange membership UDP port range
-   */
-  public void setMembershipPortRange(String membershipPortRange) {
-    this.agentConfig.setMembershipPortRange(membershipPortRange);
-  }
-
-  /**
-   * Gets the bindAddress of the distributed system that this Agent is managing.
-   *
-   * @return The bindAddress value
-   */
-  public String getBindAddress() {
-    return this.agentConfig.getBindAddress();
-  }
-
-  /**
-   * Sets the bindAddress of the distributed system that this Agent is managing.
-   *
-   * @param bindAddress The new bindAddress value
-   */
-  public void setBindAddress(String bindAddress) {
-    this.agentConfig.setBindAddress(bindAddress);
-  }
-
-  /**
-   * Retrieves the command that the DistributedSystem will use to perform remote manipulation of
-   * config files and log files.
-   *
-   * @return the remote command for DistributedSystem
-   */
-  public String getRemoteCommand() {
-    return this.agentConfig.getRemoteCommand();
-  }
-
-  /**
-   * Sets the command that the DistributedSystem will use to perform remote manipulation of config
-   * files and log files.
-   *
-   * @param remoteCommand the remote command for DistributedSystem
-   */
-  public void setRemoteCommand(String remoteCommand) {
-    this.agentConfig.setRemoteCommand(remoteCommand);
-  }
-
-  /** Returns the system identity for the DistributedSystem */
-  public String getSystemId() {
-    return this.agentConfig.getSystemId();
-  }
-
-  /** Sets the system identity for the DistributedSystem */
-  public void setSystemId(String systemId) {
-    this.agentConfig.setSystemId(systemId);
-  }
-
-  /**
-   * Gets the logFileSizeLimit in megabytes of this Agent. Zero indicates no limit.
-   *
-   * @return The logFileSizeLimit value
-   */
-  public int getLogFileSizeLimit() {
-    return this.agentConfig.getLogFileSizeLimit();
-  }
-
-  /**
-   * Sets the logFileSizeLimit in megabytes of this Agent. Zero indicates no limit.
-   *
-   * @param logFileSizeLimit The new logFileSizeLimit value
-   */
-  public void setLogFileSizeLimit(int logFileSizeLimit) {
-    this.agentConfig.setLogFileSizeLimit(logFileSizeLimit);
-    LogWriterAppenders.configChanged(LogWriterAppenders.Identifier.MAIN);
-  }
-
-  /**
-   * Gets the logDiskSpaceLimit in megabytes of this Agent. Zero indicates no limit.
-   *
-   * @return The logDiskSpaceLimit value
-   */
-  public int getLogDiskSpaceLimit() {
-    return this.agentConfig.getLogDiskSpaceLimit();
-  }
-
-  /**
-   * Sets the logDiskSpaceLimit in megabytes of this Agent. Zero indicates no limit.
-   *
-   * @param logDiskSpaceLimit The new logDiskSpaceLimit value
-   */
-  public void setLogDiskSpaceLimit(int logDiskSpaceLimit) {
-    this.agentConfig.setLogDiskSpaceLimit(logDiskSpaceLimit);
-    LogWriterAppenders.configChanged(LogWriterAppenders.Identifier.MAIN);
-  }
-
-  /**
-   * Gets the logFile name for this Agent to log to.
-   *
-   * @return The logFile value
-   */
-  public String getLogFile() {
-    return this.agentConfig.getLogFile();
-  }
-
-  /**
-   * Sets the logFile name for this Agent to log to.
-   *
-   * @param logFile The new logFile value
-   */
-  public void setLogFile(String logFile) {
-    this.agentConfig.setLogFile(logFile);
-    LogWriterAppenders.configChanged(LogWriterAppenders.Identifier.MAIN);
-  }
-
-  /**
-   * Gets the logLevel of this Agent.
-   *
-   * @return The logLevel value
-   */
-  public String getLogLevel() {
-    return this.agentConfig.getLogLevel();
-  }
-
-  /**
-   * Sets the logLevel of this Agent.
-   *
-   * @param logLevel The new logLevel value
-   */
-  public void setLogLevel(String logLevel) {
-    this.agentConfig.setLogLevel(logLevel);
-    LogWriterAppenders.configChanged(LogWriterAppenders.Identifier.MAIN);
-  }
-
-  /** Returns true if the Agent is set to auto connect to a system. */
-  public boolean getAutoConnect() {
-    return this.agentConfig.getAutoConnect();
-  }
-
-  /** Returns true if the Agent is set to auto connect to a system. */
-  public boolean isAutoConnect() {
-    return this.agentConfig.getAutoConnect();
-  }
-
-  /** Sets or unsets the option to auto connect to a system. */
-  public void setAutoConnect(boolean v) {
-    this.agentConfig.setAutoConnect(v);
-  }
-
-  /**
-   * Returns the address (URL) on which the RMI connector server runs or <code>null</code> if the
-   * RMI connector server has not been started. This method is used primarily for testing purposes.
-   *
-   * @see JMXConnectorServer#getAddress()
-   */
-  public JMXServiceURL getRMIAddress() {
-    if (this.rmiConnector != null) {
-      return this.rmiConnector.getAddress();
-
-    } else {
-      return null;
-    }
-  }
-
-  /**
-   * Gets the configuration for this Agent.
-   *
-   * @return the configuration for this Agent
-   */
-  protected AgentConfig getAgentConfig() {
-    return this.agentConfig;
-  }
-
-  // -------------------------------------------------------------------------
-  // Internal implementation methods
-  // -------------------------------------------------------------------------
-
-  /** Returns the tail of the system log specified by <code>File</code>. */
-  private String tailFile(File f) {
-    try {
-      return TailLogResponse.tailSystemLog(f);
-    } catch (IOException ex) {
-      return LocalizedStrings.AgentImpl_COULD_NOT_TAIL_0_BECAUSE_1
-          .toLocalizedString(new Object[] {f, ex});
-    }
-  }
-
-  /**
-   * Returns the active MBeanServer which has any GemFire MBeans registered.
-   *
-   * @return the GemFire mbeanServer
-   */
-  public MBeanServer getMBeanServer() {
-    return mBeanServer;
-  }
-
-  // /**
-  // * Returns the active modeler Registry which has been initialized with all
-  // * the ModelMBean descriptors needed for GemFire MBeans.
-  // *
-  // * @return the modeler registry
-  // */
-  // private Registry getRegistry() {
-  // return MBeanUtil.getRegistry();
-  // }
-
-  /**
-   * Gets the current instance of LogWriter for logging
-   *
-   * @return the logWriter
-   */
-  public LogWriter getLogWriter() {
-    return this.logWriter;
-  }
-
-  private final Thread shutdownHook =
-      new Thread(LoggingThreadGroup.createThreadGroup("Shutdown"), "Shutdown") {
-        @Override
-        public void run() {
-          disconnectFromSystem();
-        }
-      };
-
-  /**
-   * Adds a ShutdownHook to the Agent for cleaning up any resources
-   */
-  private void addShutdownHook() {
-    if (!Boolean.getBoolean(
-        org.apache.geode.distributed.internal.InternalDistributedSystem.DISABLE_SHUTDOWN_HOOK_PROPERTY)) {
-      Runtime.getRuntime().addShutdownHook(shutdownHook);
-    }
-  }
-
-  private void removeShutdownHook() {
-    if (!Boolean.getBoolean(
-        org.apache.geode.distributed.internal.InternalDistributedSystem.DISABLE_SHUTDOWN_HOOK_PROPERTY)) {
-      Runtime.getRuntime().removeShutdownHook(shutdownHook);
-    }
-  }
-
-  /**
-   * Creates a LogWriterI18n for this Agent to use in logging.
-   */
-  @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE",
-      justification = "Return value for file delete is not important here.")
-  private void initLogWriter() throws org.apache.geode.admin.AdminException {
-    final LogConfig logConfig = this.agentConfig.createLogConfig();
-
-    // LOG: create logWriterAppender here
-    this.logWriterAppender = LogWriterAppenders
-        .getOrCreateAppender(LogWriterAppenders.Identifier.MAIN, false, logConfig, false);
-
-    // LOG: look in AgentConfigImpl for existing LogWriter to use
-    InternalLogWriter existingLogWriter = this.agentConfig.getInternalLogWriter();
-    if (existingLogWriter != null) {
-      this.logWriter = existingLogWriter;
-    } else {
-      // LOG: create LogWriterLogger
-      this.logWriter = LogWriterFactory.createLogWriterLogger(false, false, logConfig, false);
-      // LOG: changed statement from config to info
-      this.logWriter.info(Banner.getString(null));
-      // Set this log writer in AgentConfigImpl
-      this.agentConfig.setInternalLogWriter(this.logWriter);
-    }
-
-    // LOG: create logWriter here
-    this.logWriter = LogWriterFactory.createLogWriterLogger(false, false, logConfig, false);
-
-    // Set this log writer in AgentConfig
-    this.agentConfig.setInternalLogWriter(this.logWriter);
-
-    // Print Banner information
-    logger.info(Banner.getString(this.agentConfig.getOriginalArgs()));
-
-    // LOG:CONFIG: changed next three statements from config to info
-    logger.info(LogMarker.CONFIG, LocalizedStrings.AgentImpl_AGENT_CONFIG_PROPERTY_FILE_NAME_0
-        .toLocalizedString(AgentConfigImpl.retrievePropertyFile()));
-    logger.info(LogMarker.CONFIG, this.agentConfig.getPropertyFileDescription());
-    logger.info(LogMarker.CONFIG, this.agentConfig.toPropertiesAsString());
-  }
-
-  /**
-   * Stops the HttpAdaptor and its XsltProcessor. Unregisters the associated MBeans.
-   */
-  private void stopHttpAdaptor() {
-    if (!this.agentConfig.isHttpEnabled())
-      return;
-
-    // stop the adaptor...
-    try {
-      this.httpAdaptor.stop();
-    } catch (Exception e) {
-      logger.warn(e.getMessage(), e);
-    }
-
-    try {
-      MBeanUtil.unregisterMBean(getHttpAdaptorName());
-      MBeanUtil.unregisterMBean(getXsltProcessorName());
-    } catch (MalformedObjectNameException e) {
-      logger.warn(e.getMessage(), e);
-    }
-  }
-
-  /** Stops the RMIConnectorServer and unregisters its MBean. */
-  private void stopRMIConnectorServer() {
-    if (!this.agentConfig.isRmiEnabled())
-      return;
-
-    // stop the RMI Connector server...
-    try {
-      this.rmiConnector.stop();
-    } catch (Exception e) {
-      logger.warn(e.getMessage(), e);
-    }
-
-    try {
-      ObjectName rmiRegistryNamingName = getRMIRegistryNamingName();
-      if (this.agentConfig.isRmiRegistryEnabled()
-          && mBeanServer.isRegistered(rmiRegistryNamingName)) {
-        String[] empty = new String[0];
-        mBeanServer.invoke(rmiRegistryNamingName, "stop", empty, empty);
-        MBeanUtil.unregisterMBean(rmiRegistryNamingName);
-      }
-    } catch (MalformedObjectNameException e) {
-      logger.warn(e.getMessage(), e);
-    } catch (InstanceNotFoundException e) {
-      logger.warn(e.getMessage(), e);
-    } catch (ReflectionException e) {
-      logger.warn(e.getMessage(), e);
-    } catch (MBeanException e) {
-      logger.warn(e.getMessage(), e);
-    }
-
-    try {
-      ObjectName rmiConnectorServerName = getRMIConnectorServerName();
-      if (mBeanServer.isRegistered(rmiConnectorServerName)) {
-        MBeanUtil.unregisterMBean(rmiConnectorServerName);
-      }
-    } catch (MalformedObjectNameException e) {
-      logger.warn(e.getMessage(), e);
-    }
-  }
-
-  /** Stops the SnmpAdaptor and unregisters its MBean. */
-  private void stopSnmpAdaptor() {
-    if (!this.agentConfig.isSnmpEnabled())
-      return;
-
-    // stop the SnmpAdaptor...
-    try {
-      getMBeanServer().invoke(getSnmpAdaptorName(), "unbind", new Object[0], new String[0]);
-    } catch (Exception e) {
-      logger.warn(e.getMessage(), e);
-    }
-
-    try {
-      MBeanUtil.unregisterMBean(getSnmpAdaptorName());
-    } catch (MalformedObjectNameException e) {
-      logger.warn(e.getMessage(), e);
-    }
-  }
-
-  /** Returns the JMX ObjectName for the RMI registry Naming MBean. */
-  private ObjectName getRMIRegistryNamingName()
-      throws javax.management.MalformedObjectNameException {
-    return ObjectName.getInstance("naming:type=rmiregistry");
-  }
-
-  /** Returns the JMX ObjectName for the HttpAdaptor. */
-  private ObjectName getHttpAdaptorName() throws javax.management.MalformedObjectNameException {
-    return new ObjectName("Server:name=HttpAdaptor");
-  }
-
-  /** Returns the JMX ObjectName for the RMIConnectorServer. */
-  private ObjectName getRMIConnectorServerName()
-      throws javax.management.MalformedObjectNameException {
-    return new ObjectName("connectors:protocol=rmi");
-  }
-
-  /** Returns the JMX ObjectName for the SnmpAdaptor. */
-  private ObjectName getSnmpAdaptorName() throws javax.management.MalformedObjectNameException {
-    return new ObjectName("Adaptors:protocol=SNMP");
-  }
-
-  /** Returns the JMX ObjectName for the HttpAdaptor's XsltProcessor. */
-  private ObjectName getXsltProcessorName() throws javax.management.MalformedObjectNameException {
-    return new ObjectName("Server:name=XSLTProcessor");
-  }
-
-  // -------------------------------------------------------------------------
-  // Factory method for creating DistributedSystem
-  // -------------------------------------------------------------------------
-
-  /**
-   * Creates and connects to a <code>DistributedSystem</code>.
-   *
-   * @param config
-   */
-  private AdminDistributedSystem createDistributedSystem(AgentConfigImpl config)
-      throws org.apache.geode.admin.AdminException {
-    return new AdminDistributedSystemJmxImpl(config);
-  }
-
-  // -------------------------------------------------------------------------
-  // Agent main
-  // -------------------------------------------------------------------------
-
-  /**
-   * Command-line main for running the GemFire Management Agent.
-   * <p>
-   * Accepts command-line arguments matching the options in {@link AgentConfig} and
-   * {@link org.apache.geode.admin.DistributedSystemConfig}.
-   * <p>
-   * <code>AgentConfig</code> will convert -Jarguments to System properties.
-   */
-  public static void main(String[] args) {
-    SystemFailure.loadEmergencyClasses();
-
-    AgentConfigImpl ac;
-    try {
-      ac = new AgentConfigImpl(args);
-    } catch (RuntimeException ex) {
-      System.err
-          .println(LocalizedStrings.AgentImpl_FAILED_READING_CONFIGURATION_0.toLocalizedString(ex));
-      System.exit(1);
-      return;
-    }
-
-    try {
-      Agent agent = AgentFactory.getAgent(ac);
-      agent.start();
-
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Throwable t) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      t.printStackTrace();
-      System.exit(1);
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // MX4J Connectors/Adaptors
-  // -------------------------------------------------------------------------
-
-  private void createRMIRegistry() throws Exception {
-    if (!this.agentConfig.isRmiRegistryEnabled()) {
-      return;
-    }
-    MBeanServer mbs = getMBeanServer();
-    String host = this.agentConfig.getRmiBindAddress();
-    int port = this.agentConfig.getRmiPort();
-
-    /*
-     * Register and start the rmi-registry naming MBean, which is needed by JSR 160
-     * RMIConnectorServer
-     */
-    ObjectName registryName = getRMIRegistryNamingName();
-    try {
-      RMIRegistryService registryNamingService = null;
-      if (host != null && !("".equals(host.trim()))) {
-        registryNamingService = new RMIRegistryService(host, port);
-      } else {
-        registryNamingService = new RMIRegistryService(port);
-      }
-      mbs.registerMBean(registryNamingService, registryName);
-    } catch (javax.management.InstanceAlreadyExistsException e) {
-      logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_0__IS_ALREADY_REGISTERED,
-          registryName));
-    }
-    mbs.invoke(registryName, "start", null, null);
-  }
-
-  /**
-   * Defines and starts the JMX RMIConnector and service.
-   * <p>
-   * If {@link AgentConfig#isRmiEnabled} returns false, then this adaptor will not be started.
-   */
-  private void startRMIConnectorServer() {
-    if (!this.agentConfig.isRmiEnabled())
-      return;
-
-    String rmiBindAddress = this.agentConfig.getRmiBindAddress();
-
-    // Set RMI Stubs to use the given RMI Bind Address
-    // Default bindAddress is "", if none is set - ignore if not set
-    // If java.rmi.server.hostname property is specified then
-    // that override is not changed
-    String rmiStubServerNameKey = "java.rmi.server.hostname";
-    String overrideHostName = System.getProperty(rmiStubServerNameKey);
-    if ((overrideHostName == null || overrideHostName.trim().length() == 0)
-        && (rmiBindAddress != null && rmiBindAddress.trim().length() != 0)) {
-      System.setProperty(rmiStubServerNameKey, rmiBindAddress);
-      logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_SETTING_0,
-          new StringBuilder(rmiStubServerNameKey).append(" = ").append(rmiBindAddress)));
-    }
-
-    try {
-      createRMIRegistry();
-      ObjectName objName = getRMIConnectorServerName();
-
-      // make sure this adaptor is not already registered...
-      if (getMBeanServer().isRegistered(objName)) {
-        // dunno how we got here...
-        logger.info(LocalizedMessage.create(
-            LocalizedStrings.AgentImpl_RMICONNECTORSERVER_ALREADY_REGISTERED_AS__0, objName));
-        return;
-      }
-
-      /*
-       * url defined as: service:jmx:protocol:sap where 1. protocol: rmi 2. sap is:
-       * [host[:port]][url-path] where host: rmi-binding-address port: rmi-server-port url-path:
-       * /jndi/rmi://<rmi-binding-address>:<rmi-port><JNDI_NAME>
-       */
-      String urlString = null;
-      String connectorServerHost = "";
-      int connectorServerPort = this.agentConfig.getRmiServerPort();
-      String rmiRegistryHost = "";
-      int rmiRegistryPort = this.agentConfig.getRmiPort();
-
-      // Set registryHost to localhost if not specified
-      // RMI stubs would use a default IP if namingHost is left empty
-      if (rmiBindAddress == null || rmiBindAddress.trim().length() == 0) {
-        connectorServerHost = "localhost";
-        rmiRegistryHost = "";
-      } else {
-        connectorServerHost = applyRFC2732(rmiBindAddress);
-        rmiRegistryHost = connectorServerHost;
-      }
-
-      urlString = MessageFormat.format(AgentImpl.JMX_SERVICE_URL, connectorServerHost,
-          String.valueOf(connectorServerPort), rmiRegistryHost, String.valueOf(rmiRegistryPort),
-          JNDI_NAME);
-
-      logger.debug("JMX Service URL string is : \"{}\"", urlString);
-
-      // The address of the connector
-      JMXServiceURL url = new JMXServiceURL(urlString);
-
-      Map<String, Object> env = new HashMap<String, Object>();
-      // env.put(Context.INITIAL_CONTEXT_FACTORY,
-      // "com.sun.jndi.rmi.registry.RegistryContextFactory");
-      // env.put(Context.PROVIDER_URL, "rmi://localhost:1099");
-
-      RMIServerSocketFactory ssf = new MX4JServerSocketFactory(this.agentConfig.isAgentSSLEnabled(), // true,
-          this.agentConfig.isAgentSSLRequireAuth(), // true,
-          this.agentConfig.getAgentSSLProtocols(), // "any",
-          this.agentConfig.getAgentSSLCiphers(), // "any",
-          this.agentConfig.getRmiBindAddress(), 10, // backlog
-          this.agentConfig.getGfSecurityProperties());
-      env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, ssf);
-
-      if (this.agentConfig.isAgentSSLEnabled()) {
-        RMIClientSocketFactory csf = new SslRMIClientSocketFactory();
-        env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
-      }
-
-      MBeanServer mbs = null; // will be set by registering w/ mbeanServer
-      this.rmiConnector = JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
-
-      // for cleanup
-      this.rmiConnector.addNotificationListener(new ConnectionNotificationAdapter(),
-          new ConnectionNotificationFilterImpl(), this);
-
-      // Register the JMXConnectorServer in the MBeanServer
-      getMBeanServer().registerMBean(this.rmiConnector, objName);
-
-      // Start the JMXConnectorServer
-      this.rmiConnector.start();
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Throwable t) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(LocalizedStrings.AgentImpl_FAILED_TO_START_RMICONNECTORSERVER, t);
-      throw new StartupException(
-          LocalizedStrings.AgentImpl_FAILED_TO_START_RMI_SERVICE.toLocalizedString(), t);
-    }
-  }
-
-  /**
-   * Starts the optional third-party AdventNet SNMP Adaptor.
-   * <p>
-   * If {@link AgentConfig#isSnmpEnabled} returns false, then this adaptor will not be started.
-   */
-  private void startSnmpAdaptor() {
-    if (!this.agentConfig.isSnmpEnabled())
-      return;
-    try {
-      ObjectName objName = getSnmpAdaptorName();
-
-      // make sure this adaptor is not already registered...
-      if (getMBeanServer().isRegistered(objName)) {
-        // dunno how we got here...
-        logger.info(LocalizedMessage
-            .create(LocalizedStrings.AgentImpl_SNMPADAPTOR_ALREADY_REGISTERED_AS__0, objName));
-        return;
-      }
-
-      String className = "com.adventnet.adaptors.snmp.snmpsupport.SmartSnmpAdaptor";
-      String snmpDir = this.agentConfig.getSnmpDirectory();
-      // ex:/merry2/users/klund/agent
-
-      // validate the directory...
-      if (snmpDir == null || snmpDir.length() == 0) {
-        throw new IllegalArgumentException(
-            LocalizedStrings.AgentImpl_SNMPDIRECTORY_MUST_BE_SPECIFIED_BECAUSE_SNMP_IS_ENABLED
-                .toLocalizedString());
-      }
-      File root = new File(snmpDir);
-      if (!root.exists()) {
-        throw new IllegalArgumentException(
-            LocalizedStrings.AgentImpl_SNMPDIRECTORY_DOES_NOT_EXIST.toLocalizedString());
-      }
-
-      // create the adaptor...
-      String[] sigs = new String[] {"java.lang.String"};
-      Object[] args = new Object[] {snmpDir};
-
-      String bindAddress = this.agentConfig.getSnmpBindAddress();
-      if (bindAddress != null && bindAddress.length() > 0) {
-        sigs = new String[] {"java.lang.String", sigs[0]};
-        args = new Object[] {bindAddress, args[0]};
-      }
-
-      // go...
-      getMBeanServer().createMBean(className, objName, args, sigs);
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Throwable t) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(LocalizedMessage
-          .create(LocalizedStrings.AgentImpl_FAILED_TO_START_SNMPADAPTOR__0, t.getMessage()));
-      throw new StartupException(LocalizedStrings.AgentImpl_FAILED_TO_START_SNMPADAPTOR__0
-          .toLocalizedString(t.getMessage()), t);
-    }
-  }
-
-  /**
-   * Defines and starts the JMX Http Adaptor service from MX4J.
-   * <p>
-   * If {@link AgentConfig#isHttpEnabled} returns false, then this adaptor will not be started.
-   */
-  private void startHttpAdaptor() {
-    if (!this.agentConfig.isHttpEnabled())
-      return;
-    try {
-      ObjectName objName = getHttpAdaptorName();
-
-      // make sure this adaptor is not already registered...
-      if (getMBeanServer().isRegistered(objName)) {
-        // dunno how we got here...
-        logger.info(LocalizedMessage
-            .create(LocalizedStrings.AgentImpl_HTTPADAPTOR_ALREADY_REGISTERED_AS__0, objName));
-        return;
-      }
-
-      this.httpAdaptor = new HttpAdaptor();
-
-      // validate and set host and port values...
-      if (this.agentConfig.getHttpPort() > 0) {
-        this.httpAdaptor.setPort(this.agentConfig.getHttpPort());
-        logger.info(LogMarker.CONFIG,
-            LocalizedMessage.create(LocalizedStrings.AgentImpl_HTTP_ADAPTOR_LISTENING_ON_PORT__0,
-                this.agentConfig.getHttpPort()));
-      } else {
-        logger.error(LocalizedMessage.create(LocalizedStrings.AgentImpl_INCORRECT_PORT_VALUE__0,
-            this.agentConfig.getHttpPort()));
-      }
-
-      if (this.agentConfig.getHttpBindAddress() != null) {
-        String host = this.agentConfig.getHttpBindAddress();
-        logger.info(LogMarker.CONFIG, LocalizedMessage
-            .create(LocalizedStrings.AgentImpl_HTTP_ADAPTOR_LISTENING_ON_ADDRESS__0, host));
-        this.httpAdaptor.setHost(host);
-      } else {
-        logger.error(LocalizedMessage.create(LocalizedStrings.AgentImpl_INCORRECT_NULL_HOSTNAME));
-      }
-
-      // SSL support...
-      MX4JServerSocketFactory socketFactory =
-          new MX4JServerSocketFactory(this.agentConfig.isAgentSSLEnabled(),
-              this.agentConfig.isHttpSSLRequireAuth(), this.agentConfig.getAgentSSLProtocols(),
-              this.agentConfig.getAgentSSLCiphers(), this.agentConfig.getGfSecurityProperties());
-      this.httpAdaptor.setSocketFactory(socketFactory);
-
-      // authentication (user login) support...
-      if (this.agentConfig.isHttpAuthEnabled()) {
-        // this pops up a login dialog from the browser...
-        this.httpAdaptor.setAuthenticationMethod(MX4J_HTTPADAPTOR_BASIC_AUTHENTICATION); // only
-                                                                                         // basic
-                                                                                         // works
-
-        this.httpAdaptor.addAuthorization(this.agentConfig.getHttpAuthUser(),
-            this.agentConfig.getHttpAuthPassword());
-      }
-
-      // add the XsltProcessor...
-      this.httpAdaptor.setProcessorName(createXsltProcessor());
-
-      // register the HttpAdaptor and snap on the XsltProcessor...
-      getMBeanServer().registerMBean(this.httpAdaptor, objName);
-      this.httpAdaptor.start();
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Throwable t) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(LocalizedMessage
-          .create(LocalizedStrings.AgentImpl_FAILED_TO_START_HTTPADAPTOR__0, t.getMessage()));
-      throw new StartupException(LocalizedStrings.AgentImpl_FAILED_TO_START_HTTPADAPTOR__0
-          .toLocalizedString(t.getMessage()), t);
-    }
-  }
-
-  /**
-   * Defines and starts the Xslt Processor helper service for the Http Adaptor.
-   */
-  private ObjectName createXsltProcessor() throws javax.management.JMException {
-    ObjectName objName = getXsltProcessorName();
-
-    // make sure this mbean is not already registered...
-    if (getMBeanServer().isRegistered(objName)) {
-      // dunno how we got here...
-      logger.info(LocalizedMessage
-          .create(LocalizedStrings.AgentImpl_XSLTPROCESSOR_ALREADY_REGISTERED_AS__0, objName));
-      return objName;
-    }
-
-    getMBeanServer().registerMBean(new mx4j.tools.adaptor.http.XSLTProcessor(), objName);
-    return objName;
-  }
-
-  // -------------------------------------------------------------------------
-  // Private support methods...
-  // -------------------------------------------------------------------------
-
-  // /** Not used anymore but seems moderately useful... */
-  // private String[] parseSSLCiphers(String ciphers) {
-  // List list = new ArrayList();
-  // StringTokenizer st = new StringTokenizer(ciphers);
-  // while (st.hasMoreTokens()) {
-  // list.add(st.nextToken());
-  // }
-  // return (String[]) list.toArray(new String[list.size()]);
-  // }
-
-  // -------------------------------------------------------------------------
-  // SSL configuration for GemFire
-  // -------------------------------------------------------------------------
-  public boolean isSSLEnabled() {
-    return this.agentConfig.isSSLEnabled();
-  }
-
-  public void setSSLEnabled(boolean enabled) {
-    this.agentConfig.setSSLEnabled(enabled);
-  }
-
-  public String getSSLProtocols() {
-    return this.agentConfig.getSSLProtocols();
-  }
-
-  public void setSSLProtocols(String protocols) {
-    this.agentConfig.setSSLProtocols(protocols);
-  }
-
-  public String getSSLCiphers() {
-    return this.agentConfig.getSSLCiphers();
-  }
-
-  public void setSSLCiphers(String ciphers) {
-    this.agentConfig.setSSLCiphers(ciphers);
-  }
-
-  public boolean isSSLAuthenticationRequired() {
-    return this.agentConfig.isSSLAuthenticationRequired();
-  }
-
-  public void setSSLAuthenticationRequired(boolean authRequired) {
-    this.agentConfig.setSSLAuthenticationRequired(authRequired);
-  }
-
-  public Properties getSSLProperties() {
-    return this.agentConfig.getSSLProperties();
-  }
-
-  public void setSSLProperties(Properties sslProperties) {
-    this.agentConfig.setSSLProperties(sslProperties);
-  }
-
-  public void addSSLProperty(String key, String value) {
-    this.agentConfig.addSSLProperty(key, value);
-  }
-
-  public void removeSSLProperty(String key) {
-    this.agentConfig.removeSSLProperty(key);
-  }
-
-  // -------------------------------------------------------------------------
-  // ManagedResource implementation
-  // -------------------------------------------------------------------------
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.AGENT;
-  }
-
-  public void cleanupResource() {}
-
-  static class StartupException extends GemFireException {
-    private static final long serialVersionUID = 6614145962199330348L;
-
-    StartupException(Throwable cause) {
-      super(cause);
-    }
-
-    StartupException(String reason, Throwable cause) {
-      super(reason, cause);
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // Other Support methods
-  // -------------------------------------------------------------------------
-  /**
-   * Checks the no. of active RMI clients and updates a flag in the Admin Distributed System.
-   *
-   * @see AdminDistributedSystemJmxImpl#setRmiClientCountZero(boolean)
-   * @since GemFire 6.0
-   */
-  void updateRmiClientsCount() {
-    int noOfClientsConnected = 0;
-
-    String[] connectionIds = this.rmiConnector.getConnectionIds();
-
-    if (connectionIds != null) {
-      noOfClientsConnected = connectionIds.length;
-    }
-
-    logger.info("No. of RMI clients connected :: {}", noOfClientsConnected);
-
-    AdminDistributedSystemJmxImpl adminDSJmx = (AdminDistributedSystemJmxImpl) this.system;
-
-    adminDSJmx.setRmiClientCountZero(noOfClientsConnected == 0);
-  }
-
-  @Override
-  public String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.append("AgentImpl[");
-    sb.append("config=" + agentConfig.toProperties().toString());
-    // sb.append("; adaptor=" + httpAdaptor.toString());
-    sb.append("; mbeanName=" + mbeanName);
-    sb.append("; modelMBean=" + modelMBean);
-    sb.append("; objectName=" + objectName);
-    sb.append("; propertyFile=" + propertyFile);
-    sb.append(": rmiConnector=" + rmiConnector);
-    // sb.append("; system=" + system);)
-    sb.append("]");
-    return sb.toString();
-  }
-
-  /**
-   * Process the String form of a hostname to make it comply with Jmx URL restrictions. Namely wrap
-   * IPv6 literal address with "[", "]"
-   * 
-   * @param hostname the name to safeguard.
-   * @return a string representation suitable for use in a Jmx connection URL
-   */
-  private static String applyRFC2732(String hostname) {
-    if (hostname.indexOf(":") != -1) {
-      // Assuming an IPv6 literal because of the ':'
-      return "[" + hostname + "]";
-    }
-    return hostname;
-  }
-}
-
-
-/**
- * Adapter class for NotificationListener that listens to notifications of type
- * javax.management.remote.JMXConnectionNotification
- *
- * @since GemFire 6.0
- */
-class ConnectionNotificationAdapter implements NotificationListener {
-  private static final Logger logger = LogService.getLogger();
-
-  /**
-   * If the handback object passed is an AgentImpl, updates the JMX client count
-   *
-   * @param notification JMXConnectionNotification for change in client connection status
-   * @param handback An opaque object which helps the listener to associate information regarding
-   *        the MBean emitter. This object is passed to the MBean during the addListener call and
-   *        resent, without modification, to the listener. The MBean object should not use or modify
-   *        the object. (NOTE: copied from javax.management.NotificationListener)
-   */
-  @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "BC_UNCONFIRMED_CAST",
-      justification = "Only JMXConnectionNotification instances are used.")
-  public void handleNotification(Notification notification, Object handback) {
-    if (handback instanceof AgentImpl) {
-      AgentImpl agent = (AgentImpl) handback;
-
-      JMXConnectionNotification jmxNotifn = (JMXConnectionNotification) notification;
-
-      if (logger.isDebugEnabled()) {
-        logger.debug("Connection notification for connection id : '{}'",
-            jmxNotifn.getConnectionId());
-      }
-
-      agent.updateRmiClientsCount();
-    }
-  }
-}
-
-
-/**
- * Filters out the notifications of the type JMXConnectionNotification.OPENED,
- * JMXConnectionNotification.CLOSED and JMXConnectionNotification.FAILED.
- *
- * @since GemFire 6.0
- */
-class ConnectionNotificationFilterImpl implements NotificationFilter {
-
-  /**
-   * Default serialVersionUID
-   */
-  private static final long serialVersionUID = 1L;
-
-  /**
-   * Invoked before sending the specified notification to the listener. Returns whether the given
-   * notification is to be sent to the listener.
-   *
-   * @param notification The notification to be sent.
-   * @return true if the notification has to be sent to the listener, false otherwise.
-   */
-  public boolean isNotificationEnabled(Notification notification) {
-    boolean isThisNotificationEnabled = false;
-    if (notification.getType().equals(JMXConnectionNotification.OPENED)
-        || notification.getType().equals(JMXConnectionNotification.CLOSED)
-        || notification.getType().equals(JMXConnectionNotification.FAILED)) {
-      isThisNotificationEnabled = true;
-    }
-    return isThisNotificationEnabled;
-  }
-}
-


[18/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java
new file mode 100755
index 0000000..2facc17
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JModelMBean.java
@@ -0,0 +1,1232 @@
+/*
+ * Copyright (C) MX4J. All rights reserved.
+ *
+ * This software is distributed under the terms of the MX4J License version 1.0. See the terms of
+ * the MX4J License in the documentation provided with this software.
+ */
+
+package org.apache.geode.internal.admin.api.jmx.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Date;
+import java.util.Iterator;
+
+import javax.management.Attribute;
+import javax.management.AttributeChangeNotification;
+import javax.management.AttributeChangeNotificationFilter;
+import javax.management.AttributeList;
+import javax.management.AttributeNotFoundException;
+import javax.management.Descriptor;
+import javax.management.InstanceNotFoundException;
+import javax.management.InvalidAttributeValueException;
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanNotificationInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanRegistration;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.Notification;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.NotificationEmitter;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.management.RuntimeErrorException;
+import javax.management.RuntimeOperationsException;
+import javax.management.ServiceNotFoundException;
+import javax.management.loading.ClassLoaderRepository;
+import javax.management.modelmbean.InvalidTargetObjectTypeException;
+import javax.management.modelmbean.ModelMBean;
+import javax.management.modelmbean.ModelMBeanAttributeInfo;
+import javax.management.modelmbean.ModelMBeanInfo;
+import javax.management.modelmbean.ModelMBeanOperationInfo;
+
+import mx4j.ImplementationException;
+import mx4j.log.FileLogger;
+import mx4j.log.Log;
+import mx4j.log.Logger;
+import mx4j.log.MBeanLogger;
+import mx4j.persist.FilePersister;
+import mx4j.persist.MBeanPersister;
+import mx4j.persist.PersisterMBean;
+import mx4j.util.Utils;
+
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+/**
+ * @author <a href="mailto:biorn_steedom@users.sourceforge.net">Simone Bordet</a>
+ * @version $Revision: 1.14 $
+ */
+public class MX4JModelMBean implements ModelMBean, MBeanRegistration, NotificationEmitter {
+  private static final String OBJECT_RESOURCE_TYPE = "ObjectReference";
+
+  private static final int ALWAYS_STALE = 1;
+  private static final int NEVER_STALE = 2;
+  private static final int STALE = 3;
+  private static final int NOT_STALE = 4;
+
+  private static final int PERSIST_NEVER = -1;
+  private static final int PERSIST_ON_TIMER = -2;
+  private static final int PERSIST_ON_UPDATE = -3;
+  private static final int PERSIST_NO_MORE_OFTEN_THAN = -4;
+
+  private MBeanServer m_mbeanServer;
+  private Object m_managedResource;
+  private boolean m_canBeRegistered;
+  private ModelMBeanInfo m_modelMBeanInfo;
+  private NotificationBroadcasterSupport m_attributeChangeBroadcaster =
+      new NotificationBroadcasterSupport();
+  private NotificationBroadcasterSupport m_generalBroadcaster =
+      new NotificationBroadcasterSupport();
+
+  public MX4JModelMBean() throws MBeanException, RuntimeOperationsException {
+    try {
+      load();
+    } catch (Exception x) {
+      Logger logger = getLogger();
+      logger.warn(LocalizedStrings.MX4JModelMBean_CANNOT_RESTORE_PREVIOUSLY_SAVED_STATUS
+          .toLocalizedString(), x);
+    }
+  }
+
+  public MX4JModelMBean(ModelMBeanInfo info) throws MBeanException, RuntimeOperationsException {
+    if (info == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_PARAMETER_CANT_BE_NULL
+              .toLocalizedString()));
+    else
+      setModelMBeanInfo(info);
+  }
+
+  private Logger getLogger() {
+    return Log.getLogger(getClass().getName());
+  }
+
+  public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception {
+    if (m_canBeRegistered) {
+      m_mbeanServer = server;
+      return name;
+    } else {
+      throw new MBeanRegistrationException(new IllegalStateException(
+          LocalizedStrings.MX4JModelMBean_MODELMBEAN_CANNOT_BE_REGISTERED_UNTIL_SETMODELMBEANINFO_HAS_BEEN_CALLED
+              .toLocalizedString()));
+    }
+  }
+
+  public void postRegister(Boolean registrationDone) {
+    if (!registrationDone.booleanValue())
+      clear();
+  }
+
+  public void preDeregister() throws Exception {}
+
+  public void postDeregister() {
+    clear();
+  }
+
+  private void clear() {
+    m_mbeanServer = null;
+    m_managedResource = null;
+    m_modelMBeanInfo = null;
+    m_generalBroadcaster = null;
+    m_attributeChangeBroadcaster = null;
+    // PENDING: also remove generic listeners, attribute change listeners, log4j appenders...
+  }
+
+  public void setModelMBeanInfo(ModelMBeanInfo modelMBeanInfo)
+      throws MBeanException, RuntimeOperationsException {
+    if (modelMBeanInfo == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_CANNOT_BE_NULL.toLocalizedString()));
+    if (!isModelMBeanInfoValid(modelMBeanInfo))
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_IS_INVALID.toLocalizedString()));
+
+    m_modelMBeanInfo = (ModelMBeanInfo) modelMBeanInfo.clone();
+
+    Logger logger = getLogger();
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("ModelMBeanInfo successfully set to: " + m_modelMBeanInfo);
+    // Only now the MBean can be registered in the MBeanServer
+    m_canBeRegistered = true;
+  }
+
+  private boolean isModelMBeanInfoValid(ModelMBeanInfo info) {
+    if (info == null || info.getClassName() == null)
+      return false;
+    // PENDING: maybe more checks are needed
+    return true;
+  }
+
+  public void setManagedResource(Object resource, String resourceType) throws MBeanException,
+      RuntimeOperationsException, InstanceNotFoundException, InvalidTargetObjectTypeException {
+    if (resource == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_MANAGED_RESOURCE_CANNOT_BE_NULL.toLocalizedString()));
+    if (!isResourceTypeSupported(resourceType))
+      throw new InvalidTargetObjectTypeException(resourceType);
+
+    Logger logger = getLogger();
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Setting managed resource to be: " + resource);
+    m_managedResource = resource;
+  }
+
+  private boolean isResourceTypeSupported(String resourceType) {
+    // For now only object reference is supported
+    return OBJECT_RESOURCE_TYPE.equals(resourceType);
+  }
+
+  private Object getManagedResource() {
+    return m_managedResource;
+  }
+
+  public MBeanInfo getMBeanInfo() {
+    return m_modelMBeanInfo == null ? null : (MBeanInfo) m_modelMBeanInfo.clone();
+  }
+
+  public void addAttributeChangeNotificationListener(NotificationListener listener,
+      String attributeName, Object handback)
+      throws MBeanException, RuntimeOperationsException, IllegalArgumentException {
+    if (listener == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_LISTENER_CANNOT_BE_NULL.toLocalizedString()));
+    AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
+    if (attributeName != null) {
+      filter.enableAttribute(attributeName);
+    } else {
+      MBeanAttributeInfo[] ai = m_modelMBeanInfo.getAttributes();
+      for (int i = 0; i < ai.length; i++) {
+        Descriptor d = ((ModelMBeanAttributeInfo) ai[i]).getDescriptor();
+        filter.enableAttribute((String) d.getFieldValue("name"));
+      }
+    }
+
+    getAttributeChangeBroadcaster().addNotificationListener(listener, filter, handback);
+
+    Logger logger = getLogger();
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Listener " + listener + " for attribute " + attributeName
+          + " added successfully, handback is " + handback);
+  }
+
+  public void addNotificationListener(NotificationListener listener, NotificationFilter filter,
+      Object handback) throws IllegalArgumentException {
+    m_generalBroadcaster.addNotificationListener(listener, filter, handback);
+  }
+
+  public MBeanNotificationInfo[] getNotificationInfo() {
+    return m_modelMBeanInfo.getNotifications();
+  }
+
+  public void removeAttributeChangeNotificationListener(NotificationListener listener,
+      String attributeName) throws RuntimeOperationsException, ListenerNotFoundException {
+    try {
+      removeAttributeChangeNotificationListener(listener, attributeName, null);
+    } catch (MBeanException e) {
+      throw new RuntimeOperationsException(new RuntimeException(e.getMessage()));
+    }
+  }
+
+  // Not in the spec but needed
+  private void removeAttributeChangeNotificationListener(NotificationListener listener,
+      String attributeName, Object handback)
+      throws MBeanException, RuntimeOperationsException, ListenerNotFoundException {
+    if (listener == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_LISTENER_CANNOT_BE_NULL.toLocalizedString()));
+    AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
+    if (attributeName != null) {
+      filter.enableAttribute(attributeName);
+    } else {
+      MBeanAttributeInfo[] ai = m_modelMBeanInfo.getAttributes();
+      for (int i = 0; i < ai.length; i++) {
+        Descriptor d = ((ModelMBeanAttributeInfo) ai[i]).getDescriptor();
+        filter.enableAttribute((String) d.getFieldValue("name"));
+      }
+    }
+
+    getAttributeChangeBroadcaster().removeNotificationListener(listener, filter, handback);
+
+    Logger logger = getLogger();
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Listener " + listener + " for attribute " + attributeName
+          + " removed successfully, handback is " + handback);
+  }
+
+  public void removeNotificationListener(NotificationListener listener)
+      throws RuntimeOperationsException, ListenerNotFoundException {
+    m_generalBroadcaster.removeNotificationListener(listener);
+  }
+
+  public void removeNotificationListener(NotificationListener listener, NotificationFilter filter,
+      Object handback) throws RuntimeOperationsException, ListenerNotFoundException {
+    m_generalBroadcaster.removeNotificationListener(listener, filter, handback);
+  }
+
+  public void sendAttributeChangeNotification(Attribute oldAttribute, Attribute newAttribute)
+      throws MBeanException, RuntimeOperationsException {
+    if (oldAttribute == null || newAttribute == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_CANNOT_BE_NULL.toLocalizedString()));
+    if (!oldAttribute.getName().equals(newAttribute.getName()))
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_NAMES_CANNOT_BE_DIFFERENT.toLocalizedString()));
+
+    // TODO: the source must be the object name of the MBean if the listener was registered through
+    // MBeanServer
+    Object oldValue = oldAttribute.getValue();
+    AttributeChangeNotification n = new AttributeChangeNotification(this, 1,
+        System.currentTimeMillis(), "Attribute value changed", oldAttribute.getName(),
+        oldValue == null ? null : oldValue.getClass().getName(), oldValue, newAttribute.getValue());
+    sendAttributeChangeNotification(n);
+  }
+
+  public void sendAttributeChangeNotification(AttributeChangeNotification notification)
+      throws MBeanException, RuntimeOperationsException {
+    if (notification == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_NOTIFICATION_CANNOT_BE_NULL.toLocalizedString()));
+
+    getAttributeChangeBroadcaster().sendNotification(notification);
+
+    Logger modelMBeanLogger = getModelMBeanLogger(notification.getType());
+    if (modelMBeanLogger != null)
+      if (modelMBeanLogger.isEnabledFor(Logger.DEBUG))
+        modelMBeanLogger.debug("ModelMBean log: " + new Date() + " - " + notification);
+
+    Logger logger = getLogger();
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Attribute change notification " + notification + " sent");
+  }
+
+  public void sendNotification(String message) throws MBeanException, RuntimeOperationsException {
+    Notification notification = new Notification("jmx.modelmbean.general", this, 1, message);
+    sendNotification(notification);
+  }
+
+  public void sendNotification(Notification notification)
+      throws MBeanException, RuntimeOperationsException {
+    if (m_generalBroadcaster != null) {
+      m_generalBroadcaster.sendNotification(notification);
+    }
+  }
+
+  public AttributeList getAttributes(String[] attributes) {
+    if (attributes == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_NAMES_CANNOT_BE_NULL.toLocalizedString()));
+
+    Logger logger = getLogger();
+
+    AttributeList list = new AttributeList();
+    for (int i = 0; i < attributes.length; ++i) {
+      String attrName = attributes[i];
+      Attribute attribute = null;
+      try {
+        Object value = getAttribute(attrName);
+        attribute = new Attribute(attrName, value);
+        list.add(attribute);
+      } catch (Exception x) {
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("getAttribute for attribute " + attrName + " failed", x);
+        // And go on with the next attribute
+      }
+    }
+    return list;
+  }
+
+  public Object getAttribute(String attribute)
+      throws AttributeNotFoundException, MBeanException, ReflectionException {
+    if (attribute == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_NAME_CANNOT_BE_NULL.toLocalizedString()));
+
+    Logger logger = getLogger();
+
+    // I want the real info, not its clone
+    ModelMBeanInfo info = getModelMBeanInfo();
+    if (info == null)
+      throw new AttributeNotFoundException(
+          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_IS_NULL.toLocalizedString());
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("ModelMBeanInfo is: " + info);
+
+    // This is a clone, we use it read only
+    ModelMBeanAttributeInfo attrInfo = info.getAttribute(attribute);
+    if (attrInfo == null)
+      throw new AttributeNotFoundException(
+          LocalizedStrings.MX4JModelMBean_CANNOT_FIND_MODELMBEANATTRIBUTEINFO_FOR_ATTRIBUTE_0
+              .toLocalizedString(attribute));
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Attribute info is: " + attrInfo);
+    if (!attrInfo.isReadable())
+      throw new AttributeNotFoundException(
+          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_0_IS_NOT_READABLE.toLocalizedString(attribute));
+
+    // This returns a clone of the mbean descriptor, we use it read only
+    Descriptor mbeanDescriptor = info.getMBeanDescriptor();
+    if (mbeanDescriptor == null)
+      throw new AttributeNotFoundException(
+          LocalizedStrings.MX4JModelMBean_MBEAN_DESCRIPTOR_CANNOT_BE_NULL.toLocalizedString());
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("MBean descriptor is: " + mbeanDescriptor);
+
+    // This descriptor is a clone
+    Descriptor attributeDescriptor = attrInfo.getDescriptor();
+    if (attributeDescriptor == null)
+      throw new AttributeNotFoundException(
+          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_DESCRIPTOR_FOR_ATTRIBUTE_0_CANNOT_BE_NULL
+              .toLocalizedString(attribute));
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Attribute descriptor is: " + attributeDescriptor);
+
+    Object returnValue = null;
+
+    String lastUpdateField = "lastUpdatedTimeStamp";
+
+    int staleness = getStaleness(attributeDescriptor, mbeanDescriptor, lastUpdateField);
+
+    if (staleness == ALWAYS_STALE || staleness == STALE) {
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("Value is stale");
+
+      String getter = (String) attributeDescriptor.getFieldValue("getMethod");
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("getMethod field is: " + getter);
+      if (getter == null) {
+        // No getter, use default value
+        returnValue = attributeDescriptor.getFieldValue("default");
+
+        if (returnValue != null) {
+          // Check if the return type is of the same type
+          // As an extension allow covariant return type
+          Class returned = returnValue.getClass();
+          Class declared = loadClassWithContextClassLoader(attrInfo.getType());
+
+          checkAssignability(returned, declared);
+        }
+
+        if (logger.isEnabledFor(Logger.DEBUG))
+          logger.debug(
+              "getAttribute for attribute " + attribute + " returns default value: " + returnValue);
+      } else {
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("Invoking attribute getter...");
+        // As an extension, allow attributes to be called on target objects also
+        Object target = resolveTargetObject(attributeDescriptor);
+        returnValue = invokeMethod(target, getter, new Class[0], new Object[0]);
+        if (logger.isEnabledFor(Logger.DEBUG))
+          logger.debug("Returned value is: " + returnValue);
+
+        if (returnValue != null) {
+          // Check if the return type is of the same type
+          // As an extension allow covariant return type
+          Class returned = returnValue.getClass();
+          Class declared = loadClassWithContextClassLoader(attrInfo.getType());
+
+          checkAssignability(returned, declared);
+        }
+
+        // Cache the new value only if caching is needed
+        if (staleness != ALWAYS_STALE) {
+          attributeDescriptor.setField("value", returnValue);
+          attributeDescriptor.setField(lastUpdateField, Long.valueOf(System.currentTimeMillis()));
+          if (logger.isEnabledFor(Logger.TRACE))
+            logger.trace("Returned value has been cached");
+
+          // And now replace the descriptor with the updated clone
+          info.setDescriptor(attributeDescriptor, "attribute");
+        }
+
+        if (logger.isEnabledFor(Logger.DEBUG))
+          logger.debug(
+              "getAttribute for attribute " + attribute + " returns invoked value: " + returnValue);
+      }
+    } else {
+      // Return cached value
+      returnValue = attributeDescriptor.getFieldValue("value");
+
+      if (returnValue != null) {
+        // Check if the return type is of the same type
+        // As an extension allow covariant return type
+        Class returned = returnValue.getClass();
+        Class declared = loadClassWithContextClassLoader(attrInfo.getType());
+
+        checkAssignability(returned, declared);
+      }
+
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug(
+            "getAttribute for attribute " + attribute + " returns cached value: " + returnValue);
+    }
+
+    // Puff, everything went ok
+    return returnValue;
+  }
+
+  public AttributeList setAttributes(AttributeList attributes) {
+    if (attributes == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_LIST_CANNOT_BE_NULL.toLocalizedString()));
+
+    Logger logger = getLogger();
+
+    AttributeList list = new AttributeList();
+    for (Iterator i = attributes.iterator(); i.hasNext();) {
+      Attribute attribute = (Attribute) i.next();
+      String name = attribute.getName();
+      try {
+        setAttribute(attribute);
+        list.add(attribute);
+      } catch (Exception x) {
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("setAttribute for attribute " + name + " failed", x);
+        // And go on with the next one
+      }
+    }
+    return list;
+  }
+
+  public void setAttribute(Attribute attribute) throws AttributeNotFoundException,
+      InvalidAttributeValueException, MBeanException, ReflectionException {
+    if (attribute == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_CANNOT_BE_NULL.toLocalizedString()));
+
+    Logger logger = getLogger();
+
+    // No need to synchronize: I work mostly on clones
+    // I want the real info, not its clone
+    ModelMBeanInfo info = getModelMBeanInfo();
+    if (info == null)
+      throw new AttributeNotFoundException(
+          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_IS_NULL.toLocalizedString());
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("ModelMBeanInfo is: " + info);
+
+    String attrName = attribute.getName();
+    Object attrValue = attribute.getValue();
+
+    // This is a clone, we use it read only
+    ModelMBeanAttributeInfo attrInfo = info.getAttribute(attrName);
+    if (attrInfo == null)
+      throw new AttributeNotFoundException(
+          LocalizedStrings.MX4JModelMBean_CANNOT_FIND_MODELMBEANATTRIBUTEINFO_FOR_ATTRIBUTE_0
+              .toLocalizedString(attrName));
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Attribute info is: " + attrInfo);
+
+    if (!attrInfo.isWritable())
+      throw new AttributeNotFoundException(
+          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_0_IS_NOT_WRITABLE.toLocalizedString(attrName));
+
+    // This returns a clone of the mbean descriptor, we use it read only
+    Descriptor mbeanDescriptor = info.getMBeanDescriptor();
+    if (mbeanDescriptor == null)
+      throw new AttributeNotFoundException(
+          LocalizedStrings.MX4JModelMBean_MBEAN_DESCRIPTOR_CANNOT_BE_NULL.toLocalizedString());
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("MBean descriptor is: " + mbeanDescriptor);
+
+    // This descriptor is a clone
+    Descriptor attributeDescriptor = attrInfo.getDescriptor();
+    if (attributeDescriptor == null)
+      throw new AttributeNotFoundException(
+          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_DESCRIPTOR_FOR_ATTRIBUTE_0_CANNOT_BE_NULL
+              .toLocalizedString(attrName));
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Attribute descriptor is: " + attributeDescriptor);
+
+    String lastUpdateField = "lastUpdatedTimeStamp";
+
+    Object oldValue = null;
+    try {
+      oldValue = getAttribute(attrName);
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("Previous value of attribute " + attrName + ": " + oldValue);
+    } catch (Exception x) {
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("Cannot get previous value of attribute " + attrName, x);
+    }
+
+    // Check if setMethod is present
+    String method = (String) attributeDescriptor.getFieldValue("setMethod");
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("setMethod field is: " + method);
+    if (method != null) {
+      Class declared = loadClassWithContextClassLoader(attrInfo.getType());
+      if (attrValue != null) {
+        Class parameter = attrValue.getClass();
+        checkAssignability(parameter, declared);
+      }
+
+      // As an extension, allow attributes to be called on target objects also
+      Object target = resolveTargetObject(attributeDescriptor);
+      invokeMethod(target, method, new Class[] {declared}, new Object[] {attrValue});
+
+      // Cache the value only if currencyTimeLimit is not 0, ie it is not always stale
+      int staleness = getStaleness(attributeDescriptor, mbeanDescriptor, lastUpdateField);
+      if (staleness != ALWAYS_STALE) {
+        attributeDescriptor.setField("value", attrValue);
+        attributeDescriptor.setField(lastUpdateField, Long.valueOf(System.currentTimeMillis()));
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("Attribute's value has been cached");
+      } else {
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("Always stale, avoiding to cache attribute's value");
+      }
+    } else {
+      if (attrValue != null) {
+        Class parameter = attrValue.getClass();
+        Class declared = loadClassWithContextClassLoader(attrInfo.getType());
+
+        checkAssignability(parameter, declared);
+      }
+
+      // Always store the value in the descriptor: no setMethod
+      attributeDescriptor.setField("value", attrValue);
+    }
+
+    // And now replace the descriptor with the updated clone
+    info.setDescriptor(attributeDescriptor, "attribute");
+
+    // Send notifications to listeners
+    if (logger.isEnabledFor(Logger.TRACE))
+      logger.trace("Sending attribute change notifications");
+    sendAttributeChangeNotification(new Attribute(attrName, oldValue), attribute);
+
+    // Persist this ModelMBean
+    boolean persistNow = shouldPersistNow(attributeDescriptor, mbeanDescriptor, lastUpdateField);
+    if (persistNow) {
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("Persisting this ModelMBean...");
+      try {
+        store();
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("ModelMBean persisted successfully");
+      } catch (Exception x) {
+        logger.error(LocalizedStrings.MX4JModelMBean_CANNOT_STORE_MODELMBEAN_AFTER_SETATTRIBUTE, x);
+        if (x instanceof MBeanException)
+          throw (MBeanException) x;
+        else
+          throw new MBeanException(x);
+      }
+    }
+  }
+
+  public Object invoke(String method, Object[] arguments, String[] params)
+      throws MBeanException, ReflectionException {
+    if (method == null)
+      throw new RuntimeOperationsException(new IllegalArgumentException(
+          LocalizedStrings.MX4JModelMBean_METHOD_NAME_CANNOT_BE_NULL.toLocalizedString()));
+    if (arguments == null)
+      arguments = new Object[0];
+    if (params == null)
+      params = new String[0];
+
+    Logger logger = getLogger();
+
+    // Find operation descriptor
+    ModelMBeanInfo info = getModelMBeanInfo();
+    if (info == null)
+      throw new MBeanException(new ServiceNotFoundException(
+          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_IS_NULL.toLocalizedString()));
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("ModelMBeanInfo is: " + info);
+
+    // This is a clone, we use it read only
+    ModelMBeanOperationInfo operInfo = info.getOperation(method);
+    if (operInfo == null)
+      throw new MBeanException(new ServiceNotFoundException(
+          LocalizedStrings.MX4JModelMBean_CANNOT_FIND_MODELMBEANOPERATIONINFO_FOR_OPERATION_0
+              .toLocalizedString(method)));
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Operation info is: " + operInfo);
+
+    // This descriptor is a clone
+    Descriptor operationDescriptor = operInfo.getDescriptor();
+    if (operationDescriptor == null)
+      throw new MBeanException(new ServiceNotFoundException(
+          LocalizedStrings.MX4JModelMBean_OPERATION_DESCRIPTOR_FOR_OPERATION_0_CANNOT_BE_NULL
+              .toLocalizedString(method)));
+    String role = (String) operationDescriptor.getFieldValue("role");
+    if (role == null || !role.equals("operation"))
+      throw new MBeanException(new ServiceNotFoundException(
+          LocalizedStrings.MX4JModelMBean_OPERATION_DESCRIPTOR_FIELD_ROLE_MUST_BE_OPERATION_NOT_0
+              .toLocalizedString(role)));
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Operation descriptor is: " + operationDescriptor);
+
+    // This returns a clone of the mbean descriptor, we use it read only
+    Descriptor mbeanDescriptor = info.getMBeanDescriptor();
+    if (mbeanDescriptor == null)
+      throw new MBeanException(new ServiceNotFoundException(
+          LocalizedStrings.MX4JModelMBean_MBEAN_DESCRIPTOR_CANNOT_BE_NULL.toLocalizedString()));
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("MBean descriptor is: " + mbeanDescriptor);
+
+    Object returnValue = null;
+
+    String lastUpdateField = "lastReturnedTimeStamp";
+
+    // Check if the method should be invoked given the cache settings
+    int staleness = getStaleness(operationDescriptor, mbeanDescriptor, lastUpdateField);
+
+    if (staleness == ALWAYS_STALE || staleness == STALE) {
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("Value is stale");
+
+      // Find parameters classes
+      Class[] parameters = null;
+      try {
+        parameters = Utils.loadClasses(Thread.currentThread().getContextClassLoader(), params);
+      } catch (ClassNotFoundException x) {
+        logger.error(LocalizedStrings.MX4JModelMBean_CANNOT_FIND_OPERATIONS_PARAMETER_CLASSES, x);
+        throw new ReflectionException(x);
+      }
+
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("Invoking operation...");
+
+      // Find target object
+      Object target = resolveTargetObject(operationDescriptor);
+      returnValue = invokeMethod(target, method, parameters, arguments);
+
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("Returned value is: " + returnValue);
+
+      if (returnValue != null) {
+        Class parameter = returnValue.getClass();
+        Class declared = loadClassWithContextClassLoader(operInfo.getReturnType());
+
+        checkAssignability(parameter, declared);
+      }
+
+      // Cache the new value only if caching is needed
+      if (staleness != ALWAYS_STALE) {
+        operationDescriptor.setField("lastReturnedValue", returnValue);
+        operationDescriptor.setField(lastUpdateField, Long.valueOf(System.currentTimeMillis()));
+        if (logger.isEnabledFor(Logger.TRACE)) {
+          logger.trace("Returned value has been cached");
+        }
+
+        // And now replace the descriptor with the updated clone
+        info.setDescriptor(operationDescriptor, "operation");
+      }
+
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("invoke for operation " + method + " returns invoked value: " + returnValue);
+    } else {
+      // Return cached value
+      returnValue = operationDescriptor.getFieldValue("lastReturnedValue");
+
+      if (returnValue != null) {
+        Class parameter = returnValue.getClass();
+        Class declared = loadClassWithContextClassLoader(operInfo.getReturnType());
+
+        checkAssignability(parameter, declared);
+      }
+
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("invoke for operation " + method + " returns cached value: " + returnValue);
+    }
+
+    // As an extension, persist this model mbean also after operation invocation, but using only
+    // settings provided in the operation descriptor, without falling back to defaults set in
+    // the MBean descriptor
+    boolean persistNow = shouldPersistNow(operationDescriptor, null, lastUpdateField);
+    int impact = operInfo.getImpact();
+    if (persistNow && impact != MBeanOperationInfo.INFO) {
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("Persisting this ModelMBean...");
+      try {
+        store();
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("ModelMBean persisted successfully");
+      } catch (Exception x) {
+        logger.error(
+            LocalizedStrings.MX4JModelMBean_CANNOT_STORE_MODELMBEAN_AFTER_OPERATION_INVOCATION, x);
+        if (x instanceof MBeanException)
+          throw (MBeanException) x;
+        else
+          throw new MBeanException(x);
+      }
+    }
+
+    return returnValue;
+  }
+
+  private Object resolveTargetObject(Descriptor descriptor) throws MBeanException {
+    Logger logger = getLogger();
+    Object target = descriptor.getFieldValue("targetObject");
+    if (logger.isEnabledFor(Logger.TRACE))
+      logger.trace("targetObject is: " + target);
+    if (target == null) {
+      target = getManagedResource();
+    } else {
+      String targetObjectType = (String) descriptor.getFieldValue("targetObjectType");
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("targetObjectType is: " + targetObjectType);
+      if (targetObjectType == null) {
+        // Not defined, assume object reference
+        targetObjectType = OBJECT_RESOURCE_TYPE;
+      }
+
+      if (!isResourceTypeSupported(targetObjectType))
+        throw new MBeanException(new InvalidTargetObjectTypeException(targetObjectType));
+    }
+    return target;
+  }
+
+  public void load() throws MBeanException, RuntimeOperationsException, InstanceNotFoundException {
+    PersisterMBean persister = findPersister();
+    if (persister != null) {
+      ModelMBeanInfo info = (ModelMBeanInfo) persister.load();
+      setModelMBeanInfo(info);
+    }
+  }
+
+  public void store() throws MBeanException, RuntimeOperationsException, InstanceNotFoundException {
+    PersisterMBean persister = findPersister();
+    if (persister != null) {
+      // Take a clone to avoid synchronization problems
+      ModelMBeanInfo info = (ModelMBeanInfo) getMBeanInfo();
+      persister.store(info);
+    }
+  }
+
+  protected ClassLoaderRepository getClassLoaderRepository() {
+    if (m_mbeanServer != null)
+      return m_mbeanServer.getClassLoaderRepository();
+    else
+      return null;
+  }
+
+
+  private boolean shouldPersistNow(Descriptor attribute, Descriptor mbean, String lastUpdateField) {
+    int persist = getPersistPolicy(attribute, mbean);
+    if (persist == PERSIST_NO_MORE_OFTEN_THAN) {
+      Long period = getFieldTimeValue(attribute, mbean, "persistPeriod");
+      long now = System.currentTimeMillis();
+      Long lastUpdate = (Long) attribute.getFieldValue(lastUpdateField);
+      if (now - lastUpdate.longValue() < period.longValue())
+        return false;
+      else
+        return true;
+    } else if (persist == PERSIST_NEVER) {
+      return false;
+    } else if (persist == PERSIST_ON_TIMER) {
+      return false;
+    } else if (persist == PERSIST_ON_UPDATE) {
+      return true;
+    } else {
+      throw new ImplementationException(
+          LocalizedStrings.MX4JModelMBean_INVALID_PERSIST_VALUE.toLocalizedString());
+    }
+  }
+
+  private int getPersistPolicy(Descriptor descriptor, Descriptor mbean) {
+    Logger logger = getLogger();
+
+    String persist = (String) descriptor.getFieldValue("persistPolicy");
+    if (persist == null && mbean != null)
+      persist = (String) mbean.getFieldValue("persistPolicy");
+    if (persist == null) {
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("No persist policy defined, assuming Never");
+      return PERSIST_NEVER;
+    } else {
+      if (persist.equals("Never")) {
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("Persist never");
+        return PERSIST_NEVER;
+      } else if (persist.equals("OnUpdate")) {
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("Persist on update");
+        return PERSIST_ON_UPDATE;
+      } else if (persist.equals("OnTimer")) {
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("Persist on update");
+        return PERSIST_ON_TIMER;
+      } else if (persist.equals("NoMoreOftenThan")) {
+        if (logger.isEnabledFor(Logger.TRACE)) {
+          Long period = getFieldTimeValue(descriptor, mbean, "persistPeriod");
+          logger.trace("Persist no more often than " + period);
+        }
+        return PERSIST_NO_MORE_OFTEN_THAN;
+      } else {
+        // Garbage, assuming Never
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("Invalid persist policy, assuming persist never");
+        return PERSIST_NEVER;
+      }
+    }
+  }
+
+  private int getStaleness(Descriptor attribute, Descriptor mbean, String lastUpdateField) {
+    Logger logger = getLogger();
+
+    Long currencyTimeLimit = getFieldTimeValue(attribute, mbean, "currencyTimeLimit");
+    if (currencyTimeLimit == null) {
+      // No time limit defined
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("No currencyTimeLimit defined, assuming always stale");
+      return ALWAYS_STALE;
+    } else {
+      long ctl = currencyTimeLimit.longValue() * 1000;
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("currencyTimeLimit is (ms): " + ctl);
+
+      if (ctl == 0) {
+        // Never stale
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("Never stale");
+        return NEVER_STALE;
+      } else if (ctl < 0) // this should be == -1 but the other cases are in the air
+      {
+        // Always stale
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("Always stale");
+        return ALWAYS_STALE;
+      } else {
+        Long timestamp = (Long) attribute.getFieldValue(lastUpdateField);
+        long luts = 0;
+
+        if (timestamp != null)
+          luts = timestamp.longValue();
+        if (logger.isEnabledFor(Logger.DEBUG))
+          logger.debug(lastUpdateField + " is: " + luts);
+
+        long now = System.currentTimeMillis();
+        if (now < luts + ctl) {
+          // Seems to be not stale, but has been set at least once ?
+          if (timestamp == null) {
+            // Return stale to call it the first time
+            if (logger.isEnabledFor(Logger.TRACE))
+              logger.trace("Stale since was never set");
+            return STALE;
+          } else {
+            if (logger.isEnabledFor(Logger.TRACE))
+              logger.trace("Not stale");
+            return NOT_STALE;
+          }
+        } else {
+          // Stale
+          if (logger.isEnabledFor(Logger.TRACE))
+            logger.trace("Stale");
+          return STALE;
+        }
+      }
+    }
+  }
+
+  private Long getFieldTimeValue(Descriptor descriptor, Descriptor mbean, String field) {
+    Logger logger = getLogger();
+
+    Object value = descriptor.getFieldValue(field);
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Descriptor's " + field + " field: " + value);
+
+    if (value == null && mbean != null) {
+      value = mbean.getFieldValue(field);
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("MBean's " + field + " field: " + value);
+      if (value == null)
+        return null;
+    }
+
+    if (value instanceof Number)
+      return Long.valueOf(((Number) value).longValue());
+
+    if (value instanceof String) {
+      try {
+        long ctl = Long.parseLong((String) value);
+        return Long.valueOf(ctl);
+      } catch (NumberFormatException x) {
+        return Long.valueOf(0);
+      }
+    }
+    return Long.valueOf(0);
+  }
+
+  private Object invokeMethod(Object target, String methodName, Class[] params, Object[] args)
+      throws MBeanException, ReflectionException {
+    // First try on this instance, then on the target
+    Object realTarget = null;
+    Method method = null;
+    try {
+      realTarget = this;
+      method = realTarget.getClass().getMethod(methodName, params);
+    } catch (NoSuchMethodException x) {
+      realTarget = target;
+    }
+
+    if (realTarget == null)
+      throw new MBeanException(new ServiceNotFoundException(
+          LocalizedStrings.MX4JModelMBean_COULD_NOT_FIND_TARGET.toLocalizedString()));
+
+    if (method == null) {
+      try {
+        method = realTarget.getClass().getMethod(methodName, params);
+      } catch (NoSuchMethodException x) {
+        throw new ReflectionException(x);
+      }
+    }
+
+    try {
+      Object value = method.invoke(realTarget, args);
+      Logger logger = getLogger();
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("Method invocation returned value: " + value);
+      return value;
+    } catch (IllegalAccessException x) {
+      throw new ReflectionException(x);
+    } catch (IllegalArgumentException x) {
+      throw new MBeanException(x);
+    } catch (InvocationTargetException x) {
+      Throwable t = x.getTargetException();
+      if (t instanceof Error)
+        throw new MBeanException(new RuntimeErrorException((Error) t));
+      else
+        throw new MBeanException((Exception) t);
+    }
+  }
+
+  private Logger getModelMBeanLogger(String notificationType) throws MBeanException {
+    // Get a copy to avoid synchronization
+    ModelMBeanInfo info = getModelMBeanInfo();
+
+    // First look if there is a suitable notification descriptor, otherwise use MBean descriptor
+    Descriptor descriptor = null;
+    Logger modelMBeanLogger = null;
+    if (notificationType != null) {
+      descriptor = info.getDescriptor(notificationType, "notification");
+      modelMBeanLogger = findLogger(descriptor);
+    }
+
+    if (modelMBeanLogger == null) {
+      descriptor = info.getMBeanDescriptor();
+      modelMBeanLogger = findLogger(descriptor);
+      if (modelMBeanLogger != null)
+        return modelMBeanLogger;
+    }
+
+    return null;
+  }
+
+  private Logger findLogger(Descriptor descriptor) {
+    Logger logger = getLogger();
+
+    if (descriptor == null) {
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("Can't find MBean logger, descriptor is null");
+      return null;
+    }
+
+    String log = (String) descriptor.getFieldValue("log");
+    String location = (String) descriptor.getFieldValue("logFile");
+
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Log fields: log=" + log + ", file=" + location);
+
+    if (log == null || !Boolean.valueOf(log).booleanValue()) {
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("Logging is not supported by this ModelMBean");
+      return null;
+    }
+    // Logger is supported, where log to ?
+    if (location == null) {
+      // As an extension, see if the field logMBean has been defined
+      location = (String) descriptor.getFieldValue("logMBean");
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("Log fields: mbean=" + location);
+
+      if (location == null) {
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("Logging is not supported by this ModelMBean");
+        return null;
+      }
+
+      // It seems that the user wants to delegate a registered mbean to log
+      try {
+        ObjectName objectName = new ObjectName(location);
+        MBeanServer server = getMBeanServer();
+        if (server == null)
+          throw new MBeanException(new IllegalStateException(
+              LocalizedStrings.MX4JModelMBean_MX4JMODELMBEAN_IS_NOT_REGISTERED
+                  .toLocalizedString()));
+        if (server.isRegistered(objectName)) {
+          MBeanLogger l = new MBeanLogger(server, objectName);
+          if (logger.isEnabledFor(Logger.DEBUG))
+            logger.debug("ModelMBean log supported by delegating to this MBean: " + objectName);
+          return l;
+        }
+
+        return null;
+      } catch (MalformedObjectNameException x) {
+        // Ah, was not a correct object name
+        if (logger.isEnabledFor(Logger.DEBUG))
+          logger.debug("Specified logMBean field does not contain a valid ObjectName: " + location);
+        return null;
+      } catch (MBeanException x) {
+        if (logger.isEnabledFor(Logger.DEBUG))
+          logger.debug("logMBean field does not specify an MBean that supports logging delegation",
+              x);
+        return null;
+      }
+    } else {
+      // User decided to log to a file
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("ModelMBean log supported on file system");
+      return new FileLogger(location);
+    }
+  }
+
+  private NotificationBroadcasterSupport getAttributeChangeBroadcaster() {
+    return m_attributeChangeBroadcaster;
+  }
+
+  private MBeanServer getMBeanServer() {
+    return m_mbeanServer;
+  }
+
+  private ModelMBeanInfo getModelMBeanInfo() {
+    // No cloning performed
+    return m_modelMBeanInfo;
+  }
+
+  private PersisterMBean findPersister() throws MBeanException, InstanceNotFoundException {
+    Logger logger = getLogger();
+
+    ModelMBeanInfo info = getModelMBeanInfo();
+    if (info == null) {
+      // Not yet initialized
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("Can't find persister, ModelMBeanInfo is null");
+      return null;
+    }
+    Descriptor mbeanDescriptor = info.getMBeanDescriptor();
+    if (mbeanDescriptor == null) {
+      // This is normally should not happen if ModelMBeanInfoSupport is used
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("Can't find persister, MBean descriptor is null");
+      return null;
+    }
+
+    String location = (String) mbeanDescriptor.getFieldValue("persistLocation");
+    String name = (String) mbeanDescriptor.getFieldValue("persistName");
+    String mbeanName = (String) mbeanDescriptor.getFieldValue("name");
+    if (logger.isEnabledFor(Logger.DEBUG))
+      logger.debug("Persistence fields: location=" + location + ", name=" + name);
+
+    if (mbeanName == null && name == null) {
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("Persistence is not supported by this ModelMBean");
+      return null;
+    }
+
+    // Try to see if this mbean should delegate to another mbean
+    if (name != null) {
+      try {
+        ObjectName objectName = new ObjectName(name.trim());
+        // OK, a valid object name
+        MBeanServer server = getMBeanServer();
+        if (server == null)
+          throw new MBeanException(new IllegalStateException(
+              LocalizedStrings.MX4JModelMBean_MX4JMODELMBEAN_IS_NOT_REGISTERED
+                  .toLocalizedString()));
+
+        if (server.isRegistered(objectName)
+            && server.isInstanceOf(objectName, PersisterMBean.class.getName())) {
+          // OK, the given mbean is registered with this mbean server
+          PersisterMBean persister = new MBeanPersister(server, objectName);
+          if (logger.isEnabledFor(Logger.DEBUG))
+            logger.debug("Persistence is delegated to this MBean: " + objectName);
+          return persister;
+        } else {
+          throw new InstanceNotFoundException(objectName.toString());
+        }
+      } catch (MalformedObjectNameException ignored) {
+        // It does not delegates to another mbean, use default
+        if (logger.isEnabledFor(Logger.TRACE))
+          logger.trace("Persistence is not delegated to another MBean");
+      }
+
+      // Default is serialization to file
+      FilePersister persister = new FilePersister(location, name);
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("Persistence is realized through file system in " + persister.getFileName());
+      return persister;
+    } else {
+      // Only location given, use MBean name
+      FilePersister persister = new FilePersister(location, mbeanName);
+      if (logger.isEnabledFor(Logger.DEBUG))
+        logger.debug("Persistence is realized through file system in " + persister.getFileName());
+      return persister;
+    }
+  }
+
+  private Class loadClassWithContextClassLoader(String name) {
+    try {
+      return Utils.loadClass(Thread.currentThread().getContextClassLoader(), name);
+    } catch (ClassNotFoundException x) {
+      Logger logger = getLogger();
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace("Cannot find attribute's declared return class", x);
+      return null;
+    }
+  }
+
+  private void checkAssignability(Class parameter, Class declared) throws MBeanException {
+    Logger logger = getLogger();
+
+    if (logger.isEnabledFor(Logger.DEBUG)) {
+      logger.debug("The class of the parameter is: " + parameter);
+      if (parameter != null)
+        logger.debug("The classloder of the parameter's class is: " + parameter.getClassLoader());
+      logger.debug("The class declared as type of the attribute is: " + declared);
+      if (declared != null)
+        logger.debug(
+            "The classloader of the declared parameter's class is: " + declared.getClassLoader());
+    }
+
+    boolean assignable = false;
+
+    if (declared == null || parameter == null)
+      assignable = false;
+    else if (declared == boolean.class && parameter == Boolean.class)
+      assignable = true;
+    else if (declared == byte.class && parameter == Byte.class)
+      assignable = true;
+    else if (declared == char.class && parameter == Character.class)
+      assignable = true;
+    else if (declared == short.class && parameter == Short.class)
+      assignable = true;
+    else if (declared == int.class && parameter == Integer.class)
+      assignable = true;
+    else if (declared == long.class && parameter == Long.class)
+      assignable = true;
+    else if (declared == float.class && parameter == Float.class)
+      assignable = true;
+    else if (declared == double.class && parameter == Double.class)
+      assignable = true;
+    else
+      assignable = declared.isAssignableFrom(parameter);
+
+    if (!assignable) {
+      if (logger.isEnabledFor(Logger.TRACE))
+        logger.trace(
+            "Parameter value's class and attribute's declared return class are not assignable");
+      throw new MBeanException(new InvalidAttributeValueException(
+          LocalizedStrings.MX4JModelMBean_RETURNED_TYPE_AND_DECLARED_TYPE_ARE_NOT_ASSIGNABLE
+              .toLocalizedString()));
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JServerSocketFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JServerSocketFactory.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JServerSocketFactory.java
new file mode 100644
index 0000000..cf9df4a
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MX4JServerSocketFactory.java
@@ -0,0 +1,136 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.impl.InetAddressUtil;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.net.SocketCreatorFactory;
+
+import org.apache.logging.log4j.Logger;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.util.Properties;
+
+/**
+ * Creates <code>ServerSockets</code> for JMX adaptors.
+ * <p>
+ * The interface {@link mx4j.tools.adaptor.AdaptorServerSocketFactory} is implemented in order to
+ * support securing of {@link mx4j.tools.adaptor.http.HttpAdaptor}.
+ * <p>
+ * The interface {@link java.rmi.server.RMIServerSocketFactory} is implemented to support the
+ * securing of {@link javax.management.remote.JMXConnectorServer}. See
+ * {@link javax.management.remote.rmi.RMIConnectorServer} for the actual subclass that is used for
+ * the JMX RMI adaptor.
+ * <p>
+ * Complete info on JSSE, including debugging, can be found at
+ * <a href="http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html">
+ * http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html</a>
+ *
+ * @since GemFire 3.5 (old name was SSLAdaptorServerSocketFactory)
+ */
+public class MX4JServerSocketFactory implements mx4j.tools.adaptor.AdaptorServerSocketFactory,
+    java.rmi.server.RMIServerSocketFactory {
+
+  private static final Logger logger = LogService.getLogger();
+
+  private static final int DEFAULT_BACKLOG = 50;
+
+  private final SocketCreator socketCreator;
+  private String bindAddress = DistributedSystemConfig.DEFAULT_BIND_ADDRESS;
+  private int backlog = DEFAULT_BACKLOG;
+
+  /**
+   * Constructs new instance of MX4JServerSocketFactory.
+   * 
+   * @param useSSL true if ssl is to be enabled
+   * @param needClientAuth true if client authentication is required
+   * @param protocols space-delimited list of ssl protocols to use
+   * @param ciphers space-delimited list of ssl ciphers to use
+   * @param gfsecurityProps vendor properties passed in through gfsecurity.properties
+   */
+  public MX4JServerSocketFactory(boolean useSSL, boolean needClientAuth, String protocols,
+      String ciphers, Properties gfsecurityProps) {
+    if (protocols == null || protocols.length() == 0) {
+      protocols = DistributionConfig.DEFAULT_SSL_PROTOCOLS;
+    }
+    if (ciphers == null || ciphers.length() == 0) {
+      ciphers = DistributionConfig.DEFAULT_SSL_CIPHERS;
+    }
+    this.socketCreator = SocketCreatorFactory.createNonDefaultInstance(useSSL, needClientAuth,
+        protocols, ciphers, gfsecurityProps);
+  }
+
+  /**
+   * Constructs new instance of MX4JServerSocketFactory.
+   * 
+   * @param useSSL true if ssl is to be enabled
+   * @param needClientAuth true if client authentication is required
+   * @param protocols space-delimited list of ssl protocols to use
+   * @param ciphers space-delimited list of ssl ciphers to use
+   * @param bindAddress host or address to bind to (bind-address)
+   * @param backlog how many connections are queued
+   * @param gfsecurityProps vendor properties passed in through gfsecurity.properties
+   */
+  public MX4JServerSocketFactory(boolean useSSL, boolean needClientAuth, String protocols,
+      String ciphers, String bindAddress, // optional for RMI impl
+      int backlog, // optional for RMI impl
+      Properties gfsecurityProps) {
+    this(useSSL, needClientAuth, protocols, ciphers, gfsecurityProps);
+    this.bindAddress = bindAddress;
+    this.backlog = backlog;
+  }
+
+  // -------------------------------------------------------------------------
+  // mx4j.tools.adaptor.AdaptorServerSocketFactory impl...
+  // -------------------------------------------------------------------------
+
+  public ServerSocket createServerSocket(int port, int backlog, String bindAddress)
+      throws IOException {
+    if ("".equals(bindAddress)) {
+      return socketCreator.createServerSocket(port, backlog);
+
+    } else {
+      return socketCreator.createServerSocket(port, backlog,
+          InetAddressUtil.toInetAddress(bindAddress));
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // java.rmi.server.RMIServerSocketFactory impl...
+  // -------------------------------------------------------------------------
+
+  public ServerSocket createServerSocket(int port) throws IOException {
+    ServerSocket sock = null;
+    if ("".equals(bindAddress)) {
+      sock = socketCreator.createServerSocket(port, this.backlog);
+    } else {
+      sock = socketCreator.createServerSocket(port, this.backlog,
+          InetAddressUtil.toInetAddress(this.bindAddress));
+    }
+
+    if (logger.isDebugEnabled()) {
+      logger.debug(
+          "MX4JServerSocketFactory RMIServerSocketFactory, INetAddress {}, LocalPort {}, LocalSocketAddress {}",
+          sock.getInetAddress(), sock.getLocalPort(), sock.getLocalSocketAddress());
+    }
+    return sock;
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MailManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MailManager.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MailManager.java
new file mode 100755
index 0000000..92e6f2d
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/MailManager.java
@@ -0,0 +1,327 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Properties;
+
+import javax.mail.Message;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+
+/**
+ * Provides the ways to send emails to all the registered email id It also provides the way to
+ * add/remove email ids. Can be used to send email in case of any alerts raised / warning / failure
+ * in gemfire.
+ * 
+ * @since GemFire 5.1
+ */
+public class MailManager {
+
+  private static final Logger logger = LogService.getLogger();
+
+  public MailManager() {}
+
+  public MailManager(Properties mailProperties) {
+    setMailProperties(mailProperties);
+  }
+
+  public MailManager(File mailPropertiesFile) throws IOException {
+    Properties prop = new Properties();
+    FileInputStream fio = new FileInputStream(mailPropertiesFile);
+    try {
+      prop.load(fio);
+    } finally {
+      fio.close();
+    }
+    setMailProperties(prop);
+  }
+
+  public MailManager(String mailHost, String mailFrom) {
+    this.mailHost = mailHost;
+    this.mailFrom = mailFrom;
+  }
+
+  /**
+   * Send email to all the registered email id with given subject and message
+   */
+  public void sendEmail(String subject, String message) {
+    processEmail(new EmailData(subject, message));
+  }
+
+  /**
+   * Send Emails to all the registered email id
+   * 
+   * @param emailData Instance of EmailData
+   */
+  // Why a separate method & class EmailData needed???
+  private void processEmail(EmailData emailData) {
+    if (logger.isTraceEnabled()) {
+      logger.trace("Entered MailManager:processEmail");
+    }
+
+    if (mailHost == null || mailHost.length() == 0 || emailData == null
+        || mailToAddresses.length == 0) {
+      logger.error(LocalizedMessage
+          .create(LocalizedStrings.MailManager_REQUIRED_MAILSERVER_CONFIGURATION_NOT_SPECIFIED));
+      if (logger.isDebugEnabled()) {
+        logger.debug("Exited MailManager:processEmail: Not sending email as conditions not met");
+      }
+      return;
+    }
+
+    Session session = Session.getDefaultInstance(getMailHostConfiguration());
+    MimeMessage mimeMessage = new MimeMessage(session);
+    String subject = emailData.subject;
+    String message = emailData.message;
+    String mailToList = getMailToAddressesAsString();
+
+    try {
+      for (int i = 0; i < mailToAddresses.length; i++) {
+        mimeMessage.addRecipient(Message.RecipientType.TO, new InternetAddress(mailToAddresses[i]));
+      }
+
+      if (subject == null) {
+        subject = LocalizedStrings.MailManager_ALERT_MAIL_SUBJECT.toLocalizedString();
+      }
+      mimeMessage.setSubject(subject);
+
+      if (message == null) {
+        message = "";
+      }
+      mimeMessage.setText(message);
+
+      Transport.send(mimeMessage);
+      logger.info(
+          LocalizedMessage.create(LocalizedStrings.MailManager_EMAIL_ALERT_HAS_BEEN_SENT_0_1_2,
+              new Object[] {mailToList, subject, message}));
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (Throwable ex) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      StringBuilder buf = new StringBuilder();
+      buf.append(LocalizedStrings.MailManager_AN_EXCEPTION_OCCURRED_WHILE_SENDING_EMAIL
+          .toLocalizedString());
+      buf.append(
+          LocalizedStrings.MailManager_UNABLE_TO_SEND_EMAIL_PLEASE_CHECK_YOUR_EMAIL_SETTINGS_AND_LOG_FILE
+              .toLocalizedString());
+      buf.append("\n\n").append(
+          LocalizedStrings.MailManager_EXCEPTION_MESSAGE_0.toLocalizedString(ex.getMessage()));
+      buf.append("\n\n").append(
+          LocalizedStrings.MailManager_FOLLOWING_EMAIL_WAS_NOT_DELIVERED.toLocalizedString());
+      buf.append("\n\t")
+          .append(LocalizedStrings.MailManager_MAIL_HOST_0.toLocalizedString(mailHost));
+      buf.append("\n\t").append(LocalizedStrings.MailManager_FROM_0.toLocalizedString(mailFrom));
+      buf.append("\n\t").append(LocalizedStrings.MailManager_TO_0.toLocalizedString(mailToList));
+      buf.append("\n\t").append(LocalizedStrings.MailManager_SUBJECT_0.toLocalizedString(subject));
+      buf.append("\n\t").append(LocalizedStrings.MailManager_CONTENT_0.toLocalizedString(message));
+
+      logger.error(buf.toString(), ex);
+    }
+    if (logger.isTraceEnabled()) {
+      logger.trace("Exited MailManager:processEmail");
+    }
+  }
+
+  /**
+   * Not yet implemented
+   */
+  public void close() {}
+
+  /**
+   * @return All the registered email id as string
+   */
+  private String getMailToAddressesAsString() {
+    StringBuffer mailToList = new StringBuffer();
+    for (int i = 0; i < mailToAddresses.length; i++) {
+      mailToList.append(mailToAddresses[i]);
+      mailToList.append(", ");
+    }
+    return mailToList.toString();
+  }
+
+  /**
+   * 
+   * @return Properties consisting mailHost and mailFrom property
+   */
+  private Properties getMailHostConfiguration() {
+    Properties result = new Properties();
+    if (mailHost == null) {
+      mailHost = "";
+    }
+    if (mailFrom == null) {
+      mailFrom = "";
+    }
+    result.setProperty("mail.host", mailHost);
+    result.put("mail.from", mailFrom);
+    return result;
+  }
+
+  /**
+   * 
+   * @param host mail host server name
+   */
+  public void setMailHost(String host) {
+    this.mailHost = host;
+  }
+
+  /**
+   * 
+   * @return mail host server name
+   */
+  public String getMailHost() {
+    return this.mailHost;
+  }
+
+  /**
+   * 
+   * @param fromAddress mailFrom email id
+   */
+  public void setMailFromAddress(String fromAddress) {
+    mailFrom = fromAddress;
+  }
+
+  /**
+   * 
+   * @return mailFrom email id
+   */
+  public String getMailFromAddress() {
+    return mailFrom;
+  }
+
+  /**
+   * add new mail id to ToList
+   */
+  public void addMailToAddress(String toAddress) {
+    mailToSet.add(toAddress);
+    mailToAddresses = getAllToAddresses();
+  }
+
+  /**
+   * remove given mail id from ToList
+   */
+  public void removeMailToAddress(String toAddress) {
+    mailToSet.remove(toAddress);
+    mailToAddresses = getAllToAddresses();
+  }
+
+  /**
+   * @return list all the registered email id
+   */
+  public String[] getAllToAddresses() {
+    return (String[]) mailToSet.toArray(new String[0]);
+  }
+
+  /**
+   * remove all the registered email ids from ToList
+   */
+  public void removeAllMailToAddresses() {
+    mailToSet.clear();
+    mailToAddresses = new String[0];
+  }
+
+  /**
+   * Set the mail properties, e.g mail host, mailFrom, MailTo etc
+   */
+  public void setMailProperties(Properties mailProperties) {
+    mailHost = mailProperties.getProperty(PROPERTY_MAIL_HOST);
+    mailFrom = mailProperties.getProperty(PROPERTY_MAIL_FROM);
+    String mailList = mailProperties.getProperty(PROPERTY_MAIL_TO_LIST, "");
+    String split[] = mailList.split(",");
+    removeAllMailToAddresses();
+    for (int i = 0; i < split.length; i++) {
+      addMailToAddress(split[i].trim());
+    }
+  }
+
+  @Override
+  public String toString() {
+    StringBuffer buffer = new StringBuffer(200);
+    buffer.append("[Mail Host: ");
+    buffer.append(getMailHost());
+    buffer.append("]");
+    buffer.append(" [Mail From: ");
+    buffer.append(getMailFromAddress());
+    buffer.append("]");
+    buffer.append(" [Mail To: ");
+    if (mailToAddresses.length > 0) {
+
+      for (int i = 0; i < mailToAddresses.length; i++) {
+        buffer.append(mailToAddresses[i]);
+        buffer.append(", ");
+      }
+      buffer.replace(buffer.length() - 2, buffer.length(), "");
+    } else {
+      buffer.append(" Undefined");
+    }
+    buffer.append("]");
+    return buffer.toString();
+  }
+
+  private HashSet mailToSet = new HashSet();
+
+  private String mailToAddresses[] = new String[0];
+
+  protected String mailHost;
+
+  protected String mailFrom;
+
+  public final static String PROPERTY_MAIL_HOST = "mail.host";
+
+  public final static String PROPERTY_MAIL_FROM = "mail.from";
+
+  public final static String PROPERTY_MAIL_TO_LIST = "mail.toList";
+
+  /**
+   * Incorporating subject and message of email
+   * 
+   * 
+   */
+  static private class EmailData {
+    String subject;
+
+    String message;
+
+    EmailData(String subject, String message) {
+      this.subject = subject;
+      this.message = message;
+    }
+  }
+
+  public static void main(String args[]) {
+    MailManager mailManager = new MailManager("mailsrv1.gemstone.com", "hkhanna@gemstone.com");
+    mailManager.sendEmail("Alert!", "Test");
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ManagedResource.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ManagedResource.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ManagedResource.java
new file mode 100755
index 0000000..99c9ed8
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ManagedResource.java
@@ -0,0 +1,74 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+
+/**
+ * Represents a component or resource that is managed by a
+ * {@link javax.management.modelmbean.ModelMBean}.
+ *
+ * @since GemFire 3.5
+ *
+ */
+public interface ManagedResource {
+
+  /**
+   * The prefix of MBean names. Note: this is NOT used by Members, Stats, or any other MBean that
+   * has it's own domain.
+   *
+   * @see #getMBeanName
+   */
+  public static final String MBEAN_NAME_PREFIX = "GemFire:type=";
+
+  /**
+   * Returns the name of the ModelMBean that will manage this resource. They [some] are of the form
+   *
+   * <PRE>
+   * MBEAN_NAME_PREFIX + typeName + ",id=" + id
+   * </PRE>
+   *
+   * @see #MBEAN_NAME_PREFIX
+   */
+  public String getMBeanName();
+
+  /** Returns the ModelMBean that is configured to manage this resource */
+  public ModelMBean getModelMBean();
+
+  /** Sets the ModelMBean that is configured to manage this resource */
+  public void setModelMBean(ModelMBean modelMBean);
+
+  /**
+   * Returns the enumerated ManagedResourceType of this resource.
+   *
+   * @see ManagedResourceType
+   */
+  public ManagedResourceType getManagedResourceType();
+
+  /**
+   * Returns the JMX <code>ObjectName</code> of this managed resource.
+   *
+   * @see #getMBeanName
+   */
+  public ObjectName getObjectName();
+
+  /**
+   * Perform any cleanup necessary before stopping management of this resource.
+   */
+  public void cleanupResource();
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ManagedResourceType.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ManagedResourceType.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ManagedResourceType.java
new file mode 100755
index 0000000..48da3a0
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ManagedResourceType.java
@@ -0,0 +1,215 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.commons.lang.StringUtils;
+
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.CacheVm;
+import org.apache.geode.internal.admin.api.DistributedSystemHealthConfig;
+import org.apache.geode.internal.admin.api.DistributionLocator;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.StatisticResource;
+import org.apache.geode.internal.admin.api.SystemMember;
+import org.apache.geode.internal.admin.api.SystemMemberCache;
+import org.apache.geode.internal.admin.api.SystemMemberCacheServer;
+import org.apache.geode.internal.admin.api.SystemMemberRegion;
+import org.apache.geode.internal.admin.api.jmx.Agent;
+
+/**
+ * Type-safe definition for ModelMBean managed resources. The class type ({@link #getClassTypeName})
+ * must match the fully qualified class name listed in the type descriptor in
+ * mbeans-descriptors.xml.
+ *
+ * @since GemFire 3.5
+ *
+ */
+public class ManagedResourceType implements java.io.Serializable {
+  private static final long serialVersionUID = 3752874768667480449L;
+
+  /** Agent managed resource type */
+  public static final ManagedResourceType AGENT = new ManagedResourceType("Agent", Agent.class);
+
+  /** DistributedSystem managed resource type */
+  public static final ManagedResourceType DISTRIBUTED_SYSTEM =
+      new ManagedResourceType("AdminDistributedSystem", AdminDistributedSystem.class);
+
+  /** SystemMember managed resource type */
+  public static final ManagedResourceType SYSTEM_MEMBER =
+      new ManagedResourceType("SystemMember", SystemMember.class);
+
+  /** SystemMemberCache managed resource type */
+  public static final ManagedResourceType SYSTEM_MEMBER_CACHE =
+      new ManagedResourceType("SystemMemberCache", SystemMemberCache.class);
+
+  /** SystemMemberCache managed resource type */
+  public static final ManagedResourceType SYSTEM_MEMBER_REGION =
+      new ManagedResourceType("SystemMemberRegion", SystemMemberRegion.class);
+
+  /** SystemMemberCacheServer managed resource type */
+  public static final ManagedResourceType SYSTEM_MEMBER_CACHE_SERVER =
+      new ManagedResourceType("SystemMemberCacheServer", SystemMemberCacheServer.class);
+
+  /** CacheVm managed resource type */
+  public static final ManagedResourceType CACHE_VM =
+      new ManagedResourceType("CacheVm", CacheVm.class);
+
+  /** StatisticResource managed resource type */
+  public static final ManagedResourceType STATISTIC_RESOURCE =
+      new ManagedResourceType("StatisticResource", StatisticResource.class);
+
+  public static final ManagedResourceType GEMFIRE_HEALTH =
+      new ManagedResourceType("GemFireHealth", GemFireHealth.class);
+
+  public static final ManagedResourceType DISTRIBUTED_SYSTEM_HEALTH_CONFIG =
+      new ManagedResourceType("DistributedSystemHealthConfig", DistributedSystemHealthConfig.class);
+
+  public static final ManagedResourceType GEMFIRE_HEALTH_CONFIG =
+      new ManagedResourceType("GemFireHealthConfig", GemFireHealthConfig.class);
+
+  public static final ManagedResourceType DISTRIBUTION_LOCATOR =
+      new ManagedResourceType("DistributionLocator", DistributionLocator.class);
+
+  //////////////////// Instance Fields ////////////////////
+
+  /** The display-friendly name of this managed resource type. */
+  private final transient String name;
+
+  /**
+   * The interface/class used to externally represent this type. Note: this must match the mbean
+   * type descriptor in mbeans-descriptors.xml.
+   */
+  private final transient Class clazz;
+
+  // The 4 declarations below are necessary for serialization
+  /** int used as ordinal to represent this Scope */
+  public final int ordinal = nextOrdinal++;
+
+  private static int nextOrdinal = 0;
+
+  private static final ManagedResourceType[] VALUES =
+      {AGENT, DISTRIBUTED_SYSTEM, SYSTEM_MEMBER, SYSTEM_MEMBER_CACHE, SYSTEM_MEMBER_REGION,
+          SYSTEM_MEMBER_CACHE_SERVER, CACHE_VM, STATISTIC_RESOURCE, GEMFIRE_HEALTH,
+          DISTRIBUTED_SYSTEM_HEALTH_CONFIG, GEMFIRE_HEALTH_CONFIG, DISTRIBUTION_LOCATOR};
+
+  private Object readResolve() throws java.io.ObjectStreamException {
+    return VALUES[ordinal]; // Canonicalize
+  }
+
+  /** Creates a new instance of ManagedResourceType. */
+  private ManagedResourceType(String name, Class clazz) {
+    this.name = name;
+    this.clazz = clazz;
+  }
+
+  /** Returns the ManagedResourceType represented by specified ordinal */
+  public static ManagedResourceType fromOrdinal(int ordinal) {
+    return VALUES[ordinal];
+  }
+
+  /** Returns the display-friendly name of this managed resource type */
+  public String getName() {
+    return this.name;
+  }
+
+  /** Returns the interface/class used to externally represent this type */
+  public Class getClassType() {
+    return this.clazz;
+  }
+
+  /**
+   * Returns the fully qualified name of the interface/class used to externally represent this type
+   */
+  public String getClassTypeName() {
+    return this.clazz.getName();
+  }
+
+  /** Returns true if this is <code>AGENT</code>. */
+  public boolean isAgent() {
+    return this.equals(AGENT);
+  }
+
+  /** Returns true if this is <code>DISTRIBUTED_SYSTEM</code>. */
+  public boolean isDistributedSystem() {
+    return this.equals(DISTRIBUTED_SYSTEM);
+  }
+
+  /** Returns true if this is <code>SYSTEM_MEMBER</code>. */
+  public boolean isSystemMember() {
+    return this.equals(SYSTEM_MEMBER);
+  }
+
+  /** Returns whether this is <code>STATISTIC_RESOURCE</code>. */
+  public boolean isStatisticResource() {
+    return this.equals(STATISTIC_RESOURCE);
+  }
+
+  /** Return whether this is <code>GEMFIRE_HEALTH</code>. */
+  public boolean isGemFireHealth() {
+    return this.equals(GEMFIRE_HEALTH);
+  }
+
+  /**
+   * Returns a string representation for this type.
+   */
+  @Override
+  public String toString() {
+    return this.name;
+  }
+
+  /**
+   * Indicates whether some other object is "equal to" this one.
+   *
+   * @param other the reference object with which to compare.
+   * @return true if this object is the same as the obj argument; false otherwise.
+   */
+  @Override
+  public boolean equals(Object other) {
+    if (other == this)
+      return true;
+    if (other == null)
+      return false;
+    if (!(other instanceof ManagedResourceType))
+      return false;
+    final ManagedResourceType that = (ManagedResourceType) other;
+
+    if (!StringUtils.equals(this.name, that.name))
+      return false;
+    if (this.clazz != that.clazz && !(this.clazz != null && this.clazz.equals(that.clazz)))
+      return false;
+
+    return true;
+  }
+
+  /**
+   * Returns a hash code for the object. This method is supported for the benefit of hashtables such
+   * as those provided by java.util.Hashtable.
+   *
+   * @return the integer 0 if description is null; otherwise a unique integer.
+   */
+  @Override
+  public int hashCode() {
+    int result = 17;
+    final int mult = 37;
+
+    result = mult * result + (this.name == null ? 0 : this.name.hashCode());
+    result = mult * result + (this.clazz == null ? 0 : this.clazz.hashCode());
+
+    return result;
+  }
+
+}
+


[32/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertLevel.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertLevel.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertLevel.java
new file mode 100755
index 0000000..1bcc0e6
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertLevel.java
@@ -0,0 +1,168 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.internal.admin.Alert;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+/**
+ * Type-safe enumeration for {@link org.apache.geode.internal.admin.api.Alert Alert} level.
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class AlertLevel implements java.io.Serializable {
+  private static final long serialVersionUID = -4752438966587392126L;
+
+  public static final AlertLevel WARNING = new AlertLevel(Alert.WARNING, "WARNING");
+  public static final AlertLevel ERROR = new AlertLevel(Alert.ERROR, "ERROR");
+  public static final AlertLevel SEVERE = new AlertLevel(Alert.SEVERE, "SEVERE");
+
+  public static final AlertLevel OFF = new AlertLevel(Alert.OFF, "OFF");
+
+  /** The severity level of this AlertLevel. Greater is more severe. */
+  private final transient int severity;
+
+  /** The name of this AlertLevel. */
+  private final transient String name;
+
+  // The 4 declarations below are necessary for serialization
+  /** int used as ordinal to represent this AlertLevel */
+  public final int ordinal = nextOrdinal++;
+
+  private static int nextOrdinal = 0;
+
+  private static final AlertLevel[] VALUES = {WARNING, ERROR, SEVERE, OFF};
+
+  private Object readResolve() throws java.io.ObjectStreamException {
+    return VALUES[ordinal]; // Canonicalize
+  }
+
+  /** Creates a new instance of AlertLevel. */
+  private AlertLevel(int severity, String name) {
+    this.severity = severity;
+    this.name = name;
+  }
+
+  /** Return the AlertLevel represented by specified ordinal */
+  public static AlertLevel fromOrdinal(int ordinal) {
+    return VALUES[ordinal];
+  }
+
+  /**
+   * Returns the <code>AlertLevel</code> for the given severity
+   *
+   * @throws IllegalArgumentException If there is no alert level with the given
+   *         <code>severity</code>
+   */
+  public static AlertLevel forSeverity(int severity) {
+    switch (severity) {
+      case Alert.WARNING:
+        return AlertLevel.WARNING;
+      case Alert.ERROR:
+        return AlertLevel.ERROR;
+      case Alert.SEVERE:
+        return AlertLevel.SEVERE;
+      case Alert.OFF:
+        return AlertLevel.OFF;
+      default:
+        throw new IllegalArgumentException(LocalizedStrings.AlertLevel_UNKNOWN_ALERT_SEVERITY_0
+            .toLocalizedString(Integer.valueOf(severity)));
+    }
+  }
+
+  /**
+   * Returns the <code>AlertLevel</code> with the given name
+   *
+   * @throws IllegalArgumentException If there is no alert level named <code>name</code>
+   */
+  public static AlertLevel forName(String name) {
+    for (int i = 0; i < VALUES.length; i++) {
+      AlertLevel level = VALUES[i];
+      if (level.getName().equalsIgnoreCase(name)) {
+        return level;
+      }
+    }
+
+    throw new IllegalArgumentException(
+        LocalizedStrings.AlertLevel_THERE_IS_NO_ALERT_LEVEL_0.toLocalizedString(name));
+  }
+
+  public int getSeverity() {
+    return this.severity;
+  }
+
+  public String getName() {
+    return this.name;
+  }
+
+  public static AlertLevel[] values() {
+    return VALUES;
+  }
+
+  /**
+   * Returns a string representation for this alert level.
+   *
+   * @return the name of this alert level
+   */
+  @Override
+  public String toString() {
+    return this.name /* + "=" + this.severity */;
+  }
+
+  /**
+   * Indicates whether some other object is "equal to" this one.
+   *
+   * @param other the reference object with which to compare.
+   * @return true if this object is the same as the obj argument; false otherwise.
+   */
+  @Override
+  public boolean equals(Object other) {
+    if (other == this)
+      return true;
+    if (other == null)
+      return false;
+    if (!(other instanceof AlertLevel))
+      return false;
+    final AlertLevel that = (AlertLevel) other;
+
+    if (this.severity != that.severity)
+      return false;
+    if (this.name != null && !this.name.equals(that.name))
+      return false;
+
+    return true;
+  }
+
+  /**
+   * Returns a hash code for the object. This method is supported for the benefit of hashtables such
+   * as those provided by java.util.Hashtable.
+   *
+   * @return the integer 0 if description is null; otherwise a unique integer.
+   */
+  @Override
+  public int hashCode() {
+    int result = 17;
+    final int mult = 37;
+
+    result = mult * result + this.severity;
+    result = mult * result + (this.name == null ? 0 : this.name.hashCode());
+
+    return result;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertListener.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertListener.java
new file mode 100755
index 0000000..073431f
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/AlertListener.java
@@ -0,0 +1,30 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * A listener whose callback methods are invoked when an {@link Alert} is received.
+ * 
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface AlertListener extends java.util.EventListener {
+
+  /**
+   * Invoked when an <code>Alert</code> is received.
+   */
+  public void alert(Alert alert);
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/BackupStatus.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/BackupStatus.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/BackupStatus.java
new file mode 100644
index 0000000..f9d396e
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/BackupStatus.java
@@ -0,0 +1,46 @@
+/*
+ * 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.internal.admin.api;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedMember;
+
+/**
+ * The status of a backup operation, returned by
+ * {@link AdminDistributedSystem#backupAllMembers(java.io.File,java.io.File)}.
+ * 
+ * @since GemFire 6.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface BackupStatus {
+
+  /**
+   * Returns a map of disk stores that were successfully backed up. The key is an online distributed
+   * member. The value is the set of disk stores on that distributed member.
+   */
+  Map<DistributedMember, Set<PersistentID>> getBackedUpDiskStores();
+
+  /**
+   * Returns the set of disk stores that were known to be offline at the time of the backup. These
+   * members were not backed up. If this set is not empty the backup may not contain a complete
+   * snapshot of any partitioned regions in the distributed system.
+   */
+  Set<PersistentID> getOfflineDiskStores();
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheDoesNotExistException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheDoesNotExistException.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheDoesNotExistException.java
new file mode 100644
index 0000000..7ff2f06
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheDoesNotExistException.java
@@ -0,0 +1,80 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * An <code>CacheDoesNotExistException</code> is thrown when an attempt is made to get a cache and
+ * one does not exist.
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class CacheDoesNotExistException extends AdminException {
+  private static final long serialVersionUID = -1639933911265729978L;
+
+  /**
+   * Constructs a new exception with <code>null</code> as its detail message. The cause is not
+   * initialized, and may subsequently be initialized by a call to {@link Throwable#initCause}.
+   */
+  public CacheDoesNotExistException() {
+    super();
+  }
+
+  /**
+   * Constructs a new exception with the specified detail message. The cause is not initialized, and
+   * may subsequently be initialized by a call to {@link Throwable#initCause}.
+   *
+   * @param message the detail message. The detail message is saved for later retrieval by the
+   *        {@link #getMessage()} method.
+   */
+  public CacheDoesNotExistException(String message) {
+    super(message);
+  }
+
+  /**
+   * Constructs a new exception with the specified detail message and cause.
+   * <p>
+   * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically
+   * incorporated in this exception's detail message.
+   *
+   * @param message the detail message (which is saved for later retrieval by the
+   *        {@link #getMessage()} method).
+   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
+   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
+   *        unknown.)
+   */
+  public CacheDoesNotExistException(String message, Throwable cause) {
+    super(message, cause);
+  }
+
+  /**
+   * Constructs a new exception with the specified cause and a detail message of
+   * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail
+   * message of <tt>cause</tt>). This constructor is useful for exceptions that are little more than
+   * wrappers for other throwables (for example, {@link java.security.PrivilegedActionException}).
+   *
+   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
+   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
+   *        unknown.)
+   */
+  public CacheDoesNotExistException(Throwable cause) {
+    super(cause);
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheHealthConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheHealthConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheHealthConfig.java
new file mode 100644
index 0000000..69c0c82
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheHealthConfig.java
@@ -0,0 +1,151 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * Provides configuration information relating to the health of a member of a GemFire distributed
+ * system that hosts a GemFire {@link org.apache.geode.cache.Cache Cache}.
+ *
+ * <P>
+ *
+ * If any of the following criteria is true, then a cache member is considered to be in
+ * {@link GemFireHealth#OKAY_HEALTH OKAY_HEALTH}.
+ *
+ * <UL>
+ *
+ * <LI><code>netSearch</code> operations take {@linkplain #getMaxNetSearchTime too long} to
+ * complete.</LI>
+ *
+ * <LI>Cache <code>load</code> operations take {@linkplain #getMaxLoadTime too long} to
+ * complete.</LI>
+ *
+ * <LI>The overall cache {@link #getMinHitRatio hitRatio} is too small</LI>
+ *
+ * <LI>The number of entries in the Cache {@link #getMaxEventQueueSize event delivery queue} is too
+ * large.</LI>
+ * 
+ * <LI>If one of the regions is configured with {@link org.apache.geode.cache.LossAction#FULL_ACCESS
+ * FULL_ACCESS} on role loss.</LI>
+ *
+ * </UL>
+ *
+ * If any of the following criteria is true, then a cache member is considered to be in
+ * {@link GemFireHealth#POOR_HEALTH POOR_HEALTH}.
+ * 
+ * <UL>
+ * 
+ * <LI>If one of the regions is configured with {@link org.apache.geode.cache.LossAction#NO_ACCESS
+ * NO_ACCESS} on role loss.</LI>
+ * 
+ * <LI>If one of the regions is configured with
+ * {@link org.apache.geode.cache.LossAction#LIMITED_ACCESS LIMITED_ACCESS} on role loss.</LI>
+ * 
+ * </UL>
+ * 
+ * <UL>
+ *
+ * </UL>
+ *
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface CacheHealthConfig {
+
+  /**
+   * The default maximum number of milliseconds a <code>netSearch</code> operation can take before
+   * the cache member is considered to be unhealthy.
+   */
+  public static final long DEFAULT_MAX_NET_SEARCH_TIME = 60 * 1000;
+
+  /**
+   * The default maximum mumber of milliseconds a cache <code>load</code> operation can take before
+   * the cache member is considered to be unhealthy.
+   */
+  public static final long DEFAULT_MAX_LOAD_TIME = 60 * 1000;
+
+  /** The default minimum hit ratio of a healthy cache member. */
+  public static final double DEFAULT_MIN_HIT_RATIO = 0.0;
+
+  /**
+   * The default maximum number of entries in the event delivery queue of a healthy cache member.
+   */
+  public static final long DEFAULT_MAX_EVENT_QUEUE_SIZE = 1000;
+
+  /////////////////////// Instance Methods ///////////////////////
+
+  /**
+   * Returns the maximum number of milliseconds a <code>netSearch</code> operation can take before
+   * the cache member is considered to be unhealthy.
+   *
+   * @see #DEFAULT_MAX_NET_SEARCH_TIME
+   */
+  public long getMaxNetSearchTime();
+
+  /**
+   * Sets the maximum number of milliseconds a <code>netSearch</code> operation can take before the
+   * cache member is considered to be unhealthy.
+   *
+   * @see #getMaxNetSearchTime
+   */
+  public void setMaxNetSearchTime(long maxNetSearchTime);
+
+  /**
+   * Returns the maximum mumber of milliseconds a cache <code>load</code> operation can take before
+   * the cache member is considered to be unhealthy.
+   *
+   * @see #DEFAULT_MAX_LOAD_TIME
+   */
+  public long getMaxLoadTime();
+
+  /**
+   * Sets the maximum mumber of milliseconds a cache <code>load</code> operation can take before the
+   * cache member is considered to be unhealthy.
+   *
+   * @see #getMaxLoadTime
+   */
+  public void setMaxLoadTime(long maxLoadTime);
+
+  /**
+   * Returns the minimum hit ratio of a healthy cache member.
+   *
+   * @see #DEFAULT_MIN_HIT_RATIO
+   */
+  public double getMinHitRatio();
+
+  /**
+   * Sets the minimum hit ratio of a healthy cache member.
+   *
+   * @see #getMinHitRatio
+   */
+  public void setMinHitRatio(double minHitRatio);
+
+  /**
+   * Returns the maximum number of entries in the event delivery queue of a healthy cache member.
+   *
+   * @see #DEFAULT_MAX_EVENT_QUEUE_SIZE
+   */
+  public long getMaxEventQueueSize();
+
+  /**
+   * Sets the maximum number of entries in the event delivery queue of a healthy cache member.
+   *
+   * @see #getMaxEventQueueSize
+   */
+  public void setMaxEventQueueSize(long maxEventQueueSize);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheServer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheServer.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheServer.java
new file mode 100644
index 0000000..79f6e7a
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheServer.java
@@ -0,0 +1,43 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * A dedicated cache server VM that is managed by the administration API.
+ *
+ * @since GemFire 4.0
+ * @deprecated as of 5.7 use {@link CacheVm} instead.
+ */
+@Deprecated
+public interface CacheServer extends SystemMember, ManagedEntity {
+  /**
+   * Returns the configuration of this cache vm
+   * 
+   * @deprecated as of 5.7 use {@link CacheVm#getVmConfig} instead.
+   */
+  @Deprecated
+  public CacheServerConfig getConfig();
+
+  /**
+   * Find whether this server is primary for given client (durableClientId)
+   * 
+   * @param durableClientId - durable-id of the client
+   * @return true if the server is primary for given client
+   * 
+   * @since GemFire 5.6
+   */
+  public boolean isPrimaryForDurableClient(String durableClientId);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheServerConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheServerConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheServerConfig.java
new file mode 100644
index 0000000..383cf2e
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheServerConfig.java
@@ -0,0 +1,50 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * Configuration for a GemFire cache server that is managed by the administration API. The cache
+ * server may or may not be running.
+ *
+ * @see AdminDistributedSystem#addCacheServer()
+ *
+ * @since GemFire 4.0
+ * @deprecated as of 5.7 use {@link CacheVmConfig} instead.
+ */
+@Deprecated
+public interface CacheServerConfig extends CacheVmConfig {
+  /**
+   * Returns the <code>cache.xml</code> declarative caching initialization file used to configure
+   * this cache server VM. By default, a cache server VM is started without an XML file.
+   */
+  public String getCacheXMLFile();
+
+  /**
+   * Sets the <code>cache.xml</code> declarative caching initialization file used to configure this
+   * cache server VM.
+   */
+  public void setCacheXMLFile(String cacheXml);
+
+  /**
+   * Returns the location(s) of user classes (such as cache loaders) required by the cache server
+   * VM.
+   */
+  public String getClassPath();
+
+  /**
+   * Sets the location(s) of user classes (such as cache loaders) required by the cache server VM.
+   */
+  public void setClassPath(String classpath);
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheVm.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheVm.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheVm.java
new file mode 100755
index 0000000..139e189
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheVm.java
@@ -0,0 +1,35 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * A dedicated cache server VM that is managed by the administration API.
+ * <p>
+ * Note that this may not represent an instance of
+ * {@link org.apache.geode.cache.server.CacheServer}. It is possible for a cache VM to be started
+ * but for it not to listen for client connections in which case it is not a
+ * {@link org.apache.geode.cache.server.CacheServer} but is an instance of this interface.
+ *
+ * @since GemFire 5.7
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface CacheVm extends SystemMember, ManagedEntity {
+  /**
+   * Returns the configuration of this cache vm
+   */
+  public CacheVmConfig getVmConfig();
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheVmConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheVmConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheVmConfig.java
new file mode 100755
index 0000000..a42437d
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/CacheVmConfig.java
@@ -0,0 +1,51 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * Configuration for a GemFire cache server VM that is managed by the administration API. The VM may
+ * or may not be running.
+ *
+ * @see AdminDistributedSystem#addCacheVm()
+ *
+ * @since GemFire 5.7
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface CacheVmConfig extends ManagedEntityConfig {
+  /**
+   * Returns the <code>cache.xml</code> declarative caching initialization file used to configure
+   * this cache server VM. By default, a cache server VM is started without an XML file.
+   */
+  public String getCacheXMLFile();
+
+  /**
+   * Sets the <code>cache.xml</code> declarative caching initialization file used to configure this
+   * cache server VM.
+   */
+  public void setCacheXMLFile(String cacheXml);
+
+  /**
+   * Returns the location(s) of user classes (such as cache loaders) required by the cache server
+   * VM.
+   */
+  public String getClassPath();
+
+  /**
+   * Sets the location(s) of user classes (such as cache loaders) required by the cache server VM.
+   */
+  public void setClassPath(String classpath);
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/ConfigurationParameter.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/ConfigurationParameter.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/ConfigurationParameter.java
new file mode 100755
index 0000000..88e8aa8
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/ConfigurationParameter.java
@@ -0,0 +1,72 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * A single configuration parameter of a {@link SystemMember}.
+ *
+ * @since GemFire 3.5
+ *
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface ConfigurationParameter {
+
+  /** Gets the identifying name of this configuration parameter. */
+  public String getName();
+
+  /** Gets the full description of this configuration parameter */
+  public String getDescription();
+
+  /** Gets the current value */
+  public Object getValue();
+
+  /** Gets the current value as a string */
+  public String getValueAsString();
+
+  /** Gets the class type of the value */
+  public Class getValueType();
+
+  /** True if this is modifiable; false if read-only */
+  public boolean isModifiable();
+
+  /** Returns true if this config parameter uses a string array for value. */
+  public boolean isArray();
+
+  /** Returns true if this config parameter represents an InetAddress value. */
+  public boolean isInetAddress();
+
+  /** Returns true if this config parameter represents a File value. */
+  public boolean isFile();
+
+  /** Returns true if this config parameter represents an octal value. */
+  public boolean isOctal();
+
+  /** Returns true if this config parameter represents a string value. */
+  public boolean isString();
+
+  /**
+   * Sets a new value for this configuration parameter.
+   *
+   * @param value the new value which must be of type {@link #getValueType}
+   * @throws IllegalArgumentException if value type does not match {@link #getValueType}
+   * @throws UnmodifiableConfigurationException if attempting to set value when isModifiable is
+   *         false
+   */
+  public void setValue(Object value) throws UnmodifiableConfigurationException;
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributedSystemConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributedSystemConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributedSystemConfig.java
new file mode 100755
index 0000000..9755d76
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributedSystemConfig.java
@@ -0,0 +1,625 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.internal.admin.api.impl.InetAddressUtil;
+import org.apache.geode.distributed.internal.DistributionConfig;
+
+import java.util.Properties;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+
+/**
+ * Configuration for defining a GemFire distributed system to administrate. This configuration
+ * includes information about the discovery mechanism used to find members of the distributed system
+ * and information about {@linkplain ManagedEntity managed entities} such as
+ * {@linkplain DistributionLocator distribution locators} and {@linkplain CacheVm GemFire cache vms}
+ * that can be {@linkplain AdminDistributedSystem#start started}.
+ *
+ * <P>
+ *
+ * Detailed descriptions of many of these configuration attributes can be found in the
+ * {@link org.apache.geode.distributed.DistributedSystem DistributedSystem} class. Note that the
+ * default values of these configuration attributes can be specified using Java system properties.
+ *
+ * <P>
+ *
+ * A <code>DistributedSystemConfig</code> can be modified using a number of mutator methods until
+ * the <code>AdminDistributedSystem</code> that it configures
+ * {@linkplain AdminDistributedSystem#connect connects} to the distributed system. After that,
+ * attempts to modify most attributes in the <code>DistributedSystemConfig</code> will result in an
+ * {@link IllegalStateException} being thrown. If you wish to use the same
+ * <code>DistributedSystemConfig</code> to configure multiple <code>AdminDistributedSystem</code>s,
+ * a copy of the <code>DistributedSystemConfig</code> object can be made by invoking the
+ * {@link #clone} method.
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface DistributedSystemConfig extends Cloneable {
+
+  /**
+   * The name of an XML file that specifies the configuration for the {@linkplain ManagedEntity
+   * managed entities} administered by the <code>DistributedSystem</code>. The XML file must conform
+   * to a <a href="doc-files/ds5_0.dtd">dtd</a>.
+   */
+  String ENTITY_CONFIG_XML_FILE_NAME = "entity-config-xml-file";
+
+  /**
+   * The default value of the "entity-config-xml-file" property ("distributed-system.xml").
+   */
+  String DEFAULT_ENTITY_CONFIG_XML_FILE = "distributed-system.xml";
+
+  /** The name of the "system-id" property */
+  String SYSTEM_ID_NAME = "system-id";
+
+  /** The default value of the "system-id" property ("") */
+  String DEFAULT_SYSTEM_ID = "Default System";
+
+  /** The name of the "name" property. See {@link #getSystemName()}. */
+  String NAME_NAME = NAME;
+
+  /** The default value of the "name" property (""). See {@link #getSystemName()}. */
+  String DEFAULT_NAME = "";
+
+  /** The name of the "mcastPort" property */
+  String MCAST_PORT_NAME = MCAST_PORT;
+
+  /** The default value of the "mcastPort" property (10334) */
+  int DEFAULT_MCAST_PORT = DistributionConfig.DEFAULT_MCAST_PORT;
+
+  /** The minimum mcastPort (0) */
+  int MIN_MCAST_PORT = DistributionConfig.MIN_MCAST_PORT;
+
+  /** The maximum mcastPort (65535) */
+  int MAX_MCAST_PORT = DistributionConfig.MAX_MCAST_PORT;
+
+  /** The name of the "mcastAddress" property */
+  String MCAST_ADDRESS_NAME = MCAST_ADDRESS;
+
+  /** The default value of the "mcastAddress" property (239.192.81.1). */
+  String DEFAULT_MCAST_ADDRESS = InetAddressUtil.toString(DistributionConfig.DEFAULT_MCAST_ADDRESS);
+
+  /**
+   * The name of the "membership-port-range" property
+   * 
+   * @since GemFire 6.5
+   */
+  String MEMBERSHIP_PORT_RANGE_NAME = MEMBERSHIP_PORT_RANGE;
+
+  /**
+   * The default membership-port-range.
+   * <p>
+   * Actual value is <code>[1024,65535]</code>.
+   * 
+   * @since GemFire 6.5
+   */
+  int[] DEFAULT_MEMBERSHIP_PORT_RANGE = DistributionConfig.DEFAULT_MEMBERSHIP_PORT_RANGE;
+
+  /**
+   * settings for tcp-port
+   * 
+   * @since GemFire 6.5
+   */
+  String TCP_PORT_NAME = TCP_PORT;
+  /**
+   * The default value of the "tcpPort" property.
+   * <p>
+   * Actual value is <code>0</code>.
+   * 
+   * @since GemFire 6.5
+   */
+  int DEFAULT_TCP_PORT = DistributionConfig.DEFAULT_TCP_PORT;
+
+  /**
+   * The default AckWaitThreshold.
+   * <p>
+   * Actual value of this constant is <code>15</code> seconds.
+   */
+  int DEFAULT_ACK_WAIT_THRESHOLD = DistributionConfig.DEFAULT_ACK_WAIT_THRESHOLD;
+  /**
+   * The minimum AckWaitThreshold.
+   * <p>
+   * Actual value of this constant is <code>1</code> second.
+   */
+  int MIN_ACK_WAIT_THRESHOLD = DistributionConfig.MIN_ACK_WAIT_THRESHOLD;
+  /**
+   * The maximum AckWaitThreshold.
+   * <p>
+   * Actual value of this constant is <code>MAX_INT</code> seconds.
+   */
+  int MAX_ACK_WAIT_THRESHOLD = DistributionConfig.MIN_ACK_WAIT_THRESHOLD;
+
+  /**
+   * The default ackSevereAlertThreshold.
+   * <p>
+   * Actual value of this constant is <code>0</code> seconds, which turns off forced disconnects
+   * based on ack wait periods.
+   */
+  int DEFAULT_ACK_SEVERE_ALERT_THRESHOLD = DistributionConfig.DEFAULT_ACK_SEVERE_ALERT_THRESHOLD;
+  /**
+   * The minimum ackSevereAlertThreshold.
+   * <p>
+   * Actual value of this constant is <code>0</code> second, which turns off forced disconnects
+   * based on ack wait periods.
+   */
+  int MIN_ACK_SEVERE_ALERT_THRESHOLD = DistributionConfig.MIN_ACK_SEVERE_ALERT_THRESHOLD;
+  /**
+   * The maximum ackSevereAlertThreshold.
+   * <p>
+   * Actual value of this constant is <code>MAX_INT</code> seconds.
+   */
+  int MAX_ACK_SEVERE_ALERT_THRESHOLD = DistributionConfig.MAX_ACK_SEVERE_ALERT_THRESHOLD;
+
+  /** The name of the "locators" property (comma-delimited host[port] list) */
+  String LOCATORS_NAME = LOCATORS;
+
+  /** The default value of the "locators" property ("") */
+  String DEFAULT_LOCATORS = DistributionConfig.DEFAULT_LOCATORS;
+
+  /** The name of the "bindAddress" property */
+  String BIND_ADDRESS_NAME = BIND_ADDRESS;
+
+  /** The default value of the "bindAddress" property */
+  String DEFAULT_BIND_ADDRESS = DistributionConfig.DEFAULT_BIND_ADDRESS;
+
+  /** The name of the remote-command property */
+  String REMOTE_COMMAND_NAME = "remote-command";
+
+  /** The default value of the remote-command property */
+  String DEFAULT_REMOTE_COMMAND = "rsh -n {HOST} {CMD}";
+
+  /** The default disable-tcp value (<code>false</code>) */
+  boolean DEFAULT_DISABLE_TCP = DistributionConfig.DEFAULT_DISABLE_TCP;
+
+  /** The default enable-network-partition-detection setting (<code>false</code>) */
+  boolean DEFAULT_ENABLE_NETWORK_PARTITION_DETECTION =
+      DistributionConfig.DEFAULT_ENABLE_NETWORK_PARTITION_DETECTION;
+
+  /** The default disable-auto-reconnect setting (<code>false</code>) */
+  boolean DEFAULT_DISABLE_AUTO_RECONNECT = DistributionConfig.DEFAULT_DISABLE_AUTO_RECONNECT;
+
+  /** The default failure-detection timeout period for member heart-beat responses */
+  int DEFAULT_MEMBER_TIMEOUT = DistributionConfig.DEFAULT_MEMBER_TIMEOUT;
+
+  /** The name of the "logFile" property */
+  String LOG_FILE_NAME = LOG_FILE;
+
+  /**
+   * The default log-file value ("" which directs logging to standard output)
+   */
+  String DEFAULT_LOG_FILE = "";
+
+  /** The name of the "logLevel" property */
+  String LOG_LEVEL_NAME = LOG_LEVEL;
+
+  /** The default log level ("config") */
+  String DEFAULT_LOG_LEVEL = "config";
+
+  /** The name of the "LogDiskSpaceLimit" property */
+  String LOG_DISK_SPACE_LIMIT_NAME = LOG_DISK_SPACE_LIMIT;
+
+  /** The default log disk space limit in megabytes (0) */
+  int DEFAULT_LOG_DISK_SPACE_LIMIT = DistributionConfig.DEFAULT_LOG_DISK_SPACE_LIMIT;
+
+  /** The minimum log disk space limit in megabytes (0) */
+  int MIN_LOG_DISK_SPACE_LIMIT = DistributionConfig.MIN_LOG_DISK_SPACE_LIMIT;
+
+  /** The minimum log disk space limit in megabytes (1000000) */
+  int MAX_LOG_DISK_SPACE_LIMIT = DistributionConfig.MAX_LOG_DISK_SPACE_LIMIT;
+
+  /** The name of the "LogFileSizeLimit" property */
+  String LOG_FILE_SIZE_LIMIT_NAME = LOG_FILE_SIZE_LIMIT;
+
+  /** The default log file size limit in megabytes (0) */
+  int DEFAULT_LOG_FILE_SIZE_LIMIT = DistributionConfig.DEFAULT_LOG_FILE_SIZE_LIMIT;
+
+  /** The minimum log file size limit in megabytes (0) */
+  int MIN_LOG_FILE_SIZE_LIMIT = DistributionConfig.MIN_LOG_FILE_SIZE_LIMIT;
+
+  /** The minimum log file size limit in megabytes (1000000) */
+  int MAX_LOG_FILE_SIZE_LIMIT = DistributionConfig.MAX_LOG_FILE_SIZE_LIMIT;
+
+  /**
+   * The name of the "refreshInterval" property which will apply to SystemMember, SystemMemberCache
+   * and StatisticResource refresh. This interval (in seconds) is used for auto-polling and updating
+   * AdminDistributedSystem constituents including SystemMember, CacheServer, SystemMemberCache and
+   * StatisticResource. This interval is read-only and retains the value set when the config is
+   * created. Note that the resource MBeans actually refresh and hit the DS only if there is an RMI
+   * client connected
+   */
+  String REFRESH_INTERVAL_NAME = "refresh-interval";
+
+  /**
+   * The default "refreshInterval" in seconds which will apply to REFRESH_INTERVAL_NAME property.
+   * The default value is 15 secs
+   */
+  int DEFAULT_REFRESH_INTERVAL = 15;
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Returns the name of the XML file that specifies the configuration of the
+   * {@linkplain ManagedEntity managed entities} administered by the <code>DistributedSystem</code>.
+   * The XML file must conform to a <a href="doc-files/ds5_0.dtd">dtd</a>.
+   *
+   * @since GemFire 4.0
+   */
+  public String getEntityConfigXMLFile();
+
+  /**
+   * Sets the name of the XML file that specifies the configuration of managed entities administered
+   * by the <code>DistributedSystem</code>.
+   */
+  public void setEntityConfigXMLFile(String xmlFile);
+
+  /** Returns the string identity for the system */
+  public String getSystemId();
+
+  /** Sets the string identity for the system */
+  public void setSystemId(String systemId);
+
+  /** Returns the optional non-unique name for the system */
+  public String getSystemName();
+
+  /** Sets the optional non-unique name for the system */
+  public void setSystemName(final String name);
+
+  /** Returns the multicast address for the system */
+  public String getMcastAddress();
+
+  /** Sets the multicast address for the system */
+  public void setMcastAddress(String mcastAddress);
+
+  /** Returns the multicast port for the system */
+  public int getMcastPort();
+
+  /** Sets the multicast port for the system */
+  public void setMcastPort(int mcastPort);
+
+  /** Returns the ack-wait-threshold for the system */
+  public int getAckWaitThreshold();
+
+  /** Sets the ack-wait-threshold for the system */
+  public void setAckWaitThreshold(int seconds);
+
+  /** Returns the ack-severe-alert-threshold for the system */
+  public int getAckSevereAlertThreshold();
+
+  /** Sets the ack-severe-alert-threshold for the system */
+  public void setAckSevereAlertThreshold(int seconds);
+
+  /** Returns a comma-delimited list of locators for the system */
+  public String getLocators();
+
+  /** Sets the comma-delimited list of locators for the system */
+  public void setLocators(String locators);
+
+  /**
+   * Returns the membership-port-range property of the Distributed System. This range is given as
+   * two numbers separated by a minus sign.
+   * 
+   * @since GemFire 6.5
+   */
+  public String getMembershipPortRange();
+
+  /**
+   * Sets the membership-port-range property of the Distributed System. This range is given as two
+   * numbers separated by a minus sign.
+   * 
+   * @since GemFire 6.5
+   */
+  public void setMembershipPortRange(String membershipPortRange);
+
+
+  /**
+   * Sets the primary communication port number for the Distributed System.
+   * 
+   * @since GemFire 6.5
+   */
+  public void setTcpPort(int port);
+
+  /**
+   * Returns the primary communication port number for the Distributed System.
+   * 
+   * @since GemFire 6.5
+   */
+  public int getTcpPort();
+
+
+  /**
+   * Sets the disable-tcp property for the system. When tcp is disabled, the cache uses udp for
+   * unicast messaging. This must be consistent across all members of the distributed system. The
+   * default is to enable tcp.
+   */
+  public void setDisableTcp(boolean flag);
+
+  /**
+   * Returns the disable-tcp property for the system. When tcp is disabled, the cache uses udp for
+   * unicast messaging. This must be consistent across all members of the distributed system. The
+   * default is to enable tcp.
+   */
+  public boolean getDisableTcp();
+
+
+  /**
+   * Turns on network partition detection
+   */
+  public void setEnableNetworkPartitionDetection(boolean newValue);
+
+  /**
+   * Returns true if network partition detection is enabled.
+   */
+  public boolean getEnableNetworkPartitionDetection();
+
+  /**
+   * Disables auto reconnect after being forced out of the distributed system
+   */
+  public void setDisableAutoReconnect(boolean newValue);
+
+  /**
+   * Returns true if auto reconnect is disabled
+   */
+  public boolean getDisableAutoReconnect();
+
+
+
+  /**
+   * Returns the member-timeout millisecond value used in failure-detection protocols
+   */
+  public int getMemberTimeout();
+
+  /**
+   * Set the millisecond value of the member-timeout used in failure-detection protocols. This
+   * timeout determines how long a member has to respond to a heartbeat request. The member is given
+   * three chances before being kicked out of the distributed system with a SystemConnectException.
+   */
+  public void setMemberTimeout(int value);
+
+  /**
+   * Returns the IP address to which the distributed system's server sockets are bound.
+   *
+   * @since GemFire 4.0
+   */
+  public String getBindAddress();
+
+  /**
+   * Sets the IP address to which the distributed system's server sockets are bound.
+   *
+   * @since GemFire 4.0
+   */
+  public void setBindAddress(String bindAddress);
+
+
+  /**
+   * Returns the IP address to which client/server server sockets are bound
+   */
+  public String getServerBindAddress();
+
+  /**
+   * Sets the IP address to which a server cache will bind when listening for client cache
+   * connections.
+   */
+  public void setServerBindAddress(String bindAddress);
+
+
+  /** Returns the remote command setting to use for remote administration */
+  public String getRemoteCommand();
+
+  /**
+   * Sets the remote command setting to use for remote administration. This attribute may be
+   * modified after this <code>DistributedSystemConfig</code> has been used to create an
+   * <codE>AdminDistributedSystem</code>.
+   */
+  public void setRemoteCommand(String command);
+
+  /** Returns the value of the "ssl-enabled" property. */
+  public boolean isSSLEnabled();
+
+  /** Sets the value of the "ssl-enabled" property. */
+  public void setSSLEnabled(boolean enabled);
+
+  /** Returns the value of the "ssl-protocols" property. */
+  public String getSSLProtocols();
+
+  /** Sets the value of the "ssl-protocols" property. */
+  public void setSSLProtocols(String protocols);
+
+  /** Returns the value of the "ssl-ciphers" property. */
+  public String getSSLCiphers();
+
+  /** Sets the value of the "ssl-ciphers" property. */
+  public void setSSLCiphers(String ciphers);
+
+  /** Returns the value of the "ssl-require-authentication" property. */
+  public boolean isSSLAuthenticationRequired();
+
+  /** Sets the value of the "ssl-require-authentication" property. */
+  public void setSSLAuthenticationRequired(boolean authRequired);
+
+  /** Returns the provider-specific properties for SSL. */
+  public Properties getSSLProperties();
+
+  /** Sets the provider-specific properties for SSL. */
+  public void setSSLProperties(Properties sslProperties);
+
+  /** Adds an SSL property */
+  public void addSSLProperty(String key, String value);
+
+  /** Removes an SSL property */
+  public void removeSSLProperty(String key);
+
+  /**
+   * Returns the name of the log file to which informational messages are written.
+   *
+   * @see org.apache.geode.i18n.LogWriterI18n
+   */
+  public String getLogFile();
+
+  /**
+   * Sets the name of the log file to which informational messages are written.
+   *
+   * @see org.apache.geode.i18n.LogWriterI18n
+   */
+  public void setLogFile(String logFile);
+
+  /**
+   * Returns the level at which informational messages are logged.
+   */
+  public String getLogLevel();
+
+  /**
+   * Sets the level at which information messages are logged.
+   */
+  public void setLogLevel(String logLevel);
+
+  /**
+   * Returns the log disk space limit in megabytes
+   */
+  public int getLogDiskSpaceLimit();
+
+  /**
+   * Sets the log disk space limit in megabytes
+   */
+  public void setLogDiskSpaceLimit(int limit);
+
+  /**
+   * Returns the log file size limit in megabytes
+   */
+  public int getLogFileSizeLimit();
+
+  /**
+   * Sets the log file size limit in megabytes
+   */
+  public void setLogFileSizeLimit(int limit);
+
+  /**
+   * Returns the refreshInterval in seconds used for auto-polling and updating
+   * AdminDistributedSystem constituents including SystemMember, CacheServer, SystemMemberCache and
+   * StatisticResource
+   * 
+   * @since GemFire 6.0
+   */
+  public int getRefreshInterval();
+
+  /**
+   * Sets the refreshInterval in seconds
+   * 
+   * @since GemFire 6.0
+   */
+  public void setRefreshInterval(int timeInSecs);
+
+  /**
+   * Returns an array of configurations for statically known <code>CacheServers</code>.
+   * 
+   * @deprecated as of 5.7 use {@link #getCacheVmConfigs} instead.
+   */
+  @Deprecated
+  public CacheServerConfig[] getCacheServerConfigs();
+
+  /**
+   * Creates the configuration for a CacheServer
+   * 
+   * @deprecated as of 5.7 use {@link #createCacheVmConfig} instead.
+   */
+  @Deprecated
+  public CacheServerConfig createCacheServerConfig();
+
+  /**
+   * Removes the configuration for a CacheServer
+   * 
+   * @deprecated as of 5.7 use {@link #removeCacheVmConfig} instead.
+   */
+  @Deprecated
+  public void removeCacheServerConfig(CacheServerConfig managerConfig);
+
+  /**
+   * Returns an array of configurations for statically known {@link CacheVm}s.
+   * 
+   * @since GemFire 5.7
+   */
+  public CacheVmConfig[] getCacheVmConfigs();
+
+  /**
+   * Creates the configuration for a {@link CacheVm}.
+   * 
+   * @since GemFire 5.7
+   */
+  public CacheVmConfig createCacheVmConfig();
+
+  /**
+   * Removes the configuration for a {@link CacheVm}
+   * 
+   * @since GemFire 5.7
+   */
+  public void removeCacheVmConfig(CacheVmConfig existing);
+
+  /**
+   * Returns configuration information about {@link DistributionLocator}s that are managed by an
+   * <code>AdminDistributedSystem</code>.
+   */
+  public DistributionLocatorConfig[] getDistributionLocatorConfigs();
+
+  /**
+   * Creates a new <code>DistributionLocatorConfig</code> for a distribution locator that is managed
+   * in this distributed system. The default locator config is set to not use multicast
+   */
+  public DistributionLocatorConfig createDistributionLocatorConfig();
+
+  /**
+   * Removes a <code>DistributionLocatorConfig</code> from the distributed system.
+   */
+  public void removeDistributionLocatorConfig(DistributionLocatorConfig config);
+
+  /** Registers listener for notification of changes in this config. */
+  public void addListener(ConfigListener listener);
+
+  /** Removes previously registered listener of this config. */
+  public void removeListener(ConfigListener listener);
+
+  /**
+   * Validates that this distributed system configuration is correct and consistent.
+   *
+   * @throws IllegalStateException If this config is not valid
+   * @throws AdminXmlException If the {@linkplain #getEntityConfigXMLFile entity config XML file} is
+   *         not valid
+   */
+  public void validate();
+
+  /**
+   * Returns a copy of this <code>DistributedSystemConfig</code> object whose configuration can be
+   * modified. Note that this {@link DistributedSystemConfig.ConfigListener ConfigListener}s that
+   * are registered on this config object are not cloned.
+   *
+   * @since GemFire 4.0
+   */
+  public Object clone() throws CloneNotSupportedException;
+
+  ////////////////////// Inner Classes //////////////////////
+
+  /**
+   * A listener whose callback methods are invoked when this config changes.
+   */
+  public interface ConfigListener extends java.util.EventListener {
+
+    /** Invoked when this configurated is changed. */
+    public void configChanged(DistributedSystemConfig config);
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributedSystemHealthConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributedSystemHealthConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributedSystemHealthConfig.java
new file mode 100644
index 0000000..c308aa2
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributedSystemHealthConfig.java
@@ -0,0 +1,74 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * Provides configuration information relating to the health of an entire GemFire distributed
+ * system.
+ *
+ * <P>
+ *
+ * If any of the following criteria is true, then the distributed system is considered to be in
+ * {@link GemFireHealth#OKAY_HEALTH OKAY_HEALTH}.
+ *
+ * <UL>
+ *
+ * </UL>
+ *
+ * If any of the following criteria is true, then the distributed system is considered to be in
+ * {@link GemFireHealth#POOR_HEALTH POOR_HEALTH}.
+ *
+ * <UL>
+ *
+ * <LI>Too many application members {@linkplain #getMaxDepartedApplications unexpectedly leave} the
+ * distributed system.</LI>
+ *
+ * <LI>Too many application members {@linkplain #getMaxDepartedApplications unexpectedly leave} the
+ * distributed system.</LI>
+ *
+ * </UL>
+ *
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface DistributedSystemHealthConfig {
+
+  /**
+   * The default maximum number of application members that can unexceptedly leave a healthy the
+   * distributed system.
+   */
+  public static final long DEFAULT_MAX_DEPARTED_APPLICATIONS = 10;
+
+  /////////////////////// Instance Methods ///////////////////////
+
+  /**
+   * Returns the maximum number of application members that can unexceptedly leave a healthy the
+   * distributed system.
+   *
+   * @see #DEFAULT_MAX_DEPARTED_APPLICATIONS
+   */
+  public long getMaxDepartedApplications();
+
+  /**
+   * Sets the maximum number of application members that can unexceptedly leave a healthy the
+   * distributed system.
+   *
+   * @see #getMaxDepartedApplications
+   */
+  public void setMaxDepartedApplications(long maxDepartedApplications);
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributionLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributionLocator.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributionLocator.java
new file mode 100755
index 0000000..4595a52
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributionLocator.java
@@ -0,0 +1,45 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * Represents a single distribution locator server, of which a distributed system may use zero or
+ * many. The distributed system will be configured to use either multicast discovery or locator
+ * service.
+ *
+ * @see DistributionLocatorConfig
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface DistributionLocator extends ManagedEntity {
+
+  /**
+   * Returns the identity name for this locator.
+   */
+  public String getId();
+
+  /**
+   * Returns the configuration object for this distribution locator.
+   *
+   * @since GemFire 4.0
+   */
+  public DistributionLocatorConfig getConfig();
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributionLocatorConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributionLocatorConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributionLocatorConfig.java
new file mode 100644
index 0000000..f331de6
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/DistributionLocatorConfig.java
@@ -0,0 +1,81 @@
+/*
+ * 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.internal.admin.api;
+
+import java.util.Properties;
+
+/**
+ * Describes the configuration of a {@link DistributionLocator} managed by the GemFire
+ * administration APIs.
+ *
+ * <P>
+ *
+ * A <code>DistributionLocatorConfig</code> can be modified using a number of mutator methods until
+ * the <code>DistributionLocator</code> configured by this object is {@linkplain ManagedEntity#start
+ * started}. After that, attempts to modify most attributes in the
+ * <code>DistributionLocatorConfig</code> will result in an {@link IllegalStateException} being
+ * thrown. If you wish to use the same <code>DistributionLocatorConfig</code> to configure another
+ * <code>DistributionLocator</code>s, a copy of the <code>DistributionLocatorConfig</code> object
+ * can be made by invoking the {@link Object#clone} method.
+ *
+ * @see AdminDistributedSystem#addDistributionLocator
+ * @see org.apache.geode.distributed.Locator
+ *
+ * @since GemFire 4.0
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface DistributionLocatorConfig extends ManagedEntityConfig {
+
+  /**
+   * Returns the port on which ths distribution locator listens for members to connect. There is no
+   * default locator port, so a non-default port must be specified.
+   */
+  public int getPort();
+
+  /**
+   * Sets the port on which the distribution locator listens for members to connect.
+   */
+  public void setPort(int port);
+
+  /**
+   * Returns the address to which the distribution locator's port is (or will be) bound. By default,
+   * the bind address is <code>null</code> meaning that the port will be bound to all network
+   * addresses on the host.
+   */
+  public String getBindAddress();
+
+  /**
+   * Sets the address to which the distribution locator's port is (or will be) bound.
+   */
+  public void setBindAddress(String bindAddress);
+
+  /**
+   * Sets the properties used to configure the locator's DistributedSystem.
+   * 
+   * @since GemFire 5.0
+   */
+  public void setDistributedSystemProperties(Properties props);
+
+  /**
+   * Retrieves the properties used to configure the locator's DistributedSystem.
+   * 
+   * @since GemFire 5.0
+   */
+  public Properties getDistributedSystemProperties();
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireHealth.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireHealth.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireHealth.java
new file mode 100644
index 0000000..b2b9f69
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireHealth.java
@@ -0,0 +1,209 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+/**
+ * Provides information about the aggregate health of the members of a GemFire distributed system
+ * ("components"). The {@link #getHealth getHealth} method provides an indication of the overall
+ * health. Health is expressed as one of three levels: {@link #GOOD_HEALTH GOOD_HEALTH},
+ * {@link #OKAY_HEALTH OKAY_HEALTH}, and {@link #POOR_HEALTH POOR_HEALTH}. The {@link #getDiagnosis
+ * getDiagnosis} method provides a more detailed explanation of the cause of ill health.
+ *
+ * <P>
+ *
+ * The aggregate health of the GemFire component is evaluated
+ * {@linkplain GemFireHealthConfig#setHealthEvaluationInterval every so often} and if certain
+ * criteria are met, then the overall health of the component changes accordingly. If any of the
+ * components is in <code>OKAY_HEALTH</code>, then the overall health is <code>OKAY_HEALTH</code>.
+ * If any of the components is in <code>POOR_HEALTH</code>, then the overall health is
+ * <code>POOR_HEALTH</code>.
+ *
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface GemFireHealth {
+
+  /**
+   * An indicator that the GemFire components are healthy.
+   *
+   * @see #getHealth
+   */
+  public static final Health GOOD_HEALTH = new Health(Health.GOOD_STRING);
+
+  /**
+   * An indicator that one or more GemFire components is slightly unhealthy. The problem may or may
+   * not require configuration changes and may not necessarily lead to poorer component health.
+   *
+   * @see #getHealth
+   */
+  public static final Health OKAY_HEALTH = new Health(Health.OKAY_STRING);
+
+  /**
+   * An indicator that one or more GemFire components is unhealthy. While it may be possible for the
+   * components to recover on their own, it is likely that they will have to be restarted.
+   *
+   * @see #getHealth
+   */
+  public static final Health POOR_HEALTH = new Health(Health.POOR_STRING);
+
+  /////////////////////// Instance Methods ///////////////////////
+
+  /**
+   * Returns an indicator of the overall health of the GemFire components.
+   *
+   * @see #GOOD_HEALTH
+   * @see #OKAY_HEALTH
+   * @see #POOR_HEALTH
+   */
+  public Health getHealth();
+
+  /**
+   * Resets the overall health of the GemFire components to {@link #GOOD_HEALTH}. This operation
+   * should be invoked when the operator has determined that warnings about the components's health
+   * do not need to be regarded.
+   */
+  public void resetHealth();
+
+  /**
+   * Returns a message that provides a description of the cause of a component's ill health.
+   */
+  public String getDiagnosis();
+
+  /**
+   * Returns the configuration for determining the health of the distributed system itself.
+   */
+  public DistributedSystemHealthConfig getDistributedSystemHealthConfig();
+
+  /**
+   * Sets the configuration for determining the health of the distributed system itself.
+   */
+  public void setDistributedSystemHealthConfig(DistributedSystemHealthConfig config);
+
+  /**
+   * Returns the <code>GemFireHealthConfig</code> for GemFire components whose configurations are
+   * not overridden on a per-host basis. Note that changes made to the returned
+   * <code>GemFireHealthConfig</code> will not take effect until
+   * {@link #setDefaultGemFireHealthConfig} is invoked.
+   */
+  public GemFireHealthConfig getDefaultGemFireHealthConfig();
+
+  /**
+   * Sets the <code>GemFireHealthConfig</code> for GemFire components whose configurations are not
+   * overridden on a per-host basis.
+   *
+   * @throws IllegalArgumentException If <code>config</code> specifies the config for a host
+   */
+  public void setDefaultGemFireHealthConfig(GemFireHealthConfig config);
+
+  /**
+   * Returns the <code>GemFireHealthConfig</code> for GemFire components that reside on a given
+   * host. This configuration will override the {@linkplain #getDefaultGemFireHealthConfig default}
+   * configuration.
+   *
+   * @param hostName The {@linkplain java.net.InetAddress#getCanonicalHostName canonical} name of
+   *        the host.
+   */
+  public GemFireHealthConfig getGemFireHealthConfig(String hostName);
+
+  /**
+   * Sets the <code>GemFireHealthConfig</code> for GemFire components that reside on a given host.
+   * This configuration will override the {@linkplain #getDefaultGemFireHealthConfig default}
+   * configuration. Note that changes made to the returned <code>GemFireHealthConfig</code> will not
+   * take effect until {@link #setDefaultGemFireHealthConfig} is invoked.
+   *
+   * @param hostName The {@linkplain java.net.InetAddress#getCanonicalHostName canonical} name of
+   *        the host.
+   *
+   * @throws IllegalArgumentException If host <code>hostName</code> does not exist or if there are
+   *         no GemFire components running on that host or if <code>config</code> does not configure
+   *         host <code>hostName</code>.
+   */
+  public void setGemFireHealthConfig(String hostName, GemFireHealthConfig config);
+
+  /**
+   * Closes this health monitor and releases all resources associated with it.
+   */
+  public void close();
+
+  /**
+   * Returns whether or not this <code>GemFireHealth</code> is {@linkplain #close closed}.
+   */
+  public boolean isClosed();
+
+  ////////////////////// Inner Classes //////////////////////
+
+  /**
+   * An enumerated type for the health of GemFire.
+   */
+  public static class Health implements java.io.Serializable {
+    private static final long serialVersionUID = 3039539430412151801L;
+    /** The string for good health */
+    static final String GOOD_STRING = LocalizedStrings.GemFireHealth_GOOD.toLocalizedString();
+
+    /** The string for okay health */
+    static final String OKAY_STRING = LocalizedStrings.GemFireHealth_OKAY.toLocalizedString();
+
+    /** The string for poor health */
+    static final String POOR_STRING = LocalizedStrings.GemFireHealth_POOR.toLocalizedString();
+
+    //////////////////// Instance Fields ////////////////////
+
+    /** The string for this health */
+    private String healthString;
+
+    ///////////////////// Constructors //////////////////////
+
+    /**
+     * Creates a new <code>Health</code> with the given string
+     */
+    protected Health(String healthString) {
+      this.healthString = healthString;
+    }
+
+    //////////////////// Instance Methods ////////////////////
+
+    /**
+     * Returns the appropriate canonical instance of <code>Health</code>.
+     */
+    public Object readResolve() {
+      if (this.healthString.equals(GOOD_STRING)) {
+        return GemFireHealth.GOOD_HEALTH;
+
+      } else if (this.healthString.equals(OKAY_STRING)) {
+        return GemFireHealth.OKAY_HEALTH;
+
+      } else if (this.healthString.equals(POOR_STRING)) {
+        return GemFireHealth.POOR_HEALTH;
+
+      } else {
+        Assert.assertTrue(false, "Unknown healthString: " + this.healthString);
+        return null;
+      }
+    }
+
+    @Override
+    public String toString() {
+      return this.healthString;
+    }
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireHealthConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireHealthConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireHealthConfig.java
new file mode 100644
index 0000000..c07cc77
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireHealthConfig.java
@@ -0,0 +1,54 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * Provides configuration information relating to all of the components of a GemFire distributed
+ * system.
+ *
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface GemFireHealthConfig extends MemberHealthConfig, CacheHealthConfig {
+
+  /**
+   * The default number of seconds between assessments of the health of the GemFire components.
+   */
+  public static final int DEFAULT_HEALTH_EVALUATION_INTERVAL = 30;
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Returns the name of the host to which this configuration applies. If this is the "default"
+   * configuration, then <code>null</code> is returned.
+   *
+   * @see GemFireHealth#getGemFireHealthConfig
+   */
+  public String getHostName();
+
+  /**
+   * Sets the number of seconds between assessments of the health of the GemFire components.
+   */
+  public void setHealthEvaluationInterval(int interval);
+
+  /**
+   * Returns the number of seconds between assessments of the health of the GemFire components.
+   */
+  public int getHealthEvaluationInterval();
+
+}


[42/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
deleted file mode 100644
index fbf0839..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMemberRegionImpl.java
+++ /dev/null
@@ -1,371 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.cache.*;
-// import org.apache.geode.internal.Assert;
-// import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.admin.remote.*;
-
-import java.io.File;
-import java.util.*;
-
-/**
- * View of a region in a GemFire system member's cache.
- *
- * @since GemFire 3.5
- */
-public class SystemMemberRegionImpl implements SystemMemberRegion {
-
-  private AdminRegion r;
-  private RegionAttributes ra;
-  private CacheStatistics rs;
-  private Set subregionNames;
-  private Set subregionFullPaths;
-  private int entryCount;
-  private int subregionCount;
-
-  /** The cache to which this region belongs */
-  private final SystemMemberCacheImpl cache;
-
-  // constructors
-  public SystemMemberRegionImpl(SystemMemberCacheImpl cache, Region r) {
-    this.cache = cache;
-    this.r = (AdminRegion) r;
-  }
-
-  private void refreshFields() {
-    this.ra = this.r.getAttributes();
-    if (getStatisticsEnabled() && !this.ra.getDataPolicy().withPartitioning()) {
-      this.rs = this.r.getStatistics();
-    } else {
-      this.rs = null;
-    }
-    { // set subregionNames
-      Set s = this.r.subregions(false);
-      Set names = new TreeSet();
-      Set paths = new TreeSet();
-      Iterator it = s.iterator();
-      while (it.hasNext()) {
-        Region r = (Region) it.next();
-        String name = r.getName();
-        names.add(name);
-        paths.add(this.getFullPath() + Region.SEPARATOR_CHAR + name);
-      }
-      this.subregionNames = names;
-      this.subregionFullPaths = paths;
-    }
-    try {
-      int[] sizes = this.r.sizes();
-      this.entryCount = sizes[0];
-      this.subregionCount = sizes[1];
-    } catch (CacheException ignore) {
-      this.entryCount = 0;
-      this.subregionCount = 0;
-    }
-  }
-
-  // attributes
-  public String getName() {
-    return this.r.getName();
-  }
-
-  public String getFullPath() {
-    return this.r.getFullPath();
-  }
-
-  public java.util.Set getSubregionNames() {
-    return this.subregionNames;
-  }
-
-  public java.util.Set getSubregionFullPaths() {
-    return this.subregionFullPaths;
-  }
-
-  public String getUserAttribute() {
-    return (String) r.getUserAttribute();
-  }
-
-  public String getCacheLoader() {
-    Object o = this.ra.getCacheLoader();
-    if (o == null) {
-      return "";
-    } else {
-      return o.toString();
-    }
-  }
-
-  public String getCacheWriter() {
-    Object o = this.ra.getCacheWriter();
-    if (o == null) {
-      return "";
-    } else {
-      return o.toString();
-    }
-  }
-
-  public String getKeyConstraint() {
-    Class constraint = this.ra.getKeyConstraint();
-    if (constraint == null) {
-      return "";
-    } else {
-      return constraint.getName();
-    }
-  }
-
-  public String getValueConstraint() {
-    Class constraint = this.ra.getValueConstraint();
-    if (constraint == null) {
-      return "";
-    } else {
-      return constraint.getName();
-    }
-  }
-
-  public boolean getEarlyAck() {
-    return this.ra.getEarlyAck();
-  }
-
-  public int getRegionTimeToLiveTimeLimit() {
-    return this.ra.getRegionTimeToLive().getTimeout();
-  }
-
-  public ExpirationAction getRegionTimeToLiveAction() {
-    return this.ra.getRegionTimeToLive().getAction();
-  }
-
-  public int getEntryTimeToLiveTimeLimit() {
-    return this.ra.getEntryTimeToLive().getTimeout();
-  }
-
-  public ExpirationAction getEntryTimeToLiveAction() {
-    return this.ra.getEntryTimeToLive().getAction();
-  }
-
-  public String getCustomEntryTimeToLive() {
-    Object o = this.ra.getCustomEntryTimeToLive();
-    if (o == null) {
-      return "";
-    } else {
-      return o.toString();
-    }
-  }
-
-  public int getRegionIdleTimeoutTimeLimit() {
-    return this.ra.getRegionIdleTimeout().getTimeout();
-  }
-
-  public ExpirationAction getRegionIdleTimeoutAction() {
-    return this.ra.getRegionIdleTimeout().getAction();
-  }
-
-  public int getEntryIdleTimeoutTimeLimit() {
-    return this.ra.getEntryIdleTimeout().getTimeout();
-  }
-
-  public ExpirationAction getEntryIdleTimeoutAction() {
-    return this.ra.getEntryIdleTimeout().getAction();
-  }
-
-  public String getCustomEntryIdleTimeout() {
-    Object o = this.ra.getCustomEntryIdleTimeout();
-    if (o == null) {
-      return "";
-    } else {
-      return o.toString();
-    }
-  }
-
-  public MirrorType getMirrorType() {
-    return this.ra.getMirrorType();
-  }
-
-  public DataPolicy getDataPolicy() {
-    return this.ra.getDataPolicy();
-  }
-
-  public Scope getScope() {
-    return this.ra.getScope();
-  }
-
-  public EvictionAttributes getEvictionAttributes() {
-    return this.ra.getEvictionAttributes();
-  }
-
-  /**
-   * This method will return an empty string if there are no CacheListeners defined on the region.
-   * If there are more than 1 CacheListeners defined, this method will return the description of the
-   * 1st CacheListener in the list returned by the getCacheListeners method. If there is only one
-   * CacheListener defined this method will return it's description
-   * 
-   * @return String the region's <code>CacheListener</code> description
-   * @deprecated as of 6.0, use {@link #getCacheListeners} instead
-   */
-  @Deprecated
-  public String getCacheListener() {
-    String[] o = this.getCacheListeners();
-    if (o.length == 0) {
-      return "";
-    } else {
-      return o[0].toString();
-    }
-  }
-
-  /**
-   * This method will return an empty array if there are no CacheListeners defined on the region. If
-   * there are one or more than 1 CacheListeners defined, this method will return an array which has
-   * the description of all the CacheListeners
-   * 
-   * @return String[] the region's <code>CacheListeners</code> descriptions as a String array
-   * @since GemFire 6.0
-   */
-  public String[] getCacheListeners() {
-    Object[] o = this.ra.getCacheListeners();
-    String[] ret = null;
-    if (o == null || o.length == 0) {
-      ret = new String[0];
-    } else {
-      ret = new String[o.length];
-      for (int i = 0; i < o.length; i++) {
-        ret[i] = o[i].toString();
-      }
-    }
-    return ret;
-  }
-
-  public int getInitialCapacity() {
-    return this.ra.getInitialCapacity();
-  }
-
-  public float getLoadFactor() {
-    return this.ra.getLoadFactor();
-  }
-
-  public int getConcurrencyLevel() {
-    return this.ra.getConcurrencyLevel();
-  }
-
-  public boolean getConcurrencyChecksEnabled() {
-    return this.ra.getConcurrencyChecksEnabled();
-  }
-
-  public boolean getStatisticsEnabled() {
-    return this.ra.getStatisticsEnabled();
-  }
-
-  public boolean getPersistBackup() {
-    return this.ra.getPersistBackup();
-  }
-
-  public DiskWriteAttributes getDiskWriteAttributes() {
-    return this.ra.getDiskWriteAttributes();
-  }
-
-  public File[] getDiskDirs() {
-    return this.ra.getDiskDirs();
-  }
-
-  public int getEntryCount() {
-    return this.entryCount;
-  }
-
-  public int getSubregionCount() {
-    return this.subregionCount;
-  }
-
-  public long getLastModifiedTime() {
-    if (this.rs == null) {
-      return 0;
-    } else {
-      return this.rs.getLastModifiedTime();
-    }
-  }
-
-  public long getLastAccessedTime() {
-    if (this.rs == null) {
-      return 0;
-    } else {
-      return this.rs.getLastAccessedTime();
-    }
-  }
-
-  public long getHitCount() {
-    if (this.rs == null) {
-      return 0;
-    } else {
-      return this.rs.getHitCount();
-    }
-  }
-
-  public long getMissCount() {
-    if (this.rs == null) {
-      return 0;
-    } else {
-      return this.rs.getMissCount();
-    }
-  }
-
-  public float getHitRatio() {
-    if (this.rs == null) {
-      return 0;
-    } else {
-      return this.rs.getHitRatio();
-    }
-  }
-
-  // operations
-  public void refresh() {
-    refreshFields();
-  }
-
-  /**
-   * Returns a string representation of the object.
-   * 
-   * @return a string representation of the object
-   */
-  @Override
-  public String toString() {
-    return getName();
-  }
-
-  public SystemMemberRegion createSubregion(String name, RegionAttributes attrs)
-      throws AdminException {
-
-    Region r = this.cache.getVM().createSubregion(this.cache.getCacheInfo(), this.getFullPath(),
-        name, attrs);
-    if (r == null) {
-      return null;
-
-    } else {
-      return this.cache.createSystemMemberRegion(r);
-    }
-
-  }
-
-  public MembershipAttributes getMembershipAttributes() {
-    return this.ra.getMembershipAttributes();
-  }
-
-  public SubscriptionAttributes getSubscriptionAttributes() {
-    return this.ra.getSubscriptionAttributes();
-  }
-
-  public PartitionAttributes getPartitionAttributes() {
-    return this.ra.getPartitionAttributes();
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMembershipEventImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMembershipEventImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMembershipEventImpl.java
deleted file mode 100644
index ad5fd5a..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/SystemMembershipEventImpl.java
+++ /dev/null
@@ -1,67 +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.admin.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.distributed.DistributedMember;
-
-/**
- * An event delivered to a {@link SystemMembershipListener} when a member has joined or left the
- * distributed system.
- *
- * @since GemFire 5.0
- */
-public class SystemMembershipEventImpl implements SystemMembershipEvent {
-
-  /** The id of the member that generated this event */
-  private DistributedMember id;
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>SystemMembershipEvent</code> for the member with the given id.
-   */
-  protected SystemMembershipEventImpl(DistributedMember id) {
-    this.id = id;
-  }
-
-  ///////////////////// Instance Methods /////////////////////
-
-  public String getMemberId() {
-    return this.id.toString();
-  }
-
-  public DistributedMember getDistributedMember() {
-    return this.id;
-  }
-
-  // /**
-  // * Returns the user specified callback object associated with this
-  // * membership event. Note that the callback argument is always
-  // * <code>null</code> for the event delivered to the {@link
-  // * SystemMembershipListener#memberCrashed} method.
-  // *
-  // * @since GemFire 4.0
-  // */
-  // public Object getCallbackArgument() {
-  // throw new UnsupportedOperationException("Not implemented yet");
-  // }
-
-  @Override
-  public String toString() {
-    return "Member " + this.getMemberId();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/internal/package.html
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/package.html b/geode-core/src/main/java/org/apache/geode/admin/internal/package.html
deleted file mode 100644
index 38f9174..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/internal/package.html
+++ /dev/null
@@ -1,53 +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.
--->
-<HTML>
-<BODY>
-
-<P>Contains the implementation of the external admin APIs from
-<a href="{@docRoot}/org/apache/geode/admin/package-summary.html#package_description">org.apache.geode.admin</a>.</P>
-
-<H2>Monitoring the "health" of GemFire</H2>
-
-<P>The health monitoring implementation comes in two pieces.  On the
-client (administrator) side there is a {@link
-org.apache.geode.admin.internal.GemFireHealthImpl} object that is
-responsible for configuring a {@link
-org.apache.geode.distributed.internal.HealthMonitorImpl} that runs
-in the member VMs.  The communication between the administration
-process and the member process is accomplised via a {@link
-org.apache.geode.internal.admin.GemFireVM GemFireVM} from the
-"internal admin" API.  The <code>HealthMonitorImpl</code> is a thread
-that periodically consults a {@link
-org.apache.geode.admin.internal.GemFireHealthEvaluator} that uses
-a {@link org.apache.geode.admin.internal.GemFireHealthConfigImpl}
-to determine the health of a GemFire component.  Most of the health
-criteria are based on {@linkplain org.apache.geode.Statistics
-statistics} that are maintained by GemFire.  When the
-<code>HealthMonitorImpl</code> determines that the health of a GemFire
-component has changed, it alerts the administrator process via a
-{@link org.apache.geode.internal.admin.HealthListener}.</P>
-
-
-<P>The below diagram explains how the classes that monitor the health
-of GemFire are implemented.</P>
-
-<CENTER>
-<IMG src="{@docRoot}/javadoc-images/health-classes.gif" HEIGHT="803" />
-</CENTER>
-
-</BODY>
-</HTML>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/Agent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/Agent.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/Agent.java
deleted file mode 100644
index 8e16dca..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/Agent.java
+++ /dev/null
@@ -1,145 +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.admin.jmx;
-
-import org.apache.geode.LogWriter;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.AdminDistributedSystem;
-
-// import javax.management.MBeanException;
-import javax.management.MalformedObjectNameException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-/**
- * A server component that provides administration-related information about a GemFire distributed
- * system via the Java Management Extension JMX API. When a JMX <code>Agent</code> is created, it
- * registers an MBean that represents {@link #getObjectName itself}. Click
- * <A href="doc-files/mbeans-descriptions.html">here</A> for a description of the attributes,
- * operations, and notifications of this and other GemFire JMX MBeans.
- *
- * <P>
- *
- * The GemFire JMX Agent currently supports three JMX "adapters" through which clients can access
- * the GemFire management beans: an "HTTP adapter" that allows a web browser client to view and
- * modify management beans via HTTP or HTTPS, an "RMI adapter" that allows Java programs to access
- * management beans using Remote Method Invocation, and an "SNMP adapter" that allows SNMP to access
- * management beans. Information about configuring these adapters can be found in
- * {@link AgentConfig}.
- *
- * <P>
- *
- * In most distributed caching architectures, JMX administration agents are run in their own
- * processes. A stand-alone JMX agent is managed using the <code>agent</code> command line utility:
- *
- * <PRE>
- * $ agent start
- * </PRE>
- *
- * This class allows a GemFire application VM to host a JMX management agent. Architectures with
- * "co-located" JMX agents reduce the number of overall proceses required. However, hosting a JMX
- * management agent in the same VM as a GemFire application is not generally recommended because it
- * adds extra burden to an application VM and in the event that the application VM exits the
- * administration information will no longer be available.
- *
- * @see AgentConfig
- * @see AgentFactory
- *
- * @since GemFire 4.0
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface Agent {
-
-  /** Lookup name for RMIConnector when rmi-registry-enabled is true */
-  public static final String JNDI_NAME = "/jmxconnector";
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Returns the configuration object for this JMX Agent.
-   */
-  public AgentConfig getConfig();
-
-  /**
-   * Starts this JMX Agent and its associated adapters. This method does not
-   * {@linkplain #connectToSystem connect} to the distributed system.
-   */
-  public void start();
-
-  /**
-   * Returns the JMX <code>MBeanServer</code> with which GemFire MBeans are registered or
-   * <code>null</code> if this <code>Agent</code> is not started.
-   */
-  public MBeanServer getMBeanServer();
-
-  /**
-   * {@linkplain #disconnectFromSystem Disconnects} from the distributed system and stops this JMX
-   * Agent and all of its associated adapters.
-   */
-  public void stop();
-
-  /**
-   * Returns the <code>ObjectName</code> of the JMX management bean that represents this agent or
-   * <code>null</code> if this <code>Agent</code> has not been started.
-   */
-  public ObjectName getObjectName();
-
-  /**
-   * Returns whether or not this JMX <code>Agent</code> is currently providing information about a
-   * distributed system.
-   */
-  public boolean isConnected();
-
-  /**
-   * Connects to the distributed system described by this <code>Agent</code>'s configuration.
-   *
-   * @return The object name of the system that the <code>Agent</code> is now connected to.
-   */
-  public ObjectName connectToSystem() throws AdminException, MalformedObjectNameException;
-
-  /**
-   * Returns the <code>AdminDistributedSystem</code> that underlies this JMX <code>Agent</code> or
-   * <code>null</code> is this agent is not {@linkplain #isConnected connected}.
-   */
-  public AdminDistributedSystem getDistributedSystem();
-
-  /**
-   * Returns the object name of the JMX MBean that represents the distributed system administered by
-   * this <code>Agent</code> or <code>null</code> if this <code>Agent</code> has not
-   * {@linkplain #connectToSystem connected} to the distributed system.
-   */
-  public ObjectName manageDistributedSystem() throws MalformedObjectNameException;
-
-  /**
-   * Disconnects this agent from the distributed system and unregisters the management beans that
-   * provided information about it. However, this agent's adapters are not stopped and it is
-   * possible to reconfigure this <code>Agent</code> to connect to another distributed system.
-   */
-  public void disconnectFromSystem();
-
-  /**
-   * Saves the configuration for this <code>Agent</code> to the file specified by @link
-   * AgentConfig#getPropertyFile.
-   */
-  public void saveProperties();
-
-  /**
-   * Returns the <code>LogWriter</code> used for logging information.
-   */
-  public LogWriter getLogWriter();
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/AgentConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/AgentConfig.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/AgentConfig.java
deleted file mode 100644
index 29f0751..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/AgentConfig.java
+++ /dev/null
@@ -1,844 +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.admin.jmx;
-
-import org.apache.geode.admin.DistributedSystemConfig;
-import org.apache.geode.distributed.internal.DistributionConfig;
-// import org.apache.geode.admin.internal.InetAddressUtil;
-
-/**
- * A configuration object for a JMX administration {@linkplain Agent agent} that is hosted by a
- * GemFire application VM. A file named {@link #DEFAULT_PROPERTY_FILE "agent.properties"} can be
- * used to override the default values of <code>AgentConfig</code> attributes. The
- * "gfAgentPropertyFile" {@linkplain System#getProperty(java.lang.String) system property} can be
- * used to specify an agent properties file other than "agent.properties". System properties
- * prefixed with {@linkplain #SYSTEM_PROPERTY_PREFIX "gemfire.agent."} can be used to override the
- * values in the properties file. For instance "-Dgemfire.agent.http-port=8081" can be used to
- * override the default port for the HTTP adapter. Configuration related to the distributed system
- * that the JMX agent administers is inherited from and described in <code>AgentConfig</code>'s
- * superinterface, {@link DistributedSystemConfig}.
- *
- * <P>
- *
- * An <code>AgentConfig</code> can be modified using a number of mutator methods until it is used to
- * create an <code>Agent</code>. After that, attempts to modify most attributes in the
- * <code>AgentConfig</code> will result in an {@link IllegalStateException} being thrown. If you
- * wish to use the same <code>AgentConfig</code> to configure multiple <code>Agent</code>s, a copy
- * of the <code>AgentConfig</code> object can be made by invoking its {@link #clone} method.
- *
- * <P>
- *
- * <B>JMX Administation Agent Configuration Properties</B>
- *
- * <dl>
- * <a name="auto-connect">
- * <dt>{@linkplain #AUTO_CONNECT_NAME auto-connect}</dt></a>
- * <dd><U>Description</U>: whether or not a JMX agent will automatically connect to the distributed
- * system it is configured to administer.</dd>
- * <dd><U>{@linkplain #DEFAULT_AUTO_CONNECT Default}</U>: false</dd>
- * </dl>
- *
- * <B>JMX Agent SSL Configuration Properties</B>
- *
- * <P>
- *
- * These parameters configure sockets that are created by the GemFire JMX Agent regardless of which
- * adapters are enabled. These setting apply to all adapters. For example, if clients connect to the
- * RMI adapter using SSL, then clients must also connect to the HTTP adapter using SSL (HTTPS). Note
- * that these configuration attributes do <b>not</b> effect how the agent connects to the
- * distributed system it administers, only how JMX clients connect to the agent.
- *
- * <dl>
- * <a name="agent-ssl-enabled">
- * <dt>{@linkplain #AGENT_SSL_ENABLED_NAME agent-ssl-enabled}</dt></a>
- * <dd><U>Description</U>: whether or not connections to the JMX agent require SSL</dd>
- * <dd><U>{@linkplain #DEFAULT_AGENT_SSL_ENABLED Default}</U>: false</dd>
- * </dl>
- * 
- * <dl>
- * <a name="agent-ssl-protocols">
- * <dt>{@linkplain #AGENT_SSL_PROTOCOLS_NAME agent-ssl-protocols}</dt></a>
- * <dd><U>Description</U>: the SSL protocols to be used when connecting to the JMX agent</dd>
- * <dd><U>{@linkplain #DEFAULT_AGENT_SSL_PROTOCOLS Default}</U>: any</dd>
- * </dl>
- *
- * <dl>
- * <a name="agent-ssl-ciphers">
- * <dt>{@linkplain #AGENT_SSL_CIPHERS_NAME agent-ssl-ciphers}</dt></a>
- * <dd><U>Description</U>: the SSL ciphers to be used when connecting to the JMX agent</dd>
- * <dd><U>{@linkplain #DEFAULT_AGENT_SSL_CIPHERS Default}</U>: any</dd>
- * </dl>
- *
- * <dl>
- * <a name="agent-ssl-require-authentication">
- * <dt>{@linkplain #AGENT_SSL_REQUIRE_AUTHENTICATION_NAME agent-ssl-require-authentication}</dt></a>
- * <dd><U>Description</U>: whether or not SSL connections to the RMI adapter require authentication
- * </dd>
- * <dd><U>{@linkplain #DEFAULT_AGENT_SSL_REQUIRE_AUTHENTICATION Default}</U>: true</dd>
- * </dl>
- *
- * <dl>
- * <a name="http-ssl-require-authentication">
- * <dt>{@linkplain #HTTP_SSL_REQUIRE_AUTHENTICATION_NAME http-ssl-require-authentication}</dt></a>
- * <dd><U>Description</U>: whether or not SSL connections to the HTTP adapter require authentication
- * </dd>
- * <dd><U>{@linkplain #DEFAULT_HTTP_SSL_REQUIRE_AUTHENTICATION Default}</U>: false</dd>
- * </dl>
- *
- * <B>HTTP Adapter Configuration</B>
- *
- * <dl>
- * <a name="http-enabled">
- * <dt>{@linkplain #HTTP_ENABLED_NAME http-enabled}</dt></a>
- * <dd><U>Description</U>: whether or not the HTTP adapter is enabled in the JMX agent.</dd>
- * <dd><U>{@linkplain #DEFAULT_HTTP_ENABLED Default}</U>: true</dd>
- * </dl>
- * 
- * <dl>
- * <a name="http-port">
- * <dt>{@linkplain #HTTP_PORT_NAME http-port}</dt></a>
- * <dd><U>Description</U>: the port on which the HTTP adapter should listen for client connections.
- * </dd>
- * <dd><U>{@linkplain #DEFAULT_HTTP_PORT Default}</U>: 8080</dd>
- * </dl>
- *
- * <dl>
- * <a name="http-bind-address">
- * <dt>{@linkplain #HTTP_BIND_ADDRESS_NAME http-bind-address}</dt></a>
- * <dd><U>Description</U>: the machine name or IP address to which the HTTP listening socket should
- * be bound. If this value is "localhost", then the socket will be bound to the loopback address
- * (127.0.0.1) and the adapter will only be accessible via the URL
- * <code>http://localhost:8080</code>.</dd>
- * <dd><U>{@linkplain #DEFAULT_HTTP_BIND_ADDRESS Default}</U>: "" (all network addresses)</dd>
- * </dl>
- *
- * <dl>
- * <a name="http-authentication-enabled">
- * <dt>{@linkplain #HTTP_AUTHENTICATION_ENABLED_NAME http-authentication-enabled}</dt></a>
- * <dd><U>Description</U>: Whether or not connections to the HTTP adapter should be authenticated
- * with a user name and password.</dd>
- * <dd><U>{@linkplain #DEFAULT_HTTP_AUTHENTICATION_ENABLED Default}</U>: false</dd>
- * </dl>
- *
- * <dl>
- * <a name="http-authentication-user">
- * <dt>{@linkplain #HTTP_AUTHENTICATION_USER_NAME http-authentication-user}</dt></a>
- * <dd><U>Description</U>: the user name for authenticating secure communication.</dd>
- * <dd><U>{@linkplain #DEFAULT_HTTP_AUTHENTICATION_USER Default}</U>: admin</dd>
- * </dl>
- *
- * <dl>
- * <a name="http-authentication-password">
- * <dt>{@linkplain #HTTP_AUTHENTICATION_PASSWORD_NAME http-authentication-password}</dt></a>
- * <dd><U>Description</U>: the password for authenticating secure communication.</dd>
- * <dd><U>{@linkplain #DEFAULT_HTTP_AUTHENTICATION_PASSWORD Default}</U>: password</dd>
- * </dl>
- *
- * <B>RMI Adapter Configuration Properties</B>
- *
- * <dl>
- * <a name="rmi-enabled">
- * <dt>{@linkplain #RMI_ENABLED_NAME rmi-enabled}</dt></a>
- * <dd><U>Description</U>: whether or not the RMI JMX adapter is enabled</dd>
- * <dd><U>{@linkplain #DEFAULT_RMI_ENABLED Default}</U>: true</dd>
- * </dl>
- *
- * <dl>
- * <a name="rmi-registry-enabled">
- * <dt>{@linkplain #RMI_REGISTRY_ENABLED_NAME rmi-registry-enabled}</dt></a>
- * <dd><U>Description</U>: whether or not the JMX agent should start an RMI registry. Alternatively,
- * a registry outside of the JMX agent VM can be used.</dd>
- * <dd><U>{@linkplain #DEFAULT_RMI_REGISTRY_ENABLED Default}</U>: true</dd>
- * </dl>
- *
- * <dl>
- * <a name="rmi-port">
- * <dt>{@linkplain #RMI_PORT_NAME rmi-port}</dt></a>
- * <dd><U>Description</U>: the port of the RMI registry in which the JMX Agent should bind remote
- * objects.</dd>
- * <dd><U>{@linkplain #DEFAULT_RMI_PORT Default}</U>: 1099</dd>
- * </dl>
- * 
- * <dl>
- * <a name="rmi-server-port">
- * <dt>{@linkplain #RMI_PORT_NAME rmi-server-port}</dt></a>
- * <dd><U>Description</U>: the port to be used by the RMI Server started by JMX Agent.</dd>
- * <dd><U>{@linkplain #DEFAULT_RMI_SERVER_PORT Default}</U>: 0</dd>
- * </dl>
- *
- * <dl>
- * <a name="rmi-bind-address">
- * <dt>{@linkplain #RMI_BIND_ADDRESS_NAME rmi-bind-address}</dt></a>
- * <dd><U>Description</U>: the bind address on which the RMI registry binds its sockets.</dd>
- * <dd><U>{@linkplain #DEFAULT_RMI_BIND_ADDRESS Default}</U>: "" (all network addresses)</dd>
- * </dl>
- *
- * <B>AdventNet SNMP Adapter Configuration Properties</B>
- *
- * <dl>
- * <a name="snmp-enabled">
- * <dt>{@linkplain #SNMP_ENABLED_NAME snmp-enabled}</dt></a>
- * <dd><U>Description</U>: whether or not the SNMP JMX adapter is enabled</dd>
- * <dd><U>{@linkplain #DEFAULT_SNMP_ENABLED Default}</U>: false</dd>
- * </dl>
- * 
- * <dl>
- * <a name="snmp-bind-address">
- * <dt>{@linkplain #SNMP_BIND_ADDRESS_NAME snmp-bind-address}</dt></a>
- * <dd><U>Description</U>: the host name to which sockets used by the SNMP adapter should be bound.
- * </dd>
- * <dd><U>{@linkplain #DEFAULT_SNMP_BIND_ADDRESS Default}</U>: the name of the local machine (not
- * <code>localhost</code>)</dd>
- * </dl>
- *
- * <dl>
- * <a name="snmp-directory">
- * <dt>{@linkplain #SNMP_DIRECTORY_NAME snmp-directory}</dt></a>
- * <dd><U>Description</U>: the deployment directory for AdventNet SNMP Adaptor</dd>
- * <dd><U>{@linkplain #DEFAULT_SNMP_DIRECTORY Default}</U>: ""</dd>
- * </dl>
- * 
- * <B>JMX Agent Email Notification Properties (for statistics alerts)</B>
- * 
- * <dl>
- * <a name="email-notification-enabled">
- * <dt>{@linkplain #EMAIL_NOTIFICATIONS_ENABLED_NAME email-notification-enabled}</dt></a>
- * <dd><U>Description</U>: Whether or not email notifications are enabled for statistics alerts.
- * </dd>
- * <dd><U>{@linkplain #DEFAULT_EMAIL_NOTIFICATIONS_ENABLED Default}</U>: false</dd>
- * </dl>
- * 
- * <dl>
- * <a name="email-notification-from">
- * <dt>{@linkplain #EMAIL_NOTIFICATIONS_FROM_NAME email-notification-from}</dt></a>
- * <dd><U>Description</U>: Email address to be used to send email notifications.</dd>
- * <dd><U>{@linkplain #DEFAULT_EMAIL_FROM Default}</U>: ""</dd>
- * </dl>
- * 
- * <dl>
- * <a name="email-notification-host">
- * <dt>{@linkplain #EMAIL_NOTIFICATIONS_HOST_NAME email-notification-host}</dt></a>
- * <dd><U>Description</U>: The host name of the mail server to be used for email communication.</dd>
- * <dd><U>{@linkplain #DEFAULT_EMAIL_HOST Default}</U>: ""</dd>
- * </dl>
- * 
- * <dl>
- * <a name="email-notification-to">
- * <dt>{@linkplain #EMAIL_NOTIFICATIONS_TO_LIST_NAME email-notification-to}</dt></a>
- * <dd><U>Description</U>: Email address where the email notifications should be sent.</dd>
- * <dd><U>{@linkplain #DEFAULT_EMAIL_TO_LIST Default}</U>: ""</dd>
- * </dl>
- * 
- * <dl>
- * <a name="state-save-file">
- * <dt>{@linkplain #STATE_SAVE_FILE_NAME state-save-file}</dt></a>
- * <dd><U>Description</U>: The name of the file to be used for saving agent state. The file is
- * stored in the same directory in which the agent.properties file is located</dd>
- * <dd><U>{@linkplain #DEFAULT_STATE_SAVE_FILE Default}</U>: ""</dd>
- * </dl>
- * 
- *
- * @since GemFire 4.0
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public interface AgentConfig extends DistributedSystemConfig {
-
-  /** The prefix for JMX Agent configuration system properties */
-  public static final String SYSTEM_PROPERTY_PREFIX = DistributionConfig.GEMFIRE_PREFIX + "agent.";
-
-  /** The default "propertyFile" value */
-  public static final String DEFAULT_PROPERTY_FILE = "agent.properties";
-
-  /** The default name for file that has "agent state saved serialized" */
-  public static final String DEFAULT_STATE_SAVE_FILE = "agent.ser";
-
-  /** The name of the "auto-connect" property */
-  public static final String AUTO_CONNECT_NAME = "auto-connect";
-
-  /** The default value of the "auto-connect" property */
-  public static final boolean DEFAULT_AUTO_CONNECT = true;
-
-  // -------------------------------------------------------------------------
-  // HttpAdaptor properties...
-  // -------------------------------------------------------------------------
-
-  /** The name of the "httpEnabled" property */
-  public static final String HTTP_ENABLED_NAME = "http-enabled";
-
-  /** The default value of the "httpEnabled" property */
-  public static final boolean DEFAULT_HTTP_ENABLED = true;
-
-  /** The name of the "httpBindAddress" property */
-  public static final String HTTP_BIND_ADDRESS_NAME = "http-bind-address";
-
-  /** The default value of the "httpBindAddress" property */
-  public static final String DEFAULT_HTTP_BIND_ADDRESS = "";
-
-  /** The name of the "httpPort" property */
-  public static final String HTTP_PORT_NAME = "http-port";
-
-  /** The default value of the "httpPort" property (8080) */
-  public static final int DEFAULT_HTTP_PORT = 8080;
-
-  /** The minimum httpPort (0) */
-  public static final int MIN_HTTP_PORT = 0;
-
-  /** The maximum httpPort (65535) */
-  public static final int MAX_HTTP_PORT = 65535;
-
-  /** The name of the "state-save-file-name" property */
-  public static final String STATE_SAVE_FILE_NAME = "state-save-file";
-
-  /** The name of the "http-authentication-enabled" property */
-  public static final String HTTP_AUTHENTICATION_ENABLED_NAME = "http-authentication-enabled";
-
-  /**
-   * The default value of the "http-authentication-enabled" property
-   */
-  public static final boolean DEFAULT_HTTP_AUTHENTICATION_ENABLED = false;
-
-  /** The name of the "http-authentication-user" property */
-  public static final String HTTP_AUTHENTICATION_USER_NAME = "http-authentication-user";
-
-  /** The default value of the "http-authentication-user" property */
-  public static final String DEFAULT_HTTP_AUTHENTICATION_USER = "admin";
-
-  /** The name of the "http-authentication-password" property */
-  public static final String HTTP_AUTHENTICATION_PASSWORD_NAME = "http-authentication-password";
-
-  /**
-   * The default value of the "http-authentication-password" property
-   */
-  public static final String DEFAULT_HTTP_AUTHENTICATION_PASSWORD = "password";
-
-  /** The name of the "email-notification-enabled" property */
-  public static final String EMAIL_NOTIFICATIONS_ENABLED_NAME = "email-notification-enabled";
-
-  /**
-   * The default value of the "email-notification-enabled" property
-   */
-  public static final boolean DEFAULT_EMAIL_NOTIFICATIONS_ENABLED = false;
-
-  /** The name of the "email-notification-from" property */
-  public static final String EMAIL_NOTIFICATIONS_FROM_NAME = "email-notification-from";
-
-  /**
-   * The default value of the "email-notification-from" property
-   */
-  public static final String DEFAULT_EMAIL_FROM = "";
-
-  /** The name of the "email-notification-host" property */
-  public static final String EMAIL_NOTIFICATIONS_HOST_NAME = "email-notification-host";
-
-  /**
-   * The default value of the "email-notification-host" property
-   */
-  public static final String DEFAULT_EMAIL_HOST = "";
-
-  /** The name of the "email-notification-to" property */
-  public static final String EMAIL_NOTIFICATIONS_TO_LIST_NAME = "email-notification-to";
-
-  /**
-   * The default value of the "email-notification-to" property
-   */
-  public static final String DEFAULT_EMAIL_TO_LIST = "";
-
-  // -------------------------------------------------------------------------
-  // RMIConnectorServer properties...
-  // -------------------------------------------------------------------------
-
-  /** The name of the "rmiEnabled" property */
-  public static final String RMI_ENABLED_NAME = "rmi-enabled";
-
-  /** The default value of the {@linkplain #RMI_ENABLED_NAME rmi-enabled} property */
-  public static final boolean DEFAULT_RMI_ENABLED = true;
-
-  /** The name of the "rmi-registry-enabled" property */
-  public static final String RMI_REGISTRY_ENABLED_NAME = "rmi-registry-enabled";
-
-  /**
-   * The default value of the {@linkplain #RMI_REGISTRY_ENABLED_NAME rmi-registry-enabled} property
-   */
-  public static final boolean DEFAULT_RMI_REGISTRY_ENABLED = true;
-
-  /** The name of the "rmiBindAddress" property */
-  public static final String RMI_BIND_ADDRESS_NAME = "rmi-bind-address";
-
-  /** The default value of the {@linkplain #RMI_BIND_ADDRESS_NAME rmi-bind-address} property */
-  public static final String DEFAULT_RMI_BIND_ADDRESS = "";
-
-  /** The name of the "rmiPort" property */
-  public static final String RMI_PORT_NAME = "rmi-port";
-
-  /** The default value of the {@linkplain #RMI_PORT_NAME rmi-port} property (1099) */
-  public static final int DEFAULT_RMI_PORT = 1099;
-
-  /**
-   * The name of the "rmi-server-port" property
-   * 
-   * @since GemFire 6.5
-   */
-  public static final String RMI_SERVER_PORT_NAME = "rmi-server-port";
-
-  /**
-   * The default value of the {@linkplain #RMI_SERVER_PORT_NAME rmi-server-port} property (0)
-   * 
-   * @since GemFire 6.5
-   */
-  public static final int DEFAULT_RMI_SERVER_PORT = 0;
-
-  /**
-   * The minimum value for {@linkplain #RMI_PORT_NAME rmi-port} or {@linkplain #RMI_SERVER_PORT_NAME
-   * rmi-server-port} (0)
-   */
-  public static final int MIN_RMI_PORT = 0;
-
-  /**
-   * The maximum value for {@linkplain #RMI_PORT_NAME rmi-port} or {@linkplain #RMI_SERVER_PORT_NAME
-   * rmi-server-port} (65535)
-   */
-  public static final int MAX_RMI_PORT = 65535;
-
-  // -------------------------------------------------------------------------
-  // AdventNetSNMPAdaptor properties...
-  // -------------------------------------------------------------------------
-
-  /** The name of the "snmpEnabled" property */
-  public static final String SNMP_ENABLED_NAME = "snmp-enabled";
-
-  /** The default value of the "snmpEnabled" property */
-  public static final boolean DEFAULT_SNMP_ENABLED = false;
-
-  /** The name of the "snmpBindAddress" property */
-  public static final String SNMP_BIND_ADDRESS_NAME = "snmp-bind-address";
-
-  /** The default value of the "snmpBindAddress" property */
-  public static final String DEFAULT_SNMP_BIND_ADDRESS = "";
-
-  /** The name of the "snmpDirectory" property */
-  public static final String SNMP_DIRECTORY_NAME = "snmp-directory";
-
-  /** The default value of the "snmpDirectory" property */
-  public static final String DEFAULT_SNMP_DIRECTORY = "";
-
-  // -------------------------------------------------------------------------
-  // JMX SSL properties...
-  // -------------------------------------------------------------------------
-
-  /** The name of the "agent-ssl-enabled" property */
-  public static final String AGENT_SSL_ENABLED_NAME = "agent-ssl-enabled";
-
-  /** The default value of the "agent-ssl-enabled" property */
-  public static final boolean DEFAULT_AGENT_SSL_ENABLED = false;
-
-  /** The name of the "agent-ssl-protocols" property */
-  public static final String AGENT_SSL_PROTOCOLS_NAME = "agent-ssl-protocols";
-
-  /** The default value of the "agent-ssl-protocols" property */
-  public static final String DEFAULT_AGENT_SSL_PROTOCOLS = "any";
-
-  /** The name of the "agent-ssl-ciphers" property */
-  public static final String AGENT_SSL_CIPHERS_NAME = "agent-ssl-ciphers";
-
-  /** The default value of the "agent-ssl-ciphers" property */
-  public static final String DEFAULT_AGENT_SSL_CIPHERS = "any";
-
-  /** The name of the "agent-ssl-require-authentication" property */
-  public static final String AGENT_SSL_REQUIRE_AUTHENTICATION_NAME =
-      "agent-ssl-require-authentication";
-
-  /**
-   * The default value of the "agent-ssl-require-authentication" property
-   */
-  public static final boolean DEFAULT_AGENT_SSL_REQUIRE_AUTHENTICATION = true;
-
-  /** The name of the "http-ssl-require-authentication" property */
-  public static final String HTTP_SSL_REQUIRE_AUTHENTICATION_NAME =
-      "http-ssl-require-authentication";
-
-  /**
-   * The default value of the "http-ssl-require-authentication" property
-   */
-  public static final boolean DEFAULT_HTTP_SSL_REQUIRE_AUTHENTICATION = false;
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Returns whether or not the JMX agent will automatically connect to the distributed system it
-   * administers.
-   *
-   * See <a href="#auto-connect">description</a> above.
-   */
-  public boolean getAutoConnect();
-
-  /**
-   * Sets whether or not the JMX agent will automatically connect to the distributed system it
-   * administers.
-   *
-   * See <a href="#auto-connect">description</a> above.
-   */
-  public void setAutoConnect(boolean autoConnect);
-
-  /**
-   * Returns whether or not the HTTP adapter is enabled.
-   *
-   * See <a href="#http-enabled">description</a> above.
-   */
-  public boolean isHttpEnabled();
-
-  /**
-   * Sets whether or not the HTTP adapter is enabled.
-   *
-   * See <a href="#http-enabled">description</a> above.
-   */
-  public void setHttpEnabled(boolean httpEnabled);
-
-  /**
-   * Returns the port of the HTTP adapter.
-   *
-   * See <a href="#http-port">description</a> above.
-   */
-  public int getHttpPort();
-
-  /**
-   * Sets the port of the HTTP adapter.
-   *
-   * See <a href="#http-port">description</a> above.
-   */
-  public void setHttpPort(int port);
-
-  /**
-   * Returns the bind address to which the HTTP adapter's listening socket is bound.
-   *
-   * See <a href="#http-bind-address">description</a> above.
-   */
-  public String getHttpBindAddress();
-
-  /**
-   * Sets the bind address to which the HTTP adapter's listening socket is bound.
-   *
-   * See <a href="#http-bind-address">description</a> above.
-   */
-  public void setHttpBindAddress(String address);
-
-  /**
-   * Returns whether or not the HTTP adapter authenticates connections.
-   *
-   * See <a href="#http-authentication-enabled">description</a> above.
-   */
-  public boolean isHttpAuthEnabled();
-
-  /**
-   * Sets whether or not the HTTP adapter authenticates connections.
-   *
-   * See <a href="#http-authentication-enabled">description</a> above.
-   */
-  public void setHttpAuthEnabled(boolean enabled);
-
-  /**
-   * Returns the user name for HTTP adapter authentication.
-   *
-   * See <a href="#http-authentication-user">description</a> above.
-   */
-  public String getHttpAuthUser();
-
-  /**
-   * Sets the user name for HTTP adapter authentication.
-   *
-   * See <a href="#http-authentication-user">description</a> above.
-   */
-  public void setHttpAuthUser(String user);
-
-  /**
-   * Returns the password for HTTP adapter authentication.
-   *
-   * See <a href="#http-authentication-password">description</a> above.
-   */
-  public String getHttpAuthPassword();
-
-  /**
-   * Sets the password for HTTP adapter authentication.
-   *
-   * See <a href="#http-authentication-password">description</a> above.
-   */
-  public void setHttpAuthPassword(String password);
-
-  /**
-   * Returns whether or not the RMI adapter is enabled.
-   *
-   * See <a href="#rmi-enabled">description</a> above.
-   */
-  public boolean isRmiEnabled();
-
-  /**
-   * Sets whether or not the RMI adapter is enabled.
-   *
-   * See <a href="#rmi-enabled">description</a> above.
-   */
-  public void setRmiEnabled(boolean rmiEnabled);
-
-  /**
-   * Returns whether or not the agent hosts an RMI registry.
-   *
-   * See <a href="#rmi-registry-enabled">description</a> above.
-   */
-  public boolean isRmiRegistryEnabled();
-
-  /**
-   * Sets whether or not the agent hosts an RMI registry.
-   *
-   * See <a href="#rmi-registry-enabled">description</a> above.
-   */
-  public void setRmiRegistryEnabled(boolean enabled);
-
-  /**
-   * Returns the port of the RMI adapter.
-   *
-   * See <a href="#rmi-port">description</a> above.
-   */
-  public int getRmiPort();
-
-  /**
-   * Sets the port of the RMI adapter.
-   *
-   * See <a href="#rmi-port">description</a> above.
-   */
-  public void setRmiPort(int port);
-
-  /**
-   * Returns the port of the RMI Connector Server.
-   *
-   * See <a href="#rmi-server-port">description</a> above.
-   * 
-   * @return the value set for rmi-server-port
-   * @since GemFire 6.5
-   */
-  public int getRmiServerPort();
-
-  /**
-   * Sets the port of the RMI Connector Server.
-   *
-   * See <a href="#rmi-server-port">description</a> above.
-   * 
-   * @param port rmi-server-port to set.
-   * @since GemFire 6.5
-   */
-  public void setRmiServerPort(int port);
-
-  /**
-   * Returns the bind address to which the RMI adapter's listening sockets are bound.
-   *
-   * See <a href="#rmi-bind-address">description</a> above.
-   */
-  public String getRmiBindAddress();
-
-  /**
-   * Sets the bind address to which the RMI adapter's listening sockets are bound.
-   *
-   * See <a href="#rmi-bind-address">description</a> above.
-   */
-  public void setRmiBindAddress(String address);
-
-  /**
-   * Returns whether or not the SNMP adapter is enabled.
-   *
-   * See <a href="#snmp-enabled">description</a> above.
-   */
-  public boolean isSnmpEnabled();
-
-  /**
-   * Sets whether or not the SNMP adapter is enabled.
-   *
-   * See <a href="#snmp-enabled">description</a> above.
-   */
-  public void setSnmpEnabled(boolean enabled);
-
-  /**
-   * Returns the bind address used with the SNMP adapter.
-   *
-   * See <a href="#snmp-bind-address">description</a> above.
-   */
-  public String getSnmpBindAddress();
-
-  /**
-   * Sets the bind address used with the SNMP adapter.
-   *
-   * See <a href="#snmp-bind-address">description</a> above.
-   */
-  public void setSnmpBindAddress(String address);
-
-  /**
-   * Returns the directory for the SNMP adapater.
-   *
-   * See <a href="#snmp-directory">description</a> above.
-   */
-  public String getSnmpDirectory();
-
-  /**
-   * Sets the directory for the SNMP adapater.
-   *
-   * See <a href="#snmp-directory">description</a> above.
-   */
-  public void setSnmpDirectory(String snmpDirectory);
-
-  /**
-   * Returns whether or not SSL is required for the JMX agent.
-   *
-   * See <a href="#agent-ssl-enabled">description</a> above.
-   */
-  public boolean isAgentSSLEnabled();
-
-  /**
-   * Sets whether or not SSL is required for the JMX agent.
-   *
-   * See <a href="#agent-ssl-enabled">description</a> above.
-   */
-  public void setAgentSSLEnabled(boolean enabled);
-
-  /**
-   * Returns the SSL protocols used when connecting to the JMX agent.
-   *
-   * See <a href="#agent-ssl-protocols">description</a> above.
-   */
-  public String getAgentSSLProtocols();
-
-  /**
-   * Sets the SSL protocols used when connecting to the JMX agent.
-   *
-   * See <a href="#agent-ssl-protocols">description</a> above.
-   */
-  public void setAgentSSLProtocols(String protocols);
-
-  /**
-   * Returns the SSL ciphers used when connecting to the JMX agent.
-   *
-   * See <a href="#agent-ssl-ciphers">description</a> above.
-   */
-  public String getAgentSSLCiphers();
-
-  /**
-   * Sets the SSL ciphers used when connecting to the JMX agent.
-   *
-   * See <a href="#agent-ssl-ciphers">description</a> above.
-   */
-  public void setAgentSSLCiphers(String ciphers);
-
-  /**
-   * Returns whether SSL authentication is used when connecting to the RMI connector.
-   *
-   * See <a href="#agent-ssl-require-authentication">description</a> above.
-   */
-  public boolean isAgentSSLRequireAuth();
-
-  /**
-   * Sets whether SSL authentication is used when connecting to the RMI connector.
-   *
-   * See <a href="#agent-ssl-require-authentication">description</a> above.
-   */
-  public void setAgentSSLRequireAuth(boolean require);
-
-  /**
-   * Returns whether SSL authentication is used when connecting to the HTTP connector.
-   *
-   * See <a href="#http-ssl-require-authentication">description</a> above.
-   */
-  public boolean isHttpSSLRequireAuth();
-
-  /**
-   * Sets whether SSL authentication is used when connecting to the HTTP connector.
-   *
-   * See <a href="#http-ssl-require-authentication">description</a> above.
-   */
-  public void setHttpSSLRequireAuth(boolean require);
-
-  /**
-   * Returns whether Emails for Notifications is enabled
-   *
-   * See <a href="#email-notification-enabled">description</a> above.
-   */
-  public boolean isEmailNotificationEnabled();
-
-  /**
-   * Sets whether Emails for Notifications is enabled
-   *
-   * See <a href="#email-notification-enabled">description</a> above.
-   */
-  public void setEmailNotificationEnabled(boolean enabled);
-
-  /**
-   * Returns the EmailID from whom notification emails are sent.
-   *
-   * See <a href="#email-notification-from">description</a> above.
-   */
-  public String getEmailNotificationFrom();
-
-  /**
-   * Sets the EmailID from whom notification emails are sent.
-   *
-   * See <a href="#email-notification-from">description</a> above.
-   */
-  public void setEmailNotificationFrom(String emailID);
-
-  /**
-   * Returns the Host Name using which notification emails are sent.
-   *
-   * See <a href="#email-notification-host">description</a> above.
-   */
-  public String getEmailNotificationHost();
-
-  /**
-   * Sets the Host Name from whom notification emails are sent.
-   *
-   * See <a href="#email-notification-host">description</a> above.
-   */
-  public void setEmailNotificationHost(String hostName);
-
-  /**
-   * Returns the comma separated EmailID list to whom notification emails are sent.
-   *
-   * See <a href="#email-notification-to">description</a> above.
-   */
-  public String getEmailNotificationToList();
-
-  /**
-   * Sets the EmailID from whom notification emails are sent as a comma separated list.
-   *
-   * See <a href="#email-notification-to">description</a> above.
-   */
-  public void setEmailNotificationToList(String emailIDs);
-
-  /**
-   * Returns the name of the file to be used for saving agent state
-   *
-   * See <a href="#state-save-file">description</a> above.
-   */
-  public String getStateSaveFile();
-
-  /**
-   * Sets the name of the file to be used for saving agent state
-   *
-   * See <a href="#state-save-file">description</a> above.
-   */
-  public void setStateSaveFile(String file);
-
-  /**
-   * Returns an <code>AgentConfig</code> with the same configuration as this
-   * <code>AgentConfig</code>.
-   */
-  public Object clone() throws CloneNotSupportedException;
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/AgentFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/AgentFactory.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/AgentFactory.java
deleted file mode 100644
index 5228c6b..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/AgentFactory.java
+++ /dev/null
@@ -1,48 +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.admin.jmx;
-
-// import org.apache.geode.admin.AdminDistributedSystem;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.jmx.internal.AgentConfigImpl;
-import org.apache.geode.admin.jmx.internal.AgentImpl;
-
-/**
- * A factory class that creates JMX administration entities.
- *
- * @since GemFire 4.0
- * @deprecated as of 7.0 use the <code><a href=
- *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
- *             package instead
- */
-public class AgentFactory {
-
-  /**
-   * Defines a "default" GemFire JMX administration agent configuration.
-   */
-  public static AgentConfig defineAgent() {
-    return new AgentConfigImpl();
-  }
-
-  /**
-   * Creates an unstarted GemFire JMX administration agent with the given configuration.
-   *
-   * @see Agent#start
-   */
-  public static Agent getAgent(AgentConfig config) throws AdminException {
-    return new AgentImpl((AgentConfigImpl) config);
-  }
-
-}


[36/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
deleted file mode 100755
index d3f4ab2..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java
+++ /dev/null
@@ -1,1232 +0,0 @@
-/*
- * Copyright (C) MX4J. All rights reserved.
- *
- * This software is distributed under the terms of the MX4J License version 1.0. See the terms of
- * the MX4J License in the documentation provided with this software.
- */
-
-package org.apache.geode.admin.jmx.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Date;
-import java.util.Iterator;
-
-import javax.management.Attribute;
-import javax.management.AttributeChangeNotification;
-import javax.management.AttributeChangeNotificationFilter;
-import javax.management.AttributeList;
-import javax.management.AttributeNotFoundException;
-import javax.management.Descriptor;
-import javax.management.InstanceNotFoundException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanNotificationInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanRegistration;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.Notification;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.management.RuntimeErrorException;
-import javax.management.RuntimeOperationsException;
-import javax.management.ServiceNotFoundException;
-import javax.management.loading.ClassLoaderRepository;
-import javax.management.modelmbean.InvalidTargetObjectTypeException;
-import javax.management.modelmbean.ModelMBean;
-import javax.management.modelmbean.ModelMBeanAttributeInfo;
-import javax.management.modelmbean.ModelMBeanInfo;
-import javax.management.modelmbean.ModelMBeanOperationInfo;
-
-import mx4j.ImplementationException;
-import mx4j.log.FileLogger;
-import mx4j.log.Log;
-import mx4j.log.Logger;
-import mx4j.log.MBeanLogger;
-import mx4j.persist.FilePersister;
-import mx4j.persist.MBeanPersister;
-import mx4j.persist.PersisterMBean;
-import mx4j.util.Utils;
-
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-/**
- * @author <a href="mailto:biorn_steedom@users.sourceforge.net">Simone Bordet</a>
- * @version $Revision: 1.14 $
- */
-public class MX4JModelMBean implements ModelMBean, MBeanRegistration, NotificationEmitter {
-  private static final String OBJECT_RESOURCE_TYPE = "ObjectReference";
-
-  private static final int ALWAYS_STALE = 1;
-  private static final int NEVER_STALE = 2;
-  private static final int STALE = 3;
-  private static final int NOT_STALE = 4;
-
-  private static final int PERSIST_NEVER = -1;
-  private static final int PERSIST_ON_TIMER = -2;
-  private static final int PERSIST_ON_UPDATE = -3;
-  private static final int PERSIST_NO_MORE_OFTEN_THAN = -4;
-
-  private MBeanServer m_mbeanServer;
-  private Object m_managedResource;
-  private boolean m_canBeRegistered;
-  private ModelMBeanInfo m_modelMBeanInfo;
-  private NotificationBroadcasterSupport m_attributeChangeBroadcaster =
-      new NotificationBroadcasterSupport();
-  private NotificationBroadcasterSupport m_generalBroadcaster =
-      new NotificationBroadcasterSupport();
-
-  public MX4JModelMBean() throws MBeanException, RuntimeOperationsException {
-    try {
-      load();
-    } catch (Exception x) {
-      Logger logger = getLogger();
-      logger.warn(LocalizedStrings.MX4JModelMBean_CANNOT_RESTORE_PREVIOUSLY_SAVED_STATUS
-          .toLocalizedString(), x);
-    }
-  }
-
-  public MX4JModelMBean(ModelMBeanInfo info) throws MBeanException, RuntimeOperationsException {
-    if (info == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_PARAMETER_CANT_BE_NULL
-              .toLocalizedString()));
-    else
-      setModelMBeanInfo(info);
-  }
-
-  private Logger getLogger() {
-    return Log.getLogger(getClass().getName());
-  }
-
-  public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception {
-    if (m_canBeRegistered) {
-      m_mbeanServer = server;
-      return name;
-    } else {
-      throw new MBeanRegistrationException(new IllegalStateException(
-          LocalizedStrings.MX4JModelMBean_MODELMBEAN_CANNOT_BE_REGISTERED_UNTIL_SETMODELMBEANINFO_HAS_BEEN_CALLED
-              .toLocalizedString()));
-    }
-  }
-
-  public void postRegister(Boolean registrationDone) {
-    if (!registrationDone.booleanValue())
-      clear();
-  }
-
-  public void preDeregister() throws Exception {}
-
-  public void postDeregister() {
-    clear();
-  }
-
-  private void clear() {
-    m_mbeanServer = null;
-    m_managedResource = null;
-    m_modelMBeanInfo = null;
-    m_generalBroadcaster = null;
-    m_attributeChangeBroadcaster = null;
-    // PENDING: also remove generic listeners, attribute change listeners, log4j appenders...
-  }
-
-  public void setModelMBeanInfo(ModelMBeanInfo modelMBeanInfo)
-      throws MBeanException, RuntimeOperationsException {
-    if (modelMBeanInfo == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_CANNOT_BE_NULL.toLocalizedString()));
-    if (!isModelMBeanInfoValid(modelMBeanInfo))
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_IS_INVALID.toLocalizedString()));
-
-    m_modelMBeanInfo = (ModelMBeanInfo) modelMBeanInfo.clone();
-
-    Logger logger = getLogger();
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("ModelMBeanInfo successfully set to: " + m_modelMBeanInfo);
-    // Only now the MBean can be registered in the MBeanServer
-    m_canBeRegistered = true;
-  }
-
-  private boolean isModelMBeanInfoValid(ModelMBeanInfo info) {
-    if (info == null || info.getClassName() == null)
-      return false;
-    // PENDING: maybe more checks are needed
-    return true;
-  }
-
-  public void setManagedResource(Object resource, String resourceType) throws MBeanException,
-      RuntimeOperationsException, InstanceNotFoundException, InvalidTargetObjectTypeException {
-    if (resource == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_MANAGED_RESOURCE_CANNOT_BE_NULL.toLocalizedString()));
-    if (!isResourceTypeSupported(resourceType))
-      throw new InvalidTargetObjectTypeException(resourceType);
-
-    Logger logger = getLogger();
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Setting managed resource to be: " + resource);
-    m_managedResource = resource;
-  }
-
-  private boolean isResourceTypeSupported(String resourceType) {
-    // For now only object reference is supported
-    return OBJECT_RESOURCE_TYPE.equals(resourceType);
-  }
-
-  private Object getManagedResource() {
-    return m_managedResource;
-  }
-
-  public MBeanInfo getMBeanInfo() {
-    return m_modelMBeanInfo == null ? null : (MBeanInfo) m_modelMBeanInfo.clone();
-  }
-
-  public void addAttributeChangeNotificationListener(NotificationListener listener,
-      String attributeName, Object handback)
-      throws MBeanException, RuntimeOperationsException, IllegalArgumentException {
-    if (listener == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_LISTENER_CANNOT_BE_NULL.toLocalizedString()));
-    AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
-    if (attributeName != null) {
-      filter.enableAttribute(attributeName);
-    } else {
-      MBeanAttributeInfo[] ai = m_modelMBeanInfo.getAttributes();
-      for (int i = 0; i < ai.length; i++) {
-        Descriptor d = ((ModelMBeanAttributeInfo) ai[i]).getDescriptor();
-        filter.enableAttribute((String) d.getFieldValue("name"));
-      }
-    }
-
-    getAttributeChangeBroadcaster().addNotificationListener(listener, filter, handback);
-
-    Logger logger = getLogger();
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Listener " + listener + " for attribute " + attributeName
-          + " added successfully, handback is " + handback);
-  }
-
-  public void addNotificationListener(NotificationListener listener, NotificationFilter filter,
-      Object handback) throws IllegalArgumentException {
-    m_generalBroadcaster.addNotificationListener(listener, filter, handback);
-  }
-
-  public MBeanNotificationInfo[] getNotificationInfo() {
-    return m_modelMBeanInfo.getNotifications();
-  }
-
-  public void removeAttributeChangeNotificationListener(NotificationListener listener,
-      String attributeName) throws RuntimeOperationsException, ListenerNotFoundException {
-    try {
-      removeAttributeChangeNotificationListener(listener, attributeName, null);
-    } catch (MBeanException e) {
-      throw new RuntimeOperationsException(new RuntimeException(e.getMessage()));
-    }
-  }
-
-  // Not in the spec but needed
-  private void removeAttributeChangeNotificationListener(NotificationListener listener,
-      String attributeName, Object handback)
-      throws MBeanException, RuntimeOperationsException, ListenerNotFoundException {
-    if (listener == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_LISTENER_CANNOT_BE_NULL.toLocalizedString()));
-    AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
-    if (attributeName != null) {
-      filter.enableAttribute(attributeName);
-    } else {
-      MBeanAttributeInfo[] ai = m_modelMBeanInfo.getAttributes();
-      for (int i = 0; i < ai.length; i++) {
-        Descriptor d = ((ModelMBeanAttributeInfo) ai[i]).getDescriptor();
-        filter.enableAttribute((String) d.getFieldValue("name"));
-      }
-    }
-
-    getAttributeChangeBroadcaster().removeNotificationListener(listener, filter, handback);
-
-    Logger logger = getLogger();
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Listener " + listener + " for attribute " + attributeName
-          + " removed successfully, handback is " + handback);
-  }
-
-  public void removeNotificationListener(NotificationListener listener)
-      throws RuntimeOperationsException, ListenerNotFoundException {
-    m_generalBroadcaster.removeNotificationListener(listener);
-  }
-
-  public void removeNotificationListener(NotificationListener listener, NotificationFilter filter,
-      Object handback) throws RuntimeOperationsException, ListenerNotFoundException {
-    m_generalBroadcaster.removeNotificationListener(listener, filter, handback);
-  }
-
-  public void sendAttributeChangeNotification(Attribute oldAttribute, Attribute newAttribute)
-      throws MBeanException, RuntimeOperationsException {
-    if (oldAttribute == null || newAttribute == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_CANNOT_BE_NULL.toLocalizedString()));
-    if (!oldAttribute.getName().equals(newAttribute.getName()))
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_NAMES_CANNOT_BE_DIFFERENT.toLocalizedString()));
-
-    // TODO: the source must be the object name of the MBean if the listener was registered through
-    // MBeanServer
-    Object oldValue = oldAttribute.getValue();
-    AttributeChangeNotification n = new AttributeChangeNotification(this, 1,
-        System.currentTimeMillis(), "Attribute value changed", oldAttribute.getName(),
-        oldValue == null ? null : oldValue.getClass().getName(), oldValue, newAttribute.getValue());
-    sendAttributeChangeNotification(n);
-  }
-
-  public void sendAttributeChangeNotification(AttributeChangeNotification notification)
-      throws MBeanException, RuntimeOperationsException {
-    if (notification == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_NOTIFICATION_CANNOT_BE_NULL.toLocalizedString()));
-
-    getAttributeChangeBroadcaster().sendNotification(notification);
-
-    Logger modelMBeanLogger = getModelMBeanLogger(notification.getType());
-    if (modelMBeanLogger != null)
-      if (modelMBeanLogger.isEnabledFor(Logger.DEBUG))
-        modelMBeanLogger.debug("ModelMBean log: " + new Date() + " - " + notification);
-
-    Logger logger = getLogger();
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Attribute change notification " + notification + " sent");
-  }
-
-  public void sendNotification(String message) throws MBeanException, RuntimeOperationsException {
-    Notification notification = new Notification("jmx.modelmbean.general", this, 1, message);
-    sendNotification(notification);
-  }
-
-  public void sendNotification(Notification notification)
-      throws MBeanException, RuntimeOperationsException {
-    if (m_generalBroadcaster != null) {
-      m_generalBroadcaster.sendNotification(notification);
-    }
-  }
-
-  public AttributeList getAttributes(String[] attributes) {
-    if (attributes == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_NAMES_CANNOT_BE_NULL.toLocalizedString()));
-
-    Logger logger = getLogger();
-
-    AttributeList list = new AttributeList();
-    for (int i = 0; i < attributes.length; ++i) {
-      String attrName = attributes[i];
-      Attribute attribute = null;
-      try {
-        Object value = getAttribute(attrName);
-        attribute = new Attribute(attrName, value);
-        list.add(attribute);
-      } catch (Exception x) {
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("getAttribute for attribute " + attrName + " failed", x);
-        // And go on with the next attribute
-      }
-    }
-    return list;
-  }
-
-  public Object getAttribute(String attribute)
-      throws AttributeNotFoundException, MBeanException, ReflectionException {
-    if (attribute == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_NAME_CANNOT_BE_NULL.toLocalizedString()));
-
-    Logger logger = getLogger();
-
-    // I want the real info, not its clone
-    ModelMBeanInfo info = getModelMBeanInfo();
-    if (info == null)
-      throw new AttributeNotFoundException(
-          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_IS_NULL.toLocalizedString());
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("ModelMBeanInfo is: " + info);
-
-    // This is a clone, we use it read only
-    ModelMBeanAttributeInfo attrInfo = info.getAttribute(attribute);
-    if (attrInfo == null)
-      throw new AttributeNotFoundException(
-          LocalizedStrings.MX4JModelMBean_CANNOT_FIND_MODELMBEANATTRIBUTEINFO_FOR_ATTRIBUTE_0
-              .toLocalizedString(attribute));
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Attribute info is: " + attrInfo);
-    if (!attrInfo.isReadable())
-      throw new AttributeNotFoundException(
-          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_0_IS_NOT_READABLE.toLocalizedString(attribute));
-
-    // This returns a clone of the mbean descriptor, we use it read only
-    Descriptor mbeanDescriptor = info.getMBeanDescriptor();
-    if (mbeanDescriptor == null)
-      throw new AttributeNotFoundException(
-          LocalizedStrings.MX4JModelMBean_MBEAN_DESCRIPTOR_CANNOT_BE_NULL.toLocalizedString());
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("MBean descriptor is: " + mbeanDescriptor);
-
-    // This descriptor is a clone
-    Descriptor attributeDescriptor = attrInfo.getDescriptor();
-    if (attributeDescriptor == null)
-      throw new AttributeNotFoundException(
-          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_DESCRIPTOR_FOR_ATTRIBUTE_0_CANNOT_BE_NULL
-              .toLocalizedString(attribute));
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Attribute descriptor is: " + attributeDescriptor);
-
-    Object returnValue = null;
-
-    String lastUpdateField = "lastUpdatedTimeStamp";
-
-    int staleness = getStaleness(attributeDescriptor, mbeanDescriptor, lastUpdateField);
-
-    if (staleness == ALWAYS_STALE || staleness == STALE) {
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("Value is stale");
-
-      String getter = (String) attributeDescriptor.getFieldValue("getMethod");
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("getMethod field is: " + getter);
-      if (getter == null) {
-        // No getter, use default value
-        returnValue = attributeDescriptor.getFieldValue("default");
-
-        if (returnValue != null) {
-          // Check if the return type is of the same type
-          // As an extension allow covariant return type
-          Class returned = returnValue.getClass();
-          Class declared = loadClassWithContextClassLoader(attrInfo.getType());
-
-          checkAssignability(returned, declared);
-        }
-
-        if (logger.isEnabledFor(Logger.DEBUG))
-          logger.debug(
-              "getAttribute for attribute " + attribute + " returns default value: " + returnValue);
-      } else {
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("Invoking attribute getter...");
-        // As an extension, allow attributes to be called on target objects also
-        Object target = resolveTargetObject(attributeDescriptor);
-        returnValue = invokeMethod(target, getter, new Class[0], new Object[0]);
-        if (logger.isEnabledFor(Logger.DEBUG))
-          logger.debug("Returned value is: " + returnValue);
-
-        if (returnValue != null) {
-          // Check if the return type is of the same type
-          // As an extension allow covariant return type
-          Class returned = returnValue.getClass();
-          Class declared = loadClassWithContextClassLoader(attrInfo.getType());
-
-          checkAssignability(returned, declared);
-        }
-
-        // Cache the new value only if caching is needed
-        if (staleness != ALWAYS_STALE) {
-          attributeDescriptor.setField("value", returnValue);
-          attributeDescriptor.setField(lastUpdateField, Long.valueOf(System.currentTimeMillis()));
-          if (logger.isEnabledFor(Logger.TRACE))
-            logger.trace("Returned value has been cached");
-
-          // And now replace the descriptor with the updated clone
-          info.setDescriptor(attributeDescriptor, "attribute");
-        }
-
-        if (logger.isEnabledFor(Logger.DEBUG))
-          logger.debug(
-              "getAttribute for attribute " + attribute + " returns invoked value: " + returnValue);
-      }
-    } else {
-      // Return cached value
-      returnValue = attributeDescriptor.getFieldValue("value");
-
-      if (returnValue != null) {
-        // Check if the return type is of the same type
-        // As an extension allow covariant return type
-        Class returned = returnValue.getClass();
-        Class declared = loadClassWithContextClassLoader(attrInfo.getType());
-
-        checkAssignability(returned, declared);
-      }
-
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug(
-            "getAttribute for attribute " + attribute + " returns cached value: " + returnValue);
-    }
-
-    // Puff, everything went ok
-    return returnValue;
-  }
-
-  public AttributeList setAttributes(AttributeList attributes) {
-    if (attributes == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_LIST_CANNOT_BE_NULL.toLocalizedString()));
-
-    Logger logger = getLogger();
-
-    AttributeList list = new AttributeList();
-    for (Iterator i = attributes.iterator(); i.hasNext();) {
-      Attribute attribute = (Attribute) i.next();
-      String name = attribute.getName();
-      try {
-        setAttribute(attribute);
-        list.add(attribute);
-      } catch (Exception x) {
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("setAttribute for attribute " + name + " failed", x);
-        // And go on with the next one
-      }
-    }
-    return list;
-  }
-
-  public void setAttribute(Attribute attribute) throws AttributeNotFoundException,
-      InvalidAttributeValueException, MBeanException, ReflectionException {
-    if (attribute == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_CANNOT_BE_NULL.toLocalizedString()));
-
-    Logger logger = getLogger();
-
-    // No need to synchronize: I work mostly on clones
-    // I want the real info, not its clone
-    ModelMBeanInfo info = getModelMBeanInfo();
-    if (info == null)
-      throw new AttributeNotFoundException(
-          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_IS_NULL.toLocalizedString());
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("ModelMBeanInfo is: " + info);
-
-    String attrName = attribute.getName();
-    Object attrValue = attribute.getValue();
-
-    // This is a clone, we use it read only
-    ModelMBeanAttributeInfo attrInfo = info.getAttribute(attrName);
-    if (attrInfo == null)
-      throw new AttributeNotFoundException(
-          LocalizedStrings.MX4JModelMBean_CANNOT_FIND_MODELMBEANATTRIBUTEINFO_FOR_ATTRIBUTE_0
-              .toLocalizedString(attrName));
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Attribute info is: " + attrInfo);
-
-    if (!attrInfo.isWritable())
-      throw new AttributeNotFoundException(
-          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_0_IS_NOT_WRITABLE.toLocalizedString(attrName));
-
-    // This returns a clone of the mbean descriptor, we use it read only
-    Descriptor mbeanDescriptor = info.getMBeanDescriptor();
-    if (mbeanDescriptor == null)
-      throw new AttributeNotFoundException(
-          LocalizedStrings.MX4JModelMBean_MBEAN_DESCRIPTOR_CANNOT_BE_NULL.toLocalizedString());
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("MBean descriptor is: " + mbeanDescriptor);
-
-    // This descriptor is a clone
-    Descriptor attributeDescriptor = attrInfo.getDescriptor();
-    if (attributeDescriptor == null)
-      throw new AttributeNotFoundException(
-          LocalizedStrings.MX4JModelMBean_ATTRIBUTE_DESCRIPTOR_FOR_ATTRIBUTE_0_CANNOT_BE_NULL
-              .toLocalizedString(attrName));
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Attribute descriptor is: " + attributeDescriptor);
-
-    String lastUpdateField = "lastUpdatedTimeStamp";
-
-    Object oldValue = null;
-    try {
-      oldValue = getAttribute(attrName);
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("Previous value of attribute " + attrName + ": " + oldValue);
-    } catch (Exception x) {
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("Cannot get previous value of attribute " + attrName, x);
-    }
-
-    // Check if setMethod is present
-    String method = (String) attributeDescriptor.getFieldValue("setMethod");
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("setMethod field is: " + method);
-    if (method != null) {
-      Class declared = loadClassWithContextClassLoader(attrInfo.getType());
-      if (attrValue != null) {
-        Class parameter = attrValue.getClass();
-        checkAssignability(parameter, declared);
-      }
-
-      // As an extension, allow attributes to be called on target objects also
-      Object target = resolveTargetObject(attributeDescriptor);
-      invokeMethod(target, method, new Class[] {declared}, new Object[] {attrValue});
-
-      // Cache the value only if currencyTimeLimit is not 0, ie it is not always stale
-      int staleness = getStaleness(attributeDescriptor, mbeanDescriptor, lastUpdateField);
-      if (staleness != ALWAYS_STALE) {
-        attributeDescriptor.setField("value", attrValue);
-        attributeDescriptor.setField(lastUpdateField, Long.valueOf(System.currentTimeMillis()));
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("Attribute's value has been cached");
-      } else {
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("Always stale, avoiding to cache attribute's value");
-      }
-    } else {
-      if (attrValue != null) {
-        Class parameter = attrValue.getClass();
-        Class declared = loadClassWithContextClassLoader(attrInfo.getType());
-
-        checkAssignability(parameter, declared);
-      }
-
-      // Always store the value in the descriptor: no setMethod
-      attributeDescriptor.setField("value", attrValue);
-    }
-
-    // And now replace the descriptor with the updated clone
-    info.setDescriptor(attributeDescriptor, "attribute");
-
-    // Send notifications to listeners
-    if (logger.isEnabledFor(Logger.TRACE))
-      logger.trace("Sending attribute change notifications");
-    sendAttributeChangeNotification(new Attribute(attrName, oldValue), attribute);
-
-    // Persist this ModelMBean
-    boolean persistNow = shouldPersistNow(attributeDescriptor, mbeanDescriptor, lastUpdateField);
-    if (persistNow) {
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("Persisting this ModelMBean...");
-      try {
-        store();
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("ModelMBean persisted successfully");
-      } catch (Exception x) {
-        logger.error(LocalizedStrings.MX4JModelMBean_CANNOT_STORE_MODELMBEAN_AFTER_SETATTRIBUTE, x);
-        if (x instanceof MBeanException)
-          throw (MBeanException) x;
-        else
-          throw new MBeanException(x);
-      }
-    }
-  }
-
-  public Object invoke(String method, Object[] arguments, String[] params)
-      throws MBeanException, ReflectionException {
-    if (method == null)
-      throw new RuntimeOperationsException(new IllegalArgumentException(
-          LocalizedStrings.MX4JModelMBean_METHOD_NAME_CANNOT_BE_NULL.toLocalizedString()));
-    if (arguments == null)
-      arguments = new Object[0];
-    if (params == null)
-      params = new String[0];
-
-    Logger logger = getLogger();
-
-    // Find operation descriptor
-    ModelMBeanInfo info = getModelMBeanInfo();
-    if (info == null)
-      throw new MBeanException(new ServiceNotFoundException(
-          LocalizedStrings.MX4JModelMBean_MODELMBEANINFO_IS_NULL.toLocalizedString()));
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("ModelMBeanInfo is: " + info);
-
-    // This is a clone, we use it read only
-    ModelMBeanOperationInfo operInfo = info.getOperation(method);
-    if (operInfo == null)
-      throw new MBeanException(new ServiceNotFoundException(
-          LocalizedStrings.MX4JModelMBean_CANNOT_FIND_MODELMBEANOPERATIONINFO_FOR_OPERATION_0
-              .toLocalizedString(method)));
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Operation info is: " + operInfo);
-
-    // This descriptor is a clone
-    Descriptor operationDescriptor = operInfo.getDescriptor();
-    if (operationDescriptor == null)
-      throw new MBeanException(new ServiceNotFoundException(
-          LocalizedStrings.MX4JModelMBean_OPERATION_DESCRIPTOR_FOR_OPERATION_0_CANNOT_BE_NULL
-              .toLocalizedString(method)));
-    String role = (String) operationDescriptor.getFieldValue("role");
-    if (role == null || !role.equals("operation"))
-      throw new MBeanException(new ServiceNotFoundException(
-          LocalizedStrings.MX4JModelMBean_OPERATION_DESCRIPTOR_FIELD_ROLE_MUST_BE_OPERATION_NOT_0
-              .toLocalizedString(role)));
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Operation descriptor is: " + operationDescriptor);
-
-    // This returns a clone of the mbean descriptor, we use it read only
-    Descriptor mbeanDescriptor = info.getMBeanDescriptor();
-    if (mbeanDescriptor == null)
-      throw new MBeanException(new ServiceNotFoundException(
-          LocalizedStrings.MX4JModelMBean_MBEAN_DESCRIPTOR_CANNOT_BE_NULL.toLocalizedString()));
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("MBean descriptor is: " + mbeanDescriptor);
-
-    Object returnValue = null;
-
-    String lastUpdateField = "lastReturnedTimeStamp";
-
-    // Check if the method should be invoked given the cache settings
-    int staleness = getStaleness(operationDescriptor, mbeanDescriptor, lastUpdateField);
-
-    if (staleness == ALWAYS_STALE || staleness == STALE) {
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("Value is stale");
-
-      // Find parameters classes
-      Class[] parameters = null;
-      try {
-        parameters = Utils.loadClasses(Thread.currentThread().getContextClassLoader(), params);
-      } catch (ClassNotFoundException x) {
-        logger.error(LocalizedStrings.MX4JModelMBean_CANNOT_FIND_OPERATIONS_PARAMETER_CLASSES, x);
-        throw new ReflectionException(x);
-      }
-
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("Invoking operation...");
-
-      // Find target object
-      Object target = resolveTargetObject(operationDescriptor);
-      returnValue = invokeMethod(target, method, parameters, arguments);
-
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("Returned value is: " + returnValue);
-
-      if (returnValue != null) {
-        Class parameter = returnValue.getClass();
-        Class declared = loadClassWithContextClassLoader(operInfo.getReturnType());
-
-        checkAssignability(parameter, declared);
-      }
-
-      // Cache the new value only if caching is needed
-      if (staleness != ALWAYS_STALE) {
-        operationDescriptor.setField("lastReturnedValue", returnValue);
-        operationDescriptor.setField(lastUpdateField, Long.valueOf(System.currentTimeMillis()));
-        if (logger.isEnabledFor(Logger.TRACE)) {
-          logger.trace("Returned value has been cached");
-        }
-
-        // And now replace the descriptor with the updated clone
-        info.setDescriptor(operationDescriptor, "operation");
-      }
-
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("invoke for operation " + method + " returns invoked value: " + returnValue);
-    } else {
-      // Return cached value
-      returnValue = operationDescriptor.getFieldValue("lastReturnedValue");
-
-      if (returnValue != null) {
-        Class parameter = returnValue.getClass();
-        Class declared = loadClassWithContextClassLoader(operInfo.getReturnType());
-
-        checkAssignability(parameter, declared);
-      }
-
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("invoke for operation " + method + " returns cached value: " + returnValue);
-    }
-
-    // As an extension, persist this model mbean also after operation invocation, but using only
-    // settings provided in the operation descriptor, without falling back to defaults set in
-    // the MBean descriptor
-    boolean persistNow = shouldPersistNow(operationDescriptor, null, lastUpdateField);
-    int impact = operInfo.getImpact();
-    if (persistNow && impact != MBeanOperationInfo.INFO) {
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("Persisting this ModelMBean...");
-      try {
-        store();
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("ModelMBean persisted successfully");
-      } catch (Exception x) {
-        logger.error(
-            LocalizedStrings.MX4JModelMBean_CANNOT_STORE_MODELMBEAN_AFTER_OPERATION_INVOCATION, x);
-        if (x instanceof MBeanException)
-          throw (MBeanException) x;
-        else
-          throw new MBeanException(x);
-      }
-    }
-
-    return returnValue;
-  }
-
-  private Object resolveTargetObject(Descriptor descriptor) throws MBeanException {
-    Logger logger = getLogger();
-    Object target = descriptor.getFieldValue("targetObject");
-    if (logger.isEnabledFor(Logger.TRACE))
-      logger.trace("targetObject is: " + target);
-    if (target == null) {
-      target = getManagedResource();
-    } else {
-      String targetObjectType = (String) descriptor.getFieldValue("targetObjectType");
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("targetObjectType is: " + targetObjectType);
-      if (targetObjectType == null) {
-        // Not defined, assume object reference
-        targetObjectType = OBJECT_RESOURCE_TYPE;
-      }
-
-      if (!isResourceTypeSupported(targetObjectType))
-        throw new MBeanException(new InvalidTargetObjectTypeException(targetObjectType));
-    }
-    return target;
-  }
-
-  public void load() throws MBeanException, RuntimeOperationsException, InstanceNotFoundException {
-    PersisterMBean persister = findPersister();
-    if (persister != null) {
-      ModelMBeanInfo info = (ModelMBeanInfo) persister.load();
-      setModelMBeanInfo(info);
-    }
-  }
-
-  public void store() throws MBeanException, RuntimeOperationsException, InstanceNotFoundException {
-    PersisterMBean persister = findPersister();
-    if (persister != null) {
-      // Take a clone to avoid synchronization problems
-      ModelMBeanInfo info = (ModelMBeanInfo) getMBeanInfo();
-      persister.store(info);
-    }
-  }
-
-  protected ClassLoaderRepository getClassLoaderRepository() {
-    if (m_mbeanServer != null)
-      return m_mbeanServer.getClassLoaderRepository();
-    else
-      return null;
-  }
-
-
-  private boolean shouldPersistNow(Descriptor attribute, Descriptor mbean, String lastUpdateField) {
-    int persist = getPersistPolicy(attribute, mbean);
-    if (persist == PERSIST_NO_MORE_OFTEN_THAN) {
-      Long period = getFieldTimeValue(attribute, mbean, "persistPeriod");
-      long now = System.currentTimeMillis();
-      Long lastUpdate = (Long) attribute.getFieldValue(lastUpdateField);
-      if (now - lastUpdate.longValue() < period.longValue())
-        return false;
-      else
-        return true;
-    } else if (persist == PERSIST_NEVER) {
-      return false;
-    } else if (persist == PERSIST_ON_TIMER) {
-      return false;
-    } else if (persist == PERSIST_ON_UPDATE) {
-      return true;
-    } else {
-      throw new ImplementationException(
-          LocalizedStrings.MX4JModelMBean_INVALID_PERSIST_VALUE.toLocalizedString());
-    }
-  }
-
-  private int getPersistPolicy(Descriptor descriptor, Descriptor mbean) {
-    Logger logger = getLogger();
-
-    String persist = (String) descriptor.getFieldValue("persistPolicy");
-    if (persist == null && mbean != null)
-      persist = (String) mbean.getFieldValue("persistPolicy");
-    if (persist == null) {
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("No persist policy defined, assuming Never");
-      return PERSIST_NEVER;
-    } else {
-      if (persist.equals("Never")) {
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("Persist never");
-        return PERSIST_NEVER;
-      } else if (persist.equals("OnUpdate")) {
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("Persist on update");
-        return PERSIST_ON_UPDATE;
-      } else if (persist.equals("OnTimer")) {
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("Persist on update");
-        return PERSIST_ON_TIMER;
-      } else if (persist.equals("NoMoreOftenThan")) {
-        if (logger.isEnabledFor(Logger.TRACE)) {
-          Long period = getFieldTimeValue(descriptor, mbean, "persistPeriod");
-          logger.trace("Persist no more often than " + period);
-        }
-        return PERSIST_NO_MORE_OFTEN_THAN;
-      } else {
-        // Garbage, assuming Never
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("Invalid persist policy, assuming persist never");
-        return PERSIST_NEVER;
-      }
-    }
-  }
-
-  private int getStaleness(Descriptor attribute, Descriptor mbean, String lastUpdateField) {
-    Logger logger = getLogger();
-
-    Long currencyTimeLimit = getFieldTimeValue(attribute, mbean, "currencyTimeLimit");
-    if (currencyTimeLimit == null) {
-      // No time limit defined
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("No currencyTimeLimit defined, assuming always stale");
-      return ALWAYS_STALE;
-    } else {
-      long ctl = currencyTimeLimit.longValue() * 1000;
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("currencyTimeLimit is (ms): " + ctl);
-
-      if (ctl == 0) {
-        // Never stale
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("Never stale");
-        return NEVER_STALE;
-      } else if (ctl < 0) // this should be == -1 but the other cases are in the air
-      {
-        // Always stale
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("Always stale");
-        return ALWAYS_STALE;
-      } else {
-        Long timestamp = (Long) attribute.getFieldValue(lastUpdateField);
-        long luts = 0;
-
-        if (timestamp != null)
-          luts = timestamp.longValue();
-        if (logger.isEnabledFor(Logger.DEBUG))
-          logger.debug(lastUpdateField + " is: " + luts);
-
-        long now = System.currentTimeMillis();
-        if (now < luts + ctl) {
-          // Seems to be not stale, but has been set at least once ?
-          if (timestamp == null) {
-            // Return stale to call it the first time
-            if (logger.isEnabledFor(Logger.TRACE))
-              logger.trace("Stale since was never set");
-            return STALE;
-          } else {
-            if (logger.isEnabledFor(Logger.TRACE))
-              logger.trace("Not stale");
-            return NOT_STALE;
-          }
-        } else {
-          // Stale
-          if (logger.isEnabledFor(Logger.TRACE))
-            logger.trace("Stale");
-          return STALE;
-        }
-      }
-    }
-  }
-
-  private Long getFieldTimeValue(Descriptor descriptor, Descriptor mbean, String field) {
-    Logger logger = getLogger();
-
-    Object value = descriptor.getFieldValue(field);
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Descriptor's " + field + " field: " + value);
-
-    if (value == null && mbean != null) {
-      value = mbean.getFieldValue(field);
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("MBean's " + field + " field: " + value);
-      if (value == null)
-        return null;
-    }
-
-    if (value instanceof Number)
-      return Long.valueOf(((Number) value).longValue());
-
-    if (value instanceof String) {
-      try {
-        long ctl = Long.parseLong((String) value);
-        return Long.valueOf(ctl);
-      } catch (NumberFormatException x) {
-        return Long.valueOf(0);
-      }
-    }
-    return Long.valueOf(0);
-  }
-
-  private Object invokeMethod(Object target, String methodName, Class[] params, Object[] args)
-      throws MBeanException, ReflectionException {
-    // First try on this instance, then on the target
-    Object realTarget = null;
-    Method method = null;
-    try {
-      realTarget = this;
-      method = realTarget.getClass().getMethod(methodName, params);
-    } catch (NoSuchMethodException x) {
-      realTarget = target;
-    }
-
-    if (realTarget == null)
-      throw new MBeanException(new ServiceNotFoundException(
-          LocalizedStrings.MX4JModelMBean_COULD_NOT_FIND_TARGET.toLocalizedString()));
-
-    if (method == null) {
-      try {
-        method = realTarget.getClass().getMethod(methodName, params);
-      } catch (NoSuchMethodException x) {
-        throw new ReflectionException(x);
-      }
-    }
-
-    try {
-      Object value = method.invoke(realTarget, args);
-      Logger logger = getLogger();
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("Method invocation returned value: " + value);
-      return value;
-    } catch (IllegalAccessException x) {
-      throw new ReflectionException(x);
-    } catch (IllegalArgumentException x) {
-      throw new MBeanException(x);
-    } catch (InvocationTargetException x) {
-      Throwable t = x.getTargetException();
-      if (t instanceof Error)
-        throw new MBeanException(new RuntimeErrorException((Error) t));
-      else
-        throw new MBeanException((Exception) t);
-    }
-  }
-
-  private Logger getModelMBeanLogger(String notificationType) throws MBeanException {
-    // Get a copy to avoid synchronization
-    ModelMBeanInfo info = getModelMBeanInfo();
-
-    // First look if there is a suitable notification descriptor, otherwise use MBean descriptor
-    Descriptor descriptor = null;
-    Logger modelMBeanLogger = null;
-    if (notificationType != null) {
-      descriptor = info.getDescriptor(notificationType, "notification");
-      modelMBeanLogger = findLogger(descriptor);
-    }
-
-    if (modelMBeanLogger == null) {
-      descriptor = info.getMBeanDescriptor();
-      modelMBeanLogger = findLogger(descriptor);
-      if (modelMBeanLogger != null)
-        return modelMBeanLogger;
-    }
-
-    return null;
-  }
-
-  private Logger findLogger(Descriptor descriptor) {
-    Logger logger = getLogger();
-
-    if (descriptor == null) {
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("Can't find MBean logger, descriptor is null");
-      return null;
-    }
-
-    String log = (String) descriptor.getFieldValue("log");
-    String location = (String) descriptor.getFieldValue("logFile");
-
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Log fields: log=" + log + ", file=" + location);
-
-    if (log == null || !Boolean.valueOf(log).booleanValue()) {
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("Logging is not supported by this ModelMBean");
-      return null;
-    }
-    // Logger is supported, where log to ?
-    if (location == null) {
-      // As an extension, see if the field logMBean has been defined
-      location = (String) descriptor.getFieldValue("logMBean");
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("Log fields: mbean=" + location);
-
-      if (location == null) {
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("Logging is not supported by this ModelMBean");
-        return null;
-      }
-
-      // It seems that the user wants to delegate a registered mbean to log
-      try {
-        ObjectName objectName = new ObjectName(location);
-        MBeanServer server = getMBeanServer();
-        if (server == null)
-          throw new MBeanException(new IllegalStateException(
-              LocalizedStrings.MX4JModelMBean_MX4JMODELMBEAN_IS_NOT_REGISTERED
-                  .toLocalizedString()));
-        if (server.isRegistered(objectName)) {
-          MBeanLogger l = new MBeanLogger(server, objectName);
-          if (logger.isEnabledFor(Logger.DEBUG))
-            logger.debug("ModelMBean log supported by delegating to this MBean: " + objectName);
-          return l;
-        }
-
-        return null;
-      } catch (MalformedObjectNameException x) {
-        // Ah, was not a correct object name
-        if (logger.isEnabledFor(Logger.DEBUG))
-          logger.debug("Specified logMBean field does not contain a valid ObjectName: " + location);
-        return null;
-      } catch (MBeanException x) {
-        if (logger.isEnabledFor(Logger.DEBUG))
-          logger.debug("logMBean field does not specify an MBean that supports logging delegation",
-              x);
-        return null;
-      }
-    } else {
-      // User decided to log to a file
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("ModelMBean log supported on file system");
-      return new FileLogger(location);
-    }
-  }
-
-  private NotificationBroadcasterSupport getAttributeChangeBroadcaster() {
-    return m_attributeChangeBroadcaster;
-  }
-
-  private MBeanServer getMBeanServer() {
-    return m_mbeanServer;
-  }
-
-  private ModelMBeanInfo getModelMBeanInfo() {
-    // No cloning performed
-    return m_modelMBeanInfo;
-  }
-
-  private PersisterMBean findPersister() throws MBeanException, InstanceNotFoundException {
-    Logger logger = getLogger();
-
-    ModelMBeanInfo info = getModelMBeanInfo();
-    if (info == null) {
-      // Not yet initialized
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("Can't find persister, ModelMBeanInfo is null");
-      return null;
-    }
-    Descriptor mbeanDescriptor = info.getMBeanDescriptor();
-    if (mbeanDescriptor == null) {
-      // This is normally should not happen if ModelMBeanInfoSupport is used
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("Can't find persister, MBean descriptor is null");
-      return null;
-    }
-
-    String location = (String) mbeanDescriptor.getFieldValue("persistLocation");
-    String name = (String) mbeanDescriptor.getFieldValue("persistName");
-    String mbeanName = (String) mbeanDescriptor.getFieldValue("name");
-    if (logger.isEnabledFor(Logger.DEBUG))
-      logger.debug("Persistence fields: location=" + location + ", name=" + name);
-
-    if (mbeanName == null && name == null) {
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("Persistence is not supported by this ModelMBean");
-      return null;
-    }
-
-    // Try to see if this mbean should delegate to another mbean
-    if (name != null) {
-      try {
-        ObjectName objectName = new ObjectName(name.trim());
-        // OK, a valid object name
-        MBeanServer server = getMBeanServer();
-        if (server == null)
-          throw new MBeanException(new IllegalStateException(
-              LocalizedStrings.MX4JModelMBean_MX4JMODELMBEAN_IS_NOT_REGISTERED
-                  .toLocalizedString()));
-
-        if (server.isRegistered(objectName)
-            && server.isInstanceOf(objectName, PersisterMBean.class.getName())) {
-          // OK, the given mbean is registered with this mbean server
-          PersisterMBean persister = new MBeanPersister(server, objectName);
-          if (logger.isEnabledFor(Logger.DEBUG))
-            logger.debug("Persistence is delegated to this MBean: " + objectName);
-          return persister;
-        } else {
-          throw new InstanceNotFoundException(objectName.toString());
-        }
-      } catch (MalformedObjectNameException ignored) {
-        // It does not delegates to another mbean, use default
-        if (logger.isEnabledFor(Logger.TRACE))
-          logger.trace("Persistence is not delegated to another MBean");
-      }
-
-      // Default is serialization to file
-      FilePersister persister = new FilePersister(location, name);
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("Persistence is realized through file system in " + persister.getFileName());
-      return persister;
-    } else {
-      // Only location given, use MBean name
-      FilePersister persister = new FilePersister(location, mbeanName);
-      if (logger.isEnabledFor(Logger.DEBUG))
-        logger.debug("Persistence is realized through file system in " + persister.getFileName());
-      return persister;
-    }
-  }
-
-  private Class loadClassWithContextClassLoader(String name) {
-    try {
-      return Utils.loadClass(Thread.currentThread().getContextClassLoader(), name);
-    } catch (ClassNotFoundException x) {
-      Logger logger = getLogger();
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace("Cannot find attribute's declared return class", x);
-      return null;
-    }
-  }
-
-  private void checkAssignability(Class parameter, Class declared) throws MBeanException {
-    Logger logger = getLogger();
-
-    if (logger.isEnabledFor(Logger.DEBUG)) {
-      logger.debug("The class of the parameter is: " + parameter);
-      if (parameter != null)
-        logger.debug("The classloder of the parameter's class is: " + parameter.getClassLoader());
-      logger.debug("The class declared as type of the attribute is: " + declared);
-      if (declared != null)
-        logger.debug(
-            "The classloader of the declared parameter's class is: " + declared.getClassLoader());
-    }
-
-    boolean assignable = false;
-
-    if (declared == null || parameter == null)
-      assignable = false;
-    else if (declared == boolean.class && parameter == Boolean.class)
-      assignable = true;
-    else if (declared == byte.class && parameter == Byte.class)
-      assignable = true;
-    else if (declared == char.class && parameter == Character.class)
-      assignable = true;
-    else if (declared == short.class && parameter == Short.class)
-      assignable = true;
-    else if (declared == int.class && parameter == Integer.class)
-      assignable = true;
-    else if (declared == long.class && parameter == Long.class)
-      assignable = true;
-    else if (declared == float.class && parameter == Float.class)
-      assignable = true;
-    else if (declared == double.class && parameter == Double.class)
-      assignable = true;
-    else
-      assignable = declared.isAssignableFrom(parameter);
-
-    if (!assignable) {
-      if (logger.isEnabledFor(Logger.TRACE))
-        logger.trace(
-            "Parameter value's class and attribute's declared return class are not assignable");
-      throw new MBeanException(new InvalidAttributeValueException(
-          LocalizedStrings.MX4JModelMBean_RETURNED_TYPE_AND_DECLARED_TYPE_ARE_NOT_ASSIGNABLE
-              .toLocalizedString()));
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JServerSocketFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JServerSocketFactory.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JServerSocketFactory.java
deleted file mode 100644
index e799279..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JServerSocketFactory.java
+++ /dev/null
@@ -1,136 +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.admin.jmx.internal;
-
-import org.apache.geode.admin.DistributedSystemConfig;
-import org.apache.geode.admin.internal.InetAddressUtil;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.net.SocketCreatorFactory;
-
-import org.apache.logging.log4j.Logger;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.util.Properties;
-
-/**
- * Creates <code>ServerSockets</code> for JMX adaptors.
- * <p>
- * The interface {@link mx4j.tools.adaptor.AdaptorServerSocketFactory} is implemented in order to
- * support securing of {@link mx4j.tools.adaptor.http.HttpAdaptor}.
- * <p>
- * The interface {@link java.rmi.server.RMIServerSocketFactory} is implemented to support the
- * securing of {@link javax.management.remote.JMXConnectorServer}. See
- * {@link javax.management.remote.rmi.RMIConnectorServer} for the actual subclass that is used for
- * the JMX RMI adaptor.
- * <p>
- * Complete info on JSSE, including debugging, can be found at
- * <a href="http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html">
- * http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html</a>
- *
- * @since GemFire 3.5 (old name was SSLAdaptorServerSocketFactory)
- */
-public class MX4JServerSocketFactory implements mx4j.tools.adaptor.AdaptorServerSocketFactory,
-    java.rmi.server.RMIServerSocketFactory {
-
-  private static final Logger logger = LogService.getLogger();
-
-  private static final int DEFAULT_BACKLOG = 50;
-
-  private final SocketCreator socketCreator;
-  private String bindAddress = DistributedSystemConfig.DEFAULT_BIND_ADDRESS;
-  private int backlog = DEFAULT_BACKLOG;
-
-  /**
-   * Constructs new instance of MX4JServerSocketFactory.
-   * 
-   * @param useSSL true if ssl is to be enabled
-   * @param needClientAuth true if client authentication is required
-   * @param protocols space-delimited list of ssl protocols to use
-   * @param ciphers space-delimited list of ssl ciphers to use
-   * @param gfsecurityProps vendor properties passed in through gfsecurity.properties
-   */
-  public MX4JServerSocketFactory(boolean useSSL, boolean needClientAuth, String protocols,
-      String ciphers, Properties gfsecurityProps) {
-    if (protocols == null || protocols.length() == 0) {
-      protocols = DistributionConfig.DEFAULT_SSL_PROTOCOLS;
-    }
-    if (ciphers == null || ciphers.length() == 0) {
-      ciphers = DistributionConfig.DEFAULT_SSL_CIPHERS;
-    }
-    this.socketCreator = SocketCreatorFactory.createNonDefaultInstance(useSSL, needClientAuth,
-        protocols, ciphers, gfsecurityProps);
-  }
-
-  /**
-   * Constructs new instance of MX4JServerSocketFactory.
-   * 
-   * @param useSSL true if ssl is to be enabled
-   * @param needClientAuth true if client authentication is required
-   * @param protocols space-delimited list of ssl protocols to use
-   * @param ciphers space-delimited list of ssl ciphers to use
-   * @param bindAddress host or address to bind to (bind-address)
-   * @param backlog how many connections are queued
-   * @param gfsecurityProps vendor properties passed in through gfsecurity.properties
-   */
-  public MX4JServerSocketFactory(boolean useSSL, boolean needClientAuth, String protocols,
-      String ciphers, String bindAddress, // optional for RMI impl
-      int backlog, // optional for RMI impl
-      Properties gfsecurityProps) {
-    this(useSSL, needClientAuth, protocols, ciphers, gfsecurityProps);
-    this.bindAddress = bindAddress;
-    this.backlog = backlog;
-  }
-
-  // -------------------------------------------------------------------------
-  // mx4j.tools.adaptor.AdaptorServerSocketFactory impl...
-  // -------------------------------------------------------------------------
-
-  public ServerSocket createServerSocket(int port, int backlog, String bindAddress)
-      throws IOException {
-    if ("".equals(bindAddress)) {
-      return socketCreator.createServerSocket(port, backlog);
-
-    } else {
-      return socketCreator.createServerSocket(port, backlog,
-          InetAddressUtil.toInetAddress(bindAddress));
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // java.rmi.server.RMIServerSocketFactory impl...
-  // -------------------------------------------------------------------------
-
-  public ServerSocket createServerSocket(int port) throws IOException {
-    ServerSocket sock = null;
-    if ("".equals(bindAddress)) {
-      sock = socketCreator.createServerSocket(port, this.backlog);
-    } else {
-      sock = socketCreator.createServerSocket(port, this.backlog,
-          InetAddressUtil.toInetAddress(this.bindAddress));
-    }
-
-    if (logger.isDebugEnabled()) {
-      logger.debug(
-          "MX4JServerSocketFactory RMIServerSocketFactory, INetAddress {}, LocalPort {}, LocalSocketAddress {}",
-          sock.getInetAddress(), sock.getLocalPort(), sock.getLocalSocketAddress());
-    }
-    return sock;
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MailManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MailManager.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MailManager.java
deleted file mode 100755
index a86d082..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MailManager.java
+++ /dev/null
@@ -1,327 +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.admin.jmx.internal;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Properties;
-
-import javax.mail.Message;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.SystemFailure;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-
-/**
- * Provides the ways to send emails to all the registered email id It also provides the way to
- * add/remove email ids. Can be used to send email in case of any alerts raised / warning / failure
- * in gemfire.
- * 
- * @since GemFire 5.1
- */
-public class MailManager {
-
-  private static final Logger logger = LogService.getLogger();
-
-  public MailManager() {}
-
-  public MailManager(Properties mailProperties) {
-    setMailProperties(mailProperties);
-  }
-
-  public MailManager(File mailPropertiesFile) throws IOException {
-    Properties prop = new Properties();
-    FileInputStream fio = new FileInputStream(mailPropertiesFile);
-    try {
-      prop.load(fio);
-    } finally {
-      fio.close();
-    }
-    setMailProperties(prop);
-  }
-
-  public MailManager(String mailHost, String mailFrom) {
-    this.mailHost = mailHost;
-    this.mailFrom = mailFrom;
-  }
-
-  /**
-   * Send email to all the registered email id with given subject and message
-   */
-  public void sendEmail(String subject, String message) {
-    processEmail(new EmailData(subject, message));
-  }
-
-  /**
-   * Send Emails to all the registered email id
-   * 
-   * @param emailData Instance of EmailData
-   */
-  // Why a separate method & class EmailData needed???
-  private void processEmail(EmailData emailData) {
-    if (logger.isTraceEnabled()) {
-      logger.trace("Entered MailManager:processEmail");
-    }
-
-    if (mailHost == null || mailHost.length() == 0 || emailData == null
-        || mailToAddresses.length == 0) {
-      logger.error(LocalizedMessage
-          .create(LocalizedStrings.MailManager_REQUIRED_MAILSERVER_CONFIGURATION_NOT_SPECIFIED));
-      if (logger.isDebugEnabled()) {
-        logger.debug("Exited MailManager:processEmail: Not sending email as conditions not met");
-      }
-      return;
-    }
-
-    Session session = Session.getDefaultInstance(getMailHostConfiguration());
-    MimeMessage mimeMessage = new MimeMessage(session);
-    String subject = emailData.subject;
-    String message = emailData.message;
-    String mailToList = getMailToAddressesAsString();
-
-    try {
-      for (int i = 0; i < mailToAddresses.length; i++) {
-        mimeMessage.addRecipient(Message.RecipientType.TO, new InternetAddress(mailToAddresses[i]));
-      }
-
-      if (subject == null) {
-        subject = LocalizedStrings.MailManager_ALERT_MAIL_SUBJECT.toLocalizedString();
-      }
-      mimeMessage.setSubject(subject);
-
-      if (message == null) {
-        message = "";
-      }
-      mimeMessage.setText(message);
-
-      Transport.send(mimeMessage);
-      logger.info(
-          LocalizedMessage.create(LocalizedStrings.MailManager_EMAIL_ALERT_HAS_BEEN_SENT_0_1_2,
-              new Object[] {mailToList, subject, message}));
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Throwable ex) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      StringBuilder buf = new StringBuilder();
-      buf.append(LocalizedStrings.MailManager_AN_EXCEPTION_OCCURRED_WHILE_SENDING_EMAIL
-          .toLocalizedString());
-      buf.append(
-          LocalizedStrings.MailManager_UNABLE_TO_SEND_EMAIL_PLEASE_CHECK_YOUR_EMAIL_SETTINGS_AND_LOG_FILE
-              .toLocalizedString());
-      buf.append("\n\n").append(
-          LocalizedStrings.MailManager_EXCEPTION_MESSAGE_0.toLocalizedString(ex.getMessage()));
-      buf.append("\n\n").append(
-          LocalizedStrings.MailManager_FOLLOWING_EMAIL_WAS_NOT_DELIVERED.toLocalizedString());
-      buf.append("\n\t")
-          .append(LocalizedStrings.MailManager_MAIL_HOST_0.toLocalizedString(mailHost));
-      buf.append("\n\t").append(LocalizedStrings.MailManager_FROM_0.toLocalizedString(mailFrom));
-      buf.append("\n\t").append(LocalizedStrings.MailManager_TO_0.toLocalizedString(mailToList));
-      buf.append("\n\t").append(LocalizedStrings.MailManager_SUBJECT_0.toLocalizedString(subject));
-      buf.append("\n\t").append(LocalizedStrings.MailManager_CONTENT_0.toLocalizedString(message));
-
-      logger.error(buf.toString(), ex);
-    }
-    if (logger.isTraceEnabled()) {
-      logger.trace("Exited MailManager:processEmail");
-    }
-  }
-
-  /**
-   * Not yet implemented
-   */
-  public void close() {}
-
-  /**
-   * @return All the registered email id as string
-   */
-  private String getMailToAddressesAsString() {
-    StringBuffer mailToList = new StringBuffer();
-    for (int i = 0; i < mailToAddresses.length; i++) {
-      mailToList.append(mailToAddresses[i]);
-      mailToList.append(", ");
-    }
-    return mailToList.toString();
-  }
-
-  /**
-   * 
-   * @return Properties consisting mailHost and mailFrom property
-   */
-  private Properties getMailHostConfiguration() {
-    Properties result = new Properties();
-    if (mailHost == null) {
-      mailHost = "";
-    }
-    if (mailFrom == null) {
-      mailFrom = "";
-    }
-    result.setProperty("mail.host", mailHost);
-    result.put("mail.from", mailFrom);
-    return result;
-  }
-
-  /**
-   * 
-   * @param host mail host server name
-   */
-  public void setMailHost(String host) {
-    this.mailHost = host;
-  }
-
-  /**
-   * 
-   * @return mail host server name
-   */
-  public String getMailHost() {
-    return this.mailHost;
-  }
-
-  /**
-   * 
-   * @param fromAddress mailFrom email id
-   */
-  public void setMailFromAddress(String fromAddress) {
-    mailFrom = fromAddress;
-  }
-
-  /**
-   * 
-   * @return mailFrom email id
-   */
-  public String getMailFromAddress() {
-    return mailFrom;
-  }
-
-  /**
-   * add new mail id to ToList
-   */
-  public void addMailToAddress(String toAddress) {
-    mailToSet.add(toAddress);
-    mailToAddresses = getAllToAddresses();
-  }
-
-  /**
-   * remove given mail id from ToList
-   */
-  public void removeMailToAddress(String toAddress) {
-    mailToSet.remove(toAddress);
-    mailToAddresses = getAllToAddresses();
-  }
-
-  /**
-   * @return list all the registered email id
-   */
-  public String[] getAllToAddresses() {
-    return (String[]) mailToSet.toArray(new String[0]);
-  }
-
-  /**
-   * remove all the registered email ids from ToList
-   */
-  public void removeAllMailToAddresses() {
-    mailToSet.clear();
-    mailToAddresses = new String[0];
-  }
-
-  /**
-   * Set the mail properties, e.g mail host, mailFrom, MailTo etc
-   */
-  public void setMailProperties(Properties mailProperties) {
-    mailHost = mailProperties.getProperty(PROPERTY_MAIL_HOST);
-    mailFrom = mailProperties.getProperty(PROPERTY_MAIL_FROM);
-    String mailList = mailProperties.getProperty(PROPERTY_MAIL_TO_LIST, "");
-    String split[] = mailList.split(",");
-    removeAllMailToAddresses();
-    for (int i = 0; i < split.length; i++) {
-      addMailToAddress(split[i].trim());
-    }
-  }
-
-  @Override
-  public String toString() {
-    StringBuffer buffer = new StringBuffer(200);
-    buffer.append("[Mail Host: ");
-    buffer.append(getMailHost());
-    buffer.append("]");
-    buffer.append(" [Mail From: ");
-    buffer.append(getMailFromAddress());
-    buffer.append("]");
-    buffer.append(" [Mail To: ");
-    if (mailToAddresses.length > 0) {
-
-      for (int i = 0; i < mailToAddresses.length; i++) {
-        buffer.append(mailToAddresses[i]);
-        buffer.append(", ");
-      }
-      buffer.replace(buffer.length() - 2, buffer.length(), "");
-    } else {
-      buffer.append(" Undefined");
-    }
-    buffer.append("]");
-    return buffer.toString();
-  }
-
-  private HashSet mailToSet = new HashSet();
-
-  private String mailToAddresses[] = new String[0];
-
-  protected String mailHost;
-
-  protected String mailFrom;
-
-  public final static String PROPERTY_MAIL_HOST = "mail.host";
-
-  public final static String PROPERTY_MAIL_FROM = "mail.from";
-
-  public final static String PROPERTY_MAIL_TO_LIST = "mail.toList";
-
-  /**
-   * Incorporating subject and message of email
-   * 
-   * 
-   */
-  static private class EmailData {
-    String subject;
-
-    String message;
-
-    EmailData(String subject, String message) {
-      this.subject = subject;
-      this.message = message;
-    }
-  }
-
-  public static void main(String args[]) {
-    MailManager mailManager = new MailManager("mailsrv1.gemstone.com", "hkhanna@gemstone.com");
-    mailManager.sendEmail("Alert!", "Test");
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ManagedResource.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ManagedResource.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ManagedResource.java
deleted file mode 100755
index 5c2a81f..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ManagedResource.java
+++ /dev/null
@@ -1,74 +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.admin.jmx.internal;
-
-import javax.management.ObjectName;
-import javax.management.modelmbean.ModelMBean;
-
-/**
- * Represents a component or resource that is managed by a
- * {@link javax.management.modelmbean.ModelMBean}.
- *
- * @since GemFire 3.5
- *
- */
-public interface ManagedResource {
-
-  /**
-   * The prefix of MBean names. Note: this is NOT used by Members, Stats, or any other MBean that
-   * has it's own domain.
-   *
-   * @see #getMBeanName
-   */
-  public static final String MBEAN_NAME_PREFIX = "GemFire:type=";
-
-  /**
-   * Returns the name of the ModelMBean that will manage this resource. They [some] are of the form
-   *
-   * <PRE>
-   * MBEAN_NAME_PREFIX + typeName + ",id=" + id
-   * </PRE>
-   *
-   * @see #MBEAN_NAME_PREFIX
-   */
-  public String getMBeanName();
-
-  /** Returns the ModelMBean that is configured to manage this resource */
-  public ModelMBean getModelMBean();
-
-  /** Sets the ModelMBean that is configured to manage this resource */
-  public void setModelMBean(ModelMBean modelMBean);
-
-  /**
-   * Returns the enumerated ManagedResourceType of this resource.
-   *
-   * @see ManagedResourceType
-   */
-  public ManagedResourceType getManagedResourceType();
-
-  /**
-   * Returns the JMX <code>ObjectName</code> of this managed resource.
-   *
-   * @see #getMBeanName
-   */
-  public ObjectName getObjectName();
-
-  /**
-   * Perform any cleanup necessary before stopping management of this resource.
-   */
-  public void cleanupResource();
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ManagedResourceType.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ManagedResourceType.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ManagedResourceType.java
deleted file mode 100755
index 3b5747f..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ManagedResourceType.java
+++ /dev/null
@@ -1,204 +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.admin.jmx.internal;
-
-import org.apache.commons.lang.StringUtils;
-
-/**
- * Type-safe definition for ModelMBean managed resources. The class type ({@link #getClassTypeName})
- * must match the fully qualified class name listed in the type descriptor in
- * mbeans-descriptors.xml.
- *
- * @since GemFire 3.5
- *
- */
-public class ManagedResourceType implements java.io.Serializable {
-  private static final long serialVersionUID = 3752874768667480449L;
-
-  /** Agent managed resource type */
-  public static final ManagedResourceType AGENT =
-      new ManagedResourceType("Agent", org.apache.geode.admin.jmx.Agent.class);
-
-  /** DistributedSystem managed resource type */
-  public static final ManagedResourceType DISTRIBUTED_SYSTEM = new ManagedResourceType(
-      "AdminDistributedSystem", org.apache.geode.admin.AdminDistributedSystem.class);
-
-  /** SystemMember managed resource type */
-  public static final ManagedResourceType SYSTEM_MEMBER =
-      new ManagedResourceType("SystemMember", org.apache.geode.admin.SystemMember.class);
-
-  /** SystemMemberCache managed resource type */
-  public static final ManagedResourceType SYSTEM_MEMBER_CACHE =
-      new ManagedResourceType("SystemMemberCache", org.apache.geode.admin.SystemMemberCache.class);
-
-  /** SystemMemberCache managed resource type */
-  public static final ManagedResourceType SYSTEM_MEMBER_REGION = new ManagedResourceType(
-      "SystemMemberRegion", org.apache.geode.admin.SystemMemberRegion.class);
-
-  /** SystemMemberCacheServer managed resource type */
-  public static final ManagedResourceType SYSTEM_MEMBER_CACHE_SERVER = new ManagedResourceType(
-      "SystemMemberCacheServer", org.apache.geode.admin.SystemMemberCacheServer.class);
-
-  /** CacheVm managed resource type */
-  public static final ManagedResourceType CACHE_VM =
-      new ManagedResourceType("CacheVm", org.apache.geode.admin.CacheVm.class);
-
-  /** StatisticResource managed resource type */
-  public static final ManagedResourceType STATISTIC_RESOURCE =
-      new ManagedResourceType("StatisticResource", org.apache.geode.admin.StatisticResource.class);
-
-  public static final ManagedResourceType GEMFIRE_HEALTH =
-      new ManagedResourceType("GemFireHealth", org.apache.geode.admin.GemFireHealth.class);
-
-  public static final ManagedResourceType DISTRIBUTED_SYSTEM_HEALTH_CONFIG =
-      new ManagedResourceType("DistributedSystemHealthConfig",
-          org.apache.geode.admin.DistributedSystemHealthConfig.class);
-
-  public static final ManagedResourceType GEMFIRE_HEALTH_CONFIG = new ManagedResourceType(
-      "GemFireHealthConfig", org.apache.geode.admin.GemFireHealthConfig.class);
-
-  public static final ManagedResourceType DISTRIBUTION_LOCATOR = new ManagedResourceType(
-      "DistributionLocator", org.apache.geode.admin.DistributionLocator.class);
-
-  //////////////////// Instance Fields ////////////////////
-
-  /** The display-friendly name of this managed resource type. */
-  private final transient String name;
-
-  /**
-   * The interface/class used to externally represent this type. Note: this must match the mbean
-   * type descriptor in mbeans-descriptors.xml.
-   */
-  private final transient Class clazz;
-
-  // The 4 declarations below are necessary for serialization
-  /** int used as ordinal to represent this Scope */
-  public final int ordinal = nextOrdinal++;
-
-  private static int nextOrdinal = 0;
-
-  private static final ManagedResourceType[] VALUES =
-      {AGENT, DISTRIBUTED_SYSTEM, SYSTEM_MEMBER, SYSTEM_MEMBER_CACHE, SYSTEM_MEMBER_REGION,
-          SYSTEM_MEMBER_CACHE_SERVER, CACHE_VM, STATISTIC_RESOURCE, GEMFIRE_HEALTH,
-          DISTRIBUTED_SYSTEM_HEALTH_CONFIG, GEMFIRE_HEALTH_CONFIG, DISTRIBUTION_LOCATOR};
-
-  private Object readResolve() throws java.io.ObjectStreamException {
-    return VALUES[ordinal]; // Canonicalize
-  }
-
-  /** Creates a new instance of ManagedResourceType. */
-  private ManagedResourceType(String name, Class clazz) {
-    this.name = name;
-    this.clazz = clazz;
-  }
-
-  /** Returns the ManagedResourceType represented by specified ordinal */
-  public static ManagedResourceType fromOrdinal(int ordinal) {
-    return VALUES[ordinal];
-  }
-
-  /** Returns the display-friendly name of this managed resource type */
-  public String getName() {
-    return this.name;
-  }
-
-  /** Returns the interface/class used to externally represent this type */
-  public Class getClassType() {
-    return this.clazz;
-  }
-
-  /**
-   * Returns the fully qualified name of the interface/class used to externally represent this type
-   */
-  public String getClassTypeName() {
-    return this.clazz.getName();
-  }
-
-  /** Returns true if this is <code>AGENT</code>. */
-  public boolean isAgent() {
-    return this.equals(AGENT);
-  }
-
-  /** Returns true if this is <code>DISTRIBUTED_SYSTEM</code>. */
-  public boolean isDistributedSystem() {
-    return this.equals(DISTRIBUTED_SYSTEM);
-  }
-
-  /** Returns true if this is <code>SYSTEM_MEMBER</code>. */
-  public boolean isSystemMember() {
-    return this.equals(SYSTEM_MEMBER);
-  }
-
-  /** Returns whether this is <code>STATISTIC_RESOURCE</code>. */
-  public boolean isStatisticResource() {
-    return this.equals(STATISTIC_RESOURCE);
-  }
-
-  /** Return whether this is <code>GEMFIRE_HEALTH</code>. */
-  public boolean isGemFireHealth() {
-    return this.equals(GEMFIRE_HEALTH);
-  }
-
-  /**
-   * Returns a string representation for this type.
-   */
-  @Override
-  public String toString() {
-    return this.name;
-  }
-
-  /**
-   * Indicates whether some other object is "equal to" this one.
-   *
-   * @param other the reference object with which to compare.
-   * @return true if this object is the same as the obj argument; false otherwise.
-   */
-  @Override
-  public boolean equals(Object other) {
-    if (other == this)
-      return true;
-    if (other == null)
-      return false;
-    if (!(other instanceof ManagedResourceType))
-      return false;
-    final ManagedResourceType that = (ManagedResourceType) other;
-
-    if (!StringUtils.equals(this.name, that.name))
-      return false;
-    if (this.clazz != that.clazz && !(this.clazz != null && this.clazz.equals(that.clazz)))
-      return false;
-
-    return true;
-  }
-
-  /**
-   * Returns a hash code for the object. This method is supported for the benefit of hashtables such
-   * as those provided by java.util.Hashtable.
-   *
-   * @return the integer 0 if description is null; otherwise a unique integer.
-   */
-  @Override
-  public int hashCode() {
-    int result = 17;
-    final int mult = 37;
-
-    result = mult * result + (this.name == null ? 0 : this.name.hashCode());
-    result = mult * result + (this.clazz == null ? 0 : this.clazz.hashCode());
-
-    return result;
-  }
-
-}
-


[22/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentConfigImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentConfigImpl.java
new file mode 100644
index 0000000..5652b1a
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentConfigImpl.java
@@ -0,0 +1,1911 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+import static org.apache.geode.distributed.internal.DistributionConfig.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.InetAddress;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import org.apache.geode.GemFireIOException;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.internal.admin.api.impl.DistributedSystemConfigImpl;
+import org.apache.geode.internal.admin.api.impl.InetAddressUtil;
+import org.apache.geode.internal.admin.api.jmx.Agent;
+import org.apache.geode.internal.admin.api.jmx.AgentConfig;
+import org.apache.geode.internal.ClassPathLoader;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.util.IOUtils;
+
+/**
+ * Provides the JMX Agent configuration properties.
+ * <p>
+ * Supports importing of persisted properties from an external configuration file.
+ * <p>
+ * Select values can also be overridden with command line arguments. See remarks on individual
+ * properties for further information.
+ * <p>
+ * Extends and implements DistributedSystemConfig.
+ * 
+ * @since GemFire 3.5 (in which it was named AgentConfig)
+ */
+public class AgentConfigImpl extends DistributedSystemConfigImpl implements AgentConfig {
+
+  // -------------------------------------------------------------------------
+  // Static class variable(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Command-line arg to enable agent debugging
+   */
+  public static final String AGENT_DEBUG = "agent-debug";
+
+  /**
+   * The name of the "propertyFile" property. May specify as cmd-line arg
+   */
+  public static final String PROPERTY_FILE_NAME = "property-file";
+
+  /**
+   * The name of the "gfAgentPropertyFile" property, can be specified as System Property
+   */
+  public static final String AGENT_PROPSFILE_PROPERTY_NAME = "gfAgentPropertyFile";
+
+  // -------------------------------------------------------------------------
+  // DistributionLocator properties...
+  // -------------------------------------------------------------------------
+
+  /**
+   * The name of the "locator.host-" property
+   */
+  public static final String LOCATOR_HOST_NAME = "locator.host-";
+  /**
+   * The name of the "locator.port-" property
+   */
+  public static final String LOCATOR_PORT_NAME = "locator.port-";
+  /**
+   * The name of the "locator.product-directory-" property
+   */
+  public static final String LOCATOR_PRODUCT_DIRECTORY_NAME = "locator.product-directory-";
+  /**
+   * The name of the "locator.working-directory-" property
+   */
+  public static final String LOCATOR_WORKING_DIRECTORY_NAME = "locator.working-directory-";
+  /**
+   * The name of the "locator.remote-command-" property
+   */
+  public static final String LOCATOR_REMOTE_COMMAND = "locator.remote-command-";
+  /**
+   * The name of the "locator.bind-address-" property
+   */
+  public static final String LOCATOR_BIND_ADDRESS = "locator.bind-address-";
+  /**
+   * the properties used in configuring a locator's distributed system
+   */
+  public static final String LOCATOR_DS_PROPERTIES = "locator.ds-properties";
+
+  /**
+   * The default log file for stand-alone JMX agents
+   */
+  /* package scope */
+  static final String DEFAULT_LOG_FILE = "agent.log";
+
+  /**
+   * The default startup log file to be used by agent launcher
+   */
+  /* package scope */
+  static final String DEFAULT_STARTUP_LOG_FILE = "start_agent.log";
+
+  private static String OBFUSCATED_STRING = "********";
+
+  ////////////////////// Static Methods //////////////////////
+
+  /**
+   * The <code>propertyFile</code> is the name of the property file that will be loaded on startup
+   * of the Agent.
+   * <p>
+   * The file will be searched for, in order, in the following directories:
+   * <ol>
+   * <li>the current directory
+   * <li>the home directory
+   * <li>the class path
+   * </ol>
+   * Only the first file found will be used.
+   * <p>
+   * The default value of propertyFile is <code>"agent.properties"</code>. However if the
+   * "gfAgentPropertyFile" system property is set then its value is the value of propertyFile. If
+   * this value is a relative file system path then the above search is done. If its an absolute
+   * file system path then that file must exist; no search for it is done.
+   */
+  static String retrievePropertyFile() {
+    return System.getProperty(AGENT_PROPSFILE_PROPERTY_NAME, DEFAULT_PROPERTY_FILE);
+  }
+
+  /**
+   * Creates a new <code>Properties</code> object that contains all of the default values.
+   */
+  private static Properties getDefaultProperties() {
+    Properties props = new Properties();
+
+    props.setProperty(AUTO_CONNECT_NAME, String.valueOf(DEFAULT_AUTO_CONNECT));
+
+    props.setProperty(HTTP_ENABLED_NAME, String.valueOf(DEFAULT_HTTP_ENABLED));
+    props.setProperty(HTTP_BIND_ADDRESS_NAME, String.valueOf(DEFAULT_HTTP_BIND_ADDRESS));
+    props.setProperty(HTTP_PORT_NAME, String.valueOf(DEFAULT_HTTP_PORT));
+    props.setProperty(HTTP_AUTHENTICATION_ENABLED_NAME,
+        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_ENABLED));
+    props.setProperty(HTTP_AUTHENTICATION_USER_NAME,
+        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_USER));
+    props.setProperty(HTTP_AUTHENTICATION_PASSWORD_NAME,
+        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_PASSWORD));
+
+    props.setProperty(RMI_ENABLED_NAME, String.valueOf(DEFAULT_RMI_ENABLED));
+    props.setProperty(RMI_REGISTRY_ENABLED_NAME, String.valueOf(DEFAULT_RMI_REGISTRY_ENABLED));
+    props.setProperty(RMI_BIND_ADDRESS_NAME, String.valueOf(DEFAULT_RMI_BIND_ADDRESS));
+    props.setProperty(RMI_PORT_NAME, String.valueOf(DEFAULT_RMI_PORT));
+    props.setProperty(RMI_SERVER_PORT_NAME, String.valueOf(DEFAULT_RMI_SERVER_PORT));
+
+    props.setProperty(SNMP_ENABLED_NAME, String.valueOf(DEFAULT_SNMP_ENABLED));
+    props.setProperty(SNMP_DIRECTORY_NAME, String.valueOf(DEFAULT_SNMP_DIRECTORY));
+
+    props.setProperty(AGENT_SSL_ENABLED_NAME, String.valueOf(DEFAULT_AGENT_SSL_ENABLED));
+    props.setProperty(AGENT_SSL_PROTOCOLS_NAME, String.valueOf(DEFAULT_AGENT_SSL_PROTOCOLS));
+    props.setProperty(AGENT_SSL_CIPHERS_NAME, String.valueOf(DEFAULT_AGENT_SSL_CIPHERS));
+    props.setProperty(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME,
+        String.valueOf(DEFAULT_AGENT_SSL_REQUIRE_AUTHENTICATION));
+    props.setProperty(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME,
+        String.valueOf(DEFAULT_HTTP_SSL_REQUIRE_AUTHENTICATION));
+
+    return props;
+  }
+
+  /**
+   * Returns default values for all valid agent properties as a Properties object.
+   * 
+   * @return default values for all valid agent properties
+   */
+  static Properties getDefaultValuesForAllProperties() {
+    Properties props = new Properties();
+
+    props.setProperty(AUTO_CONNECT_NAME, String.valueOf(DEFAULT_AUTO_CONNECT));
+
+    props.setProperty(HTTP_ENABLED_NAME, String.valueOf(DEFAULT_HTTP_ENABLED));
+
+    props.setProperty(HTTP_BIND_ADDRESS_NAME, String.valueOf(DEFAULT_HTTP_BIND_ADDRESS));
+
+    props.setProperty(HTTP_PORT_NAME, String.valueOf(DEFAULT_HTTP_PORT));
+
+    props.setProperty(HTTP_AUTHENTICATION_ENABLED_NAME,
+        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_ENABLED));
+
+    props.setProperty(HTTP_AUTHENTICATION_USER_NAME,
+        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_USER));
+
+    props.setProperty(HTTP_AUTHENTICATION_PASSWORD_NAME,
+        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_PASSWORD));
+
+    props.setProperty(RMI_ENABLED_NAME, String.valueOf(DEFAULT_RMI_ENABLED));
+
+    props.setProperty(RMI_REGISTRY_ENABLED_NAME, String.valueOf(DEFAULT_RMI_REGISTRY_ENABLED));
+
+    props.setProperty(RMI_BIND_ADDRESS_NAME, String.valueOf(DEFAULT_RMI_BIND_ADDRESS));
+
+    props.setProperty(RMI_PORT_NAME, String.valueOf(DEFAULT_RMI_PORT));
+
+    props.setProperty(RMI_SERVER_PORT_NAME, String.valueOf(DEFAULT_RMI_SERVER_PORT));
+
+    props.setProperty(SNMP_ENABLED_NAME, String.valueOf(DEFAULT_SNMP_ENABLED));
+
+    props.setProperty(SNMP_DIRECTORY_NAME, String.valueOf(DEFAULT_SNMP_DIRECTORY));
+
+    props.setProperty(AGENT_SSL_ENABLED_NAME, String.valueOf(DEFAULT_AGENT_SSL_ENABLED));
+
+    props.setProperty(AGENT_SSL_PROTOCOLS_NAME, String.valueOf(DEFAULT_AGENT_SSL_PROTOCOLS));
+
+    props.setProperty(AGENT_SSL_CIPHERS_NAME, String.valueOf(DEFAULT_AGENT_SSL_CIPHERS));
+
+    props.setProperty(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME,
+        String.valueOf(DEFAULT_AGENT_SSL_REQUIRE_AUTHENTICATION));
+
+    props.setProperty(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME,
+        String.valueOf(DEFAULT_HTTP_SSL_REQUIRE_AUTHENTICATION));
+
+    props.setProperty(SNMP_BIND_ADDRESS_NAME, String.valueOf(DEFAULT_SNMP_BIND_ADDRESS));
+
+    props.setProperty(EMAIL_NOTIFICATIONS_ENABLED_NAME,
+        String.valueOf(DEFAULT_EMAIL_NOTIFICATIONS_ENABLED));
+
+    props.setProperty(EMAIL_NOTIFICATIONS_HOST_NAME, String.valueOf(DEFAULT_EMAIL_HOST));
+
+    props.setProperty(EMAIL_NOTIFICATIONS_FROM_NAME, String.valueOf(DEFAULT_EMAIL_FROM));
+
+    props.setProperty(EMAIL_NOTIFICATIONS_TO_LIST_NAME, String.valueOf(DEFAULT_EMAIL_TO_LIST));
+
+    props.setProperty(STATE_SAVE_FILE_NAME, String.valueOf(DEFAULT_STATE_SAVE_FILE));
+
+    props.setProperty(CLUSTER_SSL_ENABLED, String.valueOf(DEFAULT_SSL_ENABLED));
+
+    props.setProperty(CLUSTER_SSL_PROTOCOLS, String.valueOf(DEFAULT_SSL_PROTOCOLS));
+
+    props.setProperty(CLUSTER_SSL_CIPHERS, String.valueOf(DEFAULT_SSL_CIPHERS));
+
+    props.setProperty(CLUSTER_SSL_REQUIRE_AUTHENTICATION,
+        String.valueOf(DEFAULT_SSL_REQUIRE_AUTHENTICATION));
+
+    props.setProperty(ENTITY_CONFIG_XML_FILE_NAME, String.valueOf(DEFAULT_ENTITY_CONFIG_XML_FILE));
+
+    props.setProperty(MCAST_PORT, String.valueOf(DEFAULT_MCAST_PORT));
+
+    props.setProperty(MCAST_ADDRESS, String.valueOf(DEFAULT_MCAST_ADDRESS));
+
+    props.setProperty(LOCATORS, String.valueOf(DEFAULT_LOCATORS));
+
+    props.setProperty(BIND_ADDRESS, String.valueOf(DEFAULT_BIND_ADDRESS));
+
+    props.setProperty(REMOTE_COMMAND_NAME, String.valueOf(DEFAULT_REMOTE_COMMAND));
+
+    props.setProperty(LOG_FILE_NAME, String.valueOf(DEFAULT_LOG_FILE));
+
+    props.setProperty(LOG_LEVEL_NAME, String.valueOf(DEFAULT_LOG_LEVEL));
+
+    props.setProperty(LOG_DISK_SPACE_LIMIT_NAME, String.valueOf(DEFAULT_LOG_DISK_SPACE_LIMIT));
+
+    props.setProperty(LOG_FILE_SIZE_LIMIT_NAME, String.valueOf(DEFAULT_LOG_FILE_SIZE_LIMIT));
+
+    props.setProperty(REFRESH_INTERVAL_NAME, String.valueOf(DEFAULT_REFRESH_INTERVAL));
+
+    return props;
+
+  }
+
+  // -------------------------------------------------------------------------
+  // Member variable(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Does agent automatically connect to the distributed system?
+   */
+  private boolean autoConnect;
+
+  /**
+   * True if Agent adaptors should use SSL
+   */
+  private boolean agentSSLEnabled;
+
+  /**
+   * The SSL Protocols that the Agent adaptors will use
+   */
+  private String agentSSLProtocols;
+
+  /**
+   * The SSL Ciphers that the Agent adaptors will use
+   */
+  private String agentSSLCiphers;
+
+  /**
+   * True if Agent adaptors require authentication when SSL is enabled
+   */
+  private boolean agentSSLRequireAuth;
+
+  /**
+   * HttpAdaptor won't work with ssl authentication required, so this attribute allows this option
+   * to be turned on for RMI but off for HTTP in the event that both adaptors are being used with
+   * ssl.
+   */
+  private boolean httpSSLRequireAuth;
+
+  /**
+   * True if HttpAdaptor authentication is enabled
+   */
+  private boolean httpAuthEnabled;
+
+  /**
+   * The login user for HttpAdaptor authentication
+   */
+  private String httpAuthUser;
+
+  /**
+   * The login password for HttpAdaptor authentication
+   */
+  private String httpAuthPassword;
+
+  /**
+   * True if the HttpAdaptor is enabled
+   */
+  private boolean httpEnabled;
+
+  /**
+   * The port for the MX4J HttpAdatper
+   */
+  private int httpPort;
+
+  /**
+   * The host for the MX4J HttpAdatper
+   */
+  private String httpBindAddress;
+
+  /**
+   * True if the RMIConnectorServer is enabled
+   */
+  private boolean rmiEnabled;
+
+  /**
+   * True if the Agent is to create its own RMI registry
+   */
+  private boolean rmiRegistryEnabled;
+
+  /**
+   * The host for the MX4J RMIConnectorServer
+   */
+  private String rmiBindAddress;
+
+  /**
+   * The port for the RMI Registry created by the Agent
+   */
+  private int rmiPort;
+
+  /**
+   * The port for the MX4J RMIConnectorServer
+   */
+  private int rmiServerPort;
+
+  /**
+   * True if the SnmpAdaptor is enabled
+   */
+  private boolean snmpEnabled;
+
+  /**
+   * The bind address for sockets used by the SNMP adapter
+   */
+  private String snmpBindAddress;
+
+  /**
+   * Path to the directory containing the SNMP Adaptor and its sub-dirs
+   */
+  private String snmpDirectory;
+
+  /**
+   * Is Email notification enabled
+   */
+  private boolean isEmailNotificationEnabled;
+
+  /**
+   * Email notification from: emailID
+   */
+  private String emailNotificationFrom;
+
+  /**
+   * The host name of the mail server to be used for email communication.
+   */
+  private String emailNotificationHostName;
+
+  /**
+   * Email notification to: emailIDs list
+   */
+  private String emailNotificationToList;
+
+  /**
+   * State Save File Name
+   */
+  private String stateSaveFile;
+
+  /**
+   * Describes the property file used to load configuration from. Null if no file was found.
+   */
+  private URL url;
+
+  /**
+   * Original command line arguments
+   */
+  private String[] originalCmdLineArgs = null;
+
+  /**
+   * The <code>Agent</code> that is configured by this <code>AgentConfigImpl</code>
+   */
+  private Agent agent;
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs new instance of <code>AgentConfigImpl</code> with the default configuration.
+   */
+  public AgentConfigImpl() {
+    this(getDefaultProperties());
+  }
+
+  /**
+   * Constructs new instance of AgentConfig. Supplied command-line arguments are used to create a
+   * set of non-default properties for initializing this AgentConfig.
+   * 
+   * @param args array of non-default configuration arguments
+   */
+  public AgentConfigImpl(String[] args) {
+    this(toProperties(args));
+    this.originalCmdLineArgs = args;
+  }
+
+  /**
+   * Creates a new <code>AgentConfig</code> with the given non-default configuration properties.
+   * 
+   * @param props overriding non-default configuration properties
+   */
+  public AgentConfigImpl(Properties props) {
+    // for admin bug #40434
+    super(filterOutAgentProperties(appendOptionalPropertyFileProperties(props)),
+        true/* ignore gemfire.properties */);
+
+    // first get any property values set in the optional property file
+    this.url = getPropertyFileURL(retrievePropertyFile());
+
+    initialize(appendOptionalPropertyFileProperties(props));
+  }
+
+  /**
+   * Constructs new instance of AgentConfig using the specified property file.
+   * 
+   * @param propFile the file to load configuration properties from
+   */
+  public AgentConfigImpl(File propFile) {
+    // Initialize default values
+    this();
+
+    Properties props = new Properties();
+    if (propFile.exists()) {
+      try {
+        FileInputStream in = new FileInputStream(propFile);
+        props.load(in);
+        in.close();
+      } catch (java.io.IOException e) {
+        throw new GemFireIOException(
+            LocalizedStrings.AgentConfigImpl_FAILED_READING_0.toLocalizedString(propFile), e);
+      }
+    } else {
+      throw new IllegalArgumentException(
+          LocalizedStrings.AgentConfigImpl_SPECIFIED_PROPERTIES_FILE_DOES_NOT_EXIST_0
+              .toLocalizedString(propFile));
+    }
+
+    initialize(props);
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Sets the <code>Agent</code> associated with this <code>AgentConfigImpl</code>.
+   */
+  void setAgent(Agent agent) {
+    this.agent = agent;
+  }
+
+  /**
+   * Checks to see if this config object is "read only". If it is, then an
+   * {@link IllegalStateException} is thrown.
+   * 
+   * @since GemFire 4.0
+   */
+  @Override
+  protected void checkReadOnly() {
+    if (this.agent != null) {
+      throw new IllegalStateException(
+          LocalizedStrings.AgentConfigImpl_AN_AGENTCONFIG_OBJECT_CANNOT_BE_MODIFIED_AFTER_IT_HAS_BEEN_USED_TO_CREATE_AN_AGENT
+              .toLocalizedString());
+    }
+
+    super.checkReadOnly();
+  }
+
+  // -------------------------------------------------------------------------
+  // Methods for handling Properties and the Properties file
+  // -------------------------------------------------------------------------
+
+  /**
+   * Returns a description of the property file used to load this config. If no property file was
+   * used then the description will say so.
+   */
+  public String getPropertyFileDescription() {
+    /*
+     * Checking if the specified or the default properties file exists. If not, just log this as an
+     * information.
+     */
+    if (this.url == null) {
+      return LocalizedStrings.AgentConfigImpl_USING_DEFAULT_CONFIGURATION_BECAUSE_PROPERTY_FILE_WAS_FOUND
+          .toLocalizedString();
+    } else {
+      return LocalizedStrings.AgentConfigImpl_CONFIGURATION_LOADED_FROM_0
+          .toLocalizedString(this.url);
+    }
+  }
+
+  /**
+   * Returns the default property file that will be used when configuration is saved.
+   */
+  public File getPropertyFile() {
+    File f;
+    if (this.url == null) {
+      f = new File(retrievePropertyFile());
+      if (!f.isAbsolute()) {
+        // save to <cwd>/propertyFile
+        f = new File(System.getProperty("user.dir"), retrievePropertyFile());
+      }
+    } else {
+      f = new File(this.url.getFile());
+    }
+    return f;
+  }
+
+  /**
+   * Converts the contents of this config to a property instance and Stringifies it
+   * 
+   * @return contents of this config as String
+   */
+  public String toPropertiesAsString() {
+    Properties p = toProperties(true /* include DS properties */);
+
+    StringWriter sw = new StringWriter();
+    PrintWriter pw = new PrintWriter(sw);
+    pw.println(LocalizedStrings.AgentConfigImpl_AGENT_CONFIGURATION.toLocalizedString());
+    Enumeration e = p.propertyNames();
+    while (e.hasMoreElements()) {
+      String pn = (String) e.nextElement();
+      String pv = p.getProperty(pn);
+      pw.println("  " + pn + " = " + pv);
+    }
+    pw.close();
+
+    return sw.toString();
+  }
+
+  /**
+   * Converts the contents of this config to a property instance.
+   * 
+   * @return contents of this config as java.util.Properties
+   */
+  public Properties toProperties() {
+    return toProperties(false /* include DS properties */);
+  }
+
+  /**
+   * Converts the contents of this config to a property instance.
+   * 
+   * @param includeDSProperties Should distributed system properties be included in the
+   *        <code>Properties</code> object? See bug 32682.
+   *
+   * @return contents of this config as java.util.Properties
+   */
+  public Properties toProperties(boolean includeDSProperties) {
+    Properties props = new Properties();
+
+    props.setProperty(AUTO_CONNECT_NAME, toString(AUTO_CONNECT_NAME, getAutoConnect()));
+
+    props.setProperty(HTTP_ENABLED_NAME, toString(HTTP_ENABLED_NAME, isHttpEnabled()));
+    props.setProperty(HTTP_BIND_ADDRESS_NAME,
+        toString(HTTP_BIND_ADDRESS_NAME, getHttpBindAddress()));
+    props.setProperty(HTTP_PORT_NAME, toString(HTTP_PORT_NAME, getHttpPort()));
+
+    props.setProperty(RMI_ENABLED_NAME, toString(RMI_ENABLED_NAME, isRmiEnabled()));
+    props.setProperty(RMI_REGISTRY_ENABLED_NAME,
+        toString(RMI_REGISTRY_ENABLED_NAME, isRmiRegistryEnabled()));
+    props.setProperty(RMI_BIND_ADDRESS_NAME, toString(RMI_BIND_ADDRESS_NAME, getRmiBindAddress()));
+    props.setProperty(RMI_PORT_NAME, toString(RMI_PORT_NAME, getRmiPort()));
+    props.setProperty(RMI_SERVER_PORT_NAME, toString(RMI_SERVER_PORT_NAME, getRmiServerPort()));
+
+    props.setProperty(SNMP_ENABLED_NAME, toString(SNMP_ENABLED_NAME, isSnmpEnabled()));
+    props.setProperty(SNMP_BIND_ADDRESS_NAME,
+        toString(SNMP_BIND_ADDRESS_NAME, getSnmpBindAddress()));
+    props.setProperty(SNMP_DIRECTORY_NAME, toString(SNMP_DIRECTORY_NAME, getSnmpDirectory()));
+
+    props.setProperty(AGENT_SSL_ENABLED_NAME,
+        toString(AGENT_SSL_ENABLED_NAME, isAgentSSLEnabled()));
+    props.setProperty(AGENT_SSL_PROTOCOLS_NAME,
+        toString(AGENT_SSL_PROTOCOLS_NAME, getAgentSSLProtocols()));
+    props.setProperty(AGENT_SSL_CIPHERS_NAME,
+        toString(AGENT_SSL_CIPHERS_NAME, getAgentSSLCiphers()));
+    props.setProperty(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME,
+        toString(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME, isAgentSSLRequireAuth()));
+    props.setProperty(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME,
+        toString(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME, isHttpSSLRequireAuth()));
+
+    props.setProperty(HTTP_AUTHENTICATION_ENABLED_NAME,
+        toString(HTTP_AUTHENTICATION_ENABLED_NAME, isHttpAuthEnabled()));
+    props.setProperty(HTTP_AUTHENTICATION_USER_NAME,
+        toString(HTTP_AUTHENTICATION_USER_NAME, getHttpAuthUser()));
+    props.setProperty(HTTP_AUTHENTICATION_PASSWORD_NAME,
+        toString(HTTP_AUTHENTICATION_PASSWORD_NAME, getHttpAuthPassword()));
+
+    props.setProperty(EMAIL_NOTIFICATIONS_ENABLED_NAME,
+        toString(EMAIL_NOTIFICATIONS_ENABLED_NAME, isEmailNotificationEnabled()));
+    props.setProperty(EMAIL_NOTIFICATIONS_HOST_NAME,
+        toString(EMAIL_NOTIFICATIONS_HOST_NAME, getEmailNotificationHost()));
+    props.setProperty(EMAIL_NOTIFICATIONS_FROM_NAME,
+        toString(EMAIL_NOTIFICATIONS_FROM_NAME, getEmailNotificationFrom()));
+    props.setProperty(EMAIL_NOTIFICATIONS_TO_LIST_NAME,
+        toString(EMAIL_NOTIFICATIONS_TO_LIST_NAME, getEmailNotificationToList()));
+
+    props.setProperty(STATE_SAVE_FILE_NAME, toString(STATE_SAVE_FILE_NAME, getStateSaveFile()));
+
+    props.setProperty(EMAIL_NOTIFICATIONS_ENABLED_NAME,
+        toString(EMAIL_NOTIFICATIONS_ENABLED_NAME, isEmailNotificationEnabled()));
+    props.setProperty(EMAIL_NOTIFICATIONS_HOST_NAME,
+        toString(EMAIL_NOTIFICATIONS_HOST_NAME, getEmailNotificationHost()));
+    props.setProperty(EMAIL_NOTIFICATIONS_FROM_NAME,
+        toString(EMAIL_NOTIFICATIONS_FROM_NAME, getEmailNotificationFrom()));
+    props.setProperty(EMAIL_NOTIFICATIONS_TO_LIST_NAME,
+        toString(EMAIL_NOTIFICATIONS_TO_LIST_NAME, getEmailNotificationToList()));
+
+    props.setProperty(CLUSTER_SSL_ENABLED, toString(CLUSTER_SSL_ENABLED, isSSLEnabled()));
+    props.setProperty(CLUSTER_SSL_PROTOCOLS, toString(CLUSTER_SSL_PROTOCOLS, getSSLProtocols()));
+    props.setProperty(CLUSTER_SSL_CIPHERS, toString(CLUSTER_SSL_CIPHERS, getSSLCiphers()));
+    props.setProperty(CLUSTER_SSL_REQUIRE_AUTHENTICATION,
+        toString(CLUSTER_SSL_REQUIRE_AUTHENTICATION, isSSLAuthenticationRequired()));
+
+    Properties sslProps = getSSLProperties();
+    if (sslProps.size() > 0) {
+      int sequence = 0;
+      for (Iterator iter = sslProps.keySet().iterator(); iter.hasNext();) {
+        String key = (String) iter.next();
+        String value = sslProps.getProperty(key);
+        props.setProperty("ssl-property-" + sequence, key + "=" + OBFUSCATED_STRING);
+        sequence++;
+      }
+    }
+
+    if (this.getDistributionLocatorConfigs().length > 0) {
+      DistributionLocatorConfig[] configs = this.getDistributionLocatorConfigs();
+      for (int i = 0; i < configs.length; i++) {
+        DistributionLocatorConfig locator = configs[i];
+        props.setProperty(LOCATOR_HOST_NAME + i, toString(LOCATOR_HOST_NAME, locator.getHost()));
+        props.setProperty(LOCATOR_PORT_NAME + i, toString(LOCATOR_PORT_NAME, locator.getPort()));
+        props.setProperty(LOCATOR_PRODUCT_DIRECTORY_NAME + i,
+            toString(LOCATOR_PRODUCT_DIRECTORY_NAME, locator.getProductDirectory()));
+        props.setProperty(LOCATOR_WORKING_DIRECTORY_NAME + i,
+            toString(LOCATOR_WORKING_DIRECTORY_NAME, locator.getWorkingDirectory()));
+        props.setProperty(LOCATOR_REMOTE_COMMAND + i,
+            toString(LOCATOR_REMOTE_COMMAND, locator.getRemoteCommand()));
+        props.setProperty(LOCATOR_BIND_ADDRESS + i,
+            toString(LOCATOR_BIND_ADDRESS, locator.getBindAddress()));
+        // props.setProperty(LOCATOR_DS_PROPERTIES + i,
+        // getdsPropertiesString(locator));
+      }
+    }
+
+    if (includeDSProperties) {
+      props.setProperty(ENTITY_CONFIG_XML_FILE_NAME,
+          toString(ENTITY_CONFIG_XML_FILE_NAME, getEntityConfigXMLFile()));
+      // This could be different each time agent is started
+      // props.setProperty(SYSTEM_ID_NAME, toString(getSystemId()));
+      props.setProperty(MCAST_PORT, toString(MCAST_PORT, getMcastPort()));
+      props.setProperty(MCAST_ADDRESS, toString(MCAST_ADDRESS, getMcastAddress()));
+      props.setProperty(LOCATORS, toString(LOCATORS, getLocators()));
+      props.setProperty(MEMBERSHIP_PORT_RANGE_NAME, getMembershipPortRange());
+      props.setProperty(TCP_PORT, "" + getTcpPort());
+      props.setProperty(BIND_ADDRESS, toString(BIND_ADDRESS, getBindAddress()));
+      props.setProperty(REMOTE_COMMAND_NAME, toString(REMOTE_COMMAND_NAME, getRemoteCommand()));
+      props.setProperty(LOG_FILE_NAME, toString(LOG_FILE_NAME, getLogFile()));
+      props.setProperty(LOG_LEVEL_NAME, toString(LOG_LEVEL_NAME, getLogLevel()));
+      props.setProperty(LOG_DISK_SPACE_LIMIT_NAME,
+          toString(LOG_DISK_SPACE_LIMIT_NAME, getLogDiskSpaceLimit()));
+      props.setProperty(LOG_FILE_SIZE_LIMIT_NAME,
+          toString(LOG_FILE_SIZE_LIMIT_NAME, getLogFileSizeLimit()));
+      props.setProperty(REFRESH_INTERVAL_NAME,
+          toString(REFRESH_INTERVAL_NAME, getRefreshInterval()));
+    }
+
+    return props;
+  }
+
+
+  // -------------------------------------------------------------------------
+  // Agent specific properties
+  // -------------------------------------------------------------------------
+
+  public boolean isAgentSSLEnabled() {
+    return this.agentSSLEnabled;
+  }
+
+  public void setAgentSSLEnabled(boolean agentSSLEnabled) {
+    checkReadOnly();
+    this.agentSSLEnabled = agentSSLEnabled;
+    configChanged();
+  }
+
+  public String getAgentSSLProtocols() {
+    return this.agentSSLProtocols;
+  }
+
+  public void setAgentSSLProtocols(String agentSSLProtocols) {
+    checkReadOnly();
+    this.agentSSLProtocols = agentSSLProtocols;
+    configChanged();
+  }
+
+  public String getAgentSSLCiphers() {
+    return this.agentSSLCiphers;
+  }
+
+  public void setAgentSSLCiphers(String agentSSLCiphers) {
+    checkReadOnly();
+    this.agentSSLCiphers = agentSSLCiphers;
+    configChanged();
+  }
+
+  public boolean isAgentSSLRequireAuth() {
+    return this.agentSSLRequireAuth;
+  }
+
+  public void setAgentSSLRequireAuth(boolean agentSSLRequireAuth) {
+    checkReadOnly();
+    this.agentSSLRequireAuth = agentSSLRequireAuth;
+    configChanged();
+  }
+
+  public boolean isHttpSSLRequireAuth() {
+    return this.httpSSLRequireAuth;
+  }
+
+  public void setHttpSSLRequireAuth(boolean httpSSLRequireAuth) {
+    checkReadOnly();
+    this.httpSSLRequireAuth = httpSSLRequireAuth;
+    configChanged();
+  }
+
+  public boolean isHttpAuthEnabled() {
+    return this.httpAuthEnabled;
+  }
+
+  public void setHttpAuthEnabled(boolean httpAuthEnabled) {
+    checkReadOnly();
+    this.httpAuthEnabled = httpAuthEnabled;
+    configChanged();
+  }
+
+  public String getHttpAuthUser() {
+    return this.httpAuthUser;
+  }
+
+  public void setHttpAuthUser(String httpAuthUser) {
+    checkReadOnly();
+    this.httpAuthUser = httpAuthUser;
+    configChanged();
+  }
+
+  public String getHttpAuthPassword() {
+    return this.httpAuthPassword;
+  }
+
+  public void setHttpAuthPassword(String httpAuthPassword) {
+    checkReadOnly();
+    this.httpAuthPassword = httpAuthPassword;
+    configChanged();
+  }
+
+  public boolean isSnmpEnabled() {
+    return this.snmpEnabled;
+  }
+
+  public void setSnmpEnabled(boolean snmpEnabled) {
+    checkReadOnly();
+    this.snmpEnabled = snmpEnabled;
+    configChanged();
+  }
+
+  public String getSnmpBindAddress() {
+    return this.snmpBindAddress;
+  }
+
+  public void setSnmpBindAddress(String snmpBindAddress) {
+    checkReadOnly();
+    this.snmpBindAddress = validateSnmpBindAddress(snmpBindAddress);
+    configChanged();
+  }
+
+  public String getSnmpDirectory() {
+    return this.snmpDirectory;
+  }
+
+  public void setSnmpDirectory(String snmpDirectory) {
+    checkReadOnly();
+    this.snmpDirectory = validateSnmpDirectory(snmpDirectory);
+    configChanged();
+  }
+
+  public boolean isRmiEnabled() {
+    return this.rmiEnabled;
+  }
+
+  public void setRmiEnabled(boolean rmiEnabled) {
+    checkReadOnly();
+    this.rmiEnabled = rmiEnabled;
+    configChanged();
+  }
+
+  public boolean isRmiRegistryEnabled() {
+    return this.rmiRegistryEnabled;
+  }
+
+  public void setRmiRegistryEnabled(boolean rmiRegistryEnabled) {
+    checkReadOnly();
+    this.rmiRegistryEnabled = rmiRegistryEnabled;
+    configChanged();
+  }
+
+  public String getRmiBindAddress() {
+    return this.rmiBindAddress;
+  }
+
+  public void setRmiBindAddress(String rmiBindAddress) {
+    checkReadOnly();
+    this.rmiBindAddress = validateRmiBindAddress(rmiBindAddress);
+    configChanged();
+  }
+
+  public int getRmiPort() {
+    return this.rmiPort;
+  }
+
+  public void setRmiPort(int rmiPort) {
+    checkReadOnly();
+    this.rmiPort = validateRmiPort(rmiPort);
+    configChanged();
+  }
+
+  /**
+   * Returns the port of the RMI Connector Server.
+   * <p>
+   * See <a href="#rmi-server-port">description</a> above.
+   * 
+   * @return the value set for rmi-server-port
+   *
+   * @since GemFire 6.5
+   */
+  public int getRmiServerPort() {
+    return this.rmiServerPort;
+  }
+
+  /**
+   * Sets the port of the RMI Connector Server.
+   * 
+   * @param port rmi-server-port to set.
+   *
+   * @since GemFire 6.5
+   */
+  public void setRmiServerPort(int port) {
+    checkReadOnly();
+    this.rmiServerPort = validateRmiServerPort(rmiServerPort);
+    configChanged();
+  }
+
+  public boolean isHttpEnabled() {
+    return this.httpEnabled;
+  }
+
+  public void setHttpEnabled(boolean httpEnabled) {
+    checkReadOnly();
+    this.httpEnabled = httpEnabled;
+    configChanged();
+  }
+
+  public int getHttpPort() {
+    return this.httpPort;
+  }
+
+  public void setHttpPort(int httpPort) {
+    checkReadOnly();
+    this.httpPort = validateHttpPort(httpPort);
+    configChanged();
+  }
+
+  public String getHttpBindAddress() {
+    return this.httpBindAddress;
+  }
+
+  public void setHttpBindAddress(String httpBindAddress) {
+    checkReadOnly();
+    this.httpBindAddress = validateHttpBindAddress(httpBindAddress);
+    configChanged();
+  }
+
+  public void setHttpBindAddress(InetAddress httpBindAddress) {
+    checkReadOnly();
+    this.httpBindAddress = validateHttpBindAddress(httpBindAddress);
+    configChanged();
+  }
+
+  public boolean getAutoConnect() {
+    return this.autoConnect;
+  }
+
+  public void setAutoConnect(boolean v) {
+    checkReadOnly();
+    this.autoConnect = v;
+    configChanged();
+  }
+
+  // -------------------------------------------------------------------------
+  // Implementation methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Initialize the values of this AgentConfig.
+   * 
+   * @param props the configuration values to use
+   */
+  private void initialize(Properties props) {
+    this.autoConnect = validateBoolean(props.getProperty(AUTO_CONNECT_NAME), DEFAULT_AUTO_CONNECT);
+
+    this.httpEnabled = validateBoolean(props.getProperty(HTTP_ENABLED_NAME), DEFAULT_HTTP_ENABLED);
+    this.httpBindAddress = validateHttpBindAddress(props.getProperty(HTTP_BIND_ADDRESS_NAME));
+    this.httpPort = validateHttpPort(props.getProperty(HTTP_PORT_NAME));
+
+    this.rmiEnabled = validateBoolean(props.getProperty(RMI_ENABLED_NAME), DEFAULT_RMI_ENABLED);
+    this.rmiRegistryEnabled =
+        validateBoolean(props.getProperty(RMI_REGISTRY_ENABLED_NAME), DEFAULT_RMI_REGISTRY_ENABLED);
+
+    this.rmiBindAddress = validateRmiBindAddress(props.getProperty(RMI_BIND_ADDRESS_NAME));
+    this.rmiPort = validateRmiPort(props.getProperty(RMI_PORT_NAME));
+    this.rmiServerPort = validateRmiServerPort(props.getProperty(RMI_SERVER_PORT_NAME));
+
+    this.snmpEnabled = validateBoolean(props.getProperty(SNMP_ENABLED_NAME), DEFAULT_SNMP_ENABLED);
+    this.snmpDirectory = validateSnmpDirectory(props.getProperty(SNMP_DIRECTORY_NAME));
+
+    this.agentSSLEnabled =
+        validateBoolean(props.getProperty(AGENT_SSL_ENABLED_NAME), DEFAULT_AGENT_SSL_ENABLED);
+    this.agentSSLProtocols = validateNonEmptyString(props.getProperty(AGENT_SSL_PROTOCOLS_NAME),
+        DEFAULT_AGENT_SSL_PROTOCOLS);
+    this.agentSSLCiphers = validateNonEmptyString(props.getProperty(AGENT_SSL_CIPHERS_NAME),
+        DEFAULT_AGENT_SSL_CIPHERS);
+    this.agentSSLRequireAuth =
+        validateBoolean(props.getProperty(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME),
+            DEFAULT_AGENT_SSL_REQUIRE_AUTHENTICATION);
+    this.httpSSLRequireAuth =
+        validateBoolean(props.getProperty(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME),
+            DEFAULT_HTTP_SSL_REQUIRE_AUTHENTICATION);
+
+    this.httpAuthEnabled = validateBoolean(props.getProperty(HTTP_AUTHENTICATION_ENABLED_NAME),
+        DEFAULT_HTTP_AUTHENTICATION_ENABLED);
+    this.httpAuthUser = validateNonEmptyString(props.getProperty(HTTP_AUTHENTICATION_USER_NAME),
+        DEFAULT_HTTP_AUTHENTICATION_USER);
+    this.httpAuthPassword = validateNonEmptyString(
+        props.getProperty(HTTP_AUTHENTICATION_PASSWORD_NAME), DEFAULT_HTTP_AUTHENTICATION_PASSWORD);
+
+    this.sslEnabled = validateBoolean(props.getProperty(CLUSTER_SSL_ENABLED), DEFAULT_SSL_ENABLED);
+    this.sslProtocols =
+        validateNonEmptyString(props.getProperty(CLUSTER_SSL_PROTOCOLS), DEFAULT_SSL_PROTOCOLS);
+    this.sslCiphers =
+        validateNonEmptyString(props.getProperty(CLUSTER_SSL_CIPHERS), DEFAULT_SSL_CIPHERS);
+    this.sslAuthenticationRequired = validateBoolean(
+        props.getProperty(CLUSTER_SSL_REQUIRE_AUTHENTICATION), DEFAULT_SSL_REQUIRE_AUTHENTICATION);
+    this.sslProperties = new Properties();
+    for (int i = 0; true; i++) {
+      String key = "ssl-property-" + i;
+      String value = props.getProperty(key);
+      if (value == null) {
+        break;
+      }
+      StringTokenizer st = new StringTokenizer(value, "=");
+      if (!st.hasMoreTokens()) {
+        break;
+      }
+      String propKey = st.nextToken();
+      if (!st.hasMoreTokens()) {
+        break;
+      }
+      String propValue = st.nextToken();
+      this.sslProperties.put(propKey, propValue);
+    }
+
+    this.isEmailNotificationEnabled =
+        validateBoolean(props.getProperty(AgentConfig.EMAIL_NOTIFICATIONS_ENABLED_NAME),
+            DEFAULT_EMAIL_NOTIFICATIONS_ENABLED);
+    this.emailNotificationHostName = validateNonEmptyString(
+        props.getProperty(AgentConfig.EMAIL_NOTIFICATIONS_HOST_NAME), DEFAULT_EMAIL_HOST);
+    this.emailNotificationFrom = validateNonEmptyString(
+        props.getProperty(AgentConfig.EMAIL_NOTIFICATIONS_FROM_NAME), DEFAULT_EMAIL_FROM);
+    this.emailNotificationToList = validateNonEmptyString(
+        props.getProperty(AgentConfig.EMAIL_NOTIFICATIONS_TO_LIST_NAME), DEFAULT_EMAIL_TO_LIST);
+
+    this.stateSaveFile = validateNonEmptyString(props.getProperty(AgentConfig.STATE_SAVE_FILE_NAME),
+        DEFAULT_STATE_SAVE_FILE);
+
+    try {
+      for (int i = 0; true; i++) {
+        String hostProp = props.getProperty(LOCATOR_HOST_NAME + i);
+        if (isEmpty(hostProp)) {
+          break;
+        }
+        String host = hostProp;
+        int port = Integer.parseInt(props.getProperty(LOCATOR_PORT_NAME + i));
+        File workDir =
+            validateWorkingDirectory(props.getProperty(LOCATOR_WORKING_DIRECTORY_NAME + i));
+        File prodDir = new File(
+            validateProductDirectory(props.getProperty(LOCATOR_PRODUCT_DIRECTORY_NAME + i)));
+        String remoteCmd = props.getProperty(LOCATOR_REMOTE_COMMAND + i);
+        String bindAddr = props.getProperty(LOCATOR_BIND_ADDRESS + i);
+
+        DistributionLocatorConfig config = this.createDistributionLocatorConfig();
+        config.setHost(host);
+        config.setPort(port);
+        config.setBindAddress(bindAddr);
+        config.setWorkingDirectory(workDir.getAbsolutePath());
+        config.setProductDirectory(prodDir.getAbsolutePath());
+        config.setRemoteCommand(remoteCmd);
+      }
+    } catch (IllegalArgumentException e) {
+      // This is how we break out of the loop? Yuck!
+      /*
+       * LogWriter is initialized afterwards. Hence printing the stack trace. This is done to avoid
+       * creation of duplicate log writer.
+       */
+      e.printStackTrace();
+    }
+  }
+
+  /**
+   * Filter all agent configuration attributes out of the given <code>Properties</code> object.
+   * <p/>
+   * 
+   * @param props the <code>Properties</code> object of filter agent configuration attributes out
+   *        of.
+   *
+   * @see AgentConfigImpl#_getPropertyDescription(String)
+   */
+  private static Properties filterOutAgentProperties(final Properties props) {
+    final Properties filteredProps = new Properties();
+
+    for (final Object key : props.keySet()) {
+      if (_getPropertyDescription(key.toString()) == null) {
+        final String value = props.getProperty(key.toString());
+        if (value != null) {
+          filteredProps.setProperty(key.toString(), value);
+        }
+      }
+    }
+
+    appendLogFileProperty(filteredProps);
+
+    return filteredProps;
+  }
+
+  /**
+   * Appends the log-file property to the Properties object if set of properties does not already
+   * define the log-file property or the gemfire.agent.log-file property.
+   * <p/>
+   * 
+   * @param props the <code>Properties</code> to append the log-file property to if the property
+   *        does not exist.
+   */
+  private static void appendLogFileProperty(final Properties props) {
+    if (!(props.containsKey(DistributedSystemConfig.LOG_FILE_NAME)
+        || props.containsKey(SYSTEM_PROPERTY_PREFIX + DistributedSystemConfig.LOG_FILE_NAME))) {
+      props.put(DistributedSystemConfig.LOG_FILE_NAME, DEFAULT_LOG_FILE);
+    }
+  }
+
+  /**
+   * Appends any additional property-file specified properties to the supplied Properties. If the
+   * supplied property overrides the property in the property-file, then property-file value is
+   * ignored. System Properties always override the supplied properties
+   * 
+   * @return appendedProps Properties appened to from the property-file if any
+   */
+  private static Properties appendOptionalPropertyFileProperties(final Properties props) {
+    final URL url = getPropertyFileURL(retrievePropertyFile());
+    final Properties appendedProps = new Properties();
+
+    appendedProps.putAll(props);
+
+    // first, get any property values set in the optional property file
+    if (url != null) {
+      InputStream in = null;
+
+      try {
+        in = url.openStream();
+
+        final Properties agentPropertyFileProperties = new Properties();
+
+        agentPropertyFileProperties.load(in);
+
+        // don't let any properties from the file override those on the command-line
+        for (final Object key : agentPropertyFileProperties.keySet()) {
+          if (props.getProperty(key.toString()) == null) {
+            appendedProps.setProperty(key.toString(),
+                agentPropertyFileProperties.getProperty(key.toString()));
+          }
+        }
+      } catch (IOException e) {
+        throw new GemFireIOException(
+            LocalizedStrings.AgentConfigImpl_FAILED_READING_0.toLocalizedString(url.toString()), e);
+      } finally {
+        IOUtils.close(in);
+      }
+    }
+
+    // last override values with those from the system properties
+    // TODO this is not exactly overriding!
+    for (final Object propSuffix : props.keySet()) {
+      final String key = SYSTEM_PROPERTY_PREFIX + propSuffix;
+      final String value = System.getProperty(key);
+
+      if (value != null) {
+        appendedProps.put(key, value);
+      }
+    }
+
+    return appendedProps;
+  }
+
+  /**
+   * Returns a description of the given agent config property
+   * 
+   * @throws IllegalArgumentException If <code>prop</code> is not a recognized agent configuration
+   *         property
+   */
+  public static String getPropertyDescription(String prop) {
+    if (prop.equals(LOG_FILE_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_NAME_OF_THE_AGENTS_LOG_FILE.toLocalizedString();
+    } else if (prop.equals(LOG_LEVEL_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_MINIMUM_LEVEL_OF_LOGGING_PERFORMED_BY_AGENT
+          .toLocalizedString();
+    } else if (prop.equals(AGENT_DEBUG)) {
+      return LocalizedStrings.AgentConfigImpl_WHETHER_THE_AGENT_SHOULD_PRINT_DEBUGGING_INFORMATION
+          .toLocalizedString();
+    } else if (prop.equals(LOG_DISK_SPACE_LIMIT_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_LIMIT_IN_MEGABYTES_OF_HOW_MUCH_DISK_SPACE_CAN_BE_CONSUMED_BY_OLD_INACTIVE_LOG_FILES
+          .toLocalizedString();
+    } else if (prop.equals(LOG_FILE_SIZE_LIMIT_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_LIMIT_IN_MEGABYTES_OF_HOW_LARGE_THE_CURRENT_STATISTIC_ARCHIVE_FILE_CAN_GROW_BEFORE_IT_IS_CLOSED_AND_ARCHIVAL_ROLLS_ON_TO_A_NEW_FILE
+          .toLocalizedString();
+    } else if (prop.equals(MCAST_PORT)) {
+      return LocalizedStrings.AgentConfigImpl_MULTICAST_PORT_USED_TO_CONNECT_TO_DISTRIBUTED_SYSTEM
+          .toLocalizedString();
+    } else if (prop.equals(MCAST_ADDRESS)) {
+      return LocalizedStrings.AgentConfigImpl_MULTICAST_ADDRESS_USED_TO_CONNECT_TO_DISTRIBUTED_SYSTEM
+          .toLocalizedString();
+    } else if (prop.equals(BIND_ADDRESS)) {
+      return LocalizedStrings.AgentConfigImpl_IP_ADDRESS_OF_THE_AGENTS_DISTRIBUTED_SYSTEM
+          .toLocalizedString();
+    } else if (prop.equals(TCP_PORT)) {
+      return LocalizedStrings.AgentConfigImpl_TCP_PORT.toLocalizedString();
+    } else if (prop.equals(LOCATORS)) {
+      return LocalizedStrings.AgentConfigImpl_ADDRESSES_OF_THE_LOCATORS_OF_THE_DISTRIBUTED_SYSTEM
+          .toLocalizedString();
+    } else if (prop.equals(MEMBERSHIP_PORT_RANGE_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_ALLOWED_RANGE_OF_UDP_PORTS_TO_FORM_UNIQUE_MEMBERSHIP_ID
+          .toLocalizedString();
+      // } else if (prop.equals(SYSTEM_ID_NAME)) {
+      // return "The id of the distributed system";
+    } else if (prop.equals(ENTITY_CONFIG_XML_FILE_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_XML_CONFIGURATION_FILE_FOR_MANAGED_ENTITIES
+          .toLocalizedString();
+    } else if (prop.equals(REFRESH_INTERVAL_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_REFRESH_INTERVAL_IN_SECONDS_FOR_AUTOREFRESH_OF_MEMBERS_AND_STATISTIC_RESOURCES
+          .toLocalizedString();
+    } else if (prop.equals(REMOTE_COMMAND_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_COMMAND_PREFIX_USED_FOR_LAUNCHING_MEMBERS_OF_THE_DISTRIBUTED_SYSTEM
+          .toLocalizedString();
+    } else if (prop.equals(CLUSTER_SSL_ENABLED)) {
+      return LocalizedStrings.AgentConfigImpl_DOES_THE_DISTRIBUTED_SYSTEM_COMMUNICATE_USING_SSL
+          .toLocalizedString();
+    } else if (prop.equals(CLUSTER_SSL_PROTOCOLS)) {
+      return LocalizedStrings.AgentConfigImpl_SSL_PROTOCOLS_USED_TO_COMMUNICATE_WITH_DISTRIBUTED_SYSTEM
+          .toLocalizedString();
+    } else if (prop.equals(CLUSTER_SSL_CIPHERS)) {
+      return LocalizedStrings.AgentConfigImpl_SSL_CIPHERS_USED_TO_COMMUNICATE_WITH_DISTRIBUTED_SYSTEM
+          .toLocalizedString();
+    } else if (prop.equals(CLUSTER_SSL_REQUIRE_AUTHENTICATION)) {
+      return LocalizedStrings.AgentConfigImpl_DOES_CONNECTING_TO_THE_DISTRIBUTED_SYSTEM_REQUIRE_SSL_AUTHENTICATION
+          .toLocalizedString();
+    } else {
+      String description = _getPropertyDescription(prop);
+      if (description == null) {
+        throw new IllegalArgumentException(
+            LocalizedStrings.AgentConfigImpl_UNKNOWN_CONFIG_PROPERTY_0.toLocalizedString(prop));
+
+      } else {
+        return description;
+      }
+    }
+  }
+
+  /**
+   * Returns a description of the given agent config property or <code>null</code> if
+   * <code>prop</code> is not a recognized agent property.
+   */
+  public static String _getPropertyDescription(String prop) {
+    if (prop.equals(AUTO_CONNECT_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_AUTOMATICALLY_CONNECT_TO_THE_DISTRIBUTED_SYSTEM
+          .toLocalizedString();
+
+      // } else if (prop.equals(SYSTEM_NAME_NAME)) {
+      // return "The logical name of the distributed system";
+
+    } else if (prop.equals(HTTP_ENABLED_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_START_THE_HTTP_JMX_ADAPTER
+          .toLocalizedString();
+
+    } else if (prop.equals(HTTP_BIND_ADDRESS_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_BIND_ADDRESS_OF_HTTP_ADAPTERS_SOCKETS
+          .toLocalizedString();
+
+    } else if (prop.equals(HTTP_PORT_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_THE_PORT_ON_WHICH_THE_HTTP_ADAPTER_WILL_BE_STARTED
+          .toLocalizedString();
+
+    } else if (prop.equals(RMI_ENABLED_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_START_THE_RMI_JMX_ADAPTER
+          .toLocalizedString();
+
+    } else if (prop.equals(RMI_REGISTRY_ENABLED_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_HOST_AN_RMI_REGISTRY
+          .toLocalizedString();
+
+    } else if (prop.equals(RMI_BIND_ADDRESS_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_BIND_ADDRESS_OF_RMI_ADAPTERS_SOCKETS
+          .toLocalizedString();
+
+    } else if (prop.equals(RMI_PORT_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_THE_PORT_ON_WHICH_TO_CONTACT_THE_RMI_REGISTER
+          .toLocalizedString();
+
+    } else if (prop.equals(RMI_SERVER_PORT_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_THE_PORT_USED_TO_CONFIGURE_RMI_CONNECTOR_SERVER
+          .toLocalizedString();
+
+    } else if (prop.equals(SNMP_ENABLED_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_START_THE_SNMP_JMX_ADAPTER
+          .toLocalizedString();
+
+    } else if (prop.equals(SNMP_BIND_ADDRESS_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_BIND_ADDRESS_OF_SNMP_ADAPTERS_SOCKETS
+          .toLocalizedString();
+
+    } else if (prop.equals(SNMP_DIRECTORY_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_THE_DIRECTORY_IN_WHICH_SNMP_CONFIGURATION_RESIDES
+          .toLocalizedString();
+
+    } else if (prop.equals(AGENT_SSL_ENABLED_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_COMMUNICATE_USING_SSL
+          .toLocalizedString();
+
+    } else if (prop.equals(AGENT_SSL_PROTOCOLS_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_THE_SSL_PROTOCOLS_USED_BY_THE_AGENT
+          .toLocalizedString();
+
+    } else if (prop.equals(AGENT_SSL_CIPHERS_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_THE_SSL_CIPHERS_USED_BY_THE_AGENT.toLocalizedString();
+
+    } else if (prop.equals(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_REQUIRE_SSL_AUTHENTICATION
+          .toLocalizedString();
+
+    } else if (prop.equals(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_WILL_THE_HTTP_ADAPTER_REQUIRE_SSL_AUTHENTICATION
+          .toLocalizedString();
+
+    } else if (prop.equals(HTTP_AUTHENTICATION_ENABLED_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_WILL_THE_HTTP_JMX_ADAPTER_USE_HTTP_AUTHENTICATION
+          .toLocalizedString();
+
+    } else if (prop.equals(HTTP_AUTHENTICATION_USER_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_THE_USER_NAME_FOR_AUTHENTICATION_IN_THE_HTTP_JMX_ADAPTER
+          .toLocalizedString();
+
+    } else if (prop.equals(HTTP_AUTHENTICATION_PASSWORD_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_THE_PASSWORD_FOR_AUTHENTICATION_IN_THE_HTTP_JMX_ADAPTER
+          .toLocalizedString();
+
+    } else if (prop.equals(PROPERTY_FILE_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_PROPERTY_FILE_FROM_WHICH_AGENT_READS_CONFIGURATION
+          .toLocalizedString();
+
+    } else if (prop.equals(LOCATOR_HOST_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_HOST_ON_WHICH_THE_DISTRIBUTED_SYSTEMS_LOCATOR_RUNS
+          .toLocalizedString();
+
+    } else if (prop.equals(LOCATOR_PORT_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_HOST_ON_WHICH_THE_DISTRIBUTED_SYSTEMS_LOCATOR_RUNS
+          .toLocalizedString();
+
+    } else if (prop.equals(LOCATOR_PRODUCT_DIRECTORY_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_GEMFIRE_PRODUCT_DIRECTORY_USED_TO_LAUNCH_A_LOCATOR
+          .toLocalizedString();
+
+    } else if (prop.equals(LOCATOR_WORKING_DIRECTORY_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_DIRECTORY_IN_WHICH_A_LOCATOR_WILL_BE_LAUNCHED
+          .toLocalizedString();
+
+    } else if (prop.equals(LOCATOR_REMOTE_COMMAND)) {
+      return LocalizedStrings.AgentConfigImpl_COMMAND_PREFIX_USED_WHEN_LAUNCHING_A_LOCATOR
+          .toLocalizedString();
+
+    } else if (prop.equals(LOCATOR_BIND_ADDRESS)) {
+      return LocalizedStrings.AgentConfigImpl_IP_ADDRESS_TO_USE_WHEN_CONTACTING_LOCATOR
+          .toLocalizedString();
+
+    } else if (prop.equals(LOCATOR_DS_PROPERTIES)) {
+      return LocalizedStrings.AgentConfigImpl_PROPERTIES_FOR_CONFIGURING_A_LOCATORS_DISTRIBUTED_SYSTEM
+          .toLocalizedString();
+
+    } else if (prop.equals(EMAIL_NOTIFICATIONS_ENABLED_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_IDENTIFY_IF_EMAIL_NOTIFICATIONS_ARE_ENABLED_OR_NOT
+          .toLocalizedString();
+
+    } else if (prop.equals(EMAIL_NOTIFICATIONS_FROM_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_IDENTIFY_THE_EMAIL_ADDRESS_USING_WHICH_EMAIL_NOTIFICATIONS_ARE_SENT
+          .toLocalizedString();
+
+    } else if (prop.equals(EMAIL_NOTIFICATIONS_HOST_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_IDENTIFY_THE_EMAIL_SERVER_HOST_USING_WHICH_EMAIL_NOTIFICATIONS_ARE_SENT
+          .toLocalizedString();
+
+    } else if (prop.equals(EMAIL_NOTIFICATIONS_TO_LIST_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_IDENTIFY_THE_COMMA_SEPARATED_EMAIL_ADDRESSES_LIST_TO_WHICH_EMAIL_NOTIFICATIONS_ARE_SENT
+          .toLocalizedString();
+
+    } else if (prop.equals(STATE_SAVE_FILE_NAME)) {
+      return LocalizedStrings.AgentConfigImpl_IDENTIFY_THE_NAME_OF_THE_FILE_TO_BE_USED_FOR_SAVING_AGENT_STATE
+          .toLocalizedString();
+
+    } else {
+      return null;
+    }
+  }
+
+  /**
+   * Parses the array of command-line arguments (format: key=value) into an instance of Properties.
+   * 
+   * @param args the command-line arguments to convert into a Properties
+   */
+  private static Properties toProperties(String[] args) {
+    Properties props = new Properties();
+    // loop all args and pick out key=value pairs...
+    for (int i = 0; i < args.length; i++) {
+      // VM args...
+      if (args[i].startsWith("-J")) {
+        int eq = args[i].indexOf("=");
+        String key = args[i].substring(2, eq);
+        String value = args[i].substring(eq + 1);
+        System.setProperty(key, value);
+      } else if (args[i].indexOf(AGENT_DEBUG) > 0) {
+        int eq = args[i].indexOf("=");
+        String key = args[i].substring(2, eq);
+        String value = args[i].substring(eq + 1);
+        System.setProperty(key, value);
+      }
+
+      // all other args
+      else if (args[i].indexOf("=") > 0) {
+        int eq = args[i].indexOf("=");
+        String key = args[i].substring(0, eq);
+        String value = args[i].substring(eq + 1);
+        props.setProperty(key, value);
+      }
+    }
+
+    return props;
+  }
+
+  /**
+   * Returns the original command-line arguments.
+   */
+  public String[] getOriginalArgs() {
+    return this.originalCmdLineArgs;
+  }
+
+  // -------------------------------------------------------------------------
+  // Validation methods for configuration options
+  // -------------------------------------------------------------------------
+
+  /**
+   * Makes sure that the mcast port and locators are correct and consistent.
+   * 
+   * @throws IllegalArgumentException If configuration is not valid
+   */
+  @Override
+  public void validate() {
+    super.validate();
+
+    if (this.httpPort < 0 || this.httpPort > MAX_HTTP_PORT) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
+              .toLocalizedString(new Object[] {HTTP_PORT_NAME, Integer.valueOf(MIN_HTTP_PORT),
+                  Integer.valueOf(MAX_HTTP_PORT)}));
+    }
+
+    if (this.rmiPort < 0 || this.rmiPort > MAX_RMI_PORT) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
+              .toLocalizedString(new Object[] {RMI_PORT_NAME, Integer.valueOf(MIN_RMI_PORT),
+                  Integer.valueOf(MAX_RMI_PORT)}));
+    }
+
+    if (this.rmiServerPort < 0 || this.rmiServerPort > MAX_RMI_PORT) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
+              .toLocalizedString(new Object[] {RMI_SERVER_PORT_NAME, Integer.valueOf(MIN_RMI_PORT),
+                  Integer.valueOf(MAX_RMI_PORT)}));
+    }
+
+  }
+
+  /**
+   * Returns defaultValue if value is empty.
+   */
+  private String validateNonEmptyString(String value, String defaultValue) {
+    return isEmpty(value) ? defaultValue : value;
+  }
+
+  /**
+   * Validates that systemHost can be used for an InetAddress.
+   */
+  private String validateSystemHost(String systemHost) {
+    return InetAddressUtil.validateHost(systemHost);
+  }
+
+  /**
+   * Returns null if productDir is empty; else converts it to File.
+   */
+  private String validateProductDirectory(String productDir) {
+    if (isEmpty(productDir)) {
+      return null;
+    }
+    return productDir;
+  }
+
+  /**
+   * Returns true if value parses as true; null value returns defaultValue.
+   */
+  private boolean validateBoolean(String value, boolean defaultValue) {
+    if (isEmpty(value)) {
+      return defaultValue;
+    }
+    return Boolean.valueOf(value).booleanValue();
+  }
+
+  // HttpAdaptor property validators...
+
+  /**
+   * Returns {@link AgentConfig#DEFAULT_HTTP_PORT} if httpPort is empty; else validates that it's an
+   * integer and returns the int form.
+   */
+  private int validateHttpPort(String val) {
+    if (isEmpty(val)) {
+      return DEFAULT_HTTP_PORT;
+    } else {
+      return validateHttpPort(Integer.parseInt(val));
+    }
+  }
+
+  /**
+   * Validates that httpPort is either zero or within the {@link AgentConfig#MIN_HTTP_PORT} and
+   * {@link AgentConfig#MAX_HTTP_PORT} values.
+   */
+  private int validateHttpPort(int val) {
+    if (val < 0 || val > MAX_HTTP_PORT) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
+              .toLocalizedString(new Object[] {HTTP_PORT_NAME, Integer.valueOf(MIN_HTTP_PORT),
+                  Integer.valueOf(MAX_HTTP_PORT)}));
+    }
+    return val;
+  }
+
+  /**
+   * Returns {@link AgentConfig#DEFAULT_HTTP_BIND_ADDRESS} unless httpBindAddress can be used to
+   * create a valid InetAddress.
+   */
+  private String validateHttpBindAddress(String val) {
+    String value = InetAddressUtil.validateHost(val);
+    if (value == null) {
+      return DEFAULT_HTTP_BIND_ADDRESS;
+    } else {
+      return value;
+    }
+  }
+
+  /**
+   * Validates that httpBindAddress is not null and then returns the string form of it.
+   */
+  private String validateHttpBindAddress(InetAddress val) {
+    if (val == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.AgentConfigImpl_HTTPBINDADDRESS_MUST_NOT_BE_NULL.toLocalizedString());
+    }
+    return toString("", val);
+  }
+
+  // SnmpAdaptor property validators...
+
+  /**
+   * Returns {@link AgentConfig#DEFAULT_SNMP_BIND_ADDRESS} unless snmpBindAddress can be used to
+   * create a valid InetAddress.
+   */
+  private String validateSnmpBindAddress(String val) {
+    String value = InetAddressUtil.validateHost(val);
+    if (value == null) {
+      return DEFAULT_SNMP_BIND_ADDRESS;
+    } else {
+      return value;
+    }
+  }
+
+  // /**
+  // * Validates that snmpBindAddress is not null and then returns the string form of it.
+  // */
+  // private String validateSnmpBindAddress(InetAddress snmpBindAddress) {
+  // if (snmpBindAddress == null) {
+  // throw new IllegalArgumentException("SnmpBindAddress must not be null");
+  // }
+  // return toString(snmpBindAddress);
+  // }
+
+  /**
+   * SnmpDirectory must be specified if SNMP is enabled. This directory must also exist.
+   */
+  private String validateSnmpDirectory(String snmpDir) {
+    /*
+     * if (isSnmpEnabled() && isEmpty(snmpDir)) { throw new
+     * IllegalArgumentException(LocalizedStrings.
+     * AgentConfigImpl_SNMPDIRECTORY_MUST_BE_SPECIFIED_BECAUSE_SNMP_IS_ENABLED.toLocalizedString());
+     * } File root new File(snmpDir); if (!root.exists()) throw new
+     * IllegalArgumentException(LocalizedStrings.AgentConfigImpl_SNMPDIRECTORY_DOES_NOT_EXIST.
+     * toLocalizedString());
+     */
+
+    return snmpDir;
+  }
+
+  // RMIConnectorServer property validators...
+
+  /**
+   * Returns {@link AgentConfig#DEFAULT_RMI_PORT} if rmiPort is empty; else validates that it's an
+   * integer and returns the int form.
+   */
+  private int validateRmiPort(String val) {
+    if (isEmpty(val)) {
+      return DEFAULT_RMI_PORT;
+    } else {
+      return validateRmiPort(Integer.parseInt(val));
+    }
+  }
+
+  /**
+   * Validates that rmiPort is either zero or within the {@link AgentConfig#MIN_RMI_PORT} and
+   * {@link AgentConfig#MAX_RMI_PORT} values.
+   */
+  private int validateRmiPort(int val) {
+    if (val < MIN_RMI_PORT || val > MAX_RMI_PORT) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
+              .toLocalizedString(new Object[] {RMI_PORT_NAME, Integer.valueOf(MIN_RMI_PORT),
+                  Integer.valueOf(MAX_RMI_PORT)}));
+    }
+    return val;
+  }
+
+  /**
+   * Returns {@link AgentConfig#DEFAULT_RMI_SERVER_PORT} if rmi-server-port is empty; else validates
+   * that it's an integer within the allowed range and returns the int form.
+   */
+  private int validateRmiServerPort(String val) {
+    if (isEmpty(val)) {
+      return DEFAULT_RMI_SERVER_PORT;
+    } else {
+      return validateRmiServerPort(Integer.parseInt(val));
+    }
+  }
+
+  /**
+   * Validates that rmiPort is either zero or within the {@link AgentConfig#MIN_RMI_PORT} and
+   * {@link AgentConfig#MAX_RMI_PORT} values.
+   */
+  private int validateRmiServerPort(int val) {
+    if (val < MIN_RMI_PORT || val > MAX_RMI_PORT) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
+              .toLocalizedString(new Object[] {RMI_SERVER_PORT_NAME, Integer.valueOf(MIN_RMI_PORT),
+                  Integer.valueOf(MAX_RMI_PORT)}));
+    }
+    return val;
+  }
+
+  /**
+   * Returns {@link AgentConfig#DEFAULT_RMI_BIND_ADDRESS} unless rmiBindAddress can be used to
+   * create a valid InetAddress.
+   */
+  private String validateRmiBindAddress(String val) {
+    String value = InetAddressUtil.validateHost(val);
+    if (value == null) {
+      return DEFAULT_RMI_BIND_ADDRESS;
+    } else {
+      return value;
+    }
+  }
+  // /**
+  // * Validates that rmiBindAddress is not null and then returns the string form of it.
+  // */
+  // private String validateRmiBindAddress(InetAddress rmiBindAddress) {
+  // if (rmiBindAddress == null) {
+  // throw new IllegalArgumentException("RmiBindAddress must not be null");
+  // }
+  // return toString(rmiBindAddress);
+  // }
+
+  /**
+   * Validates working directory is not null or empty.
+   */
+  private File validateWorkingDirectory(String workingDir) {
+    if (isEmpty(workingDir)) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.AgentConfigImpl_LOCATOR_WORKINGDIRECTORY_MUST_NOT_BE_NULL
+              .toLocalizedString());
+    }
+    return new File(workingDir);
+  }
+
+  // -------------------------------------------------------------------------
+  // Static utility methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Gets an <code>URL</code> for the property file, if one can be found, that the create method
+   * would use to determine the systemName and product home.
+   * <p>
+   * The file will be searched for, in order, in the following locations:
+   * <ol>
+   * <li>the current directory
+   * <li>the home directory
+   * <li>the class path
+   * </ol>
+   * Only the first file found will be used.
+   * 
+   * @return a <code>URL</code> that names the property file; otherwise Null if no property file was
+   *         found.
+   */
+  public static URL getPropertyFileURL(final String propFileLocation) {
+    File propFile = new File(propFileLocation);
+
+    // first, try the current directory...
+    if (propFile.exists()) {
+      propFile = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(propFile);
+
+      try {
+        return propFile.toURI().toURL();
+      } catch (java.net.MalformedURLException ignore) {
+      }
+    }
+
+    // next, try the user's home directory...
+    if (propFileLocation != null && propFileLocation.length() > 0) {
+      propFile = new File(System.getProperty("user.home"), propFileLocation);
+
+      if (propFile.exists()) {
+        propFile = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(propFile);
+
+        try {
+          return propFile.toURI().toURL();
+        } catch (java.net.MalformedURLException ignore) {
+        }
+      }
+    }
+
+    // finally, try the classpath...
+    return ClassPathLoader.getLatest().getResource(AgentConfigImpl.class, propFileLocation);
+  }
+
+  private static boolean okToDisplayPropertyValue(String attName) {
+    if (attName.startsWith(HTTP_AUTHENTICATION_USER_NAME)) {
+      return false;
+    }
+    if (attName.startsWith(HTTP_AUTHENTICATION_PASSWORD_NAME)) {
+      return false;
+    }
+    if (attName.startsWith(AGENT_SSL_PROTOCOLS_NAME)) {
+      return false;
+    }
+    if (attName.startsWith(AGENT_SSL_CIPHERS_NAME)) {
+      return false;
+    }
+    if (attName.toLowerCase().contains("javax.net.ssl")) {
+      return false;
+    }
+    if (attName.toLowerCase().contains("password")) {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Returns string representation of the specified object with special handling for InetAddress.
+   * 
+   * @param obj the object to convert to string
+   *
+   * @return string representation of the specified object
+   */
+  private static String toString(String attName, java.lang.Object obj) {
+    if (okToDisplayPropertyValue(attName)) {
+      if (obj == null) {
+        return "";
+      }
+      if (obj instanceof InetAddress) {
+        return InetAddressUtil.toString(obj);
+      }
+      return obj.toString();
+    } else {
+      return OBFUSCATED_STRING;
+    }
+  }
+
+  /**
+   * Returns string representation of the int.
+   */
+  private static String toString(String attName, int num) {
+    if (okToDisplayPropertyValue(attName)) {
+      return String.valueOf(num);
+    } else {
+      return OBFUSCATED_STRING;
+    }
+  }
+
+  /**
+   * Returns string representation of the boolean value.
+   */
+  private static String toString(String attName, boolean v) {
+    if (okToDisplayPropertyValue(attName)) {
+      return String.valueOf(v);
+    } else {
+      return OBFUSCATED_STRING;
+    }
+  }
+
+  /**
+   * Returns true if the string is null or empty.
+   */
+  public static boolean isEmpty(String string) {
+    return string == null || string.length() == 0;
+  }
+
+  // -------------------------------------------------------------------------
+  // SSL support...
+  // -------------------------------------------------------------------------
+  private boolean sslEnabled = DEFAULT_SSL_ENABLED;
+  private String sslProtocols = DEFAULT_SSL_PROTOCOLS;
+  private String sslCiphers = DEFAULT_SSL_CIPHERS;
+  private boolean sslAuthenticationRequired = DEFAULT_SSL_REQUIRE_AUTHENTICATION;
+  private Properties sslProperties = new Properties();
+
+  @Override
+  public boolean isSSLEnabled() {
+    return this.sslEnabled;
+  }
+
+  @Override
+  public void setSSLEnabled(boolean enabled) {
+    this.sslEnabled = enabled;
+    configChanged();
+  }
+
+  @Override
+  public String getSSLProtocols() {
+    return this.sslProtocols;
+  }
+
+  @Override
+  public void setSSLProtocols(String protocols) {
+    this.sslProtocols = protocols;
+    configChanged();
+  }
+
+  @Override
+  public String getSSLCiphers() {
+    return this.sslCiphers;
+  }
+
+  @Override
+  public void setSSLCiphers(String ciphers) {
+    this.sslCiphers = ciphers;
+    configChanged();
+  }
+
+  @Override
+  public boolean isSSLAuthenticationRequired() {
+    return this.sslAuthenticationRequired;
+  }
+
+  @Override
+  public void setSSLAuthenticationRequired(boolean authRequired) {
+    this.sslAuthenticationRequired = authRequired;
+    configChanged();
+  }
+
+  @Override
+  public Properties getSSLProperties() {
+    return this.sslProperties;
+  }
+
+  @Override
+  public void setSSLProperties(Properties sslProperties) {
+    this.sslProperties = sslProperties;
+    if (this.sslProperties == null) {
+      this.sslProperties = new Properties();
+    }
+    configChanged();
+  }
+
+  public String getStateSaveFile() {
+    return this.stateSaveFile;
+  }
+
+  public void setStateSaveFile(String file) {
+    checkReadOnly();
+    this.stateSaveFile = file;
+    configChanged();
+  }
+
+  public boolean isEmailNotificationEnabled() {
+    return this.isEmailNotificationEnabled;
+  }
+
+  public void setEmailNotificationEnabled(boolean enabled) {
+    checkReadOnly();
+    this.isEmailNotificationEnabled = enabled;
+    configChanged();
+  }
+
+  public String getEmailNotificationFrom() {
+    return this.emailNotificationFrom;
+  }
+
+  public void setEmailNotificationFrom(String emailID) {
+    this.emailNotificationFrom = emailID;
+    configChanged();
+  }
+
+  public String getEmailNotificationHost() {
+    return this.emailNotificationHostName;
+  }
+
+  public void setEmailNotificationHost(String hostName) {
+    this.emailNotificationHostName = hostName;
+    configChanged();
+  }
+
+  public String getEmailNotificationToList() {
+    return this.emailNotificationToList;
+  }
+
+  public void setEmailNotificationToList(String emailIDs) {
+    this.emailNotificationToList = emailIDs;
+    configChanged();
+  }
+
+  @Override
+  public Object clone() throws CloneNotSupportedException {
+    return super.clone();
+  }
+}
+


[27/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java
new file mode 100644
index 0000000..d38d5cb
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthConfigImpl.java
@@ -0,0 +1,53 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.DistributedSystemHealthConfig;
+
+/**
+ * The implementation of <code>DistributedSystemHealthConfig</code>. Note that because it never
+ * leaves the management VM, it is not <code>Serializable</code> and is not part of the
+ * {@link GemFireHealthConfigImpl} class hierarchy.
+ *
+ *
+ * @since GemFire 3.5
+ */
+public class DistributedSystemHealthConfigImpl implements DistributedSystemHealthConfig {
+
+  /**
+   * The maximum number of application members that can unexceptedly leave a healthy the distributed
+   * system.
+   */
+  private long maxDepartedApplications = DEFAULT_MAX_DEPARTED_APPLICATIONS;
+
+  ////////////////////// Constructors //////////////////////
+
+  /**
+   * Creates a new <code>DistributedSystemHealthConfigImpl</code> with the default configuration.
+   */
+  protected DistributedSystemHealthConfigImpl() {
+
+  }
+
+  ///////////////////// Instance Methods /////////////////////
+
+  public long getMaxDepartedApplications() {
+    return this.maxDepartedApplications;
+  }
+
+  public void setMaxDepartedApplications(long maxDepartedApplications) {
+    this.maxDepartedApplications = maxDepartedApplications;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java
new file mode 100644
index 0000000..5087933
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthEvaluator.java
@@ -0,0 +1,167 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.DistributedSystemHealthConfig;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.distributed.internal.MembershipListener;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Contains the logic for evaluating the health of an entire GemFire distributed system according to
+ * the thresholds provided in a {@link DistributedSystemHealthConfig}.
+ *
+ * <P>
+ *
+ * Note that unlike other evaluators, the <code>DistributedSystemHealthEvaluator</code> resides in
+ * the "administrator" VM and not in the member VMs. This is because there only needs to be one
+ * <code>DistributedSystemHealthEvaluator</code> per distributed system.
+ *
+ *
+ * @since GemFire 3.5
+ */
+class DistributedSystemHealthEvaluator extends AbstractHealthEvaluator
+    implements MembershipListener {
+
+  /** The config from which we get the evaluation criteria */
+  private DistributedSystemHealthConfig config;
+
+  /**
+   * The distribution manager with which this MembershipListener is registered
+   */
+  private DM dm;
+
+  /** The description of the distributed system being evaluated */
+  private String description;
+
+  /**
+   * The number of application members that have unexpectedly left since the previous evaluation
+   */
+  private int crashedApplications;
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>DistributedSystemHealthEvaluator</code>
+   */
+  DistributedSystemHealthEvaluator(DistributedSystemHealthConfig config, DM dm) {
+    super(null, dm);
+
+    this.config = config;
+    this.dm = dm;
+    this.dm.addMembershipListener(this);
+
+    StringBuffer sb = new StringBuffer();
+    sb.append("Distributed System ");
+
+    String desc = null;
+    if (dm instanceof DistributionManager) {
+      desc = ((DistributionManager) dm).getDistributionConfigDescription();
+    }
+
+    if (desc != null) {
+      sb.append(desc);
+
+    } else {
+      DistributionConfig dsc = dm.getSystem().getConfig();
+      String locators = dsc.getLocators();
+      if (locators == null || locators.equals("")) {
+        sb.append("using multicast ");
+        sb.append(dsc.getMcastAddress());
+        sb.append(":");
+        sb.append(dsc.getMcastPort());
+
+      } else {
+        sb.append("using locators ");
+        sb.append(locators);
+      }
+    }
+
+    this.description = sb.toString();
+  }
+
+  //////////////////// Instance Methods ////////////////////
+
+  @Override
+  protected String getDescription() {
+    return this.description;
+  }
+
+  /**
+   * Checks to make sure that the number of application members of the distributed system that have
+   * left unexpected since the last evaluation is less than the
+   * {@linkplain DistributedSystemHealthConfig#getMaxDepartedApplications threshold}. If not, the
+   * status is "poor" health.
+   */
+  void checkDepartedApplications(List status) {
+    synchronized (this) {
+      long threshold = this.config.getMaxDepartedApplications();
+      if (this.crashedApplications > threshold) {
+        String s =
+            LocalizedStrings.DistributedSystemHealth_THE_NUMBER_OF_APPLICATIONS_THAT_HAVE_LEFT_THE_DISTRIBUTED_SYSTEM_0_EXCEEDS_THE_THRESHOLD_1
+                .toLocalizedString(
+                    new Object[] {Long.valueOf(this.crashedApplications), Long.valueOf(threshold)});
+        status.add(poorHealth(s));
+      }
+      this.crashedApplications = 0;
+    }
+  }
+
+  @Override
+  protected void check(List status) {
+    checkDepartedApplications(status);
+  }
+
+  @Override
+  void close() {
+    this.dm.removeMembershipListener(this);
+  }
+
+  public void memberJoined(InternalDistributedMember id) {
+
+  }
+
+  /**
+   * Keeps track of which members depart unexpectedly
+   */
+  public void memberDeparted(InternalDistributedMember id, boolean crashed) {
+    if (!crashed)
+      return;
+    synchronized (this) {
+      int kind = id.getVmKind();
+      switch (kind) {
+        case DistributionManager.LOCATOR_DM_TYPE:
+        case DistributionManager.NORMAL_DM_TYPE:
+          this.crashedApplications++;
+          break;
+        default:
+          break;
+      }
+    } // synchronized
+  }
+
+  public void quorumLost(Set<InternalDistributedMember> failures,
+      List<InternalDistributedMember> remaining) {}
+
+  public void memberSuspect(InternalDistributedMember id, InternalDistributedMember whoSuspected,
+      String reason) {}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthMonitor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthMonitor.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthMonitor.java
new file mode 100644
index 0000000..5a6e660
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributedSystemHealthMonitor.java
@@ -0,0 +1,461 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.admin.api.GemFireMemberStatus;
+import org.apache.geode.internal.admin.api.RegionSubRegionSnapshot;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionAttributes;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.Config;
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.internal.admin.AdminBridgeServer;
+import org.apache.geode.internal.admin.CacheInfo;
+import org.apache.geode.internal.admin.DLockInfo;
+import org.apache.geode.internal.admin.GemFireVM;
+import org.apache.geode.internal.admin.GfManagerAgent;
+import org.apache.geode.internal.admin.HealthListener;
+import org.apache.geode.internal.admin.Stat;
+import org.apache.geode.internal.admin.StatAlertDefinition;
+import org.apache.geode.internal.admin.StatListener;
+import org.apache.geode.internal.admin.StatResource;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.LoggingThreadGroup;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+
+/**
+ * A thread that monitors the health of the distributed system. It is kind of like a
+ * {@link org.apache.geode.distributed.internal.HealthMonitorImpl}. In order to get it to place nice
+ * with the rest of the health monitoring APIs, this class pretends that it is a
+ * <code>GemFireVM</code>. Kind of hokey, but it beats a bunch of special-case code.
+ *
+ *
+ * @since GemFire 3.5
+ */
+class DistributedSystemHealthMonitor implements Runnable, GemFireVM {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /** Evaluates the health of the distributed system */
+  private DistributedSystemHealthEvaluator eval;
+
+  /** Notified when the health of the distributed system changes */
+  private GemFireHealthImpl healthImpl;
+
+  /** The number of seconds between health checks */
+  private int interval;
+
+  /** The thread in which the monitoring occurs */
+  private Thread thread;
+
+  /** Has this monitor been asked to stop? */
+  private volatile boolean stopRequested = false;
+
+  /** The health of the distributed system the last time we checked. */
+  private GemFireHealth.Health prevHealth = GemFireHealth.GOOD_HEALTH;
+
+  /**
+   * The most recent <code>OKAY_HEALTH</code> diagnoses of the GemFire system
+   */
+  private List okayDiagnoses;
+
+  /**
+   * The most recent <code>POOR_HEALTH</code> diagnoses of the GemFire system
+   */
+  private List poorDiagnoses;
+
+  ////////////////////// Constructors //////////////////////
+
+  /**
+   * Creates a new <code>DistributedSystemHealthMonitor</code> that evaluates the health of the
+   * distributed system against the given thresholds once every <code>interval</code> seconds.
+   *
+   * @param eval Used to evaluate the health of the distributed system
+   * @param healthImpl Receives callbacks when the health of the distributed system changes
+   * @param interval How often the health is checked
+   */
+  DistributedSystemHealthMonitor(DistributedSystemHealthEvaluator eval,
+      GemFireHealthImpl healthImpl, int interval) {
+    this.eval = eval;
+    this.healthImpl = healthImpl;
+    this.interval = interval;
+    this.okayDiagnoses = new ArrayList();
+    this.poorDiagnoses = new ArrayList();
+
+    ThreadGroup group = LoggingThreadGroup.createThreadGroup(
+        LocalizedStrings.DistributedSystemHealthMonitor_HEALTH_MONITORS.toLocalizedString(),
+        logger);
+    String name = LocalizedStrings.DistributedSystemHealthMonitor_HEALTH_MONITOR_FOR_0
+        .toLocalizedString(eval.getDescription());
+    this.thread = new Thread(group, this, name);
+    this.thread.setDaemon(true);
+  }
+
+  /**
+   * Does the work of monitoring the health of the distributed system.
+   */
+  public void run() {
+    if (logger.isDebugEnabled()) {
+      logger.debug("Monitoring health of {} every {} seconds", this.eval.getDescription(),
+          interval);
+    }
+
+    while (!this.stopRequested) {
+      SystemFailure.checkFailure();
+      try {
+        Thread.sleep(interval * 1000);
+        List status = new ArrayList();
+        eval.evaluate(status);
+
+        GemFireHealth.Health overallHealth = GemFireHealth.GOOD_HEALTH;
+        this.okayDiagnoses.clear();
+        this.poorDiagnoses.clear();
+
+        for (Iterator iter = status.iterator(); iter.hasNext();) {
+          AbstractHealthEvaluator.HealthStatus health =
+              (AbstractHealthEvaluator.HealthStatus) iter.next();
+          if (overallHealth == GemFireHealth.GOOD_HEALTH) {
+            if ((health.getHealthCode() != GemFireHealth.GOOD_HEALTH)) {
+              overallHealth = health.getHealthCode();
+            }
+
+          } else if (overallHealth == GemFireHealth.OKAY_HEALTH) {
+            if (health.getHealthCode() == GemFireHealth.POOR_HEALTH) {
+              overallHealth = GemFireHealth.POOR_HEALTH;
+            }
+          }
+
+          GemFireHealth.Health healthCode = health.getHealthCode();
+          if (healthCode == GemFireHealth.OKAY_HEALTH) {
+            this.okayDiagnoses.add(health.getDiagnosis());
+
+          } else if (healthCode == GemFireHealth.POOR_HEALTH) {
+            this.poorDiagnoses.add(health.getDiagnosis());
+            break;
+          }
+        }
+
+        if (overallHealth != prevHealth) {
+          healthImpl.healthChanged(this, overallHealth);
+          this.prevHealth = overallHealth;
+        }
+
+      } catch (InterruptedException ex) {
+        // We're all done
+        // No need to reset the interrupted flag, since we're going to exit.
+        break;
+      }
+    }
+
+    eval.close();
+    if (logger.isDebugEnabled()) {
+      logger.debug("Stopped checking for distributed system health");
+    }
+  }
+
+  /**
+   * Starts this <code>DistributedSystemHealthMonitor</code>
+   */
+  void start() {
+    this.thread.start();
+  }
+
+  /**
+   * Stops this <code>DistributedSystemHealthMonitor</code>
+   */
+  void stop() {
+    if (this.thread.isAlive()) {
+      this.stopRequested = true;
+      this.thread.interrupt();
+      this.healthImpl.nodeLeft(null, this);
+
+      try {
+        this.thread.join();
+      } catch (InterruptedException ex) {
+        Thread.currentThread().interrupt();
+        logger.warn(
+            LocalizedMessage.create(
+                LocalizedStrings.DistributedSystemHealthMonitor_INTERRUPTED_WHILE_STOPPING_HEALTH_MONITOR_THREAD),
+            ex);
+      }
+    }
+  }
+
+  ////////////////////// GemFireVM Methods //////////////////////
+
+  public java.net.InetAddress getHost() {
+    try {
+      return SocketCreator.getLocalHost();
+
+    } catch (Exception ex) {
+      throw new org.apache.geode.InternalGemFireException(
+          LocalizedStrings.DistributedSystemHealthMonitor_COULD_NOT_GET_LOCALHOST
+              .toLocalizedString());
+    }
+  }
+
+  public String getName() {
+    // return getId().toString();
+    throw new UnsupportedOperationException("Not a real GemFireVM");
+  }
+
+  public java.io.File getWorkingDirectory() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public java.io.File getGemFireDir() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public java.util.Date getBirthDate() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public Properties getLicenseInfo() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public GemFireMemberStatus getSnapshot() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public RegionSubRegionSnapshot getRegionSnapshot() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public StatResource[] getStats(String statisticsTypeName) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public StatResource[] getAllStats() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public DLockInfo[] getDistributedLockInfo() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public void addStatListener(StatListener observer, StatResource observedResource,
+      Stat observedStat) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public void removeStatListener(StatListener observer) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public void addHealthListener(HealthListener observer, GemFireHealthConfig cfg) {
+
+  }
+
+  public void removeHealthListener() {
+
+  }
+
+  public void resetHealthStatus() {
+    this.prevHealth = GemFireHealth.GOOD_HEALTH;
+  }
+
+  public String[] getHealthDiagnosis(GemFireHealth.Health healthCode) {
+    if (healthCode == GemFireHealth.GOOD_HEALTH) {
+      return new String[0];
+
+    } else if (healthCode == GemFireHealth.OKAY_HEALTH) {
+      String[] array = new String[this.okayDiagnoses.size()];
+      this.okayDiagnoses.toArray(array);
+      return array;
+
+    } else {
+      Assert.assertTrue(healthCode == GemFireHealth.POOR_HEALTH);
+      String[] array = new String[this.poorDiagnoses.size()];
+      this.poorDiagnoses.toArray(array);
+      return array;
+    }
+  }
+
+  public Config getConfig() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public void setConfig(Config cfg) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public GfManagerAgent getManagerAgent() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public String[] getSystemLogs() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public void setInspectionClasspath(String classpath) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public String getInspectionClasspath() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public Region[] getRootRegions() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public Region getRegion(CacheInfo c, String path) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public Region createVMRootRegion(CacheInfo c, String name, RegionAttributes attrs) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public Region createSubregion(CacheInfo c, String parentPath, String name,
+      RegionAttributes attrs) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public void setCacheInspectionMode(int mode) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public int getCacheInspectionMode() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public void takeRegionSnapshot(String regionName, int snapshotId) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public InternalDistributedMember getId() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public CacheInfo getCacheInfo() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public String getVersionInfo() {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public CacheInfo setCacheLockTimeout(CacheInfo c, int v) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public CacheInfo setCacheLockLease(CacheInfo c, int v) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public CacheInfo setCacheSearchTimeout(CacheInfo c, int v) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public AdminBridgeServer addCacheServer(CacheInfo cache) throws AdminException {
+
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public AdminBridgeServer getBridgeInfo(CacheInfo cache, int id) throws AdminException {
+
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public AdminBridgeServer startBridgeServer(CacheInfo cache, AdminBridgeServer bridge)
+      throws AdminException {
+
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  public AdminBridgeServer stopBridgeServer(CacheInfo cache, AdminBridgeServer bridge)
+      throws AdminException {
+
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  /**
+   * This operation is not supported for this object. Will throw UnsupportedOperationException if
+   * invoked.
+   */
+  public void setAlertsManager(StatAlertDefinition[] alertDefs, long refreshInterval,
+      boolean setRemotely) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  /**
+   * This operation is not supported for this object. Will throw UnsupportedOperationException if
+   * invoked.
+   */
+  public void setRefreshInterval(long refreshInterval) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+
+  /**
+   * This operation is not supported for this object. Will throw UnsupportedOperationException if
+   * invoked.
+   */
+  public void updateAlertDefinitions(StatAlertDefinition[] alertDefs, int actionCode) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributedSystemHealthMonitor_NOT_A_REAL_GEMFIREVM.toLocalizedString());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributionLocatorConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributionLocatorConfigImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributionLocatorConfigImpl.java
new file mode 100644
index 0000000..9dcd16f
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributionLocatorConfigImpl.java
@@ -0,0 +1,187 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.DistributionLocator;
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.distributed.internal.tcpserver.*;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+import java.net.InetAddress;
+import java.util.Properties;
+
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+
+/**
+ * Provides an implementation of <code>DistributionLocatorConfig</code>.
+ *
+ * @since GemFire 4.0
+ */
+public class DistributionLocatorConfigImpl extends ManagedEntityConfigImpl
+    implements DistributionLocatorConfig {
+
+  /** The minimum networking port (0) */
+  public static final int MIN_PORT = 0;
+
+  /** The maximum networking port (65535) */
+  public static final int MAX_PORT = 65535;
+
+  ////////////////////// Instance Fields //////////////////////
+
+  /** The port on which this locator listens */
+  private int port;
+
+  /** The address to bind to on a multi-homed host */
+  private String bindAddress;
+
+  /**
+   * The properties used to configure the DistributionLocator's DistributedSystem
+   */
+  private Properties dsProperties;
+
+  /** The DistributionLocator that was created with this config */
+  private DistributionLocator locator;
+
+  ////////////////////// Static Methods //////////////////////
+
+  /**
+   * Contacts a distribution locator on the given host and port and creates a
+   * <code>DistributionLocatorConfig</code> for it.
+   *
+   * @see TcpClient#getLocatorInfo
+   *
+   * @return <code>null</code> if the locator cannot be contacted
+   */
+  static DistributionLocatorConfig createConfigFor(String host, int port, InetAddress bindAddress) {
+    TcpClient client = new TcpClient();
+    String[] info = null;
+    if (bindAddress != null) {
+      info = client.getInfo(bindAddress, port);
+    } else {
+      info = client.getInfo(InetAddressUtil.toInetAddress(host), port);
+    }
+    if (info == null) {
+      return null;
+    }
+
+    DistributionLocatorConfigImpl config = new DistributionLocatorConfigImpl();
+    config.setHost(host);
+    config.setPort(port);
+    if (bindAddress != null) {
+      config.setBindAddress(bindAddress.getHostAddress());
+    }
+    config.setWorkingDirectory(info[0]);
+    config.setProductDirectory(info[1]);
+
+    return config;
+  }
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>DistributionLocatorConfigImpl</code> with the default settings.
+   */
+  public DistributionLocatorConfigImpl() {
+    this.port = 0;
+    this.bindAddress = null;
+    this.locator = null;
+    this.dsProperties = new java.util.Properties();
+    this.dsProperties.setProperty(MCAST_PORT, "0");
+  }
+
+  ///////////////////// Instance Methods /////////////////////
+
+  /**
+   * Sets the locator that was configured with this <Code>DistributionLocatorConfigImpl</code>.
+   */
+  void setLocator(DistributionLocator locator) {
+    this.locator = locator;
+  }
+
+  @Override
+  protected boolean isReadOnly() {
+    return this.locator != null && this.locator.isRunning();
+  }
+
+  public int getPort() {
+    return this.port;
+  }
+
+  public void setPort(int port) {
+    checkReadOnly();
+    this.port = port;
+    configChanged();
+  }
+
+  public String getBindAddress() {
+    return this.bindAddress;
+  }
+
+  public void setBindAddress(String bindAddress) {
+    checkReadOnly();
+    this.bindAddress = bindAddress;
+    configChanged();
+  }
+
+  public void setDistributedSystemProperties(Properties props) {
+    this.dsProperties = props;
+  }
+
+  public Properties getDistributedSystemProperties() {
+    return this.dsProperties;
+  }
+
+  @Override
+  public void validate() {
+    super.validate();
+
+    if (port < MIN_PORT || port > MAX_PORT) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.DistributionLocatorConfigImpl_PORT_0_MUST_BE_AN_INTEGER_BETWEEN_1_AND_2
+              .toLocalizedString(new Object[] {Integer.valueOf(port), Integer.valueOf(MIN_PORT),
+                  Integer.valueOf(MAX_PORT)}));
+    }
+
+    if (this.bindAddress != null && InetAddressUtil.validateHost(this.bindAddress) == null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.DistributionLocatorConfigImpl_INVALID_HOST_0
+              .toLocalizedString(this.bindAddress));
+    }
+  }
+
+  /**
+   * Currently, listeners are not supported on the locator config.
+   */
+  @Override
+  protected void configChanged() {
+
+  }
+
+  @Override
+  public Object clone() throws CloneNotSupportedException {
+    DistributionLocatorConfigImpl clone = (DistributionLocatorConfigImpl) super.clone();
+    clone.locator = null;
+    return clone;
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append("DistributionLocatorConfig: host=").append(getHost());
+    sb.append(", bindAddress=").append(getBindAddress());
+    sb.append(", port=").append(getPort());
+    return sb.toString();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributionLocatorImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributionLocatorImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributionLocatorImpl.java
new file mode 100755
index 0000000..ccfbcac
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/DistributionLocatorImpl.java
@@ -0,0 +1,329 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.DistributionLocator;
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.admin.remote.DistributionLocatorId;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.logging.log4j.Logger;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.*;
+
+/**
+ * Default administrative implementation of a DistributionLocator.
+ *
+ * @since GemFire 3.5
+ */
+public class DistributionLocatorImpl implements DistributionLocator, InternalManagedEntity {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /**
+   * How many new <code>DistributionLocator</code>s have been created?
+   */
+  private static int newLocators = 0;
+
+  //////////////////// Instance Fields ////////////////////
+
+  /**
+   * The configuration object for this locator
+   */
+  private final DistributionLocatorConfigImpl config;
+
+  /**
+   * The id of this distribution locator
+   */
+  private final String id;
+
+  /**
+   * Used to control the actual DistributionLocator service
+   */
+  private ManagedEntityController controller;
+
+  /**
+   * The system that this locator is a part of
+   */
+  private AdminDistributedSystemImpl system;
+
+  // -------------------------------------------------------------------------
+  // constructor(s)...
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs new instance of <code>DistributionLocatorImpl</code> that is a member of the given
+   * distributed system.
+   */
+  public DistributionLocatorImpl(DistributionLocatorConfig config,
+      AdminDistributedSystemImpl system) {
+    this.config = (DistributionLocatorConfigImpl) config;
+    this.config.validate();
+    this.config.setManagedEntity(this);
+    this.id = getNewId();
+    this.controller = system.getEntityController();
+    this.system = system;
+  }
+
+  // -------------------------------------------------------------------------
+  // Attribute accessors/mutators...
+  // -------------------------------------------------------------------------
+
+  public String getId() {
+    return this.id;
+  }
+
+  public String getNewId() {
+    synchronized (DistributionLocatorImpl.class) {
+      return "Locator" + (++newLocators);
+    }
+  }
+
+  /**
+   * Returns the configuration object for this locator.
+   *
+   * @since GemFire 4.0
+   */
+  public DistributionLocatorConfig getConfig() {
+    return this.config;
+  }
+
+  public AdminDistributedSystem getDistributedSystem() {
+    return this.system;
+  }
+
+  /**
+   * Unfortunately, it doesn't make much sense to maintain the state of a locator. The admin API
+   * does not receive notification when the locator actually starts and stops. If we try to guess,
+   * we'll just end up with race conditions galore. So, we can't fix bug 32455 for locators.
+   */
+  public int setState(int state) {
+    throw new UnsupportedOperationException(
+        LocalizedStrings.DistributionLocatorImpl_CAN_NOT_SET_THE_STATE_OF_A_LOCATOR
+            .toLocalizedString());
+  }
+
+  // -------------------------------------------------------------------------
+  // Operations...
+  // -------------------------------------------------------------------------
+
+  /**
+   * Polls to determine whether or not this managed entity has started.
+   */
+  public boolean waitToStart(long timeout) throws InterruptedException {
+
+    if (Thread.interrupted())
+      throw new InterruptedException();
+
+    long start = System.currentTimeMillis();
+    while (System.currentTimeMillis() - start < timeout) {
+      if (this.isRunning()) {
+        return true;
+
+      } else {
+        Thread.sleep(100);
+      }
+    }
+
+    logger.info(
+        LocalizedMessage.create(LocalizedStrings.DistributionLocatorImpl_DONE_WAITING_FOR_LOCATOR));
+    return this.isRunning();
+  }
+
+  /**
+   * Polls to determine whether or not this managed entity has stopped.
+   */
+  public boolean waitToStop(long timeout) throws InterruptedException {
+
+    if (Thread.interrupted())
+      throw new InterruptedException();
+
+    long start = System.currentTimeMillis();
+    while (System.currentTimeMillis() - start < timeout) {
+      if (!this.isRunning()) {
+        return true;
+
+      } else {
+        Thread.sleep(100);
+      }
+    }
+
+    return !this.isRunning();
+  }
+
+  public boolean isRunning() {
+    DM dm = ((AdminDistributedSystemImpl) getDistributedSystem()).getDistributionManager();
+    if (dm == null) {
+      try {
+        return this.controller.isRunning(this);
+      } catch (IllegalStateException e) {
+        return false;
+      }
+    }
+
+    String host = getConfig().getHost();
+    int port = getConfig().getPort();
+    String bindAddress = getConfig().getBindAddress();
+
+    boolean found = false;
+    Map<InternalDistributedMember, Collection<String>> hostedLocators = dm.getAllHostedLocators();
+    for (Iterator<InternalDistributedMember> memberIter =
+        hostedLocators.keySet().iterator(); memberIter.hasNext();) {
+      for (Iterator<String> locatorIter =
+          hostedLocators.get(memberIter.next()).iterator(); locatorIter.hasNext();) {
+        DistributionLocatorId locator = new DistributionLocatorId(locatorIter.next());
+        found = found || locator.getHost().getHostAddress().equals(host);
+        found = found || locator.getHost().getHostName().equals(host);
+        if (!found && !host.contains(".")) {
+          try {
+            InetAddress inetAddr = InetAddress.getByName(host);
+            found = locator.getHost().getHostName().equals(inetAddr.getHostName());
+            if (!found) {
+              found = locator.getHost().getHostAddress().equals(inetAddr.getHostAddress());
+            }
+          } catch (UnknownHostException e) {
+            // try config host as if it is an IP address instead of host name
+          }
+        }
+        if (locator.getBindAddress() != null && !locator.getBindAddress().isEmpty()
+            && bindAddress != null && !bindAddress.isEmpty()) {
+          found = found && locator.getBindAddress().equals(bindAddress);
+        }
+        found = found && locator.getPort() == port;
+        if (found) {
+          return true;
+        }
+      }
+    }
+    return found;
+  }
+
+  public void start() {
+    this.config.validate();
+    this.controller.start(this);
+    this.config.setLocator(this);
+    this.system.updateLocatorsString();
+  }
+
+  public void stop() {
+    this.controller.stop(this);
+    this.config.setLocator(null);
+  }
+
+  public String getLog() {
+    return this.controller.getLog(this);
+  }
+
+  /**
+   * Returns a string representation of the object.
+   *
+   * @return a string representation of the object
+   */
+  @Override
+  public String toString() {
+    return "DistributionLocator " + getId();
+  }
+
+  //////////////////////// Command execution ////////////////////////
+
+  public ManagedEntityConfig getEntityConfig() {
+    return this.getConfig();
+  }
+
+  public String getEntityType() {
+    return "Locator";
+  }
+
+  public String getStartCommand() {
+    StringBuffer sb = new StringBuffer();
+    sb.append(this.controller.getProductExecutable(this, "gemfire"));
+    sb.append(" start-locator -q -dir=");
+    sb.append(this.getConfig().getWorkingDirectory());
+    sb.append(" -port=");
+    sb.append(this.getConfig().getPort());
+    Properties props = config.getDistributedSystemProperties();
+    Enumeration en = props.propertyNames();
+    while (en.hasMoreElements()) {
+      String pn = (String) en.nextElement();
+      sb.append(" -D" + DistributionConfig.GEMFIRE_PREFIX + "" + pn + "=" + props.getProperty(pn));
+    }
+
+    String bindAddress = this.getConfig().getBindAddress();
+    if (bindAddress != null && bindAddress.length() > 0) {
+      sb.append(" -address=");
+      sb.append(this.getConfig().getBindAddress());
+    }
+    sb.append(" ");
+
+    String sslArgs = this.controller.buildSSLArguments(this.system.getConfig());
+    if (sslArgs != null) {
+      sb.append(sslArgs);
+    }
+
+    return sb.toString().trim();
+  }
+
+  public String getStopCommand() {
+    StringBuffer sb = new StringBuffer();
+    sb.append(this.controller.getProductExecutable(this, "gemfire"));
+    sb.append(" stop-locator -q -dir=");
+    sb.append(this.getConfig().getWorkingDirectory());
+    sb.append(" -port=");
+    sb.append(this.getConfig().getPort());
+
+    String bindAddress = this.getConfig().getBindAddress();
+    if (bindAddress != null && bindAddress.length() > 0) {
+      sb.append(" -address=");
+      sb.append(this.getConfig().getBindAddress());
+    }
+    sb.append(" ");
+
+    String sslArgs = this.controller.buildSSLArguments(this.system.getConfig());
+    if (sslArgs != null) {
+      sb.append(sslArgs);
+    }
+
+    return sb.toString().trim();
+  }
+
+  public String getIsRunningCommand() {
+    StringBuffer sb = new StringBuffer();
+    sb.append(this.controller.getProductExecutable(this, "gemfire"));
+    sb.append(" status-locator -dir=");
+    sb.append(this.getConfig().getWorkingDirectory());
+
+    return sb.toString().trim();
+  }
+
+  public String getLogCommand() {
+    StringBuffer sb = new StringBuffer();
+    sb.append(this.controller.getProductExecutable(this, "gemfire"));
+    sb.append(" tail-locator-log -dir=");
+    sb.append(this.getConfig().getWorkingDirectory());
+
+    return sb.toString().trim();
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/EnabledManagedEntityController.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/EnabledManagedEntityController.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/EnabledManagedEntityController.java
new file mode 100755
index 0000000..554d160
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/EnabledManagedEntityController.java
@@ -0,0 +1,385 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.ManagedEntity;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.internal.ProcessOutputReader;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.LoggingThreadGroup;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.logging.log4j.Logger;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.Properties;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+
+/**
+ * Implements the actual administration (starting, stopping, etc.) of GemFire
+ * {@link ManagedEntity}s. It {@link Runtime#exec(java.lang.String) executes} commands to administer
+ * the entities based on information provided by the {@link InternalManagedEntity} object. Note that
+ * it does not use <code>SystemAdmin</code> to manage "local" entities; it always execs the scripts.
+ *
+ * <P>
+ *
+ * This class is a refactoring of <code>Systemcontroller</code>, <code>RemoteCommand</code>, and
+ * <code>LocatorRemoteCommand</code>.
+ *
+ * @since GemFire 4.0
+ */
+class EnabledManagedEntityController implements ManagedEntityController {
+  private static final Logger logger = LogService.getLogger();
+
+  // /** A lock to ensure that only entity is managed at a time. See bug
+  // * 31374. */
+  // private static Object startStopLock = new Object();
+
+  /** Known strings found in output indicating error. */
+  private static final String[] ERROR_OUTPUTS = new String[] {"No such file or directory",
+      "The system cannot find the file specified.", "Access is denied.", "cannot open", "ERROR"};
+
+  /** Token in command prefix to be replaced with actual HOST */
+  private static final String HOST = "{HOST}";
+
+  /** Token in command prefix to be replaced with actual execution CMD */
+  private static final String CMD = "{CMD}";
+
+  ////////////////////// Instance Fields //////////////////////
+
+  /**
+   * The thread group in which threads launched by this system controller reside.
+   */
+  private final ThreadGroup threadGroup;
+
+  /** System to which the managed entities belong */
+  private final AdminDistributedSystem system;
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>ManagedEntityController</code> for entities in the given distributed
+   * system.
+   */
+  EnabledManagedEntityController(AdminDistributedSystem system) {
+    this.system = system;
+    this.threadGroup =
+        LoggingThreadGroup.createThreadGroup("ManagedEntityController threads", logger);
+  }
+
+  ///////////////////// Instance Methods /////////////////////
+
+  /**
+   * Returns <code>true</code> if the <code>output</code> string contains a known error message.
+   */
+  private boolean outputIsError(String output) {
+    if (output == null)
+      return false;
+    boolean error = false;
+    for (int i = 0; i < ERROR_OUTPUTS.length; i++) {
+      error = output.indexOf(ERROR_OUTPUTS[i]) > -1;
+      if (error)
+        return error;
+    }
+    return error;
+  }
+
+  /**
+   * Executes a command using {@link Runtime#exec(java.lang.String)}.
+   *
+   * @param command The full command to remotely execute
+   *
+   * @return Output from the command that was executed or <code>null</code> if the executing the
+   *         command failed.
+   */
+  protected String execute(String command, InternalManagedEntity entity) {
+    /*
+     * TODO: this is getting ugly... clients of this method really need to have the ability to do
+     * their own parsing/checking of 'output'
+     */
+    if (command == null || command.length() == 0) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.ManagedEntityController_EXECUTION_COMMAND_IS_EMPTY.toLocalizedString());
+    }
+
+    File workingDir = new File(entity.getEntityConfig().getWorkingDirectory());
+    logger.info(LocalizedMessage.create(
+        LocalizedStrings.ManagedEntityController_EXECUTING_REMOTE_COMMAND_0_IN_DIRECTORY_1,
+        new Object[] {command, workingDir}));
+    Process p = null;
+    try {
+      p = Runtime.getRuntime().exec(command, null /* env */, workingDir);
+
+    } catch (java.io.IOException e) {
+      logger.fatal(LocalizedMessage
+          .create(LocalizedStrings.ManagedEntityController_WHILE_EXECUTING_0, command), e);
+      return null;
+    }
+
+    final ProcessOutputReader pos = new ProcessOutputReader(p);
+    int retCode = pos.getExitCode();
+    final String output = pos.getOutput();
+    logger.info(
+        LocalizedMessage.create(LocalizedStrings.ManagedEntityController_RESULT_OF_EXECUTING_0_IS_1,
+            new Object[] {command, Integer.valueOf(retCode)}));
+    logger.info(LocalizedMessage.create(LocalizedStrings.ManagedEntityController_OUTPUT_OF_0_IS_1,
+        new Object[] {command, output}));
+
+    if (retCode != 0 || outputIsError(output)) {
+      logger.warn(LocalizedMessage
+          .create(LocalizedStrings.ManagedEntityController_REMOTE_EXECUTION_OF_0_FAILED, command));
+      return null;
+    }
+
+    return output;
+  }
+
+  /** Returns true if the path ends with a path separator. */
+  private boolean endsWithSeparator(String path) {
+    return path.endsWith("/") || path.endsWith("\\");
+  }
+
+  /** Translates the path between Windows and UNIX. */
+  private String getOSPath(String path) {
+    if (pathIsWindows(path)) {
+      return path.replace('/', '\\');
+    } else {
+      return path.replace('\\', '/');
+    }
+  }
+
+  // /** Returns true if the path is on Windows. */
+  // private boolean pathIsWindows(File path) {
+  // return pathIsWindows(path.toString());
+  // }
+
+  /** Returns true if the path is on Windows. */
+  private boolean pathIsWindows(String path) {
+    if (path != null && path.length() > 1) {
+      return (Character.isLetter(path.charAt(0)) && path.charAt(1) == ':')
+          || (path.startsWith("//") || path.startsWith("\\\\"));
+    }
+    return false;
+  }
+
+  /**
+   * If the managed entity resides on a remote host, then <code>command</code> is munged to take the
+   * remote command into account.
+   *
+   * @throws IllegalStateException If a remote command is required, but one has not been specified.
+   */
+  private String arrangeRemoteCommand(InternalManagedEntity entity, String cmd) {
+
+    String host = entity.getEntityConfig().getHost();
+    if (InetAddressUtil.isLocalHost(host)) {
+      // No arranging necessary
+      return cmd;
+    }
+
+    String prefix = entity.getEntityConfig().getRemoteCommand();
+    if (prefix == null || prefix.length() <= 0) {
+      prefix = entity.getDistributedSystem().getRemoteCommand();
+    }
+
+    if (prefix == null || prefix.length() <= 0) {
+      throw new IllegalStateException(
+          LocalizedStrings.ManagedEntityController_A_REMOTE_COMMAND_MUST_BE_SPECIFIED_TO_OPERATE_ON_A_MANAGED_ENTITY_ON_HOST_0
+              .toLocalizedString(host));
+    }
+
+    int hostIdx = prefix.indexOf(HOST);
+    int cmdIdx = prefix.indexOf(CMD);
+    if (hostIdx == -1 && cmdIdx == -1) {
+      return prefix + " " + host + " " + cmd;
+    }
+
+    if (hostIdx >= 0) {
+      String start = prefix.substring(0, hostIdx);
+      String end = null;
+      if (hostIdx + HOST.length() >= prefix.length()) {
+        end = "";
+      } else {
+        end = prefix.substring(hostIdx + HOST.length());
+      }
+      prefix = start + host + end;
+      cmdIdx = prefix.indexOf(CMD); // recalculate;
+    }
+
+    if (cmdIdx >= 0) {
+      String start = prefix.substring(0, cmdIdx);
+      String end = null;
+      if (cmdIdx + CMD.length() >= prefix.length()) {
+        end = "";
+      } else {
+        end = prefix.substring(cmdIdx + CMD.length());
+      }
+      prefix = start + cmd + end;
+    }
+    return prefix;
+  }
+
+  /**
+   * Returns the full path to the executable in <code>$GEMFIRE/bin</code> taking into account the
+   * {@linkplain ManagedEntityConfig#getProductDirectory product directory} and the platform's file
+   * separator.
+   *
+   * <P>
+   *
+   * Note: we should probably do a better job of determine whether or not the machine on which the
+   * entity runs is Windows or Linux.
+   *
+   * @param executable The name of the executable that resides in <code>$GEMFIRE/bin</code>.
+   */
+  public String getProductExecutable(InternalManagedEntity entity, String executable) {
+    String productDirectory = entity.getEntityConfig().getProductDirectory();
+    String path = null;
+    File productDir = new File(productDirectory);
+    // if (productDir != null) (cannot be null)
+    {
+      path = productDir.getPath();
+      if (!endsWithSeparator(path)) {
+        path += File.separator;
+      }
+      path += "bin" + File.separator;
+    }
+    // else {
+    // path = "";
+    // }
+
+    String bat = "";
+    if (pathIsWindows(path)) {
+      bat = ".bat";
+    }
+    return getOSPath(path) + executable + bat;
+  }
+
+  /**
+   * Builds optional SSL command-line arguments. Returns null if SSL is not enabled for the
+   * distributed system.
+   */
+  public String buildSSLArguments(DistributedSystemConfig config) {
+    Properties sslProps = buildSSLProperties(config, true);
+    if (sslProps == null)
+      return null;
+
+    StringBuffer sb = new StringBuffer();
+    for (Iterator iter = sslProps.keySet().iterator(); iter.hasNext();) {
+      String key = (String) iter.next();
+      String value = sslProps.getProperty(key);
+      sb.append(" -J-D" + key + "=" + value);
+    }
+
+    return sb.toString();
+  }
+
+  /**
+   * Builds optional SSL properties for DistributionLocator. Returns null if SSL is not enabled for
+   * the distributed system.
+   *
+   * @param forCommandLine true indicates that {@link DistributionConfig#GEMFIRE_PREFIX} should be
+   *        prepended so the argument will become -Dgemfire.xxxx
+   */
+  private Properties buildSSLProperties(DistributedSystemConfig config, boolean forCommandLine) {
+    if (!config.isSSLEnabled())
+      return null;
+
+    String prefix = "";
+    if (forCommandLine)
+      prefix = DistributionConfig.GEMFIRE_PREFIX;
+
+    Properties sslProps = (Properties) config.getSSLProperties().clone();
+    // add ssl-enabled, etc...
+    sslProps.setProperty(prefix + MCAST_PORT, "0");
+    sslProps.setProperty(prefix + CLUSTER_SSL_ENABLED, String.valueOf(config.isSSLEnabled()));
+    sslProps.setProperty(prefix + CLUSTER_SSL_CIPHERS, config.getSSLCiphers());
+    sslProps.setProperty(prefix + CLUSTER_SSL_PROTOCOLS, config.getSSLProtocols());
+    sslProps.setProperty(prefix + CLUSTER_SSL_REQUIRE_AUTHENTICATION,
+        String.valueOf(config.isSSLAuthenticationRequired()));
+    return sslProps;
+  }
+
+
+  /**
+   * Starts a managed entity.
+   */
+  public void start(final InternalManagedEntity entity) {
+    final String command = arrangeRemoteCommand(entity, entity.getStartCommand());
+    Thread start = new Thread(this.threadGroup, new Runnable() {
+      public void run() {
+        execute(command, entity);
+      }
+    }, "Start " + entity.getEntityType());
+    start.start();
+  }
+
+  /**
+   * Stops a managed entity.
+   */
+  public void stop(final InternalManagedEntity entity) {
+    final String command = arrangeRemoteCommand(entity, entity.getStopCommand());
+    Thread stop = new Thread(this.threadGroup, new Runnable() {
+      public void run() {
+        execute(command, entity);
+      }
+    }, "Stop " + entity.getEntityType());
+    stop.start();
+  }
+
+  /**
+   * Returns whether or not a managed entity is running
+   */
+  public boolean isRunning(InternalManagedEntity entity) {
+    final String command = arrangeRemoteCommand(entity, entity.getIsRunningCommand());
+    String output = execute(command, entity);
+
+    if (output == null || (output.indexOf("stop" /* "ing" "ped" */) != -1)
+        || (output.indexOf("killed") != -1) || (output.indexOf("starting") != -1)) {
+      return false;
+
+    } else if (output.indexOf("running") != -1) {
+      return true;
+
+    } else {
+      throw new IllegalStateException(
+          LocalizedStrings.ManagedEntityController_COULD_NOT_DETERMINE_IF_MANAGED_ENTITY_WAS_RUNNING_0
+              .toLocalizedString(output));
+    }
+  }
+
+  /**
+   * Returns the contents of a locator's log file. Other APIs are used to get the log file of
+   * managed entities that are also system members.
+   */
+  public String getLog(DistributionLocatorImpl locator) {
+    String command = arrangeRemoteCommand(locator, locator.getLogCommand());
+    return execute(command, locator);
+  }
+
+  /**
+   * Returns the contents of the given directory using the given managed entity to determine the
+   * host and remote command.
+   */
+  private String listDirectory(InternalManagedEntity entity, String dir) {
+    ManagedEntityConfig config = entity.getEntityConfig();
+    String listFile = pathIsWindows(config.getProductDirectory()) ? "dir " : "ls ";
+    String command = arrangeRemoteCommand(entity, listFile + dir);
+    return execute(command, entity);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FinishBackupRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FinishBackupRequest.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FinishBackupRequest.java
new file mode 100644
index 0000000..dd0d0dc
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FinishBackupRequest.java
@@ -0,0 +1,173 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.DataSerializer;
+import org.apache.geode.cache.persistence.PersistentID;
+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.ReplyException;
+import org.apache.geode.internal.admin.remote.AdminFailureResponse;
+import org.apache.geode.internal.admin.remote.AdminMultipleReplyProcessor;
+import org.apache.geode.internal.admin.remote.AdminResponse;
+import org.apache.geode.internal.admin.remote.CliLegacyMessage;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+
+/**
+ * A request send from an admin VM to all of the peers to indicate that that should complete the
+ * backup operation.
+ * 
+ *
+ */
+public class FinishBackupRequest extends CliLegacyMessage {
+  private static final Logger logger = LogService.getLogger();
+
+  private File targetDir;
+  private File baselineDir;
+  private boolean abort;
+
+  public FinishBackupRequest() {
+    super();
+  }
+
+  public FinishBackupRequest(File targetDir, File baselineDir, boolean abort) {
+    this.targetDir = targetDir;
+    this.baselineDir = baselineDir;
+    this.abort = abort;
+  }
+
+  public static Map<DistributedMember, Set<PersistentID>> send(DM dm, Set recipients,
+      File targetDir, File baselineDir, boolean abort) {
+    FinishBackupRequest request = new FinishBackupRequest(targetDir, baselineDir, abort);
+    request.setRecipients(recipients);
+
+    FinishBackupReplyProcessor replyProcessor = new FinishBackupReplyProcessor(dm, recipients);
+    request.msgId = replyProcessor.getProcessorId();
+    dm.putOutgoing(request);
+    try {
+      replyProcessor.waitForReplies();
+    } catch (ReplyException e) {
+      if (!(e.getCause() instanceof CancelException)) {
+        throw e;
+      }
+    } catch (InterruptedException e) {
+      e.printStackTrace();
+    }
+    AdminResponse response = request.createResponse((DistributionManager) dm);
+    response.setSender(dm.getDistributionManagerId());
+    replyProcessor.process(response);
+    return replyProcessor.results;
+  }
+
+  @Override
+  protected AdminResponse createResponse(DistributionManager dm) {
+    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+    HashSet<PersistentID> persistentIds;
+    if (cache == null || cache.getBackupManager() == null) {
+      persistentIds = new HashSet<PersistentID>();
+    } else {
+      try {
+        persistentIds = cache.getBackupManager().finishBackup(targetDir, baselineDir, abort);
+      } catch (IOException e) {
+        logger.error(
+            LocalizedMessage.create(LocalizedStrings.CliLegacyMessage_ERROR, this.getClass()), e);
+        return AdminFailureResponse.create(dm, getSender(), e);
+      }
+    }
+
+    return new FinishBackupResponse(this.getSender(), persistentIds);
+  }
+
+  public int getDSFID() {
+    return FINISH_BACKUP_REQUEST;
+  }
+
+  @Override
+  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
+    super.fromData(in);
+    targetDir = DataSerializer.readFile(in);
+    baselineDir = DataSerializer.readFile(in);
+    abort = DataSerializer.readBoolean(in);
+  }
+
+  @Override
+  public void toData(DataOutput out) throws IOException {
+    super.toData(out);
+    DataSerializer.writeFile(targetDir, out);
+    DataSerializer.writeFile(baselineDir, out);
+    DataSerializer.writeBoolean(abort, out);
+  }
+
+  private static class FinishBackupReplyProcessor extends AdminMultipleReplyProcessor {
+    Map<DistributedMember, Set<PersistentID>> results =
+        Collections.synchronizedMap(new HashMap<DistributedMember, Set<PersistentID>>());
+
+    public FinishBackupReplyProcessor(DM dm, Collection initMembers) {
+      super(dm, initMembers);
+    }
+
+    @Override
+    protected boolean stopBecauseOfExceptions() {
+      return false;
+    }
+
+
+
+    @Override
+    protected int getAckWaitThreshold() {
+      // Disable the 15 second warning if the backup is taking a long time
+      return 0;
+    }
+
+    @Override
+    public long getAckSevereAlertThresholdMS() {
+      // Don't log severe alerts for backups either
+      return Long.MAX_VALUE;
+    }
+
+    @Override
+    protected void process(DistributionMessage msg, boolean warn) {
+      if (msg instanceof FinishBackupResponse) {
+        final HashSet<PersistentID> persistentIds = ((FinishBackupResponse) msg).getPersistentIds();
+        if (persistentIds != null && !persistentIds.isEmpty()) {
+          results.put(msg.getSender(), persistentIds);
+        }
+      }
+      super.process(msg, warn);
+    }
+
+
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FinishBackupResponse.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FinishBackupResponse.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FinishBackupResponse.java
new file mode 100644
index 0000000..ad68f97
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FinishBackupResponse.java
@@ -0,0 +1,76 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.HashSet;
+
+import org.apache.geode.DataSerializer;
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.admin.remote.AdminResponse;
+
+/**
+ * The reply for a {@link FinishBackupRequest}. The reply contains the persistent ids of the disk
+ * stores that were backed up on this member.
+ * 
+ *
+ */
+public class FinishBackupResponse extends AdminResponse {
+
+  private HashSet<PersistentID> persistentIds;
+
+  public FinishBackupResponse() {
+    super();
+  }
+
+  public FinishBackupResponse(InternalDistributedMember sender,
+      HashSet<PersistentID> persistentIds) {
+    this.setRecipient(sender);
+    this.persistentIds = persistentIds;
+  }
+
+  public HashSet<PersistentID> getPersistentIds() {
+    return persistentIds;
+  }
+
+  @Override
+  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
+    super.fromData(in);
+    persistentIds = DataSerializer.readHashSet(in);
+  }
+
+  @Override
+  public void toData(DataOutput out) throws IOException {
+    super.toData(out);
+    DataSerializer.writeHashSet(persistentIds, out);
+  }
+
+  @Override
+  protected Object clone() throws CloneNotSupportedException {
+    return super.clone();
+  }
+
+  public int getDSFID() {
+    return FINISH_BACKUP_RESPONSE;
+  }
+
+  @Override
+  public String toString() {
+    return getClass().getName() + ": " + persistentIds;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FlushToDiskRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FlushToDiskRequest.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FlushToDiskRequest.java
new file mode 100644
index 0000000..c780d1d
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FlushToDiskRequest.java
@@ -0,0 +1,94 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.distributed.internal.ReplyException;
+import org.apache.geode.internal.admin.remote.AdminMultipleReplyProcessor;
+import org.apache.geode.internal.admin.remote.AdminResponse;
+import org.apache.geode.internal.admin.remote.CliLegacyMessage;
+import org.apache.geode.internal.cache.DiskStoreImpl;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+
+/**
+ * A request to from an admin VM to all non admin members to start a backup. In the prepare phase of
+ * the backup, the members will suspend bucket destroys to make sure buckets aren't missed during
+ * the backup.
+ * 
+ *
+ */
+public class FlushToDiskRequest extends CliLegacyMessage {
+
+  public FlushToDiskRequest() {
+
+  }
+
+  public static void send(DM dm, Set recipients) {
+    FlushToDiskRequest request = new FlushToDiskRequest();
+    request.setRecipients(recipients);
+
+    FlushToDiskProcessor replyProcessor = new FlushToDiskProcessor(dm, recipients);
+    request.msgId = replyProcessor.getProcessorId();
+    dm.putOutgoing(request);
+    try {
+      replyProcessor.waitForReplies();
+    } catch (ReplyException e) {
+      if (!(e.getCause() instanceof CancelException)) {
+        throw e;
+      }
+    } catch (InterruptedException e) {
+      e.printStackTrace();
+    }
+    AdminResponse response = request.createResponse((DistributionManager) dm);
+    response.setSender(dm.getDistributionManagerId());
+    replyProcessor.process(response);
+  }
+
+  @Override
+  protected AdminResponse createResponse(DistributionManager dm) {
+    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+    HashSet<PersistentID> persistentIds;
+    if (cache != null) {
+      Collection<DiskStoreImpl> diskStores = cache.listDiskStoresIncludingRegionOwned();
+      for (DiskStoreImpl store : diskStores) {
+        store.flush();
+      }
+    }
+
+    return new FlushToDiskResponse(this.getSender());
+  }
+
+  public int getDSFID() {
+    return FLUSH_TO_DISK_REQUEST;
+  }
+
+  private static class FlushToDiskProcessor extends AdminMultipleReplyProcessor {
+    public FlushToDiskProcessor(DM dm, Collection initMembers) {
+      super(dm, initMembers);
+    }
+
+    @Override
+    protected boolean stopBecauseOfExceptions() {
+      return false;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FlushToDiskResponse.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FlushToDiskResponse.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FlushToDiskResponse.java
new file mode 100644
index 0000000..869d56b
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/FlushToDiskResponse.java
@@ -0,0 +1,43 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.admin.remote.AdminResponse;
+
+/**
+ * The response to the {@link FlushToDiskRequest}
+ * 
+ *
+ */
+public class FlushToDiskResponse extends AdminResponse {
+
+  public FlushToDiskResponse() {
+    super();
+  }
+
+  public FlushToDiskResponse(InternalDistributedMember sender) {
+    this.setRecipient(sender);
+  }
+
+  public int getDSFID() {
+    return FLUSH_TO_DISK_RESPONSE;
+  }
+
+  @Override
+  public String toString() {
+    return getClass().getName();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthConfigImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthConfigImpl.java
new file mode 100644
index 0000000..16b1d79
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthConfigImpl.java
@@ -0,0 +1,80 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+// @todo davidw Delegate to a "parent" config for properties that are not overridden.
+// This will be made easier with a special <code>HealthConfigAttribute</code> class.
+/**
+ * The implementation of <code>GemFireHealthConfig</code>
+ *
+ *
+ *
+ * @since GemFire 3.5
+ */
+public class GemFireHealthConfigImpl extends CacheHealthConfigImpl implements GemFireHealthConfig {
+
+  private static final long serialVersionUID = -6797673296902808018L;
+
+  /** The name of the host to which this configuration applies. */
+  private String hostName;
+
+  /**
+   * The number of seconds to wait between evaluating the health of GemFire.
+   */
+  private int interval = DEFAULT_HEALTH_EVALUATION_INTERVAL;
+
+  //////////////////////// Constructors ////////////////////////
+
+  /**
+   * Creates a new <code>GemFireHealthConfigImpl</code> that applies to the host with the given
+   * name.
+   *
+   * @param hostName The name of the host to which this configuration applies. If <code>null</code>,
+   *        then this is the "default" configuration.
+   */
+  public GemFireHealthConfigImpl(String hostName) {
+    this.hostName = hostName;
+  }
+
+  /////////////////////// Instance Methods ///////////////////////
+
+  public String getHostName() {
+    return this.hostName;
+  }
+
+  public void setHealthEvaluationInterval(int interval) {
+    this.interval = interval;
+  }
+
+  public int getHealthEvaluationInterval() {
+    return this.interval;
+  }
+
+  @Override
+  public String toString() {
+    if (this.hostName == null) {
+      return LocalizedStrings.GemFireHealthConfigImpl_DEFAULT_GEMFIRE_HEALTH_CONFIGURATION
+          .toLocalizedString();
+
+    } else {
+      return LocalizedStrings.GemFireHealthConfigImpl_GEMFIRE_HEALTH_CONFIGURATION_FOR_HOST_0
+          .toLocalizedString(this.hostName);
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthEvaluator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthEvaluator.java
new file mode 100644
index 0000000..d35a94c
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthEvaluator.java
@@ -0,0 +1,182 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+
+/**
+ * Evaluates the health of various GemFire components in the VM according to a
+ * {@link GemFireHealthConfig}.
+ *
+ * <P>
+ *
+ * Note that evaluators never reside in the administration VM, they only in member VMs. They are not
+ * <code>Serializable</code> and aren't meant to be.
+ *
+ * @see MemberHealthEvaluator
+ * @see CacheHealthEvaluator
+ *
+ *
+ * @since GemFire 3.5
+ */
+public class GemFireHealthEvaluator {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /** Determines how the health of GemFire is determined */
+  private GemFireHealthConfig config;
+
+  /** Evaluates the health of this member of the distributed system */
+  private MemberHealthEvaluator memberHealth;
+
+  /** Evaluates the health of the Cache hosted in this VM */
+  private CacheHealthEvaluator cacheHealth;
+
+  /**
+   * The most recent <code>OKAY_HEALTH</code> diagnoses of the GemFire system
+   */
+  private List okayDiagnoses;
+
+  /**
+   * The most recent <code>POOR_HEALTH</code> diagnoses of the GemFire system
+   */
+  private List poorDiagnoses;
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>GemFireHealthEvaluator</code>
+   *
+   * @param config The configuration that determines whether or GemFire is healthy
+   * @param dm The distribution manager
+   */
+  public GemFireHealthEvaluator(GemFireHealthConfig config, DistributionManager dm) {
+    if (config == null) {
+      throw new NullPointerException(
+          LocalizedStrings.GemFireHealthEvaluator_NULL_GEMFIREHEALTHCONFIG.toLocalizedString());
+    }
+
+    this.config = config;
+    this.memberHealth = new MemberHealthEvaluator(config, dm);
+    this.cacheHealth = new CacheHealthEvaluator(config, dm);
+    this.okayDiagnoses = new ArrayList();
+    this.poorDiagnoses = new ArrayList();
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Evaluates the health of the GemFire components in this VM.
+   *
+   * @return The aggregate health code (such as {@link GemFireHealth#OKAY_HEALTH}) of the GemFire
+   *         components.
+   */
+  public GemFireHealth.Health evaluate() {
+    List status = new ArrayList();
+    this.memberHealth.evaluate(status);
+    this.cacheHealth.evaluate(status);
+
+    GemFireHealth.Health overallHealth = GemFireHealth.GOOD_HEALTH;
+    this.okayDiagnoses.clear();
+    this.poorDiagnoses.clear();
+
+    for (Iterator iter = status.iterator(); iter.hasNext();) {
+      AbstractHealthEvaluator.HealthStatus health =
+          (AbstractHealthEvaluator.HealthStatus) iter.next();
+      if (overallHealth == GemFireHealth.GOOD_HEALTH) {
+        if ((health.getHealthCode() != GemFireHealth.GOOD_HEALTH)) {
+          overallHealth = health.getHealthCode();
+        }
+
+      } else if (overallHealth == GemFireHealth.OKAY_HEALTH) {
+        if (health.getHealthCode() == GemFireHealth.POOR_HEALTH) {
+          overallHealth = GemFireHealth.POOR_HEALTH;
+        }
+      }
+
+      GemFireHealth.Health healthCode = health.getHealthCode();
+      if (healthCode == GemFireHealth.OKAY_HEALTH) {
+        this.okayDiagnoses.add(health.getDiagnosis());
+
+      } else if (healthCode == GemFireHealth.POOR_HEALTH) {
+        this.poorDiagnoses.add(health.getDiagnosis());
+      }
+    }
+
+    if (logger.isDebugEnabled()) {
+      logger.debug("Evaluated health to be {}", overallHealth);
+    }
+    return overallHealth;
+  }
+
+  /**
+   * Returns detailed information explaining the current health status. Each array element is a
+   * different cause for the current status. An empty array will be returned if the current status
+   * is {@link GemFireHealth#GOOD_HEALTH}.
+   */
+  public String[] getDiagnosis(GemFireHealth.Health healthCode) {
+    if (healthCode == GemFireHealth.GOOD_HEALTH) {
+      return new String[0];
+
+    } else if (healthCode == GemFireHealth.OKAY_HEALTH) {
+      String[] array = new String[this.okayDiagnoses.size()];
+      this.okayDiagnoses.toArray(array);
+      return array;
+
+    } else {
+      Assert.assertTrue(healthCode == GemFireHealth.POOR_HEALTH);
+      String[] array = new String[this.poorDiagnoses.size()];
+      this.poorDiagnoses.toArray(array);
+      return array;
+    }
+  }
+
+  /**
+   * Resets the state of this evaluator
+   */
+  public void reset() {
+    this.okayDiagnoses.clear();
+    this.poorDiagnoses.clear();
+  }
+
+  /**
+   * Returns the heath evaluation interval, in seconds.
+   *
+   * @see GemFireHealthConfig#getHealthEvaluationInterval
+   */
+  public int getEvaluationInterval() {
+    return this.config.getHealthEvaluationInterval();
+  }
+
+  /**
+   * Closes this evaluator and releases all of its resources
+   */
+  public void close() {
+    this.memberHealth.close();
+    this.cacheHealth.close();
+  }
+
+}


[41/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
deleted file mode 100755
index 1bfddf2..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AdminDistributedSystemJmxImpl.java
+++ /dev/null
@@ -1,2279 +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.admin.jmx.internal;
-
-import org.apache.geode.DataSerializer;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.*;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
-import org.apache.geode.admin.internal.CacheServerConfigImpl;
-import org.apache.geode.admin.internal.DistributionLocatorImpl;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.admin.Alert;
-import org.apache.geode.internal.admin.*;
-import org.apache.geode.internal.admin.remote.UpdateAlertDefinitionMessage;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.InternalLogWriter;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.logging.log4j.Logger;
-
-import javax.management.*;
-import javax.management.modelmbean.ModelMBean;
-import javax.management.openmbean.*;
-import java.io.*;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Provides MBean support for managing a GemFire distributed system.
- * <p>
- * TODO: refactor to implement DistributedSystem and delegate to instance of DistributedSystemImpl.
- * Wrap all delegate calls w/ e.printStackTrace() since the HttpAdaptor devours them (what to do w/
- * template methods then?)
- *
- * @since GemFire 3.5
- */
-public class AdminDistributedSystemJmxImpl extends AdminDistributedSystemImpl
-    implements ManagedResource, DistributedSystemConfig, StatAlertsAggregator {
-
-  private static final Logger logger = LogService.getLogger();
-
-  private Properties mailProps;
-
-  // The file name where the StatAlertDefinitions would be serialized
-  private String statAlertDefnSerFile = System.getProperty("user.dir");
-
-  /**
-   * Simple counter incrementing on each notification. This this currently resets at every restart
-   * of Agent
-   */
-  private final AtomicInteger notificationSequenceNumber = new AtomicInteger();
-
-  /**
-   * Variable to indicate if there are no Rmi clients connected.
-   */
-  private volatile boolean isRmiClientCountZero;
-
-  /**
-   * Variable to indicate if Statistics Alert definitions could be persisted across runs/sessions.
-   */
-  private volatile boolean canPersistStatAlertDefs = true;
-
-  /** Cache Listener to listen to Cache & Region create/destroy events */
-  private CacheAndRegionListenerImpl cacheRegionListener;
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs new DistributedSystemJmxImpl and registers an MBean to represent it.
-   * 
-   * @param config configuration defining the JMX agent.
-   */
-  public AdminDistributedSystemJmxImpl(AgentConfigImpl config)
-      throws org.apache.geode.admin.AdminException {
-    super(config);
-    this.mbeanName = "GemFire:type=AdminDistributedSystem,id="
-        + MBeanUtil.makeCompliantMBeanNameProperty(getId());
-    this.objectName = MBeanUtil.createMBean(this);
-    isEmailNotificationEnabled = config.isEmailNotificationEnabled();
-    if (isEmailNotificationEnabled) {
-      initMailProps(config);
-    }
-    // Init file name for StatAlertDefns
-    initStateSaveFile(config);
-    Assert.assertTrue(this.objectName != null);
-
-    cacheRegionListener = new CacheAndRegionListenerImpl(this);
-  }
-
-  private void initMailProps(AgentConfigImpl config) {
-    mailProps = new Properties();
-    mailProps.put(MailManager.PROPERTY_MAIL_FROM, config.getEmailNotificationFrom());
-    mailProps.put(MailManager.PROPERTY_MAIL_HOST, config.getEmailNotificationHost());
-    mailProps.put(MailManager.PROPERTY_MAIL_TO_LIST, config.getEmailNotificationToList());
-  }
-
-  private void initStateSaveFile(AgentConfigImpl agentConfig) {
-    // Init file name for StatAlertDefns
-    AgentConfigImpl impl = (AgentConfigImpl) agentConfig;
-    File propFile = impl.getPropertyFile();
-
-    if (propFile != null) {
-      if (propFile.isDirectory()) {
-        statAlertDefnSerFile = propFile.getAbsolutePath();
-      } else if (propFile.getParentFile() != null) {
-        statAlertDefnSerFile = propFile.getParentFile().getAbsolutePath();
-      }
-    }
-
-    statAlertDefnSerFile = statAlertDefnSerFile + File.separator + agentConfig.getStateSaveFile();
-  }
-
-  // -------------------------------------------------------------------------
-  // MBean operations
-  // -------------------------------------------------------------------------
-
-  /**
-   * Registers the MBeans for monitoring the health of GemFire
-   *
-   * @see org.apache.geode.admin.internal.AdminDistributedSystemImpl#getGemFireHealth
-   */
-  public ObjectName monitorGemFireHealth() throws MalformedObjectNameException {
-    GemFireHealthJmxImpl health = (GemFireHealthJmxImpl) getGemFireHealth();
-    health.ensureMBeansAreRegistered();
-    return health.getObjectName();
-  }
-
-  /**
-   * Creates a new DistributionLocator for this system and registers an MBean for managing it.
-   * <p>
-   * If the Locator already exists, then this will simply register an MBean for it.
-   *
-   * @param host the host name or IP address of the locator
-   * @param port the port the locator service listens on
-   * @param workingDirectory directory path for the locator and its log
-   * @param productDirectory directory path to the GemFire product to use
-   */
-  public ObjectName createDistributionLocator(String host, int port, String workingDirectory,
-      String productDirectory) throws MalformedObjectNameException {
-    return createDistributionLocator(host, port, workingDirectory, productDirectory,
-        getRemoteCommand());
-  }
-
-  /**
-   * Creates a new DistributionLocator for this system and registers an MBean for managing it.
-   * <p>
-   * If the Locator already exists, then this will simply register an MBean for it.
-   *
-   * @param host the host name or IP address of the locator
-   * @param port the port the locator service listens on
-   * @param workingDirectory directory path for the locator and its log
-   * @param productDirectory directory path to the GemFire product to use
-   * @param remoteCommand formatted remote command to control remotely
-   */
-  public ObjectName createDistributionLocator(String host, int port, String workingDirectory,
-      String productDirectory, String remoteCommand) throws MalformedObjectNameException {
-    try {
-      DistributionLocatorJmxImpl locator = (DistributionLocatorJmxImpl) addDistributionLocator();
-
-      DistributionLocatorConfig config = locator.getConfig();
-      config.setHost(host);
-      config.setPort(port);
-      config.setWorkingDirectory(workingDirectory);
-      config.setProductDirectory(productDirectory);
-      config.setRemoteCommand(remoteCommand);
-
-      return new ObjectName(locator.getMBeanName());
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // Template methods overriden from superclass...
-  // -------------------------------------------------------------------------
-
-  /** Override createSystemMember by instantiating SystemMemberJmxImpl */
-  @Override
-  protected SystemMember createSystemMember(ApplicationVM app)
-      throws org.apache.geode.admin.AdminException {
-    return new SystemMemberJmxImpl(this, app);
-  }
-
-  /**
-   * Constructs & returns a SystemMember instance using the corresponding InternalDistributedMember
-   * object.
-   * 
-   * @param member InternalDistributedMember instance for which a SystemMember instance is to be
-   *        constructed.
-   * @return constructed SystemMember instance
-   * @throws org.apache.geode.admin.AdminException if construction of SystemMember instance fails
-   *
-   * @since GemFire 6.5
-   */
-  protected SystemMember createSystemMember(InternalDistributedMember member)
-      throws org.apache.geode.admin.AdminException {
-    return new SystemMemberJmxImpl(this, member);
-  }
-
-
-  @Override
-  protected CacheServer createCacheServer(ApplicationVM member) throws AdminException {
-
-    return new CacheServerJmxImpl(this, member);
-  }
-
-  @Override
-  protected CacheServer createCacheServer(CacheServerConfigImpl config) throws AdminException {
-
-    return new CacheServerJmxImpl(this, config);
-  }
-
-  /** Override createGemFireHealth by instantiating GemFireHealthJmxImpl */
-  @Override
-  protected GemFireHealth createGemFireHealth(GfManagerAgent system)
-      throws org.apache.geode.admin.AdminException {
-    if (system == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.AdminDistributedSystemJmxImpl_GFMANAGERAGENT_MUST_NOT_BE_NULL
-              .toLocalizedString());
-    }
-    return new GemFireHealthJmxImpl(system, this);
-  }
-
-  /** Template-method for creating a DistributionLocatorImpl instance. */
-  @Override
-  protected DistributionLocatorImpl createDistributionLocatorImpl(
-      DistributionLocatorConfig config) {
-    return new DistributionLocatorJmxImpl(config, this);
-  }
-
-  // -------------------------------------------------------------------------
-  // Internal Admin listeners and JMX Notifications
-  // -------------------------------------------------------------------------
-
-  /** Notification type for indicating system member joined */
-  public static final String NOTIF_MEMBER_JOINED =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.member.joined";
-  /** Notification type for indicating system member left */
-  public static final String NOTIF_MEMBER_LEFT =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.member.left";
-  /** Notification type for indicating system member crashed */
-  public static final String NOTIF_MEMBER_CRASHED =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.member.crashed";
-  /** Notification type for sending GemFire alerts as JMX notifications */
-  public static final String NOTIF_ALERT =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.alert";
-  /** Notification type for sending GemFire StatAlerts as JMX notifications */
-  public static final String NOTIF_STAT_ALERT =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.statalert";
-  /** Notification type for indicating abnormal disconnection from the distributed system */
-  public static final String NOTIF_ADMIN_SYSTEM_DISCONNECT =
-      DistributionConfig.GEMFIRE_PREFIX + "distributedsystem.disconnect";
-
-
-  private static final String EML_SUBJ_PRFX_GFE_ALERT = "[GemFire Alert] ";
-  private static final String EML_SUBJ_PRFX_GFE_NOTFY = "[GemFire Notification] ";
-  private static final String EML_SUBJ_ITEM_GFE_DS = "Distributed System: ";
-
-  // --------- org.apache.geode.internal.admin.JoinLeaveListener ---------
-  /**
-   * Listener callback for when a member has joined this DistributedSystem.
-   * <p>
-   * React by creating an MBean for managing the SystemMember and then fire a Notification with the
-   * internal Id of the member VM.
-   *
-   * @param source the distributed system that fired nodeJoined
-   * @param joined the VM that joined
-   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeJoined
-   */
-  @Override
-  public void nodeJoined(GfManagerAgent source, GemFireVM joined) {
-    try {
-      super.nodeJoined(source, joined);
-
-      /*
-       * super.nodeJoined results in creation of a new SystemMember which registers itself as an
-       * MBean, so now we try to find it...
-       */
-      SystemMember member = findSystemMember(joined);
-
-      if (null == member) {
-        if (logger.isDebugEnabled()) {
-          logger.debug(
-              "AdminDistributedSystemJmxImpl.nodeJoined(), Could not find SystemMember for VM {}",
-              joined);
-        }
-        return;
-      }
-
-      try {
-        if (logger.isDebugEnabled()) {
-          logger.debug("Processing node joined for: {}", member);
-          logger.debug("RemoteGemFireVM.nodeJoined(), setting alerts manager *************");
-        }
-        setAlertsManager(joined);
-
-        this.modelMBean.sendNotification(
-            new Notification(NOTIF_MEMBER_JOINED, ((ManagedResource) member).getObjectName(), // Pass
-                                                                                              // the
-                                                                                              // ObjName
-                                                                                              // of
-                                                                                              // the
-                                                                                              // Source
-                                                                                              // Member
-                notificationSequenceNumber.addAndGet(1), joined.getId().toString()));
-
-        // String mess = "Gemfire AlertNotification: System Member Joined, System member Id: " +
-        // joined.getId().toString();
-        // sendEmail("Gemfire AlertNotification: Member Joined, ID: " + joined.getId().toString(),
-        // mess);
-        if (isEmailNotificationEnabled) {
-          String mess =
-              LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_JOINED_THE_DISTRIBUTED_SYSTEM_MEMBER_ID_0
-                  .toLocalizedString(new Object[] {joined.getId().toString()});
-          sendEmail(EML_SUBJ_PRFX_GFE_NOTFY + EML_SUBJ_ITEM_GFE_DS + getName() + " <"
-              + LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_JOINED.toLocalizedString()
-              + ">", mess);
-        }
-      } catch (javax.management.MBeanException e) {
-        logger.warn(e.getMessage(), e);
-      }
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  /**
-   * Listener callback for when a member has left this DistributedSystem.
-   * <p>
-   * React by removing the member's MBean. Also fire a Notification with the internal Id of the
-   * member VM.
-   *
-   * @param source the distributed system that fired nodeLeft
-   * @param left the VM that left
-   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeLeft
-   */
-  @Override
-  public void nodeLeft(GfManagerAgent source, GemFireVM left) {
-    try {
-      SystemMember member = findSystemMember(left, false);
-      super.nodeLeft(source, left);
-      if (logger.isDebugEnabled()) {
-        logger.debug("Processing node left for: {}", member);
-      }
-      try {
-        this.modelMBean.sendNotification(
-            new Notification(NOTIF_MEMBER_LEFT, ((ManagedResource) member).getObjectName(), // Pass
-                                                                                            // the
-                                                                                            // ObjName
-                                                                                            // of
-                                                                                            // the
-                                                                                            // Source
-                                                                                            // Member
-                notificationSequenceNumber.addAndGet(1), left.getId().toString()));
-
-        // String mess = "Gemfire AlertNotification: System Member Left the system, System member
-        // Id: " + left.getId().toString();
-        // sendEmail("Gemfire AlertNotification: Member Left, ID: " + left.getId().toString(),
-        // mess);
-        if (isEmailNotificationEnabled) {
-          String mess =
-              LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_LEFT_THE_DISTRIBUTED_SYSTEM_MEMBER_ID_0
-                  .toLocalizedString(new Object[] {left.getId().toString()});
-          sendEmail(EML_SUBJ_PRFX_GFE_NOTFY + EML_SUBJ_ITEM_GFE_DS + getName() + " <"
-              + LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_LEFT.toLocalizedString()
-              + ">", mess);
-        }
-      } catch (javax.management.MBeanException e) {
-        logger.warn(e.getMessage(), e);
-      }
-
-      SystemMemberType memberType = member.getType();
-      if (/* member != null && */ memberType.isApplication() || memberType.isCacheVm()) {
-        // automatically unregister the MBean...
-        MBeanUtil.unregisterMBean((ManagedResource) member);
-      }
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  /**
-   * Listener callback for when a member of this DistributedSystem has crashed.
-   * <p>
-   * Also fires a Notification with the internal Id of the member VM.
-   *
-   * @param source the distributed system that fired nodeCrashed
-   * @param crashed the VM that crashed
-   * @see org.apache.geode.internal.admin.JoinLeaveListener#nodeCrashed
-   */
-  @Override
-  public void nodeCrashed(GfManagerAgent source, GemFireVM crashed) {
-    try {
-      // SystemMember application has left...
-      SystemMember member = findSystemMember(crashed, false);
-      super.nodeCrashed(source, crashed);
-      if (logger.isDebugEnabled()) {
-        logger.debug("Processing node crash for: {}", member);
-      }
-
-      try {
-        this.modelMBean.sendNotification(
-            new Notification(NOTIF_MEMBER_CRASHED, ((ManagedResource) member).getObjectName(), // Pass
-                                                                                               // the
-                                                                                               // ObjName
-                                                                                               // of
-                                                                                               // the
-                                                                                               // Source
-                                                                                               // Member
-                notificationSequenceNumber.addAndGet(1), crashed.getId().toString()));
-
-        // String mess = "Gemfire AlertNotification: System Member Crashed, System member Id: " +
-        // crashed.getId().toString();
-        // sendEmail("Gemfire AlertNotification: Member Crashed, ID: " + crashed.getId().toString(),
-        // mess);
-        if (isEmailNotificationEnabled) {
-          String mess =
-              LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_CRASHED_IN_THE_DISTRIBUTED_SYSTEM_MEMBER_ID_0
-                  .toLocalizedString(new Object[] {crashed.getId().toString()});
-          sendEmail(EML_SUBJ_PRFX_GFE_ALERT + EML_SUBJ_ITEM_GFE_DS + getName() + " <"
-              + LocalizedStrings.AdminDistributedSystemJmxImpl_MEMBER_CRASHED.toLocalizedString()
-              + ">", mess);
-        }
-      } catch (javax.management.MBeanException e) {
-        logger.warn(e.getMessage(), e);
-      }
-
-      SystemMemberType memberType = member.getType();
-      if (/* member != null && */ memberType.isApplication() || memberType.isCacheVm()) {
-        // automatically unregister the MBean...
-        MBeanUtil.unregisterMBean((ManagedResource) member);
-      }
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  // ----------- org.apache.geode.internal.admin.AlertListener -----------
-  /**
-   * Listener callback for when a SystemMember of this DistributedSystem has crashed.
-   * <p>
-   * Fires a Notification with the information from the alert.
-   *
-   * @param alert the gemfire alert to broadcast as a notification
-   * @see org.apache.geode.internal.admin.AlertListener#alert
-   */
-  @Override
-  public void alert(Alert alert) {
-    try {
-      super.alert(alert);
-      try {
-        String strAlert = alert.toString();
-        this.modelMBean.sendNotification(new Notification(NOTIF_ALERT, this.mbeanName,
-            notificationSequenceNumber.addAndGet(1), strAlert));
-
-        // String mess = "Gemfire AlertNotification: System Alert :" + alert.toString();
-        // sendEmail("Gemfire AlertNotification: System Alert", mess);
-        if (isEmailNotificationEnabled) {
-          String mess =
-              LocalizedStrings.AdminDistributedSystemJmxImpl_SYSTEM_ALERT_FROM_DISTRIBUTED_SYSTEM_0
-                  .toLocalizedString(strAlert);
-          sendEmail(EML_SUBJ_PRFX_GFE_ALERT + EML_SUBJ_ITEM_GFE_DS + getName() + " <System Alert>",
-              mess);
-        }
-      } catch (javax.management.MBeanException e) {
-        logger.warn(e.getMessage(), e);
-      }
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  @Override
-  public void onDisconnect(InternalDistributedSystem sys) {
-    if (logger.isDebugEnabled()) {
-      this.logger.debug("Calling AdminDistributedSystemJmxImpl#onDisconnect");
-    }
-    try {
-      super.onDisconnect(sys);
-
-      try {
-        this.modelMBean.sendNotification(new Notification(NOTIF_ADMIN_SYSTEM_DISCONNECT,
-            this.mbeanName, notificationSequenceNumber.addAndGet(1), null));
-      } catch (MBeanException e) {
-        logger.warn(e.getMessage(), e);
-      }
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-    if (logger.isDebugEnabled()) {
-      this.logger.debug("Completed AdminDistributedSystemJmxImpl#onDisconnect");
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // ManagedResource implementation
-  // -------------------------------------------------------------------------
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The remotable ObjectName that the MBean is registered under */
-  final private ObjectName objectName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.DISTRIBUTED_SYSTEM;
-  }
-
-  // -------------------------------------------------------------------------
-  // Error traps added to overridden methods...
-  // -------------------------------------------------------------------------
-
-  @Override
-  public boolean isRunning() {
-    try {
-      return super.isRunning();
-    } catch (java.lang.RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (java.lang.Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  @Override
-  public void start() throws AdminException {
-    try {
-      super.start();
-    } catch (java.lang.RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (java.lang.Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  @Override
-  public void stop() throws AdminException {
-    try {
-      super.stop();
-    } catch (java.lang.RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (java.lang.Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  @Override
-  public boolean waitToBeConnected(long timeout) throws InterruptedException {
-
-    if (Thread.interrupted())
-      throw new InterruptedException();
-    try {
-      return super.waitToBeConnected(timeout);
-    } catch (java.lang.RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (java.lang.Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  @Override
-  public String displayMergedLogs() {
-    try {
-      return super.displayMergedLogs();
-    } catch (java.lang.RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (java.lang.Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  public ObjectName manageDistributionLocator() throws MalformedObjectNameException {
-
-    try {
-      return new ObjectName(((ManagedResource) addDistributionLocator()).getMBeanName());
-    }
-    // catch (AdminException e) { logger.warn(e.getMessage(), e); throw e; }
-    catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  public ObjectName[] manageDistributionLocators() throws MalformedObjectNameException {
-    try {
-      DistributionLocator[] locs = getDistributionLocators();
-      ObjectName[] onames = new javax.management.ObjectName[locs.length];
-      for (int i = 0; i < locs.length; i++) {
-        DistributionLocatorJmxImpl loc = (DistributionLocatorJmxImpl) locs[i];
-        onames[i] = new ObjectName(loc.getMBeanName());
-      }
-      return onames;
-    }
-    // catch (AdminException e) { logger.warn(e.getMessage(), e); throw e; }
-    catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  /**
-   * @deprecated as of 5.7 use {@link #manageCacheVm} instead.
-   */
-  @Deprecated
-  public ObjectName manageCacheServer() throws AdminException, MalformedObjectNameException {
-    return manageCacheVm();
-  }
-
-  public ObjectName manageCacheVm() throws AdminException, MalformedObjectNameException {
-    try {
-      return new ObjectName(((ManagedResource) addCacheVm()).getMBeanName());
-    } catch (AdminException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.warn(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  /**
-   * @deprecated as of 5.7 use {@link #manageCacheVms} instead.
-   */
-  @Deprecated
-  public ObjectName[] manageCacheServers() throws AdminException, MalformedObjectNameException {
-    return manageCacheVms();
-  }
-
-  public ObjectName[] manageCacheVms() throws AdminException, MalformedObjectNameException {
-    try {
-      CacheVm[] mgrs = getCacheVms();
-      ObjectName[] onames = new javax.management.ObjectName[mgrs.length];
-      for (int i = 0; i < mgrs.length; i++) {
-        CacheServerJmxImpl mgr = (CacheServerJmxImpl) mgrs[i];
-        onames[i] = new ObjectName(mgr.getMBeanName());
-      }
-      return onames;
-    } catch (AdminException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  public ObjectName[] manageSystemMemberApplications()
-      throws AdminException, MalformedObjectNameException {
-    try {
-      SystemMember[] apps = getSystemMemberApplications();
-      ObjectName[] onames = new javax.management.ObjectName[apps.length];
-      for (int i = 0; i < apps.length; i++) {
-        SystemMemberJmxImpl app = (SystemMemberJmxImpl) apps[i];
-        onames[i] = new ObjectName(app.getMBeanName());
-      }
-      return onames;
-    } catch (AdminException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  /**
-   * Return the ObjectName for the SystemMemberMBean representing the specified distributed member
-   * or null if the member is not found.
-   *
-   * @param distributedMember the distributed member to manage
-   * @return the ObjectName for the SystemMemberMBean
-   */
-  public ObjectName manageSystemMember(DistributedMember distributedMember)
-      throws AdminException, MalformedObjectNameException {
-    try {
-      SystemMember member = lookupSystemMember(distributedMember);
-      if (member == null)
-        return null;
-      SystemMemberJmxImpl jmx = (SystemMemberJmxImpl) member;
-      ObjectName oname = new ObjectName(jmx.getMBeanName());
-      return oname;
-    } catch (AdminException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  @Override
-  public void connect(InternalLogWriter logWriter) {
-    try {
-      // LOG: passes the AdminDistributedSystemImpl LogWriterLogger into GfManagerAgentConfig
-      super.connect(logWriter);
-
-      // Load existing StatAlert Definitions
-      readAlertDefinitionsAsSerializedObjects();
-
-      /* Add Cache Listener to listen to Cache & Region create/destroy events */
-      if (logger.isDebugEnabled()) {
-        logger.debug("Adding CacheAndRegionListener .... ");
-      }
-      addCacheListener(cacheRegionListener);
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  @Override
-  public void disconnect() {
-    try {
-      super.disconnect();
-
-      // Save existing StatAlert Definitions
-      saveAlertDefinitionsAsSerializedObjects();
-
-      /* Remove Cache Listener to listen to Cache & Region create/destroy events */
-      if (logger.isDebugEnabled()) {
-        logger.debug("Removing CacheAndRegionListener .... ");
-      }
-      removeCacheListener(cacheRegionListener);
-    } catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, re-throw the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  public void cleanupResource() {
-    disconnect();
-  }
-
-  /**
-   * @return the isRmiClientCountZero
-   * @since GemFire 6.0
-   */
-  public boolean isRmiClientCountZero() {
-    return isRmiClientCountZero;
-  }
-
-  /**
-   * @param isRmiClientCountZero the isJmxClientCountZero to set
-   * @since GemFire 6.0
-   */
-  void setRmiClientCountZero(boolean isRmiClientCountZero) {
-    this.isRmiClientCountZero = isRmiClientCountZero;
-
-    if (isRmiClientCountZero) {
-      logger.info(
-          LocalizedStrings.AdminDistributedSystemJmxImpl_JMX_CLIENT_COUNT_HAS_DROPPED_TO_ZERO);
-    }
-  }
-
-
-  /////////////////////// Configuration ///////////////////////
-
-  public String getEntityConfigXMLFile() {
-    return this.getConfig().getEntityConfigXMLFile();
-  }
-
-  public void setEntityConfigXMLFile(String xmlFile) {
-    this.getConfig().setEntityConfigXMLFile(xmlFile);
-  }
-
-  public String getSystemId() {
-    return this.getConfig().getSystemId();
-  }
-
-  public void setSystemId(String systemId) {
-    this.getConfig().setSystemId(systemId);
-  }
-
-  @Override
-  public String getSystemName() {
-    return this.getConfig().getSystemName();
-  }
-
-  public void setSystemName(final String name) {
-    this.getConfig().setSystemName(name);
-  }
-
-  @Override
-  public boolean getDisableTcp() {
-    return this.getConfig().getDisableTcp();
-  }
-
-  public void setEnableNetworkPartitionDetection(boolean newValue) {
-    getConfig().setEnableNetworkPartitionDetection(newValue);
-  }
-
-  public boolean getEnableNetworkPartitionDetection() {
-    return getConfig().getEnableNetworkPartitionDetection();
-  }
-
-  public int getMemberTimeout() {
-    return getConfig().getMemberTimeout();
-  }
-
-  public void setMemberTimeout(int value) {
-    getConfig().setMemberTimeout(value);
-  }
-
-  @Override
-  public String getMcastAddress() {
-    return this.getConfig().getMcastAddress();
-  }
-
-  public void setMcastAddress(String mcastAddress) {
-    this.getConfig().setMcastAddress(mcastAddress);
-  }
-
-  @Override
-  public int getMcastPort() {
-    return this.getConfig().getMcastPort();
-  }
-
-  public void setMcastPort(int mcastPort) {
-    this.getConfig().setMcastPort(mcastPort);
-  }
-
-  public int getAckWaitThreshold() {
-    return getConfig().getAckWaitThreshold();
-  }
-
-  public void setAckWaitThreshold(int seconds) {
-    getConfig().setAckWaitThreshold(seconds);
-  }
-
-  public int getAckSevereAlertThreshold() {
-    return getConfig().getAckSevereAlertThreshold();
-  }
-
-  public void setAckSevereAlertThreshold(int seconds) {
-    getConfig().setAckSevereAlertThreshold(seconds);
-  }
-
-  @Override
-  public String getLocators() {
-    return this.getConfig().getLocators();
-  }
-
-  @Override
-  public void setLocators(String locators) {
-    this.getConfig().setLocators(locators);
-  }
-
-  /*
-   * Note that the getter & setter for membership port range are referred from the super class
-   * AdminDistributedSystemImpl
-   */
-
-  public String getBindAddress() {
-    return this.getConfig().getBindAddress();
-  }
-
-  public void setBindAddress(String bindAddress) {
-    this.getConfig().setBindAddress(bindAddress);
-  }
-
-  public String getServerBindAddress() {
-    return this.getConfig().getServerBindAddress();
-  }
-
-  public void setServerBindAddress(String bindAddress) {
-    this.getConfig().setServerBindAddress(bindAddress);
-  }
-
-  @Override
-  public String getRemoteCommand() {
-    return this.getConfig().getRemoteCommand();
-  }
-
-  @Override
-  public void setRemoteCommand(String command) {
-    this.getConfig().setRemoteCommand(command);
-  }
-
-  public boolean isSSLEnabled() {
-    return this.getConfig().isSSLEnabled();
-  }
-
-  public void setSSLEnabled(boolean enabled) {
-    this.getConfig().setSSLEnabled(enabled);
-  }
-
-  public String getSSLProtocols() {
-    return this.getConfig().getSSLProtocols();
-  }
-
-  public void setSSLProtocols(String protocols) {
-    this.getConfig().setSSLProtocols(protocols);
-  }
-
-  public String getSSLCiphers() {
-    return this.getConfig().getSSLCiphers();
-  }
-
-  public void setSSLCiphers(String ciphers) {
-    this.getConfig().setSSLCiphers(ciphers);
-  }
-
-  public boolean isSSLAuthenticationRequired() {
-    return this.getConfig().isSSLAuthenticationRequired();
-  }
-
-  public void setSSLAuthenticationRequired(boolean authRequired) {
-    this.getConfig().setSSLAuthenticationRequired(authRequired);
-  }
-
-  public Properties getSSLProperties() {
-    return this.getConfig().getSSLProperties();
-  }
-
-  public void setSSLProperties(Properties sslProperties) {
-    this.getConfig().setSSLProperties(sslProperties);
-  }
-
-  public void addSSLProperty(String key, String value) {
-    this.getConfig().addSSLProperty(key, value);
-  }
-
-  public void removeSSLProperty(String key) {
-    this.getConfig().removeSSLProperty(key);
-  }
-
-  public String getLogFile() {
-    return this.getConfig().getLogFile();
-  }
-
-  public void setLogFile(String logFile) {
-    this.getConfig().setLogFile(logFile);
-  }
-
-  public String getLogLevel() {
-    return this.getConfig().getLogLevel();
-  }
-
-  public void setLogLevel(String logLevel) {
-    this.getConfig().setLogLevel(logLevel);
-  }
-
-  public int getLogDiskSpaceLimit() {
-    return this.getConfig().getLogDiskSpaceLimit();
-  }
-
-  public void setLogDiskSpaceLimit(int limit) {
-    this.getConfig().setLogDiskSpaceLimit(limit);
-  }
-
-  public int getLogFileSizeLimit() {
-    return this.getConfig().getLogFileSizeLimit();
-  }
-
-  public void setLogFileSizeLimit(int limit) {
-    this.getConfig().setLogFileSizeLimit(limit);
-  }
-
-  public void setDisableTcp(boolean flag) {
-    this.getConfig().setDisableTcp(flag);
-  }
-
-  public int getRefreshInterval() {
-    return this.getConfig().getRefreshInterval();
-  }
-
-  /*
-   * The interval (in seconds) between auto-polling for updating AdminDistributedSystem constituents
-   * including SystemMember, SystemMemberCache and StatisticResource. This applies only to the
-   * default interval set when the resource is created. Changes to this interval will not get
-   * propagated to existing resources but will apply to all new resources
-   */
-  public void setRefreshInterval(int interval) {
-    this.getConfig().setRefreshInterval(interval);
-  }
-
-  public CacheServerConfig[] getCacheServerConfigs() {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public CacheServerConfig createCacheServerConfig() {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public void removeCacheServerConfig(CacheServerConfig config) {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public CacheVmConfig[] getCacheVmConfigs() {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public CacheVmConfig createCacheVmConfig() {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public void removeCacheVmConfig(CacheVmConfig config) {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public DistributionLocatorConfig[] getDistributionLocatorConfigs() {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public DistributionLocatorConfig createDistributionLocatorConfig() {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public void removeDistributionLocatorConfig(DistributionLocatorConfig config) {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public void addListener(ConfigListener listener) {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public void removeListener(ConfigListener listener) {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public void validate() {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  @Override
-  public Object clone() throws CloneNotSupportedException {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-
-  private static final String[] PERSISTENT_ID_FIELDS = new String[] {"host", "directory", "uuid"};
-  private static final String[] PERSISTENT_ID_DESCRIPTIONS =
-      new String[] {"The host that was persisting the missing files",
-          "The directory where the files were persisted", "The unique id for the persistent files"};
-  private final CompositeType PERSISTENT_ID_TYPE;
-  private final TabularType PERSISTENT_ID_TABLE_TYPE;
-
-  {
-    try {
-      PERSISTENT_ID_TYPE = new CompositeType(PersistentID.class.getCanonicalName(),
-          "A single member's a set of persistent files for a region", PERSISTENT_ID_FIELDS,
-          PERSISTENT_ID_DESCRIPTIONS,
-          new OpenType[] {SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
-      PERSISTENT_ID_TABLE_TYPE = new TabularType("TABLE_" + PERSISTENT_ID_TYPE.getTypeName(),
-          "A table of persistent member ids", PERSISTENT_ID_TYPE, PERSISTENT_ID_FIELDS);
-    } catch (OpenDataException e) {
-      throw new ExceptionInInitializerError(e);
-    }
-  }
-
-  public TabularData getMissingPersistentMembersJMX() throws AdminException {
-
-    try {
-      Set<PersistentID> members = super.getMissingPersistentMembers();
-      TabularData results = new TabularDataSupport(PERSISTENT_ID_TABLE_TYPE);
-      int index = 0;
-      for (PersistentID id : members) {
-        CompositeData idData = new CompositeDataSupport(PERSISTENT_ID_TYPE, PERSISTENT_ID_FIELDS,
-            new Object[] {id.getHost().toString(), id.getDirectory(), id.getUUID().toString()});
-        results.put(idData);
-        index++;
-      }
-      return results;
-    } catch (OpenDataException e) {
-      logger.warn("Exception occurred while getting missing persistent members.", e);
-      throw new AdminException(e);
-    }
-  }
-
-  public void revokePersistentMember(String host, String directory)
-      throws AdminException, UnknownHostException {
-    super.revokePersistentMember(InetAddress.getByName(host), directory);
-  }
-
-  public void revokePersistentMember(String uuid) throws AdminException, UnknownHostException {
-    super.revokePersistentMember(UUID.fromString(uuid));
-  }
-
-  /* ********************************************************************* */
-  /* ************** Implementing StatAlertsAggregator interface ********** */
-  /* ********************************************************************* */
-
-  /* Map to store admin stat alert definitions */
-  private final Map ALERT_DEFINITIONS = new Hashtable();
-
-  /* Refresh interval for all stat alerts managers in seconds */
-  private int refreshIntervalForStatAlerts = 20;
-
-  /*
-   * This map contains list of stat alerts as a value for alert def ID as a key
-   */
-  private final HashMap alertsStore = new HashMap();
-
-  // TODO: yet to set the timer task
-  // private SystemTimer systemwideAlertNotificationScheduler = new SystemTimer();
-
-  private MailManager mailManager = null;
-  private final boolean isEmailNotificationEnabled;
-
-  /**
-   * Convenience method to retrieve admin stat alert definition.
-   * 
-   * @param alertDefinitionId id of a stat alert definition
-   * @return StatAlertDefinition reference to an instance of StatAlertDefinition
-   * @since GemFire 5.7
-   */
-  private StatAlertDefinition getAlertDefinition(int alertDefinitionId) {
-    synchronized (ALERT_DEFINITIONS) {
-      return (StatAlertDefinition) ALERT_DEFINITIONS.get(Integer.valueOf(alertDefinitionId));
-    }
-  }
-
-  /*
-   * private void setAlertDefinition(StatAlertDefinition alertDefinition) {
-   * ALERT_DEFINITIONS.put(Integer.valueOf(alertDefinition.getId()), alertDefinition); }
-   */
-
-  /**
-   * This method can be used to get an alert definition.
-   * 
-   * @param alertDefinition StatAlertDefinition to retrieve
-   * @return StatAlertDefinition
-   * @since GemFire 5.7
-   */
-  public StatAlertDefinition getAlertDefinition(StatAlertDefinition alertDefinition) {
-    return getAlertDefinition(alertDefinition.getId());
-  }
-
-  /**
-   * This method is used to write existing StatAlertDefinitions to a file
-   */
-  protected void readAlertDefinitionsAsSerializedObjects() {
-    StatAlertDefinition[] defns = new StatAlertDefinition[0];
-
-    File serFile = null;
-    FileInputStream foStr = null;
-    DataInputStream ooStr = null;
-
-    try {
-      serFile = new File(statAlertDefnSerFile);
-
-      if (!canWriteToFile(serFile)) {/* can not write a file */
-        canPersistStatAlertDefs = false;
-      }
-      if (!serFile.exists()) {/* file does not exist */
-        return;
-      }
-
-      if (logger.isDebugEnabled()) {
-        logger.debug(
-            "AdminDistributedSystemJmxImpl.readAlertDefinitionsAsSerializedObjects: File: {}",
-            serFile.getPath());
-      }
-
-      foStr = new FileInputStream(serFile);
-      ooStr = new DataInputStream(foStr);
-      defns = (StatAlertDefinition[]) DataSerializer.readObjectArray(ooStr);
-    } catch (ClassNotFoundException cnfEx) {
-      logger.error(LocalizedMessage.create(
-          LocalizedStrings.AdminDistributedSystem_ENCOUNTERED_A_0_WHILE_LOADING_STATALERTDEFINITIONS_1,
-          new Object[] {cnfEx.getClass().getName(), statAlertDefnSerFile}), cnfEx);
-      canPersistStatAlertDefs = false;
-    } catch (IOException ex) {
-      logger.error(LocalizedMessage.create(
-          LocalizedStrings.AdminDistributedSystem_ENCOUNTERED_A_0_WHILE_LOADING_STATALERTDEFINITIONS_1_LOADING_ABORTED,
-          new Object[] {ex.getClass().getName(), statAlertDefnSerFile}), ex);
-      canPersistStatAlertDefs = false;
-    } finally {
-      if (foStr != null) {
-        try {
-          foStr.close();
-        } catch (IOException ex) {
-          ;
-        }
-      }
-      if (ooStr != null) {
-        try {
-          ooStr.close();
-        } catch (IOException ex) {
-          ;
-        }
-      }
-    }
-
-    for (int i = 0; i < defns.length; i++) {
-      updateAlertDefinition(defns[i]);
-    }
-  }
-
-  /**
-   * This method is used to write existing StatAlertDefinitions to a file
-   */
-  public void saveAlertDefinitionsAsSerializedObjects() {
-    File serFile = null;
-    FileOutputStream foStr = null;
-    DataOutputStream ooStr = null;
-    try {
-      serFile = new File(statAlertDefnSerFile);
-
-
-      if (logger.isDebugEnabled()) {
-        logger.debug(
-            "AdminDistributedSystemJmxImpl.saveAlertDefinitionsAsSerializedObjects: File: {}",
-            serFile.getPath());
-      }
-
-      if (!canWriteToFile(serFile)) {
-        return;
-      }
-
-      foStr = new FileOutputStream(serFile);
-      ooStr = new DataOutputStream(foStr);
-
-      int numOfAlerts = 0;
-      StatAlertDefinition[] defs = null;
-
-      synchronized (ALERT_DEFINITIONS) {
-        numOfAlerts = ALERT_DEFINITIONS.size();
-        defs = new StatAlertDefinition[numOfAlerts];
-
-        int i = 0;
-        for (Iterator iter = ALERT_DEFINITIONS.keySet().iterator(); iter.hasNext();) {
-          Integer key = (Integer) iter.next();
-          StatAlertDefinition readDefn = (StatAlertDefinition) ALERT_DEFINITIONS.get(key);
-          defs[i] = readDefn;
-          i++;
-        }
-      }
-
-      DataSerializer.writeObjectArray(defs, ooStr);
-    } catch (IOException ex) {
-      logger.error(LocalizedMessage.create(
-          LocalizedStrings.AdminDistributedSystem_ENCOUNTERED_A_0_WHILE_SAVING_STATALERTDEFINITIONS_1,
-          new Object[] {ex.getClass().getName(), statAlertDefnSerFile}), ex);
-    } finally {
-      if (foStr != null)
-        try {
-          foStr.close();
-        } catch (IOException ex) {
-          ;
-        }
-      if (ooStr != null)
-        try {
-          ooStr.close();
-        } catch (IOException ex) {
-          ;
-        }
-    }
-  }
-
-  /**
-   * Checks if the given file is writable.
-   * 
-   * @param file file to check write permissions for
-   * @return true if file is writable, false otherwise
-   */
-  private boolean canWriteToFile(File file) {
-    boolean fileIsWritable = true;
-    // Fix for BUG40360 : When the user does not have write permissions for
-    // saving the stat-alert definitions, then appropriate warning message is
-    // logged and the operation is aborted. In case the file doesn't exist, then
-    // it attempts to create a file. If the attempt fails then it logs
-    // appropriate warning and the operation is aborted. File.canWrite check for
-    // a directory sometimes fails on Windows platform. Hence file creation is
-    // necessary.
-    if (file.exists()) {
-      if (!file.canWrite()) {
-        logger.warn(LocalizedMessage.create(
-            LocalizedStrings.AdminDistributedSystemJmxImpl_READONLY_STAT_ALERT_DEF_FILE_0,
-            new Object[] {file}));
-        fileIsWritable = false;
-      }
-    } else {
-      try {
-        file.createNewFile();
-      } catch (IOException e) {
-        logger.warn(LocalizedMessage.create(
-            LocalizedStrings.AdminDistributedSystemJmxImpl_FAILED_TO_CREATE_STAT_ALERT_DEF_FILE_0,
-            new Object[] {file}), e);
-        fileIsWritable = false;
-      } finally {
-        // Since we had created this file only for testing purpose, delete the
-        // same.
-        if ((file.exists() && !file.delete()) && logger.isDebugEnabled()) {
-          logger.debug("Could not delete file :'{}' which is created for checking permissions.",
-              file.getAbsolutePath());
-        }
-      }
-    }
-    return fileIsWritable;
-  }
-
-  /**
-   * This method can be used to update alert definition for the Stat mentioned. This method should
-   * update the collection maintained at the aggregator and should notify members for the newly
-   * added alert definitions. A new alert definition will be created if matching one not found.
-   * 
-   * @param alertDefinition alertDefinition to be updated
-   * @since GemFire 5.7
-   */
-  public void updateAlertDefinition(StatAlertDefinition alertDefinition) {
-    if (logger.isDebugEnabled()) {
-      logger.debug(
-          "Entered AdminDistributedSystemJmxImpl.updateAlertDefinition(StatAlertDefinition) *****");
-    }
-    /*
-     * What to update in the alert definition? There should be another argument or arguments in a
-     * map. 1. Need to update the list/map of alert definitions across members.
-     */
-    synchronized (ALERT_DEFINITIONS) {
-      ALERT_DEFINITIONS.put(Integer.valueOf(alertDefinition.getId()), alertDefinition);
-
-      if (logger.isDebugEnabled()) {
-        logger.debug(
-            "AdminDistributedSystemJmxImpl.updateAlertDefinition : alertDefinition :: id={} :: {}",
-            alertDefinition.getId(), alertDefinition.getStringRepresentation());
-      }
-
-      /* TODO: add code to retry on failure */
-      notifyMembersForAlertDefinitionChange(alertDefinition);
-    }
-    if (logger.isDebugEnabled()) {
-      logger.debug(
-          "Exiting AdminDistributedSystemJmxImpl.updateAlertDefinition(StatAlertDefinition) *****");
-    }
-  }
-
-  /**
-   * This method can be used to remove alert definition for the Stat mentioned. This method should
-   * update the collection maintained at the aggregator and should notify members for the newly
-   * added alert definitions.
-   * 
-   * @param defId id of the alert definition to be removed
-   * @since GemFire 5.7
-   */
-  public void removeAlertDefinition(Integer defId) {
-    if (logger.isDebugEnabled()) {
-      logger.debug("Entered AdminDistributedSystemJmxImpl.removeAlertDefinition id *****");
-    }
-    /*
-     * alert passed to be deleted from the list/map of alerts on JMX MBean & all Member MBeans
-     */
-    synchronized (ALERT_DEFINITIONS) {
-      StatAlertDefinition alertDefinition = (StatAlertDefinition) ALERT_DEFINITIONS.get(defId);
-      if (alertDefinition != null) {
-        ALERT_DEFINITIONS.remove(defId);
-        synchronized (alertsStore) {
-          alertsStore.remove(defId);
-        }
-        /* TODO: add code to retry on failure */
-        notifyMembersForAlertDefinitionRemoval(alertDefinition);
-      }
-    }
-    if (logger.isDebugEnabled()) {
-      logger.debug("Exiting AdminDistributedSystemJmxImpl.removeAlertDefinition() *****");
-    }
-  }
-
-  /**
-   * Convenience method to check whether an alert definition is created.
-   * 
-   * @param alertDefinition alert definition to check whether already created
-   * @return true if the alert definition is already created, false otherwise
-   * @since GemFire 5.7
-   */
-  public boolean isAlertDefinitionCreated(StatAlertDefinition alertDefinition) {
-    /*
-     * Need to maintain a map of stat against the StatAlertDefinitions. check in that map whether
-     * the alert definition is there for the given alert
-     * 
-     * TODO: optimize to use Map.containsKey - DONE
-     */
-    synchronized (ALERT_DEFINITIONS) {
-      return ALERT_DEFINITIONS.containsKey(Integer.valueOf(alertDefinition.getId()));
-    }
-  }
-
-  /**
-   * Returns the refresh interval for the Stats in seconds.
-   * 
-   * @return refresh interval for the Stats(in seconds)
-   * @since GemFire 5.7
-   */
-  public synchronized int getRefreshIntervalForStatAlerts() {
-    /*
-     * state to store the refresh interval set by the user/GFMon client
-     */
-    return refreshIntervalForStatAlerts;
-  }
-
-  /**
-   * This method is used to set the refresh interval for the Stats in seconds
-   * 
-   * @param refreshIntervalForStatAlerts refresh interval for the Stats(in seconds)
-   * @since GemFire 5.7
-   */
-  public synchronized void setRefreshIntervalForStatAlerts(int refreshIntervalForStatAlerts) {
-    /*
-     * change the state refresh interval here.
-     */
-    this.refreshIntervalForStatAlerts = refreshIntervalForStatAlerts;
-    notifyMembersForRefreshIntervalChange(this.refreshIntervalForStatAlerts * 1000l);
-  }
-
-  /**
-   * Returns whether Statistics Alert definitions could be persisted across runs/sessions
-   * 
-   * @return value of canPersistStatAlertDefs.
-   * @since GemFire 6.5
-   */
-  public boolean canPersistStatAlertDefs() {
-    return canPersistStatAlertDefs;
-  }
-
-  /**
-   * An intermediate method to notify all members for change in refresh interval.
-   * 
-   * @param newInterval refresh interval to be set for members(in milliseconds)
-   */
-  private void notifyMembersForRefreshIntervalChange(long newInterval) {
-    GfManagerAgent agent = getGfManagerAgent();
-    ApplicationVM[] VMs = agent.listApplications();
-    // TODO: is there any other way to get all VMs?
-
-    for (int i = 0; i < VMs.length; i++) {
-      VMs[i].setRefreshInterval(newInterval);
-    }
-  }
-
-  /**
-   * An intermediate method to notify all members for change in stat alert definition.
-   * 
-   * @param alertDef stat alert definition that got changed
-   */
-  private void notifyMembersForAlertDefinitionChange(StatAlertDefinition alertDef) {
-    if (logger.isDebugEnabled()) {
-      logger.debug(
-          "Entered AdminDistributedSystemJmxImpl.notifyMembersForAlertDefinitionChange(StatAlertDefinition) *****");
-    }
-    GfManagerAgent agent = getGfManagerAgent();
-    StatAlertDefinition[] alertDefs = new StatAlertDefinition[] {alertDef};
-    ApplicationVM[] VMs = agent.listApplications();
-
-    for (int i = 0; i < VMs.length; i++) {
-      VMs[i].updateAlertDefinitions(alertDefs,
-          UpdateAlertDefinitionMessage.UPDATE_ALERT_DEFINITION);
-    }
-
-    if (logger.isDebugEnabled()) {
-      logger.debug(
-          "Exiting AdminDistributedSystemJmxImpl.notifyMembersForAlertDefinitionChange(StatAlertDefinition) "
-              + VMs.length + " members notified.*****");
-    }
-  }
-
-  /**
-   * An intermediate method to notify all members for removal of stat alert definition.
-   * 
-   * @param alertDef stat alert definition to be removed
-   */
-  private void notifyMembersForAlertDefinitionRemoval(StatAlertDefinition alertDef) {
-    GfManagerAgent agent = getGfManagerAgent();
-    StatAlertDefinition[] alertDefs = new StatAlertDefinition[] {alertDef};
-    ApplicationVM[] VMs = agent.listApplications();
-
-    for (int i = 0; i < VMs.length; i++) {
-      VMs[i].updateAlertDefinitions(alertDefs,
-          UpdateAlertDefinitionMessage.REMOVE_ALERT_DEFINITION);
-    }
-  }
-
-  /**
-   * This method can be used to set the AlertsManager for the newly joined member VM.
-   * 
-   * @param memberVM Member VM to set AlertsManager for
-   * @since GemFire 5.7
-   */
-  public synchronized void setAlertsManager(GemFireVM memberVM) {
-    /*
-     * 1. Who'll call this method? Who gets notified when a member joins? I think that's
-     * AdminDistributedSystemJmxImpl.nodeCreated() 2. Is the argument GemFireVM correct? Need to
-     * modify this interface to add method to set an interface. Need to see how it can be passed to
-     * the RemoteGemFireVM implementation. Also need to check whetherother implementors (like
-     * DistributedSystemHealthMonitor) of GemFireVM even need to have the AlertsManager 3. Would the
-     * alerts manager be set by aggregator or a JMXAgent i.e. AdminDistributedSystemJmxImpl 4.
-     * Setting the list of available alert definitions & refresh interval at this moment only would
-     * be better/easier. 5. Need to know Alerts Manager creation/construction. Need to decide how
-     * the object would be set & sent across to the Agent VM.
-     */
-    if (logger.isDebugEnabled()) {
-      logger.debug("Entered AdminDistributedSystemJmxImpl.setAlertsManager(GemFireVM) *****");
-    }
-
-    // creating an array of stat alert definition objects
-    StatAlertDefinition[] alertDefs = new StatAlertDefinition[0];
-
-    Collection alertDefsCollection = null;
-    synchronized (ALERT_DEFINITIONS) {
-      alertDefsCollection = ALERT_DEFINITIONS.values();
-    }
-
-    alertDefs = (StatAlertDefinition[]) alertDefsCollection.toArray(alertDefs);
-
-    memberVM.setAlertsManager(alertDefs, getRefreshIntervalForStatAlerts() * 1000l, true);
-
-    if (logger.isDebugEnabled()) {
-      logger.debug("Exiting AdminDistributedSystemJmxImpl.setAlertsManager(GemFireVM) *****");
-    }
-  }
-
-  /**
-   * This method can be used to retrieve all available stat alert definitions. Returns empty array
-   * if there are no stat alert definitions defined.
-   * 
-   * @return An array of all available StatAlertDefinition objects
-   * @since GemFire 5.7
-   */
-  public StatAlertDefinition[] getAllStatAlertDefinitions() {
-    if (logger.isDebugEnabled()) {
-      logger.debug("Entered AdminDistributedSystemJmxImpl.getAllStatAlertDefinitions() *****");
-    }
-
-    Collection alertDefs = null;
-    synchronized (ALERT_DEFINITIONS) {
-      alertDefs = ALERT_DEFINITIONS.values();
-    }
-
-    StatAlertDefinition[] alertDefsArr = null;
-
-    if (alertDefs != null) {
-      alertDefsArr = new StatAlertDefinition[alertDefs.size()];
-      alertDefsArr = (StatAlertDefinition[]) alertDefs.toArray(alertDefsArr);
-    } else {
-      alertDefsArr = new StatAlertDefinition[0];
-    }
-
-    if (logger.isDebugEnabled()) {
-      logger.debug("Exiting AdminDistributedSystemJmxImpl.getAllStatAlertDefinitions() *****");
-    }
-
-    return alertDefsArr;
-  }
-
-
-  /**
-   * This method can be used to process the notifications sent by the member(s). Actual aggregation
-   * of stats can occur here. The array contains alert objects with alert def. ID & value.
-   * AlertHelper class can be used to retrieve the corresponding alert definition.
-   * 
-   * @param alerts array of Alert class(contains alert def. ID & value)
-   * @param remoteVM Remote Member VM that sent Stat Alerts for processing the notifications to the
-   *        clients
-   */
-  public void processNotifications(StatAlert[] alerts, GemFireVM remoteVM) {
-    if (logger.isDebugEnabled()) {
-      logger.debug(
-          "Entered AdminDistributedSystemJmxImpl.processNotifications(StatAlert[{}], GemFireVM) *************",
-          alerts.length);
-    }
-
-    /*
-     * Notifications can not be processed if the remote VM is not available. NOTE: Should this
-     * method get the required GemFireVM information instead of its reference so that even if the
-     * member leaves we still have the information collected earlier to process the notification?
-     */
-    if (remoteVM == null) {
-      if (logger.isDebugEnabled()) {
-        logger.debug("Could not process stat alert notifications as given GemFireVM is null.");
-      }
-      return;
-    }
-
-    /*
-     * 1. The implementation idea is yet not clear. 2. The StatAlert array would received directly
-     * or from a request object.
-     */
-    ArrayList notificationObjects = new ArrayList();
-
-    String memberId = remoteVM.getId().getId();
-
-    final boolean isSystemWide = false;
-
-    StatAlert alert = null;
-    Integer defId = null;
-    // Number[] values = null;
-    for (int i = 0; i < alerts.length; i++) {
-      alert = alerts[i];
-
-      // defId = Integer.valueOf(alert.getDefinitionId());
-      if (getAlertDefinition(alert.getDefinitionId()) == null)
-        continue; // Ignore any removed AlertDefns
-      // values = alert.getValues();
-
-      // StatAlertDefinition statAlertDef = (StatAlertDefinition)ALERT_DEFINITIONS.get(defId);
-
-      /*
-       * 1. check if it's system-wide. 2. if system-wide keep, it in a collection (that should get
-       * cleared on timeout). Process all alerts when notifications from all members are received.
-       * Need to check if the member leaves meanwhile.
-       * 
-       * 1. Check if function evaluation is required? 2. If it's not required, the notification
-       * should directly be sent to clients.
-       */
-
-      // if (statAlertDef.getFunctionId() != 0) {
-      /*
-       * StatAlert with alert definitions having functions assigned will get evaluated at manager
-       * side only.
-       * 
-       * Is combination of systemwide alerts with function valid? It should be & hence such
-       * evaluation should be skipped on manager side. Or is it to be evaluated at manager as well
-       * as aggragator?
-       */
-      // }
-
-      // TODO: is this object required? Or earlier canbe resused?
-      StatAlertNotification alertNotification = new StatAlertNotification(alert, memberId);
-
-      /*
-       * variable isSystemWide is created only for convienience, there should be an indication for
-       * the same in the alert definition. Currently there is no systemWide definition
-       * 
-       * Evaluating system wide alerts: 1. It'll take time for aggregator to gather alerts from all
-       * members. Member might keep joining & leaving in between. The member for whom the stat-alert
-       * value was taken might have left & new ones might have joined leave until all the
-       * calculations are complete. A disclaimer to be put that these are not exact values. 2. How
-       * would the aggregator know that it has received alerts from all the managers? Is the concept
-       * of system-wide alerts valid? System-wide stats might be!
-       * 
-       */
-      if (!isSystemWide) {
-        notificationObjects.add(alertNotification);
-        continue;
-      }
-      HashSet accumulatedAlertValues;
-      synchronized (alertsStore) {
-        accumulatedAlertValues = (HashSet) alertsStore.get(defId);
-
-        if (accumulatedAlertValues == null) {
-          accumulatedAlertValues = new HashSet();
-          alertsStore.put(defId, accumulatedAlertValues);
-        }
-      }
-      synchronized (accumulatedAlertValues) {
-        accumulatedAlertValues.add(alertNotification);
-      }
-    } // for ends
-
-    if (!notificationObjects.isEmpty()) {
-      /* TODO: should ths method send & forget or be fail-safe? */
-      sendNotifications(notificationObjects, getObjectName());
-    }
-
-    if (logger.isDebugEnabled()) {
-      logger.debug(
-          "Exiting AdminDistributedSystemJmxImpl.processNotifications(StatAlert[], GemFireVM) *************");
-    }
-  }
-
-  private byte[] convertNotificationsDataToByteArray(ArrayList notificationObjects) {
-    if (logger.isDebugEnabled()) {
-      logger.debug(
-          "AdminDistributedSystemJmxImpl#convertNotificationsDataToByteArray: {} notifications",
-          notificationObjects.size());
-    }
-
-    byte[] arr = null;
-
-    try {
-      ByteArrayOutputStream byteArrStr = new ByteArrayOutputStream();
-      DataOutputStream str = new DataOutputStream(byteArrStr);
-      DataSerializer.writeArrayList(notificationObjects, str);
-      str.flush();
-      arr = byteArrStr.toByteArray();
-    } catch (IOException ex) {
-      logger.warn(LocalizedMessage.create(
-          LocalizedStrings.AdminDistributedSystem_ENCOUNTERED_AN_IOEXCEPTION_0,
-          ex.getLocalizedMessage()));
-    }
-
-    return arr;
-  }
-
-  /**
-   * An intermediate method to send notifications to the clients.
-   * 
-   * @param notificationObjects list of StatAlertNotification objects
-   */
-  private void sendNotifications(ArrayList notificationObjects, ObjectName objName) {
-    try {
-      if (logger.isDebugEnabled()) {
-        logger.debug("AdminDistributedSystemJmxImpl#sendNotifications: sending {} notifications",
-            notificationObjects.size());
-      }
-
-      byte[] notifBytes = convertNotificationsDataToByteArray(notificationObjects);
-      if (notifBytes != null) {
-        Notification notif = new Notification(NOTIF_STAT_ALERT, objName, // Pass the
-                                                                         // StatNotifications
-            notificationSequenceNumber.addAndGet(1), "StatAlert Notifications");
-        notif.setUserData(notifBytes);
-        this.modelMBean.sendNotification(notif);
-      } // IOException handled and logged in convertNotificationsDataToByteArray
-
-      StringBuffer buf = new StringBuffer();
-      for (int i = 0; i < notificationObjects.size(); i++) {
-        StatAlertNotification not = (StatAlertNotification) notificationObjects.get(i);
-        buf.append(not.toString(getAlertDefinition(not.getDefinitionId())));
-      }
-      // sendEmail("Gemfire AlertNotification on Member:" + objName, buf.toString());
-      if (isEmailNotificationEnabled) {
-        String mess =
-            LocalizedStrings.AdminDistributedSystemJmxImpl_STATISTICS_ALERT_FROM_DISTRIBUTED_SYSTEM_MEMBER_0_STATISTICS_1
-                .toLocalizedString(new Object[] {objName.getCanonicalName(), buf.toString()});
-        sendEmail(EML_SUBJ_PRFX_GFE_ALERT + EML_SUBJ_ITEM_GFE_DS + getName() + " <"
-            + LocalizedStrings.AdminDistributedSystemJmxImpl_STATISTICS_ALERT_FOR_MEMBER
-                .toLocalizedString()
-            + ">", mess);
-      }
-    } catch (javax.management.MBeanException e) {
-      logger.error(e.getMessage(), e);
-    } catch (RuntimeException e) {
-      logger.error(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  /**
-   * Sends an email to the configured recipients using configured email server. The given message
-   * will be the email body. NOTE: the check whether email notfication is enabled or not should done
-   * using {@link #isEmailNotificationEnabled} before calling this method.
-   * 
-   * @param subject subject of the email
-   * @param message message body of the email
-   */
-  private void sendEmail(String subject, String message) {
-    if (mailManager == null) {
-      mailManager = new MailManager(mailProps);
-    }
-    this.mailManager.sendEmail(subject, message);
-  }
-
-  public void processSystemwideNotifications() {}
-
-  public String getId() {
-    String myId = super.getId();
-    return MBeanUtil.makeCompliantMBeanNameProperty(myId);
-  }
-
-  /**
-   * This method is used to process ClientMembership events sent for BridgeMembership by bridge
-   * servers to all admin members.
-   * 
-   * @param senderId id of the member that sent the ClientMembership changes for processing (could
-   *        be null)
-   * @param clientId id of a client for which the notification was sent
-   * @param clientHost host on which the client is/was running
-   * @param eventType denotes whether the client Joined/Left/Crashed should be one of
-   *        ClientMembershipMessage#JOINED, ClientMembershipMessage#LEFT,
-   *        ClientMembershipMessage#CRASHED
-   */
-  @Override
-  public void processClientMembership(String senderId, String clientId, String clientHost,
-      int eventType) {
-    logger.info(LocalizedMessage.create(
-        LocalizedStrings.AdminDistributedSystemJmxImpl_PROCESSING_CLIENT_MEMBERSHIP_EVENT_0_FROM_1_FOR_2_RUNNING_ON_3,
-        new String[] {ClientMembershipMessage.getEventTypeString(eventType), senderId, clientId,
-            clientHost}));
-    try {
-      SystemMemberJmx systemMemberJmx = null;
-      CacheVm[] cacheVms = getCacheVms();
-
-      for (CacheVm cacheVm : cacheVms) {
-        if (cacheVm.getId().equals(senderId) && cacheVm instanceof CacheServerJmxImpl) {
-          systemMemberJmx = (CacheServerJmxImpl) cacheVm;
-          break;
-        }
-      }
-
-      if (systemMemberJmx == null) {
-        SystemMember[] appVms = getSystemMemberApplications();
-
-        for (SystemMember appVm : appVms) {
-          if (appVm.getId().equals(senderId) && appVm instanceof SystemMemberJmxImpl) {
-            systemMemberJmx = (SystemMemberJmxImpl) appVm;
-            break;
-          }
-        }
-
-      }
-
-      if (systemMemberJmx != null) {
-        systemMemberJmx.handleClientMembership(clientId, eventType);
-      }
-    } catch (AdminException e) {
-      logger.error(LocalizedMessage.create(
-          LocalizedStrings.AdminDistributedSystemJmxImpl_FAILED_TO_PROCESS_CLIENT_MEMBERSHIP_FROM_0_FOR_1,
-          new Object[] {senderId, clientId}), e);
-      return;
-    } catch (RuntimeOperationsException e) {
-      logger.warn(e.getMessage(), e);// failed to send notification
-    }
-  }
-
-  public String getAlertLevelAsString() {
-    return super.getAlertLevelAsString();
-  }
-
-  public void setAlertLevelAsString(String level) {
-    String newLevel = level != null ? level.trim() : null;
-    try {
-      super.setAlertLevelAsString(newLevel);
-    } catch (IllegalArgumentException e) {
-      throw new RuntimeMBeanException(e, e.getMessage());
-    }
-  }
-
-  /**
-   * Finds the member as per details in the given event object and passes on this event for handling
-   * the cache creation.
-   * 
-   * @param event event object corresponding to the creation of the cache
-   */
-  public void handleCacheCreateEvent(SystemMemberCacheEvent event) {
-    String memberId = event.getMemberId();
-    SystemMemberJmx systemMemberJmx = (SystemMemberJmx) findCacheOrAppVmById(memberId);
-
-    if (systemMemberJmx != null) {
-      systemMemberJmx.handleCacheCreate(event);
-    }
-
-  }
-
-  /**
-   * Finds the member as per details in the given event object and passes on this event for handling
-   * the cache closure.
-   * 
-   * @param event event object corresponding to the closure of the cache
-   */
-  public void handleCacheCloseEvent(SystemMemberCacheEvent event) {
-    String memberId = event.getMemberId();
-    SystemMemberJmx systemMemberJmx = (SystemMemberJmx) findCacheOrAppVmById(memberId);
-
-    if (systemMemberJmx != null) {
-      systemMemberJmx.handleCacheClose(event);
-    }
-
-  }
-
-  /**
-   * Finds the member as per details in the given event object and passes on this event for handling
-   * the region creation.
-   * 
-   * @param event event object corresponding to the creation of a region
-   */
-  public void handleRegionCreateEvent(SystemMemberRegionEvent event) {
-    String memberId = event.getMemberId();
-    SystemMemberJmx systemMemberJmx = (SystemMemberJmx) findCacheOrAppVmById(memberId);
-
-    if (systemMemberJmx != null) {
-      systemMemberJmx.handleRegionCreate(event);
-    }
-  }
-
-  /**
-   * Finds the member as per details in the given event object and passes on this event for handling
-   * the region loss.
-   * 
-   * @param event event object corresponding to the loss of a region
-   */
-  public void handleRegionLossEvent(SystemMemberRegionEvent event) {
-    String memberId = event.getMemberId();
-    SystemMemberJmx systemMemberJmx = (SystemMemberJmx) findCacheOrAppVmById(memberId);
-
-    if (systemMemberJmx != null) {
-      systemMemberJmx.handleRegionLoss(event);
-    }
-  }
-
-  @Override
-  public void setDisableAutoReconnect(boolean newValue) {
-    getConfig().setDisableAutoReconnect(newValue);
-  }
-
-  @Override
-  public boolean getDisableAutoReconnect() {
-    return getConfig().getDisableAutoReconnect();
-  }
-
-}
-
-
-class ProcessSystemwideStatAlertsNotification extends TimerTask {
-  private StatAlertsAggregator aggregator;
-
-  ProcessSystemwideStatAlertsNotification(StatAlertsAggregator aggregator) {
-    this.aggregator = aggregator;
-  }
-
-  @Override
-  public void run() {
-    aggregator.processSystemwideNotifications();
-  }
-
-}
-
-
-/**
- * Implementation of SystemMemberCacheListener used for listening to events:
- * <ol>
- * <li>Cache Created</li>
- * <li>Cache Closed</li>
- * <li>Region Created</li>
- * <li>Region Loss</li>
- * </ol>
- * 
- */
-class CacheAndRegionListenerImpl implements SystemMemberCacheListener {
-  private AdminDistributedSystemJmxImpl adminDS;
-
-  /**
-   * Csontructor to create CacheAndRegionListenerImpl
-   * 
-   * @param adminDSResource instance of AdminDistributedSystemJmxImpl
-   */
-  CacheAndRegionListenerImpl(AdminDistributedSystemJmxImpl adminDSResource) {
-    this.adminDS = adminDSResource;
-  }
-
-  /**
-   * See SystemMemberCacheListener#afterCacheClose(SystemMemberCacheEvent)
-   */
-  public void afterCacheClose(SystemMemberCacheEvent event) {
-    adminDS.handleCacheCloseEvent(event);
-  }
-
-  /**
-   * See SystemMemberCacheListener#afterCacheCreate(SystemMemberCacheEvent)
-   */
-  public void afterCacheCreate(SystemMemberCacheEvent event) {
-    adminDS.handleCacheCreateEvent(event);
-  }
-
-  /**
-   * See SystemMemberCacheListener#afterRegionCreate(SystemMemberCacheEvent)
-   */
-  public void afterRegionCreate(SystemMemberRegionEvent event) {
-    adminDS.handleRegionCreateEvent(event);
-  }
-
-  /**
-   * See SystemMemberCacheListener#afterRegionLoss(SystemMemberCacheEvent)
-   */
-  public void afterRegionLoss(SystemMemberRegionEvent event) {
-    adminDS.handleRegionLossEvent(event);
-  }
-}
-


[20/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher.java
new file mode 100644
index 0000000..932fe21
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/AgentLauncher.java
@@ -0,0 +1,918 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.PrintStream;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.SortedMap;
+import java.util.StringTokenizer;
+import java.util.TreeMap;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.GemFireException;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.jmx.Agent;
+import org.apache.geode.internal.admin.api.jmx.AgentConfig;
+import org.apache.geode.internal.admin.api.jmx.AgentFactory;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.internal.OSProcess;
+import org.apache.geode.internal.PureJavaMode;
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.util.IOUtils;
+import org.apache.geode.internal.util.JavaCommandBuilder;
+
+/**
+ * A command line utility inspired by the <code>CacheServerLauncher</code> that is responsible for
+ * administering a stand-along GemFire JMX {@link Agent}.
+ * <p/>
+ * 
+ * @since GemFire 3.5
+ */
+public class AgentLauncher {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /** Should the launch command be printed? */
+  public static final boolean PRINT_LAUNCH_COMMAND =
+      Boolean.getBoolean(AgentLauncher.class.getSimpleName() + ".PRINT_LAUNCH_COMMAND");
+
+  /* constants used to define state */
+  static final int SHUTDOWN = 0;
+  static final int STARTING = 1;
+  static final int RUNNING = 2;
+  static final int SHUTDOWN_PENDING = 3;
+  static final int SHUTDOWN_PENDING_AFTER_FAILED_STARTUP = 4;
+  static final int UNKNOWN = 6;
+
+  /** Agent configuration options */
+  static final String AGENT_PROPS = "agent-props";
+
+  /**
+   * A flag to indicate if the current log file should be kept. Used only when 'start' is used to
+   * fork off the 'server'
+   */
+  static final String APPENDTO_LOG_FILE = "appendto-log-file";
+
+  /** optional and additional classpath entries */
+  static final String CLASSPATH = "classpath";
+
+  /** The directory argument */
+  static final String DIR = "dir";
+
+  /** Extra VM arguments */
+  static final String VMARGS = "vmargs";
+
+  /** The directory in which the agent's output resides */
+  private File workingDirectory = null;
+
+  /** The Status object for the agent */
+  private Status status = null;
+
+  /** base name for the agent to be launched */
+  private final String basename;
+
+  /** The name for the start up log file */
+  private final String startLogFileName;
+
+  /** The name of the status file */
+  private final String statusFileName;
+
+  /**
+   * Instantiates an AgentLauncher for execution and control of the GemFire JMX Agent process. This
+   * constructor is package private to prevent direct instantiation or subclassing by classes
+   * outside this package, but does allow the class to be tested as needed.
+   * <p/>
+   * 
+   * @param basename base name for the application to be launched
+   */
+  AgentLauncher(final String basename) {
+    assert basename != null : "The base name used by the AgentLauncher to create files cannot be null!";
+    this.basename = basename;
+    final String formattedBasename = this.basename.toLowerCase().replace(" ", "");
+    this.startLogFileName = "start_" + formattedBasename + ".log";
+    this.statusFileName = "." + formattedBasename + ".ser";
+  }
+
+  /**
+   * Prints information about the agent configuration options
+   */
+  public void configHelp() {
+    PrintStream out = System.out;
+
+    Properties props = AgentConfigImpl.getDefaultValuesForAllProperties();
+
+    out.println("\n");
+    out.println(LocalizedStrings.AgentLauncher_AGENT_CONFIGURATION_PROPERTIES.toString());
+
+    SortedMap<String, String> map = new TreeMap<String, String>();
+
+    int maxLength = 0;
+    for (Iterator<Object> iter = props.keySet().iterator(); iter.hasNext();) {
+      String prop = (String) iter.next();
+      int length = prop.length();
+      if (length > maxLength) {
+        maxLength = length;
+      }
+
+      map.put(prop,
+          AgentConfigImpl.getPropertyDescription(prop) + " ("
+              + LocalizedStrings.AgentLauncher_DEFAULT.toLocalizedString() + "  \""
+              + props.getProperty(prop) + "\")");
+    }
+
+    Iterator<Entry<String, String>> entries = map.entrySet().iterator();
+    while (entries.hasNext()) {
+      Entry<String, String> entry = entries.next();
+      String prop = entry.getKey();
+      out.print("  ");
+      out.println(prop);
+
+      String description = entry.getValue();
+      StringTokenizer st = new StringTokenizer(description, " ");
+      out.print("    ");
+      int printed = 6;
+      while (st.hasMoreTokens()) {
+        String word = st.nextToken();
+        if (printed + word.length() > 72) {
+          out.print("\n    ");
+          printed = 6;
+        }
+        out.print(word);
+        out.print(" ");
+        printed += word.length() + 1;
+      }
+      out.println("");
+    }
+    out.println("");
+
+    System.exit(1);
+  }
+
+  /**
+   * Returns a map that maps the name of the start options to its value on the command line. If no
+   * value is specified on the command line, a default one is provided.
+   */
+  protected Map<String, Object> getStartOptions(final String[] args) throws Exception {
+    final Map<String, Object> options = new HashMap<String, Object>();
+
+    options.put(APPENDTO_LOG_FILE, "false");
+    options.put(DIR, IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(new File(".")));
+
+    final List<String> vmArgs = new ArrayList<String>();
+    options.put(VMARGS, vmArgs);
+
+    final Properties agentProps = new Properties();
+    options.put(AGENT_PROPS, agentProps);
+
+    for (final String arg : args) {
+      if (arg.startsWith("-classpath=")) {
+        options.put(CLASSPATH, arg.substring("-classpath=".length()));
+      } else if (arg.startsWith("-dir=")) {
+        final File workingDirectory = processDirOption(options, arg.substring("-dir=".length()));
+        System.setProperty(AgentConfigImpl.AGENT_PROPSFILE_PROPERTY_NAME,
+            new File(workingDirectory, AgentConfig.DEFAULT_PROPERTY_FILE).getPath());
+      } else if (arg.startsWith("-J")) {
+        vmArgs.add(arg.substring(2));
+      } else if (arg.contains("=")) {
+        final int index = arg.indexOf("=");
+        final String prop = arg.substring(0, index);
+        final String value = arg.substring(index + 1);
+
+        // if appendto-log-file is set, put it in options; it is not set as an agent prop
+        if (prop.equals(APPENDTO_LOG_FILE)) {
+          options.put(APPENDTO_LOG_FILE, value);
+          continue;
+        }
+
+        // verify the property is valid
+        AgentConfigImpl.getPropertyDescription(prop);
+
+        // Note, the gfAgentPropertyFile System property is ultimately read in the constructor of
+        // the AgentImpl class
+        // in order to make any properties defined in this file not only accessible to the
+        // DistributedSystem but to
+        // the GemFire Agent as well.
+        if (AgentConfigImpl.PROPERTY_FILE_NAME.equals(prop)) {
+          System.setProperty(AgentConfigImpl.AGENT_PROPSFILE_PROPERTY_NAME, value);
+        }
+
+        // The Agent properties file (specified with the command-line key=value) is used to pass
+        // configuration settings
+        // to the GemFire DistributedSystem. A property file can be passed using the property-file
+        // command-line switch
+        // is a large number of properties are specified, or the properties maybe individually
+        // specified on the
+        // command-line as property=value arguments.
+        agentProps.setProperty(prop, value);
+      }
+    }
+
+    return options;
+  }
+
+  /**
+   * After parsing the command line arguments, spawn the Java VM that will host the GemFire JMX
+   * Agent.
+   */
+  public void start(final String[] args) throws Exception {
+    final Map<String, Object> options = getStartOptions(args);
+
+    workingDirectory = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile((File) options.get(DIR));
+
+    // verify that any GemFire JMX Agent process has been properly shutdown and delete any remaining
+    // status files...
+    verifyAndClearStatus();
+
+    // start the GemFire JMX Agent process...
+    runCommandLine(options, buildCommandLine(options));
+
+    // wait for the GemFire JMX Agent process to complete startup and begin running...
+    // it is also possible the Agent process may fail to start, so this should not wait indefinitely
+    // unless
+    // the status file was not successfully written to
+    pollAgentUntilRunning();
+
+    System.exit(0);
+  }
+
+  private void verifyAndClearStatus() throws Exception {
+    final Status status = getStatus();
+
+    if (status != null && status.state != SHUTDOWN) {
+      throw new IllegalStateException(
+          LocalizedStrings.AgentLauncher_JMX_AGENT_EXISTS_BUT_WAS_NOT_SHUTDOWN.toLocalizedString());
+    }
+
+    deleteStatus();
+  }
+
+  private String[] buildCommandLine(final Map<String, Object> options) {
+    final List<String> commands = JavaCommandBuilder.buildCommand(AgentLauncher.class.getName(),
+        (String) options.get(CLASSPATH), null, (List<String>) options.get(VMARGS));
+
+    commands.add("server");
+    commands.add("-dir=" + workingDirectory);
+
+    final Properties agentProps = (Properties) options.get(AGENT_PROPS);
+
+    for (final Object key : agentProps.keySet()) {
+      commands.add(key + "=" + agentProps.get(key.toString()));
+    }
+
+    return commands.toArray(new String[commands.size()]);
+  }
+
+  private void printCommandLine(final String[] commandLine) {
+    if (PRINT_LAUNCH_COMMAND) {
+      System.out.print("Starting " + this.basename + " with command:\n");
+      for (final String command : commandLine) {
+        System.out.print(command);
+        System.out.print(' ');
+      }
+      System.out.println();
+    }
+  }
+
+  private int runCommandLine(final Map<String, Object> options, final String[] commandLine)
+      throws IOException {
+    // initialize the startup log starting with a fresh log file (where all startup messages are
+    // printed)
+    final File startLogFile = IOUtils
+        .tryGetCanonicalFileElseGetAbsoluteFile(new File(workingDirectory, startLogFileName));
+
+    if (startLogFile.exists() && !startLogFile.delete()) {
+      throw new IOException(LocalizedStrings.AgentLauncher_UNABLE_TO_DELETE_FILE_0
+          .toLocalizedString(startLogFile.getAbsolutePath()));
+    }
+
+    Map<String, String> env = new HashMap<String, String>();
+    // read the passwords from command line
+    SocketCreator.readSSLProperties(env, true);
+
+    printCommandLine(commandLine);
+
+    final int pid = OSProcess.bgexec(commandLine, workingDirectory, startLogFile, false, env);
+
+    System.out.println(
+        LocalizedStrings.AgentLauncher_STARTING_JMX_AGENT_WITH_PID_0.toLocalizedString(pid));
+
+    return pid;
+  }
+
+  private void pollAgentUntilRunning() throws Exception {
+    Status status = spinReadStatus();
+
+    // TODO this loop could recurse indefinitely if the GemFire JMX Agent's state never changes from
+    // STARTING
+    // to something else (like RUNNING), which could happen if server process fails to startup
+    // correctly
+    // and did not or could not write to the status file!
+    // TODO should we really allow the InterruptedException from the Thread.sleep call to break this
+    // loop (yeah, I
+    // think so given the fact this could loop indefinitely)?
+    while (status != null && status.state == STARTING) {
+      Thread.sleep(500);
+      status = spinReadStatus();
+    }
+
+    if (status == null) {
+      // TODO throw a more appropriate Exception here!
+      throw new Exception(LocalizedStrings.AgentLauncher_NO_AVAILABLE_STATUS.toLocalizedString());
+    } else {
+      System.out.println(status);
+    }
+  }
+
+  /**
+   * Starts the GemFire JMX Agent "server" process with the given command line arguments.
+   */
+  public void server(final String[] args) throws Exception {
+    final Map<String, Object> options = getStartOptions(args);
+
+    workingDirectory = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile((File) options.get(DIR));
+
+    writeStatus(createStatus(this.basename, STARTING, OSProcess.getId()));
+
+    final Agent agent = createAgent((Properties) options.get(AGENT_PROPS));
+
+    final Thread thread = createAgentProcessThread(createAgentProcessThreadGroup(), agent);
+    thread.setDaemon(true);
+    thread.start();
+
+    // periodically check and see if the JMX Agent has been told to stop
+    pollAgentForPendingShutdown(agent);
+  }
+
+  private Agent createAgent(final Properties props) throws IOException, AdminException {
+    DistributionManager.isDedicatedAdminVM = true;
+    SystemFailure.setExitOK(true);
+
+    final AgentConfigImpl config = new AgentConfigImpl(props);
+
+    // see bug 43760
+    if (config.getLogFile() == null || "".equals(config.getLogFile().trim())) {
+      config.setLogFile(AgentConfigImpl.DEFAULT_LOG_FILE);
+    }
+
+    // LOG:TODO: redirectOutput called here
+    OSProcess.redirectOutput(new File(config.getLogFile())); // redirect output to the configured
+                                                             // log file
+
+    return AgentFactory.getAgent(config);
+  }
+
+  private ThreadGroup createAgentProcessThreadGroup() {
+    return new ThreadGroup(LocalizedStrings.AgentLauncher_STARTING_AGENT.toLocalizedString()) {
+      @Override
+      public void uncaughtException(final Thread t, final Throwable e) {
+        if (e instanceof VirtualMachineError) {
+          SystemFailure.setFailure((VirtualMachineError) e);
+        }
+        setServerError(LocalizedStrings.AgentLauncher_UNCAUGHT_EXCEPTION_IN_THREAD_0
+            .toLocalizedString(t.getName()), e);
+      }
+    };
+  }
+
+  private Thread createAgentProcessThread(final ThreadGroup group, final Agent agent) {
+    return new Thread(group, createAgentProcessRunnable(agent), "Start agent");
+  }
+
+  private Runnable createAgentProcessRunnable(final Agent agent) {
+    return new Runnable() {
+      public void run() {
+        try {
+          agent.start();
+          writeStatus(createStatus(AgentLauncher.this.basename, RUNNING, OSProcess.getId()));
+        } catch (IOException e) {
+          e.printStackTrace();
+        } catch (GemFireException e) {
+          e.printStackTrace();
+          handleGemFireException(e);
+        }
+      }
+
+      private void handleGemFireException(final GemFireException e) {
+        String message = LocalizedStrings.AgentLauncher_SERVER_FAILED_TO_START_0
+            .toLocalizedString(e.getMessage());
+
+        if (e.getCause() != null) {
+          if (e.getCause().getCause() != null) {
+            message += ", " + e.getCause().getCause().getMessage();
+          }
+        }
+
+        setServerError(null, new Exception(message));
+      }
+    };
+  }
+
+
+  /**
+   * Notes that an error has occurred in the agent and that it has shut down because of it.
+   */
+  private void setServerError(final String message, final Throwable cause) {
+    try {
+      writeStatus(createStatus(this.basename, SHUTDOWN_PENDING_AFTER_FAILED_STARTUP,
+          OSProcess.getId(), message, cause));
+    } catch (Exception e) {
+      logger.fatal(e.getMessage(), e);
+      System.exit(1);
+    }
+  }
+
+  private void pollAgentForPendingShutdown(final Agent agent) throws Exception {
+    while (true) {
+      pause(500);
+      spinReadStatus();
+
+      if (isStatus(SHUTDOWN_PENDING, SHUTDOWN_PENDING_AFTER_FAILED_STARTUP)) {
+        agent.stop();
+        final int exitCode = (isStatus(SHUTDOWN_PENDING_AFTER_FAILED_STARTUP) ? 1 : 0);
+        writeStatus(createStatus(this.status, SHUTDOWN));
+        System.exit(exitCode);
+      }
+    }
+  }
+
+  /**
+   * Extracts configuration information for stopping a agent based on the contents of the command
+   * line. This method can also be used with getting the status of a agent.
+   */
+  protected Map<String, Object> getStopOptions(final String[] args) throws Exception {
+    final Map<String, Object> options = new HashMap<String, Object>();
+
+    options.put(DIR, IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(new File(".")));
+
+    for (final String arg : args) {
+      if (arg.equals("stop") || arg.equals("status")) {
+        // expected
+      } else if (arg.startsWith("-dir=")) {
+        processDirOption(options, arg.substring("-dir=".length()));
+      } else {
+        throw new Exception(
+            LocalizedStrings.AgentLauncher_UNKNOWN_ARGUMENT_0.toLocalizedString(arg));
+      }
+    }
+
+    return options;
+  }
+
+  /**
+   * Stops a running JMX Agent by setting the status to "shutdown pending".
+   */
+  public void stop(final String[] args) throws Exception {
+    final Map<String, Object> options = getStopOptions(args);
+
+    workingDirectory = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile((File) options.get(DIR));
+
+    int exitStatus = 1;
+
+    if (new File(workingDirectory, statusFileName).exists()) {
+      spinReadStatus();
+
+      if (!isStatus(SHUTDOWN)) {
+        writeStatus(createStatus(this.basename, SHUTDOWN_PENDING, status.pid));
+      }
+
+      pollAgentForShutdown();
+
+      if (isStatus(SHUTDOWN)) {
+        System.out
+            .println(LocalizedStrings.AgentLauncher_0_HAS_STOPPED.toLocalizedString(this.basename));
+        deleteStatus();
+        exitStatus = 0;
+      } else {
+        System.out
+            .println(LocalizedStrings.AgentLauncher_TIMEOUT_WAITING_FOR_0_TO_SHUTDOWN_STATUS_IS_1
+                .toLocalizedString(this.basename, status));
+      }
+    } else {
+      System.out.println(
+          LocalizedStrings.AgentLauncher_THE_SPECIFIED_WORKING_DIRECTORY_0_CONTAINS_NO_STATUS_FILE
+              .toLocalizedString(workingDirectory));
+    }
+
+    System.exit(exitStatus);
+  }
+
+  private void pollAgentForShutdown() throws InterruptedException {
+    final long endTime = (System.currentTimeMillis() + 20000);
+    long clock = 0;
+
+    while (clock < endTime && !isStatus(SHUTDOWN)) {
+      pause(500);
+      spinReadStatus();
+      clock = System.currentTimeMillis();
+    }
+  }
+
+  /**
+   * Prints the status of the GemFire JMX Agent running in the configured working directory.
+   */
+  public void status(final String[] args) throws Exception {
+    this.workingDirectory =
+        IOUtils.tryGetCanonicalFileElseGetAbsoluteFile((File) getStopOptions(args).get(DIR));
+    System.out.println(getStatus());
+    System.exit(0);
+  }
+
+  /**
+   * Returns the <code>Status</code> of the GemFire JMX Agent in the <code>workingDirectory</code>.
+   */
+  protected Status getStatus() throws Exception {
+    Status status;
+
+    if (new File(workingDirectory, statusFileName).exists()) {
+      status = spinReadStatus();
+    } else {
+      status = createStatus(this.basename, SHUTDOWN, 0,
+          LocalizedStrings.AgentLauncher_0_IS_NOT_RUNNING_IN_SPECIFIED_WORKING_DIRECTORY_1
+              .toLocalizedString(this.basename, this.workingDirectory),
+          null);
+    }
+
+    return status;
+  }
+
+  /**
+   * Determines if the Status.state is one of the specified states in the given array of states.
+   * Note, the status of the Agent, as indicated in the .agent.ser status file, should never have a
+   * written value of UNKNOWN.
+   * <p/>
+   * 
+   * @param states an array of possible acceptable states satisfying the condition of the Agent's
+   *        status.
+   * @return a boolean value indicating whether the Agent's status satisfies one of the specified
+   *         states.
+   */
+  private boolean isStatus(final Integer... states) {
+    return (this.status != null
+        && Arrays.asList(defaultToUnknownStateIfNull(states)).contains(this.status.state));
+  }
+
+  /**
+   * Removes an agent's status file
+   */
+  protected void deleteStatus() throws IOException {
+    final File statusFile = new File(workingDirectory, statusFileName);
+
+    if (statusFile.exists() && !statusFile.delete()) {
+      throw new IOException("Could not delete status file (" + statusFile.getAbsolutePath() + ")");
+    }
+  }
+
+  /**
+   * Reads the GemFire JMX Agent's status from the status file (.agent.ser) in it's working
+   * directory.
+   * <p/>
+   * 
+   * @return a Status object containing the state persisted to the .agent.ser file in the working
+   *         directory and representing the status of the Agent
+   * @throws IOException if the status file was unable to be read.
+   * @throws RuntimeException if the class of the object written to the .agent.ser file is not of
+   *         type Status.
+   */
+  protected Status readStatus() throws IOException {
+    FileInputStream fileIn = null;
+    ObjectInputStream objectIn = null;
+
+    try {
+      fileIn = new FileInputStream(new File(workingDirectory, statusFileName));
+      objectIn = new ObjectInputStream(fileIn);
+      this.status = (Status) objectIn.readObject();
+      return this.status;
+    } catch (ClassNotFoundException e) {
+      throw new RuntimeException(e);
+    } finally {
+      IOUtils.close(objectIn);
+      IOUtils.close(fileIn);
+    }
+  }
+
+  /**
+   * A wrapper method for the readStatus method to make one last check for the GemFire JMX Agent
+   * process if running with the native libraries.
+   * 
+   * @return the Status object as returned from readStatus unless running in native mode and a
+   *         determination is made such that the Agent process is not running.
+   * @throws IOException if the state of the Agent process could not be read from the .agent.ser
+   *         status file.
+   * @see #readStatus()
+   */
+  protected Status nativeReadStatus() throws IOException {
+    Status status = readStatus();
+
+    // @see Bug #32760 - the bug is still possible in pure Java mode
+    if (status != null && !PureJavaMode.isPure() && !OSProcess.exists(status.pid)) {
+      status = createStatus(status, SHUTDOWN);
+    }
+
+    return status;
+  }
+
+  /**
+   * Reads the JMX Agent's status from the .agent.ser status file. If the status file cannot be read
+   * due to I/O problems, the method will keep attempting to read the file for up to 20 seconds.
+   * <p/>
+   * 
+   * @return the Status of the GemFire JMX Agent as determined by the .agent.ser status file, or
+   *         natively based on the presence/absence of the Agent process.
+   */
+  protected Status spinReadStatus() {
+    Status status = null;
+
+    final long endTime = (System.currentTimeMillis() + 20000);
+    long clock = 0;
+
+    while (status == null && clock < endTime) {
+      try {
+        status = nativeReadStatus();
+      } catch (Exception ignore) {
+        // see bug 31575
+        // see bug 36998
+        // try again after a short delay... the status file might have been read prematurely before
+        // it existed
+        // or while the server was trying to write to it resulting in a possible EOFException, or
+        // other IOException.
+        pause(500);
+      } finally {
+        clock = System.currentTimeMillis();
+      }
+    }
+
+    return status;
+  }
+
+  /**
+   * Sets the status of the GemFire JMX Agent by serializing a <code>Status</code> object to a
+   * status file in the Agent's working directory.
+   * <p/>
+   * 
+   * @param status the Status object representing the state of the Agent process to persist to disk.
+   * @return the written Status object.
+   * @throws IOException if the Status could not be successfully persisted to disk.
+   */
+  public Status writeStatus(final Status status) throws IOException {
+    FileOutputStream fileOut = null;
+    ObjectOutputStream objectOut = null;
+
+    try {
+      fileOut = new FileOutputStream(new File(workingDirectory, statusFileName));
+      objectOut = new ObjectOutputStream(fileOut);
+      objectOut.writeObject(status);
+      objectOut.flush();
+      this.status = status;
+      return this.status;
+    } finally {
+      IOUtils.close(objectOut);
+      IOUtils.close(fileOut);
+    }
+  }
+
+  protected static Status createStatus(final String basename, final int state, final int pid) {
+    return createStatus(basename, state, pid, null, null);
+  }
+
+  protected static Status createStatus(final String basename, final int state, final int pid,
+      final String msg, final Throwable t) {
+    final Status status = new Status(basename);
+    status.state = state;
+    status.pid = pid;
+    status.msg = msg;
+    status.exception = t;
+    return status;
+  }
+
+  protected static Status createStatus(final Status status, final int state) {
+    assert status != null : "The status to clone cannot be null!";
+    return createStatus(status.baseName, state, status.pid, status.msg, status.exception);
+  }
+
+  protected static Integer[] defaultToUnknownStateIfNull(final Integer... states) {
+    return (states != null ? states : new Integer[] {UNKNOWN});
+  }
+
+  protected static boolean pause(final int milliseconds) {
+    try {
+      Thread.sleep(milliseconds);
+      return true;
+    } catch (InterruptedException e) {
+      Thread.currentThread().interrupt();
+      return false;
+    }
+  }
+
+  protected static File processDirOption(final Map<String, Object> options, final String dirValue)
+      throws FileNotFoundException {
+    final File workingDirectory = new File(dirValue);
+
+    if (!workingDirectory.exists()) {
+      throw new FileNotFoundException(
+          LocalizedStrings.AgentLauncher_THE_INPUT_WORKING_DIRECTORY_DOES_NOT_EXIST_0
+              .toLocalizedString(dirValue));
+    }
+
+    options.put(DIR, workingDirectory);
+
+    return workingDirectory;
+  }
+
+  /**
+   * Prints usage information for the AgentLauncher to the command line.
+   * <p/>
+   * 
+   * @param message a String to output to the command line indicating the user error.
+   */
+  private static void usage(final String message) {
+    final PrintStream out = System.out;
+
+    out.println("\n** " + message + "\n");
+
+    out.println("agent start [-J<vmarg>]* [-dir=<dir>] [prop=value]*");
+    out.println(LocalizedStrings.AgentLauncher_STARTS_THE_GEMFIRE_JMX_AGENT.toLocalizedString());
+    out.println("\t" + LocalizedStrings.AgentLauncher_VMARG.toLocalizedString());
+    out.println("\t" + LocalizedStrings.AgentLauncher_DIR.toLocalizedString());
+    out.println("\t" + LocalizedStrings.AgentLauncher_PROP.toLocalizedString());
+    out.println("\t" + LocalizedStrings.AgentLauncher_SEE_HELP_CONFIG.toLocalizedString());
+    out.println();
+
+    out.println("agent stop [-dir=<dir>]");
+    out.println(LocalizedStrings.AgentLauncher_STOPS_A_GEMFIRE_JMX_AGENT.toLocalizedString());
+    out.println("\t" + LocalizedStrings.AgentLauncher_DIR.toLocalizedString());
+    out.println("");
+    out.println("agent status [-dir=<dir>]");
+    out.println(
+        LocalizedStrings.AgentLauncher_REPORTS_THE_STATUS_AND_THE_PROCESS_ID_OF_A_GEMFIRE_JMX_AGENT
+            .toLocalizedString());
+    out.println("\t" + LocalizedStrings.AgentLauncher_DIR.toLocalizedString());
+    out.println();
+
+    System.exit(1);
+  }
+
+  /**
+   * Bootstrap method to launch the GemFire JMX Agent process to monitor and manage a GemFire
+   * Distributed System/Cache. Main will read the arguments passed on the command line and dispatch
+   * the command to the appropriate handler.
+   */
+  public static void main(final String[] args) {
+    if (args.length < 1) {
+      usage(LocalizedStrings.AgentLauncher_MISSING_COMMAND.toLocalizedString());
+    }
+
+    // TODO is this only needed on 'agent server'? 'agent {start|stop|status}' technically do no run
+    // any GemFire Cache
+    // or DS code inside the current process.
+    SystemFailure.loadEmergencyClasses();
+
+    final AgentLauncher launcher = new AgentLauncher("Agent");
+
+    try {
+      final String command = args[0];
+
+      if (command.equalsIgnoreCase("start")) {
+        launcher.start(args);
+      } else if (command.equalsIgnoreCase("server")) {
+        launcher.server(args);
+      } else if (command.equalsIgnoreCase("stop")) {
+        launcher.stop(args);
+      } else if (command.equalsIgnoreCase("status")) {
+        launcher.status(args);
+      } else if (command.toLowerCase().matches("-{0,2}help")) {
+        if (args.length > 1) {
+          final String topic = args[1];
+
+          if (topic.equals("config")) {
+            launcher.configHelp();
+          } else {
+            usage(LocalizedStrings.AgentLauncher_NO_HELP_AVAILABLE_FOR_0.toLocalizedString(topic));
+          }
+        }
+
+        usage(LocalizedStrings.AgentLauncher_AGENT_HELP.toLocalizedString());
+      } else {
+        usage(LocalizedStrings.AgentLauncher_UNKNOWN_COMMAND_0.toLocalizedString(command));
+      }
+    } catch (VirtualMachineError e) {
+      SystemFailure.initiateFailure(e);
+      throw e;
+    } catch (Throwable t) {
+      SystemFailure.checkFailure();
+      t.printStackTrace();
+      System.err.println(
+          LocalizedStrings.AgentLauncher_ERROR_0.toLocalizedString(t.getLocalizedMessage()));
+      System.exit(1);
+    }
+  }
+
+  /**
+   * A class representing the current state of the GemFire JMX Agent process. Instances of this
+   * class are serialized to a {@linkplain #statusFileName file} on disk in the specified working
+   * directory {@linkplain #workingDirectory}.
+   * <p/>
+   * 
+   * @see #SHUTDOWN
+   * @see #STARTING
+   * @see #RUNNING
+   * @see #SHUTDOWN_PENDING
+   * @see #SHUTDOWN_PENDING_AFTER_FAILED_STARTUP
+   */
+  // TODO refactor this class and internalize the state
+  // TODO refactor the class and make immutable
+  static class Status implements Serializable {
+
+    private static final long serialVersionUID = -7758402454664266174L;
+
+    int pid = 0;
+    int state = 0;
+
+    final String baseName;
+    String msg;
+
+    Throwable exception;
+
+    public Status(final String baseName) {
+      this.baseName = baseName;
+    }
+
+    @Override
+    public String toString() {
+      final StringBuilder buffer = new StringBuilder();
+
+      if (pid == Integer.MIN_VALUE && state == SHUTDOWN && msg != null) {
+        buffer.append(msg);
+      } else {
+        buffer.append(
+            LocalizedStrings.AgentLauncher_0_PID_1_STATUS.toLocalizedString(this.baseName, pid));
+
+        switch (state) {
+          case SHUTDOWN:
+            buffer.append(LocalizedStrings.AgentLauncher_SHUTDOWN.toLocalizedString());
+            break;
+          case STARTING:
+            buffer.append(LocalizedStrings.AgentLauncher_STARTING.toLocalizedString());
+            break;
+          case RUNNING:
+            buffer.append(LocalizedStrings.AgentLauncher_RUNNING.toLocalizedString());
+            break;
+          case SHUTDOWN_PENDING:
+            buffer.append(LocalizedStrings.AgentLauncher_SHUTDOWN_PENDING.toLocalizedString());
+            break;
+          case SHUTDOWN_PENDING_AFTER_FAILED_STARTUP:
+            buffer.append(LocalizedStrings.AgentLauncher_SHUTDOWN_PENDING_AFTER_FAILED_STARTUP
+                .toLocalizedString());
+            break;
+          default:
+            buffer.append(LocalizedStrings.AgentLauncher_UNKNOWN.toLocalizedString());
+            break;
+        }
+
+        if (exception != null) {
+          if (msg != null) {
+            buffer.append("\n").append(msg).append(" - ");
+          } else {
+            buffer.append("\n " + LocalizedStrings.AgentLauncher_EXCEPTION_IN_0_1
+                .toLocalizedString(this.baseName, exception.getMessage()) + " - ");
+          }
+          buffer
+              .append(LocalizedStrings.AgentLauncher_SEE_LOG_FILE_FOR_DETAILS.toLocalizedString());
+        }
+      }
+
+      return buffer.toString();
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/CacheServerJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/CacheServerJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/CacheServerJmxImpl.java
new file mode 100644
index 0000000..ef6c7c4
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/CacheServerJmxImpl.java
@@ -0,0 +1,588 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.Notification;
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+import javax.naming.OperationNotSupportedException;
+
+import org.apache.commons.modeler.ManagedBean;
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.CacheServerConfig;
+import org.apache.geode.internal.admin.api.CacheVmConfig;
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+import org.apache.geode.internal.admin.api.StatisticResource;
+import org.apache.geode.internal.admin.api.SystemMemberCache;
+import org.apache.geode.internal.admin.api.SystemMemberCacheEvent;
+import org.apache.geode.internal.admin.api.SystemMemberRegionEvent;
+import org.apache.geode.internal.admin.api.CacheVm;
+import org.apache.geode.internal.admin.api.impl.CacheServerImpl;
+import org.apache.geode.internal.admin.api.impl.ConfigurationParameterImpl;
+import org.apache.geode.internal.admin.ClientMembershipMessage;
+import org.apache.geode.internal.admin.GemFireVM;
+import org.apache.geode.internal.admin.StatResource;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+
+/**
+ * MBean representation of a {@link CacheVm}.
+ *
+ * @since GemFire 4.0
+ */
+public class CacheServerJmxImpl extends CacheServerImpl
+    implements ManagedResource, CacheVmConfig, CacheServerConfig, SystemMemberJmx {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /**
+   * Interval in seconds between refreshes. Value less than one results in no refreshing
+   */
+  private int refreshInterval = 0;
+
+  /** The object name of this managed resource */
+  private ObjectName objectName;
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  /** Reference to the cache MBean representing a Cache in the Cache VM Member */
+  private SystemMemberCacheJmxImpl managedSystemMemberCache;
+
+  /** collection to collect all the resources created for this member */
+  private Map<StatResource, StatisticResourceJmxImpl> managedStatisticsResourcesMap =
+      new HashMap<StatResource, StatisticResourceJmxImpl>();
+
+  ////////////////////// Constructors //////////////////////
+
+  /**
+   * Creates a new <code>CacheServerJmxImpl</code> for an existing cache server.
+   */
+  CacheServerJmxImpl(AdminDistributedSystemJmxImpl system, GemFireVM vm) throws AdminException {
+
+    super(system, vm);
+    initializeMBean();
+  }
+
+  /**
+   * Creates a new <code>CacheServerJmxImpl</code> for an newly-created cache server.
+   */
+  CacheServerJmxImpl(AdminDistributedSystemJmxImpl system, CacheVmConfig config)
+      throws AdminException {
+
+    super(system, config);
+    initializeMBean();
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Creates and registers the MBean to manage this resource
+   */
+  private void initializeMBean() throws AdminException {
+    // initialize Managed Resources for stats & cache first.
+    // initializeManagedResources();
+
+    this.mbeanName = new StringBuffer("GemFire.CacheVm:").append("id=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(getId())).append(",type=")
+        .append(MBeanUtil.makeCompliantMBeanNameProperty(getType().getName())).toString();
+
+    this.objectName =
+        MBeanUtil.createMBean(this, addDynamicAttributes(MBeanUtil.lookupManagedBean(this)));
+
+    // Refresh Interval
+    AdminDistributedSystemJmxImpl sysJmx = (AdminDistributedSystemJmxImpl) system;
+    if (sysJmx.getRefreshInterval() > 0)
+      this.refreshInterval = sysJmx.getRefreshInterval();
+  }
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.CACHE_VM;
+  }
+
+  /**
+   * Un-registers all the statistics & cache managed resource created for this member. After
+   * un-registering the resource MBean instances, clears managedStatisticsResourcesMap collection &
+   * sets managedSystemMemberCache to null.
+   * 
+   * Creates ConfigurationParameterJmxImpl, StatisticResourceJmxImpl and SystemMemberCacheJmxImpl.
+   * But cleans up only StatisticResourceJmxImpl and SystemMemberCacheJmxImpl which are of type
+   * ManagedResource.
+   */
+  public void cleanupResource() {
+    synchronized (this.managedStatisticsResourcesMap) {
+      ConfigurationParameter[] names = getConfiguration();
+      if (names != null) {
+        for (int i = 0; i < names.length; i++) {
+          ConfigurationParameter parm = names[i];
+          ((ConfigurationParameterImpl) parm).removeConfigurationParameterListener(this);
+        }
+      }
+      this.parms.clear();
+
+      Collection<StatisticResourceJmxImpl> statisticResources =
+          managedStatisticsResourcesMap.values();
+
+      for (StatisticResourceJmxImpl statisticResource : statisticResources) {
+        MBeanUtil.unregisterMBean(statisticResource);
+      }
+
+      this.managedStatisticsResourcesMap.clear();
+    }
+
+    MBeanUtil.unregisterMBean(this.managedSystemMemberCache);
+    this.managedSystemMemberCache = null;
+  }
+
+  /////////////////////// Configuration ///////////////////////
+
+  @Override
+  public String getHost() {
+    return this.getConfig().getHost();
+  }
+
+  public void setHost(String host) {
+    this.getConfig().setHost(host);
+  }
+
+  @Override
+  public String getWorkingDirectory() {
+    return this.getConfig().getWorkingDirectory();
+  }
+
+  @Override
+  public void setWorkingDirectory(String dir) {
+    this.getConfig().setWorkingDirectory(dir);
+  }
+
+  @Override
+  public String getProductDirectory() {
+    return this.getConfig().getProductDirectory();
+  }
+
+  @Override
+  public void setProductDirectory(String dir) {
+    this.getConfig().setProductDirectory(dir);
+  }
+
+  public String getRemoteCommand() {
+    return this.getConfig().getRemoteCommand();
+  }
+
+  public void setRemoteCommand(String remoteCommand) {
+    this.getConfig().setRemoteCommand(remoteCommand);
+  }
+
+  public void validate() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  @Override
+  public Object clone() throws CloneNotSupportedException {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public String getCacheXMLFile() {
+    return this.getConfig().getCacheXMLFile();
+  }
+
+  public void setCacheXMLFile(String cacheXMLFile) {
+    this.getConfig().setCacheXMLFile(cacheXMLFile);
+  }
+
+  public String getClassPath() {
+    return this.getConfig().getClassPath();
+  }
+
+  public void setClassPath(String classpath) {
+    this.getConfig().setClassPath(classpath);
+  }
+
+  // -------------------------------------------------------------------------
+  // MBean attribute accessors/mutators
+  // -------------------------------------------------------------------------
+
+  /**
+   * Gets the interval in seconds between config refreshes
+   *
+   * @return the current refresh interval in seconds
+   */
+  public int getRefreshInterval() {
+    return this.refreshInterval;
+  }
+
+  /**
+   * Sets interval in seconds between cache config refreshes; zero or less turns off auto
+   * refreshing. Manual refreshing has no effect on when the next scheduled refresh will occur.
+   *
+   * @param refreshInterval the new refresh interval in seconds
+   */
+  public void _setRefreshInterval(int refreshInterval) {
+    boolean isRegistered = MBeanUtil.isRefreshNotificationRegistered(this,
+        RefreshNotificationType.SYSTEM_MEMBER_CONFIG);
+
+    if (isRegistered && (getRefreshInterval() == refreshInterval))
+      return;
+
+    this.refreshInterval = Helper.setAndReturnRefreshInterval(this, refreshInterval);
+  }
+
+  /**
+   * RefreshInterval is now set only through the AdminDistributedSystem property refreshInterval.
+   * Attempt to set refreshInterval on CacheServerJmx MBean would result in an
+   * OperationNotSupportedException Auto-refresh is enabled on demand when a call to refreshConfig
+   * is made
+   * 
+   * @param refreshInterval the new refresh interval in seconds
+   * @deprecated since 6.0 use DistributedSystemConfig.refreshInterval instead
+   */
+  @Deprecated
+  public void setRefreshInterval(int refreshInterval) throws OperationNotSupportedException {
+    throw new OperationNotSupportedException(
+        LocalizedStrings.MANAGED_RESOURCE_REFRESH_INTERVAL_CANT_BE_SET_DIRECTLY
+            .toLocalizedString());
+  }
+
+  // -------------------------------------------------------------------------
+  // MBean Operations
+  // -------------------------------------------------------------------------
+
+  public void refreshConfig() throws AdminException {
+    // 1st call to refreshConfig would trigger
+    // the auto-refresh if an interval is set
+    if (this.refreshInterval > 0) {
+      this._setRefreshInterval(this.refreshInterval);
+    }
+
+    super.refreshConfig();
+  }
+
+  /**
+   * Initializes Cache & Statistics managed resources.
+   * 
+   * @throws AdminException if initialization of managed resources fails
+   */
+  // private void initializeManagedResources() throws AdminException {
+  // try {
+  // manageCache();
+  // } catch (MalformedObjectNameException e) {
+  // throw new
+  // AdminException(LocalizedStrings.SystemMemberJmxImpl_EXCEPTION_OCCURRED_WHILE_INITIALIZING_0_MBEANS_FOR_1.toLocalizedString(
+  // new Object[] {"Cache", getId()}),
+  // e);
+  // } catch (AdminException ae) {
+  // if
+  // (LocalizedStrings.SystemMemberJmx_THIS_SYSTEM_MEMBER_DOES_NOT_HAVE_A_CACHE.toLocalizedString().equals(ae.getMessage()))
+  // {
+  // //ignore this exception for a cache-less peer
+  // } else {
+  // throw ae;
+  // }
+  // }
+  // try {
+  // manageStats();
+  // } catch (MalformedObjectNameException e) {
+  // throw new
+  // AdminException(LocalizedStrings.SystemMemberJmxImpl_EXCEPTION_OCCURRED_WHILE_INITIALIZING_0_MBEANS_FOR_1.toLocalizedString(
+  // new Object[] {"Statistics", getId()}),
+  // e);
+  // }
+  // }
+
+  /**
+   * Gets this member's cache.
+   *
+   * @return array of ObjectName for this member's cache
+   */
+  public ObjectName manageCache() throws AdminException, MalformedObjectNameException {
+    return Helper.manageCache(this);
+  }
+
+  /**
+   * Gets all active StatisticResources for this manager.
+   *
+   * @return array of ObjectName instances
+   */
+  public ObjectName[] manageStats() throws AdminException, MalformedObjectNameException {
+    return Helper.manageStats(this);
+  }
+
+  /**
+   * Gets the active StatisticResources for this manager, based on the typeName as the key
+   *
+   * @return ObjectName of StatisticResourceJMX instance
+   */
+  public ObjectName[] manageStat(String statisticsTypeName)
+      throws AdminException, MalformedObjectNameException {
+
+    return Helper.manageStat(this, statisticsTypeName);
+  }
+
+  // -------------------------------------------------------------------------
+  // JMX Notification listener
+  // -------------------------------------------------------------------------
+
+  /**
+   * Handles notification to refresh. Reacts by refreshing the values of this GemFireManager's
+   * ConfigurationParamaters. Any other notification is ignored. Given notification is handled only
+   * if there is any JMX client connected to the system.
+   * 
+   * @param notification the JMX notification being received
+   * @param hb handback object is unused
+   */
+  public void handleNotification(Notification notification, Object hb) {
+    AdminDistributedSystemJmxImpl systemJmx = (AdminDistributedSystemJmxImpl) this.system;
+
+    if (!systemJmx.isRmiClientCountZero()) {
+      Helper.handleNotification(this, notification, hb);
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // Template methods overriden from superclass...
+  // -------------------------------------------------------------------------
+
+  /**
+   * Template method for creating instance of ConfigurationParameter. Overridden to return
+   * ConfigurationParameterJmxImpl.
+   */
+  @Override
+  protected ConfigurationParameter createConfigurationParameter(String name, String description,
+      Object value, Class type, boolean userModifiable) {
+    return new ConfigurationParameterJmxImpl(name, description, value, type, userModifiable);
+  }
+
+
+
+  /**
+   * Override createStatisticResource by instantiating StatisticResourceJmxImpl if it was not
+   * created earlier otherwise returns the same instance.
+   * 
+   * @param stat StatResource reference for which this JMX resource is to be created
+   * @return StatisticResourceJmxImpl - JMX Implementation of StatisticResource
+   * @throws AdminException if constructing StatisticResourceJmxImpl instance fails
+   */
+  @Override
+  protected StatisticResource createStatisticResource(StatResource stat) throws AdminException {
+    StatisticResourceJmxImpl managedStatisticResource = null;
+
+    synchronized (this.managedStatisticsResourcesMap) {
+      /*
+       * Ensuring that a single instance of Statistic Resource is created per StatResource.
+       */
+      StatisticResourceJmxImpl statisticResourceJmxImpl = managedStatisticsResourcesMap.get(stat);
+      if (statisticResourceJmxImpl != null) {
+        managedStatisticResource = statisticResourceJmxImpl;
+      } else {
+        managedStatisticResource = new StatisticResourceJmxImpl(stat, this);
+        managedStatisticResource.getStatistics();// inits timer
+        managedStatisticsResourcesMap.put(stat, managedStatisticResource);
+      }
+    }
+    return managedStatisticResource;
+  }
+
+  /**
+   * Override createSystemMemberCache by instantiating SystemMemberCacheJmxImpl if it was not
+   * created earlier.
+   * 
+   * @param vm GemFireVM reference for which this JMX resource is to be created
+   * @return SystemMemberCacheJmxImpl - JMX Implementation of SystemMemberCache
+   * @throws AdminException if constructing SystemMemberCacheJmxImpl instance fails
+   */
+  @Override
+  protected SystemMemberCache createSystemMemberCache(GemFireVM vm) throws AdminException {
+    if (managedSystemMemberCache == null) {
+      managedSystemMemberCache = new SystemMemberCacheJmxImpl(vm);
+    }
+    return managedSystemMemberCache;
+  }
+
+  // -------------------------------------------------------------------------
+  // Create MBean attributes for each ConfigurationParameter
+  // -------------------------------------------------------------------------
+
+  /**
+   * Add MBean attribute definitions for each ConfigurationParameter.
+   *
+   * @param managed the mbean definition to add attributes to
+   * @return a new instance of ManagedBean copied from <code>managed</code> but with the new
+   *         attributes added
+   */
+  public ManagedBean addDynamicAttributes(ManagedBean managed) throws AdminException {
+    return Helper.addDynamicAttributes(this, managed);
+  }
+
+  /**
+   * Cleans up Managed Resources created for the client that was connected to the server represented
+   * by this class.
+   * 
+   * @param clientId id of the client to be removed
+   * @return List of ManagedResources associated with the client of given client id
+   */
+  /*
+   * This clean up is for the clients. The clients are started with a loner DM. Hence the clientId
+   * is not supposed to contain '/' as per InternalDistributedMember.toString().
+   */
+  public List<ManagedResource> cleanupBridgeClientResources(String clientId) {
+    List<ManagedResource> returnedResources = new ArrayList<ManagedResource>();
+
+    String compatibleId = "id_" + MBeanUtil.makeCompliantMBeanNameProperty(clientId);
+    synchronized (this.managedStatisticsResourcesMap) {
+      Set<Entry<StatResource, StatisticResourceJmxImpl>> entrySet =
+          this.managedStatisticsResourcesMap.entrySet();
+
+      for (Iterator<Entry<StatResource, StatisticResourceJmxImpl>> it = entrySet.iterator(); it
+          .hasNext();) {
+        Entry<StatResource, StatisticResourceJmxImpl> entry = it.next();
+        StatisticResourceJmxImpl resource = entry.getValue();
+        if (resource.getMBeanName().contains(compatibleId)) {
+          it.remove(); // remove matching entry
+          returnedResources.add(resource);
+        }
+      }
+    }
+    return returnedResources;
+  }
+
+  /**
+   * Implementation handles client membership changes.
+   * 
+   * @param clientId id of the client for whom membership change happened
+   * @param eventType membership change type; one of {@link ClientMembershipMessage#JOINED},
+   *        {@link ClientMembershipMessage#LEFT}, {@link ClientMembershipMessage#CRASHED}
+   */
+  public void handleClientMembership(String clientId, int eventType) {
+    String notifType = null;
+    List<ManagedResource> cleanedUp = null;
+
+    if (eventType == ClientMembershipMessage.LEFT) {
+      notifType = NOTIF_CLIENT_LEFT;
+      cleanedUp = cleanupBridgeClientResources(clientId);
+    } else if (eventType == ClientMembershipMessage.CRASHED) {
+      notifType = NOTIF_CLIENT_CRASHED;
+      cleanedUp = cleanupBridgeClientResources(clientId);
+    } else if (eventType == ClientMembershipMessage.JOINED) {
+      notifType = NOTIF_CLIENT_JOINED;
+    }
+
+    if (cleanedUp != null) {
+      for (ManagedResource resource : cleanedUp) {
+        MBeanUtil.unregisterMBean(resource);
+      }
+    }
+
+    Helper.sendNotification(this, new Notification(notifType, this.modelMBean,
+        Helper.getNextNotificationSequenceNumber(), clientId));
+  }
+
+  /**
+   * Implementation handles creation of cache by extracting the details from the given event object
+   * and sending the {@link SystemMemberJmx#NOTIF_CACHE_CREATED} notification to the connected JMX
+   * Clients.
+   * 
+   * @param event event object corresponding to the creation of the cache
+   */
+  public void handleCacheCreate(SystemMemberCacheEvent event) {
+    Helper.sendNotification(this, new Notification(NOTIF_CACHE_CREATED, this.modelMBean,
+        Helper.getNextNotificationSequenceNumber(), Helper.getCacheEventDetails(event)));
+  }
+
+  /**
+   * Implementation handles closure of cache by extracting the details from the given event object
+   * and sending the {@link SystemMemberJmx#NOTIF_CACHE_CLOSED} notification to the connected JMX
+   * Clients.
+   * 
+   * @param event event object corresponding to the closure of the cache
+   */
+  public void handleCacheClose(SystemMemberCacheEvent event) {
+    Helper.sendNotification(this, new Notification(NOTIF_CACHE_CLOSED, this.modelMBean,
+        Helper.getNextNotificationSequenceNumber(), Helper.getCacheEventDetails(event)));
+  }
+
+  /**
+   * Implementation handles creation of region by extracting the details from the given event object
+   * and sending the {@link SystemMemberJmx#NOTIF_REGION_CREATED} notification to the connected JMX
+   * Clients. Region Path is set as User Data in Notification.
+   * 
+   * @param event event object corresponding to the creation of a region
+   */
+  public void handleRegionCreate(SystemMemberRegionEvent event) {
+    Notification notification = new Notification(NOTIF_REGION_CREATED, this.modelMBean,
+        Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event));
+
+    notification.setUserData(event.getRegionPath());
+
+    Helper.sendNotification(this, notification);
+  }
+
+  /**
+   * Implementation should handle loss of region by extracting the details from the given event
+   * object and sending the {@link SystemMemberJmx#NOTIF_REGION_LOST} notification to the connected
+   * JMX Clients. Region Path is set as User Data in Notification. Additionally, it also clears the
+   * ManagedResources created for the region that is lost.
+   * 
+   * @param event event object corresponding to the loss of a region
+   */
+  public void handleRegionLoss(SystemMemberRegionEvent event) {
+    SystemMemberCacheJmxImpl cacheResource = this.managedSystemMemberCache;
+
+    if (cacheResource != null) {
+      ManagedResource cleanedUp = cacheResource.cleanupRegionResources(event.getRegionPath());
+
+      if (cleanedUp != null) {
+        MBeanUtil.unregisterMBean(cleanedUp);
+      }
+    }
+
+    Notification notification = new Notification(NOTIF_REGION_LOST, this.modelMBean,
+        Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event));
+
+    notification.setUserData(event.getRegionPath());
+
+    Helper.sendNotification(this, notification);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ConfigAttributeInfo.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ConfigAttributeInfo.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ConfigAttributeInfo.java
new file mode 100755
index 0000000..e94f521
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ConfigAttributeInfo.java
@@ -0,0 +1,66 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.admin.api.ConfigurationParameter;
+
+import javax.management.Descriptor;
+import javax.management.modelmbean.DescriptorSupport;
+import javax.management.modelmbean.ModelMBeanAttributeInfo;
+
+/**
+ * Subclass of AttributeInfo with {@link ConfigurationParameter} added for use as the
+ * {@link javax.management.modelmbean.ModelMBeanAttributeInfo} descriptor's <i>targetObject</i>
+ * value.
+ *
+ * @since GemFire 3.5
+ *
+ */
+class ConfigAttributeInfo extends org.apache.commons.modeler.AttributeInfo {
+  private static final long serialVersionUID = -1918437700841687078L;
+
+  private final ConfigurationParameterJmxImpl config;
+
+  public ConfigAttributeInfo(ConfigurationParameterJmxImpl config) {
+    super();
+    this.config = config;
+  }
+
+  public ConfigurationParameterJmxImpl getConfig() {
+    return this.config;
+  }
+
+  @Override
+  public ModelMBeanAttributeInfo createAttributeInfo() {
+    Descriptor desc = new DescriptorSupport(new String[] {"name=" + this.displayName,
+        "descriptorType=attribute", "currencyTimeLimit=-1", // always stale
+        "displayName=" + this.displayName, "getMethod=getJmxValue", "setMethod=setJmxValue"});
+
+    Assert.assertTrue(this.config != null, "Config target object is null!");
+    desc.setField("targetObject", this.config);
+
+    ModelMBeanAttributeInfo info = new ModelMBeanAttributeInfo(this.displayName, // name
+        this.type, // type
+        this.description, // description
+        this.readable, // isReadable
+        this.writeable, // isWritable
+        this.is, // isIs
+        desc);
+
+    return info;
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ConfigurationParameterJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ConfigurationParameterJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ConfigurationParameterJmxImpl.java
new file mode 100755
index 0000000..0476fdb
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/ConfigurationParameterJmxImpl.java
@@ -0,0 +1,164 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.apache.logging.log4j.Level;
+
+import org.apache.geode.SystemFailure;
+import org.apache.geode.internal.admin.api.UnmodifiableConfigurationException;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.admin.api.impl.ConfigurationParameterImpl;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+/**
+ * Provides MBean support for managing accessing a ConfigurationParameter.
+ * <p>
+ * Implements java.io.Serializable because several MBeans have attributes of type
+ * ConfigurationParameter. This means that calls to getMBeanInfo which may be serialized for remote
+ * clients will be broken unless those attributes support serialization.
+ * <p>
+ * TODO: refactor to implement ConfigurationParameter and delegate to ConfigurationParameterImpl.
+ * Wrap all delegate calls w/ e.printStackTrace() since the HttpAdaptor devours them
+ *
+ * @since GemFire 3.5
+ *
+ */
+public class ConfigurationParameterJmxImpl extends ConfigurationParameterImpl
+    implements Serializable {
+
+  private static final long serialVersionUID = -7822171853906772375L;
+  private boolean deserialized = false;
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  protected ConfigurationParameterJmxImpl(String name, String description, Object value, Class type,
+      boolean userModifiable) {
+    super(name, description, value, type, userModifiable);
+  }
+
+  protected ConfigurationParameterJmxImpl(String name, Object value) {
+    super(name, value);
+  }
+
+  /** Constructor to allow serialization */
+  protected ConfigurationParameterJmxImpl() {
+    super();
+  }
+
+  @Override
+  public void setValue(Object value) throws UnmodifiableConfigurationException {
+    if (deserialized) {
+      throw new UnsupportedOperationException(
+          LocalizedStrings.ConfigurationParameterJmxImpl_REMOTE_MUTATION_OF_CONFIGURATIONPARAMETER_IS_CURRENTLY_UNSUPPORTED
+              .toLocalizedString());
+    }
+    try {
+      super.setValue(value);
+    } catch (UnmodifiableConfigurationException e) {
+      MBeanUtil.logStackTrace(Level.WARN, e);
+      throw e;
+    } catch (java.lang.RuntimeException e) {
+      MBeanUtil.logStackTrace(Level.WARN, e);
+      throw e;
+    } catch (VirtualMachineError err) {
+      SystemFailure.initiateFailure(err);
+      // If this ever returns, rethrow the error. We're poisoned
+      // now, so don't let this thread continue.
+      throw err;
+    } catch (java.lang.Error e) {
+      // Whenever you catch Error or Throwable, you must also
+      // catch VirtualMachineError (see above). However, there is
+      // _still_ a possibility that you are dealing with a cascading
+      // error condition, so you also need to check to see if the JVM
+      // is still usable:
+      SystemFailure.checkFailure();
+      MBeanUtil.logStackTrace(Level.ERROR, e);
+      throw e;
+    }
+  }
+
+  // -------------------------------------------------------------------------
+  // HACK
+  // -------------------------------------------------------------------------
+  public void setJmxValue(Integer value) throws UnmodifiableConfigurationException {
+    setValue(value);
+  }
+
+  public void setJmxValue(String value) throws UnmodifiableConfigurationException {
+    setValue(value);
+  }
+
+  public void setJmxValue(java.io.File value) throws UnmodifiableConfigurationException {
+    setValue(value);
+  }
+
+  public void setJmxValue(Boolean value) throws UnmodifiableConfigurationException {
+    setValue(value);
+  }
+
+  public Class getJmxValueType() {
+    if (isInetAddress() || isFile() || isOctal()) {
+      return java.lang.String.class;
+    }
+    return getValueType();
+  }
+
+  public Object getJmxValue() {
+    if (isInetAddress() || isFile() || isOctal()) {
+      return getValueAsString();
+    }
+    return getValue();
+  }
+
+  /**
+   * Override writeObject which is used in serialization. This class is serialized when JMX client
+   * acquires MBeanInfo for ConfigurationParameter MBean. Super class is not serializable.
+   */
+  private void writeObject(java.io.ObjectOutputStream out) throws IOException {
+    out.writeObject(this.name);
+    out.writeObject(this.description);
+    out.writeObject(this.value);
+    out.writeObject(this.type);
+    out.writeBoolean(this.userModifiable);
+  }
+
+  /**
+   * Override readObject which is used in serialization. Customize serialization of this exception
+   * to avoid escape of InternalRole which is not Serializable.
+   */
+  private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
+    String inName = (String) in.readObject();
+    String inDescription = (String) in.readObject();
+    Object inValue = in.readObject();
+    Class inClass = (Class) in.readObject();
+    boolean inUserModifiable = in.readBoolean();
+
+    Assert.assertTrue(inName != null);
+    Assert.assertTrue(inDescription != null);
+    Assert.assertTrue(inValue != null);
+    Assert.assertTrue(inClass != null);
+
+    this.deserialized = true;
+    this.name = inName;
+    setInternalState(inDescription, inValue, inClass, inUserModifiable);
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DistributedSystemHealthConfigJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DistributedSystemHealthConfigJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DistributedSystemHealthConfigJmxImpl.java
new file mode 100644
index 0000000..af13bbb
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DistributedSystemHealthConfigJmxImpl.java
@@ -0,0 +1,98 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.impl.DistributedSystemHealthConfigImpl;
+import javax.management.*;
+import javax.management.modelmbean.*;
+
+/**
+ * The JMX "managed resource" that represents the configuration for the health of a distributed
+ * system. Basically, it provides the behavior of <code>DistributedSystemHealthConfigImpl</code>,
+ * but does some JMX stuff like registering beans with the agent.
+ *
+ * @see GemFireHealthJmxImpl#createDistributedSystemHealthConfig
+ *
+ *
+ * @since GemFire 3.5
+ */
+public class DistributedSystemHealthConfigJmxImpl extends DistributedSystemHealthConfigImpl
+    implements ManagedResource {
+
+  /** The <code>GemFireHealth</code> that we help configure */
+  private GemFireHealth health;
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  /** The JMX object name of the MBean for this managed resource */
+  private final ObjectName objectName;
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>DistributedSystemHealthCOnfigJmxImpl</code> that configures the health of
+   * the distributed system monitored by <code>health</code>.
+   */
+  DistributedSystemHealthConfigJmxImpl(GemFireHealthJmxImpl health) throws AdminException {
+
+    super();
+    this.health = health;
+    this.mbeanName =
+        new StringBuffer().append(MBEAN_NAME_PREFIX).append("DistributedSystemHealthConfig,id=")
+            .append(MBeanUtil.makeCompliantMBeanNameProperty(health.getDistributedSystem().getId()))
+            .toString();
+    this.objectName = MBeanUtil.createMBean(this);
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Applies the changes made to this config back to the health monitor.
+   *
+   * @see GemFireHealth#setDistributedSystemHealthConfig
+   */
+  public void applyChanges() {
+    this.health.setDistributedSystemHealthConfig(this);
+  }
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.DISTRIBUTED_SYSTEM_HEALTH_CONFIG;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public void cleanupResource() {}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DistributionLocatorJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DistributionLocatorJmxImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DistributionLocatorJmxImpl.java
new file mode 100755
index 0000000..8da7482
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DistributionLocatorJmxImpl.java
@@ -0,0 +1,163 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.internal.admin.api.impl.AdminDistributedSystemImpl;
+import org.apache.geode.internal.admin.api.impl.DistributionLocatorImpl;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import javax.management.ObjectName;
+import javax.management.modelmbean.ModelMBean;
+
+/**
+ * Provides MBean support for managing a distribution locator.
+ *
+ */
+public class DistributionLocatorJmxImpl extends DistributionLocatorImpl
+    implements ManagedResource, DistributionLocatorConfig {
+
+  /** The JMX object name of this managed resource */
+  private ObjectName objectName;
+
+  // -------------------------------------------------------------------------
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * Constructs new instance of DistributionLocatorJmxImpl for managing a distribution locator
+   * service via JMX.
+   */
+  public DistributionLocatorJmxImpl(DistributionLocatorConfig config,
+      AdminDistributedSystemImpl system) {
+    super(config, system);
+    initializeMBean();
+  }
+
+  /** Create and register the MBean to manage this resource */
+  private void initializeMBean() {
+    this.mbeanName =
+        "GemFire:type=DistributionLocator,id=" + MBeanUtil.makeCompliantMBeanNameProperty(getId());
+    this.objectName = MBeanUtil.createMBean(this, MBeanUtil.lookupManagedBean(this));
+  }
+
+  //////////////////////// Configuration ////////////////////////
+
+  public String getHost() {
+    return this.getConfig().getHost();
+  }
+
+  public void setHost(String host) {
+    this.getConfig().setHost(host);
+  }
+
+  public String getWorkingDirectory() {
+    return this.getConfig().getWorkingDirectory();
+  }
+
+  public void setWorkingDirectory(String dir) {
+    this.getConfig().setWorkingDirectory(dir);
+  }
+
+  public String getProductDirectory() {
+    return this.getConfig().getProductDirectory();
+  }
+
+  public void setProductDirectory(String dir) {
+    this.getConfig().setProductDirectory(dir);
+  }
+
+  public String getRemoteCommand() {
+    return this.getConfig().getRemoteCommand();
+  }
+
+  public void setRemoteCommand(String remoteCommand) {
+    this.getConfig().setRemoteCommand(remoteCommand);
+  }
+
+  public java.util.Properties getDistributedSystemProperties() {
+    return this.getConfig().getDistributedSystemProperties();
+  }
+
+  public void setDistributedSystemProperties(java.util.Properties props) {
+    this.getConfig().setDistributedSystemProperties(props);
+  }
+
+  public void validate() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  @Override
+  public Object clone() throws CloneNotSupportedException {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  public int getPort() {
+    return this.getConfig().getPort();
+  }
+
+  public void setPort(int port) {
+    this.getConfig().setPort(port);
+  }
+
+  public String getBindAddress() {
+    return this.getConfig().getBindAddress();
+  }
+
+  public void setBindAddress(String bindAddress) {
+    this.getConfig().setBindAddress(bindAddress);
+  }
+
+  // -------------------------------------------------------------------------
+  // MBean attributes - accessors/mutators
+  // -------------------------------------------------------------------------
+
+  // -------------------------------------------------------------------------
+  // JMX Notification listener
+  // -------------------------------------------------------------------------
+
+  // -------------------------------------------------------------------------
+  // ManagedResource implementation
+  // -------------------------------------------------------------------------
+
+  /** The name of the MBean that will manage this resource */
+  private String mbeanName;
+
+  /** The ModelMBean that is configured to manage this resource */
+  private ModelMBean modelMBean;
+
+  public String getMBeanName() {
+    return this.mbeanName;
+  }
+
+  public ModelMBean getModelMBean() {
+    return this.modelMBean;
+  }
+
+  public void setModelMBean(ModelMBean modelMBean) {
+    this.modelMBean = modelMBean;
+  }
+
+  public ObjectName getObjectName() {
+    return this.objectName;
+  }
+
+  public ManagedResourceType getManagedResourceType() {
+    return ManagedResourceType.DISTRIBUTION_LOCATOR;
+  }
+
+  public void cleanupResource() {}
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DynamicManagedBean.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DynamicManagedBean.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DynamicManagedBean.java
new file mode 100755
index 0000000..5693a5a
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/jmx/impl/DynamicManagedBean.java
@@ -0,0 +1,143 @@
+/*
+ * 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.internal.admin.api.jmx.impl;
+
+
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.modeler.AttributeInfo;
+import org.apache.commons.modeler.OperationInfo;
+import org.apache.commons.modeler.ManagedBean;
+
+/**
+ * Extends ManagedBean to allow for dynamically creating new instances of ManagedBean based on an
+ * existing instance of ManagedBean.
+ * 
+ * @since GemFire 5.0.1
+ */
+public class DynamicManagedBean extends org.apache.commons.modeler.ManagedBean {
+  private static final long serialVersionUID = 4051924500150228160L;
+
+  public DynamicManagedBean(ManagedBean managed) {
+    super();
+
+    this.attributes = managed.getAttributes();
+    this.className = managed.getClassName();
+    this.constructors = managed.getConstructors();
+    this.description = managed.getDescription();
+    this.domain = managed.getDomain();
+    this.group = managed.getGroup();
+    this.name = managed.getName();
+    this.fields = managed.getFields();
+    this.notifications = managed.getNotifications();
+    this.operations = managed.getOperations();
+    this.type = managed.getType();
+
+    /*
+     * we don't use modelerType and it's nice to remove it to keep the list of attributes cleaned
+     * up...
+     */
+    removeAttribute("modelerType");
+  }
+
+  /**
+   * Removes an attribute from this ManagedBean's attribute descriptor list.
+   *
+   * @param name the attribute to be removed
+   */
+  public void removeAttribute(String name) {
+    if (name == null || name.length() < 1) {
+      return;
+    }
+    synchronized (this.attributes) {
+      List attributesList = new ArrayList(this.attributes.length);
+      for (int i = 0; i < this.attributes.length; i++) {
+        if (!name.equals(this.attributes[i].getName())) {
+          attributesList.add(this.attributes[i]);
+        }
+      }
+      this.attributes =
+          (AttributeInfo[]) attributesList.toArray(new AttributeInfo[attributesList.size()]);
+
+      /*
+       * super.info should be nulled out anytime the structure is changed, such as altering the
+       * attributes, operations, or notifications
+       *
+       * however super.info is private, so we need the following hack to cause the super class to
+       * null it out for us...
+       */
+      setType(this.type); // causes this in super: "this.info = null;"
+    }
+  }
+
+  /**
+   * Removes the operation with the given name from thie <code>ManageBean</code>'s operation
+   * descriptor list.
+   *
+   * @since GemFire 4.0
+   */
+  public void removeOperation(String name) {
+    if (name == null || name.length() < 1) {
+      return;
+    }
+
+    synchronized (operations) {
+      List operationsList = new ArrayList(this.operations.length);
+      for (int i = 0; i < this.operations.length; i++) {
+        if (!name.equals(this.operations[i].getName())) {
+          operationsList.add(this.operations[i]);
+        }
+      }
+      this.operations =
+          (OperationInfo[]) operationsList.toArray(new OperationInfo[operationsList.size()]);
+
+      /*
+       * super.info should be nulled out anytime the structure is changed, such as altering the
+       * operations, operations, or notifications
+       *
+       * however super.info is private, so we need the following hack to cause the super class to
+       * null it out for us...
+       */
+      setType(this.type); // causes this in super: "this.info = null;"
+    }
+  }
+
+  /**
+   * Return a string representation of this managed bean.
+   */
+  @Override
+  public String toString() {
+    StringBuffer sb = new StringBuffer("DynamicManagedBean[");
+    sb.append("name=");
+    sb.append(name);
+    sb.append(", className=");
+    sb.append(className);
+    sb.append(", description=");
+    sb.append(description);
+    if (group != null) {
+      sb.append(", group=");
+      sb.append(group);
+    }
+    sb.append(", type=");
+    sb.append(type);
+    sb.append(", attributes=");
+    sb.append(Arrays.asList(attributes));
+    sb.append("]");
+    return (sb.toString());
+  }
+}
+


[37/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl.java
deleted file mode 100644
index 6c44811..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthConfigJmxImpl.java
+++ /dev/null
@@ -1,211 +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.admin.jmx.internal;
-
-import javax.management.ObjectName;
-import javax.management.modelmbean.ModelMBean;
-
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.GemFireHealth;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.admin.internal.GemFireHealthConfigImpl;
-
-/**
- * The JMX "managed resource" that represents the configuration for the health of GemFire.
- * Basically, it provides the behavior of <code>GemFireHealthConfigImpl</code>, but does some JMX
- * stuff like registering beans with the agent.
- *
- * <P>
- *
- * Unlike other <code>ManagedResource</code>s this class cannot simply subclass
- * <code>GemFireHealthImpl</code> because it instances are serialized and sent to other VMs. This is
- * problematic because the other VMs most likely do not have JMX classes like
- * <code>ModelMBean</code> on their classpaths. So, instead we delegate all of the
- * <code>GemFireHealthConfig</code> behavior to another object which IS serialized.
- *
- * @see GemFireHealthJmxImpl#createDistributedSystemHealthConfig
- *
- *
- * @since GemFire 3.5
- */
-@edu.umd.cs.findbugs.annotations.SuppressWarnings(
-    justification = "This class is deprecated. Also, any further changes so close to the release is inadvisable.")
-public class GemFireHealthConfigJmxImpl
-    implements GemFireHealthConfig, ManagedResource, java.io.Serializable {
-
-  private static final long serialVersionUID = 1482719647163239953L;
-
-  /** The <code>GemFireHealth</code> that we help configure */
-  private GemFireHealth health;
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  /** The delegate that contains the real config state */
-  private GemFireHealthConfig delegate;
-
-  /** The object name of this managed resource */
-  private ObjectName objectName;
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>GemFireHealthConfigJmxImpl</code> that configures the health monitoring of
-   * components running on the given host.
-   */
-  GemFireHealthConfigJmxImpl(GemFireHealthJmxImpl health, String hostName) throws AdminException {
-
-    this.delegate = new GemFireHealthConfigImpl(hostName);
-    this.health = health;
-    this.mbeanName = new StringBuffer().append(MBEAN_NAME_PREFIX).append("GemFireHealthConfig,id=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(health.getDistributedSystem().getId()))
-        .append(",host=")
-        .append((hostName == null ? "default" : MBeanUtil.makeCompliantMBeanNameProperty(hostName)))
-        .toString();
-    this.objectName = MBeanUtil.createMBean(this);
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Applies the changes made to this config back to the health monitor.
-   *
-   * @see GemFireHealth#setDistributedSystemHealthConfig
-   */
-  public void applyChanges() {
-    String hostName = this.getHostName();
-    if (hostName == null) {
-      this.health.setDefaultGemFireHealthConfig(this);
-
-    } else {
-      this.health.setGemFireHealthConfig(hostName, this);
-    }
-  }
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.GEMFIRE_HEALTH_CONFIG;
-  }
-
-  /**
-   * Replace this object with the delegate that can be properly serialized.
-   */
-  public Object writeReplace() {
-    return this.delegate;
-  }
-
-  ////////////////////// MemberHealthConfig //////////////////////
-
-  public long getMaxVMProcessSize() {
-    return delegate.getMaxVMProcessSize();
-  }
-
-  public void setMaxVMProcessSize(long size) {
-    delegate.setMaxVMProcessSize(size);
-  }
-
-  public long getMaxMessageQueueSize() {
-    return delegate.getMaxMessageQueueSize();
-  }
-
-  public void setMaxMessageQueueSize(long maxMessageQueueSize) {
-    delegate.setMaxMessageQueueSize(maxMessageQueueSize);
-  }
-
-  public long getMaxReplyTimeouts() {
-    return delegate.getMaxReplyTimeouts();
-  }
-
-  public void setMaxReplyTimeouts(long maxReplyTimeouts) {
-    delegate.setMaxReplyTimeouts(maxReplyTimeouts);
-  }
-
-  public double getMaxRetransmissionRatio() {
-    return delegate.getMaxRetransmissionRatio();
-  }
-
-  public void setMaxRetransmissionRatio(double ratio) {
-    delegate.setMaxRetransmissionRatio(ratio);
-  }
-
-  ////////////////////// CacheHealthConfig //////////////////////
-
-  public long getMaxNetSearchTime() {
-    return delegate.getMaxNetSearchTime();
-  }
-
-  public void setMaxNetSearchTime(long maxNetSearchTime) {
-    delegate.setMaxNetSearchTime(maxNetSearchTime);
-  }
-
-  public long getMaxLoadTime() {
-    return delegate.getMaxLoadTime();
-  }
-
-  public void setMaxLoadTime(long maxLoadTime) {
-    delegate.setMaxLoadTime(maxLoadTime);
-  }
-
-  public double getMinHitRatio() {
-    return delegate.getMinHitRatio();
-  }
-
-  public void setMinHitRatio(double minHitRatio) {
-    delegate.setMinHitRatio(minHitRatio);
-  }
-
-  public long getMaxEventQueueSize() {
-    return delegate.getMaxEventQueueSize();
-  }
-
-  public void setMaxEventQueueSize(long maxEventQueueSize) {
-    delegate.setMaxEventQueueSize(maxEventQueueSize);
-  }
-
-  ////////////////////// GemFireHealthConfig //////////////////////
-
-  public String getHostName() {
-    return delegate.getHostName();
-  }
-
-  public void setHealthEvaluationInterval(int interval) {
-    delegate.setHealthEvaluationInterval(interval);
-  }
-
-  public int getHealthEvaluationInterval() {
-    return delegate.getHealthEvaluationInterval();
-  }
-
-  public void cleanupResource() {}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthJmxImpl.java
deleted file mode 100644
index a47ff27..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GemFireHealthJmxImpl.java
+++ /dev/null
@@ -1,171 +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.admin.jmx.internal;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.management.modelmbean.ModelMBean;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.DistributedSystemHealthConfig;
-import org.apache.geode.admin.GemFireHealthConfig;
-import org.apache.geode.admin.RuntimeAdminException;
-import org.apache.geode.admin.internal.GemFireHealthImpl;
-import org.apache.geode.internal.admin.GfManagerAgent;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-// import org.apache.commons.modeler.ManagedBean;
-
-/**
- * The JMX "managed resource" that represents the health of GemFire. Basically, it provides the
- * behavior of <code>GemFireHealthImpl</code>, but does some JMX stuff like registering beans with
- * the agent.
- *
- * @see AdminDistributedSystemJmxImpl#createGemFireHealth
- *
- *
- * @since GemFire 3.5
- */
-public class GemFireHealthJmxImpl extends GemFireHealthImpl implements ManagedResource {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  /** The object name of the MBean created for this managed resource */
-  private final ObjectName objectName;
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>GemFireHealthJmxImpl</code> that monitors the health of the given
-   * distributed system and uses the given JMX agent.
-   */
-  GemFireHealthJmxImpl(GfManagerAgent agent, AdminDistributedSystemJmxImpl system)
-      throws AdminException {
-
-    super(agent, system);
-    this.mbeanName = new StringBuffer().append(MBEAN_NAME_PREFIX).append("GemFireHealth,id=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(system.getId())).toString();
-    this.objectName = MBeanUtil.createMBean(this);
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  public String getHealthStatus() {
-    return getHealth().toString();
-  }
-
-  public ObjectName manageGemFireHealthConfig(String hostName) throws MalformedObjectNameException {
-    try {
-      GemFireHealthConfig config = getGemFireHealthConfig(hostName);
-      GemFireHealthConfigJmxImpl jmx = (GemFireHealthConfigJmxImpl) config;
-      return new ObjectName(jmx.getMBeanName());
-    } // catch (AdminException e) { logWriter.warning(e); throw e; }
-    catch (RuntimeException e) {
-      logger.warn(e.getMessage(), e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logger.error(e.getMessage(), e);
-      throw e;
-    }
-  }
-
-  /**
-   * Creates a new {@link DistributedSystemHealthConfigJmxImpl}
-   */
-  @Override
-  protected DistributedSystemHealthConfig createDistributedSystemHealthConfig() {
-
-    try {
-      return new DistributedSystemHealthConfigJmxImpl(this);
-
-    } catch (AdminException ex) {
-      throw new RuntimeAdminException(
-          LocalizedStrings.GemFireHealthJmxImpl_WHILE_GETTING_THE_DISTRIBUTEDSYSTEMHEALTHCONFIG
-              .toLocalizedString(),
-          ex);
-    }
-  }
-
-  /**
-   * Creates a new {@link GemFireHealthConfigJmxImpl}
-   */
-  @Override
-  protected GemFireHealthConfig createGemFireHealthConfig(String hostName) {
-
-    try {
-      return new GemFireHealthConfigJmxImpl(this, hostName);
-
-    } catch (AdminException ex) {
-      throw new RuntimeAdminException(
-          LocalizedStrings.GemFireHealthJmxImpl_WHILE_GETTING_THE_GEMFIREHEALTHCONFIG
-              .toLocalizedString(),
-          ex);
-    }
-  }
-
-  /**
-   * Ensures that the three primary Health MBeans are registered and returns their ObjectNames.
-   */
-  protected void ensureMBeansAreRegistered() {
-    MBeanUtil.ensureMBeanIsRegistered(this);
-    MBeanUtil.ensureMBeanIsRegistered((ManagedResource) this.defaultConfig);
-    MBeanUtil.ensureMBeanIsRegistered((ManagedResource) this.dsHealthConfig);
-  }
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.GEMFIRE_HEALTH;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public void cleanupResource() {
-    close();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GenerateMBeanHTML.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GenerateMBeanHTML.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GenerateMBeanHTML.java
deleted file mode 100644
index 5375a19..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/GenerateMBeanHTML.java
+++ /dev/null
@@ -1,502 +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.admin.jmx.internal;
-
-import org.apache.geode.internal.ClassPathLoader;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import org.xml.sax.*;
-import org.xml.sax.helpers.DefaultHandler;
-import java.io.*;
-// import java.util.*;
-
-/**
- * A tool that reads the XML description of MBeans used with the Jakarta Commons Modeler and
- * generates an HTML file that documents each MBean.
- *
- * @since GemFire 3.5
- */
-public class GenerateMBeanHTML extends DefaultHandler {
-
-  /** The location of the DTD for the MBean descriptions */
-  private static final String DTD_LOCATION =
-      "/org/apache/geode/admin/jmx/internal/doc-files/mbeans-descriptors.dtd";
-
-  // /** The system id of MBean description's DTD */
-  // private static final String SYSTEM_ID =
-  // "http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd";
-
-  // /** The public id for the DTD */
-  // private static final String PUBLIC_ID =
-  // "-//Apache Software Foundation//DTD Model MBeans Configuration File";
-
-  /** The name of the "mbean-descriptors" element */
-  private static final String MBEANS_DESCRIPTORS = "mbeans-descriptors";
-
-  /** The name of the "mbean" element */
-  private static final String MBEAN = "mbean";
-
-  /** The name of the "name" attribute */
-  private static final String NAME = "name";
-
-  /** The name of the "description" attribute */
-  private static final String DESCRIPTION = "description";
-
-  /** The name of the "type" attribute */
-  private static final String TYPE = "type";
-
-  /** The name of the "attribute" element */
-  private static final String ATTRIBUTE = "attribute";
-
-  /** The name of the "writeable" attribute */
-  private static final String WRITEABLE = "writeable";
-
-  /** The name of the "operation" element */
-  private static final String OPERATION = "operation";
-
-  /** The name of the "returnType" attribute */
-  private static final String RETURN_TYPE = "returnType";
-
-  /** The name of the "paremeter" element */
-  private static final String PARAMETER = "parameter";
-
-  /** The name of the "notification" element */
-  private static final String NOTIFICATION = "notification";
-
-  // /** The name of the "description" element */
-  // private static final String DESCRIPTOR = "descriptor";
-
-  /** The name of the "field" element */
-  private static final String FIELD = "field";
-
-  /** The name of the "value" attribute */
-  private static final String VALUE = "value";
-
-  ////////////////////// Instance Fields ///////////////////////
-
-  /** Where the generated HTML data is written */
-  private PrintWriter pw;
-
-  /** Have we seen attributes for the current MBean? */
-  private boolean seenAttribute = false;
-
-  /** Have we seen operations for the current MBean? */
-  private boolean seenOperation = false;
-
-  /** Have we seen notifications for the current MBean? */
-  private boolean seenNotifications = false;
-
-  /////////////////////// Static Methods ///////////////////////
-
-  /**
-   * Converts data from the given <code>InputStream</code> into HTML that is written to the given
-   * <code>PrintWriter</code>
-   */
-  private static void convert(InputStream in, PrintWriter out) throws Exception {
-
-    SAXParserFactory factory = SAXParserFactory.newInstance();
-    factory.setValidating(true);
-    SAXParser parser = factory.newSAXParser();
-    DefaultHandler handler = new GenerateMBeanHTML(out);
-    parser.parse(in, handler);
-  }
-
-  //////////////////////// Constructors ////////////////////////
-
-  /**
-   * Creates a new <code>GenerateMBeanHTML</code> that writes to the given <code>PrintWriter</code>.
-   */
-  private GenerateMBeanHTML(PrintWriter pw) {
-    this.pw = pw;
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Given a public id, attempt to resolve it to a DTD. Returns an <code>InputSoure</code> for the
-   * DTD.
-   */
-  @Override
-  public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
-
-    if (publicId == null || systemId == null) {
-      throw new SAXException(LocalizedStrings.GenerateMBeanHTML_PUBLIC_ID_0_SYSTEM_ID_1
-          .toLocalizedString(new Object[] {publicId, systemId}));
-    }
-
-    // Figure out the location for the publicId.
-    String location = DTD_LOCATION;
-
-    InputSource result;
-    // if (location != null) (cannot be null)
-    {
-      InputStream stream = ClassPathLoader.getLatest().getResourceAsStream(getClass(), location);
-      if (stream != null) {
-        result = new InputSource(stream);
-      } else {
-        throw new SAXNotRecognizedException(
-            LocalizedStrings.GenerateMBeanHTML_DTD_NOT_FOUND_0.toLocalizedString(location));
-      }
-
-      // } else {
-      // throw new
-      // SAXNotRecognizedException(LocalizedStrings.GenerateMBeanHTML_COULD_NOT_FIND_DTD_FOR_0_1.toLocalizedString(new
-      // Object[] {publicId, systemId}));
-    }
-
-    return result;
-  }
-
-  /**
-   * Warnings are ignored
-   */
-  @Override
-  public void warning(SAXParseException ex) throws SAXException {
-
-  }
-
-  /**
-   * Rethrow the <code>SAXParseException</code>
-   */
-  @Override
-  public void error(SAXParseException ex) throws SAXException {
-    throw ex;
-  }
-
-  /**
-   * Rethrow the <code>SAXParseException</code>
-   */
-  @Override
-  public void fatalError(SAXParseException ex) throws SAXException {
-    throw ex;
-  }
-
-  /**
-   * Starts the HTML document
-   */
-  private void startMBeansDescriptors() {
-    pw.println("<HTML>");
-    pw.println("<HEAD>");
-    pw.println("<TITLE>GemFire MBeans Interface</TITLE>");
-    pw.println("</HEAD>");
-    pw.println("");
-    pw.println("<h1>GemFire Management Beans</h1>");
-    pw.println("");
-    pw.println("<P>This document describes the attributes, operations,");
-    pw.println("and notifications of the GemFire Administration");
-    pw.println("Management Beans (MBeans).</P>");
-    pw.println("");
-  }
-
-  /**
-   * Ends the HTML document
-   */
-  private void endMBeansDescriptors() {
-    pw.println("</HTML>");
-  }
-
-  /**
-   * Generates a heading and a table declaration for an MBean
-   */
-  private void startMBean(Attributes atts) {
-    String name = atts.getValue(NAME);
-    /* String description = */ atts.getValue(DESCRIPTION);
-    pw.println("<h2><b>" + name + "</b> MBean</h2>");
-    pw.println("<table border=\"0\" cellpadding=\"3\">");
-    pw.println("<tr valign=\"top\">");
-    pw.println("  <th align=\"left\">Description:</th>");
-    pw.println("  <td colspan=\"4\">GemFire distributed system</td>");
-    pw.println("</tr>");
-  }
-
-  /**
-   * Ends the MBean table
-   */
-  private void endMBean() {
-    this.seenAttribute = false;
-    this.seenOperation = false;
-    this.seenNotifications = false;
-
-    pw.println("</table>");
-    pw.println("");
-
-    pw.println("<P></P>");
-    pw.println("");
-  }
-
-  /**
-   * Generates a table row for an MBean attribute
-   */
-  private void startAttribute(Attributes atts) {
-    if (!this.seenAttribute) {
-      // Print header row
-      pw.println("<tr valign=\"top\">");
-      pw.println("  <th align=\"left\">Attributes</th>");
-      pw.println("  <th align=\"left\" colspan=\"2\">Name</th>");
-      pw.println("  <th align=\"left\">Type</th>");
-      pw.println("  <th align=\"left\">Description</th>");
-      pw.println("  <th align=\"left\">Writable</th>");
-      pw.println("</tr>");
-
-    }
-
-    this.seenAttribute = true;
-
-    String name = atts.getValue(NAME);
-    String description = atts.getValue(DESCRIPTION);
-    String type = atts.getValue(TYPE);
-    String writeable = atts.getValue(WRITEABLE);
-
-    pw.println("<tr valign=\"top\">");
-    pw.println("  <td></td>");
-    pw.println("  <td colspan=\"2\">" + name + "</td>");
-    pw.println("  <td>" + type + "</td>");
-    pw.println("  <td>" + description + "</td>");
-    pw.println("  <td>" + writeable + "</td>");
-    pw.println("</tr>");
-  }
-
-  /**
-   * Generates a table row for an MBean operation
-   */
-  private void startOperation(Attributes atts) {
-    if (!this.seenOperation) {
-      if (!this.seenAttribute) {
-        pw.println("<tr valign=\"top\">");
-        pw.println("  <th align=\"left\">Operations</th>");
-        pw.println("  <th align=\"left\" colspan=\"2\">Name</th>");
-        pw.println("  <th align=\"left\">Type</th>");
-        pw.println("  <th align=\"left\">Description</th>");
-        pw.println("  <th align=\"left\"></th>");
-        pw.println("</tr>");
-
-      } else {
-        String title = "Operations and Parameters";
-        pw.println("<tr valign=\"top\">");
-        pw.println("  <th align=\"left\" colspan=\"6\">" + title + "</th>");
-        pw.println("</tr>");
-      }
-    }
-
-    this.seenOperation = true;
-
-    String name = atts.getValue(NAME);
-    String type = atts.getValue(RETURN_TYPE);
-    String description = atts.getValue(DESCRIPTION);
-
-    pw.println("<tr valign=\"top\">");
-    pw.println("  <td></td>");
-    pw.println("  <td colspan=\"2\">" + name + "</td>");
-    pw.println("  <td>" + type + "</td>");
-    pw.println("  <td colspan=\"2\">" + description + "</td>");
-    pw.println("</tr>");
-
-  }
-
-  /**
-   * Generates a table row for the parameter of an MBean operation
-   */
-  private void startParameter(Attributes atts) {
-    String name = atts.getValue(NAME);
-    String description = atts.getValue(DESCRIPTION);
-    String type = atts.getValue(TYPE);
-
-    pw.println("<tr valign=\"top\">");
-    pw.println("  <td></td>");
-    pw.println("  <td width=\"10\"></td>");
-    pw.println("  <td>" + name + "</td>");
-    pw.println("  <td>" + type + "</td>");
-    pw.println("  <td colspan=\"2\">" + description + "</td>");
-    pw.println("</tr>");
-  }
-
-  /**
-   * Generates a row in a table for an MBean notification
-   */
-  private void startNotification(Attributes atts) {
-    if (!this.seenNotifications) {
-      if (!this.seenAttribute && !this.seenOperation) {
-        pw.println("<tr valign=\"top\">");
-        pw.println("  <th align=\"left\">Notifications</th>");
-        pw.println("  <th align=\"left\" colspan=\"2\">Name</th>");
-        pw.println("  <th align=\"left\">Type</th>");
-        pw.println("  <th align=\"left\">Description</th>");
-        pw.println("  <th align=\"left\"></th>");
-        pw.println("</tr>");
-        pw.println("</tr>");
-
-      } else {
-        pw.println("<tr valign=\"top\">");
-        pw.println("  <th align=\"left\" colspan=\"6\">Notifications and Fields</th>");
-        pw.println("</tr>");
-      }
-    }
-
-    this.seenNotifications = true;
-
-    String name = atts.getValue(NAME);
-    String description = atts.getValue(DESCRIPTION);
-
-    pw.println("<tr valign=\"top\">");
-    pw.println("  <td></td>");
-    pw.println("  <td colspan=\"3\">" + name + "</td>");
-    pw.println("  <td colspan=\"3\">" + description + "</td>");
-    pw.println("</tr>");
-
-  }
-
-  /**
-   * Generates a table row for a descriptor field
-   */
-  private void startField(Attributes atts) {
-    String name = atts.getValue(NAME);
-    String value = atts.getValue(VALUE);
-
-    pw.println("<tr valign=\"top\">");
-    pw.println("  <td></td>");
-    pw.println("  <td width=\"10\"></td>");
-    pw.println("  <td colspan=\"2\">" + name + "</td>");
-    pw.println("  <td colspan=\"2\">" + value + "</td>");
-    pw.println("</tr>");
-
-  }
-
-  @Override
-  public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
-      throws SAXException {
-
-    if (qName.equals(MBEANS_DESCRIPTORS)) {
-      startMBeansDescriptors();
-
-    } else if (qName.equals(MBEAN)) {
-      startMBean(atts);
-
-    } else if (qName.equals(ATTRIBUTE)) {
-      startAttribute(atts);
-
-    } else if (qName.equals(OPERATION)) {
-      startOperation(atts);
-
-    } else if (qName.equals(PARAMETER)) {
-      startParameter(atts);
-
-    } else if (qName.equals(NOTIFICATION)) {
-      startNotification(atts);
-
-    } else if (qName.equals(FIELD)) {
-      startField(atts);
-    }
-
-  }
-
-
-  @Override
-  public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
-
-    if (qName.equals(MBEANS_DESCRIPTORS)) {
-      endMBeansDescriptors();
-
-    } else if (qName.equals(MBEAN)) {
-      endMBean();
-    }
-
-  }
-
-  ////////// Inherited methods that don't do anything //////////
-
-  @Override
-  public void characters(char[] ch, int start, int length) throws SAXException {
-
-  }
-
-  @Override
-  public void setDocumentLocator(Locator locator) {}
-
-  @Override
-  public void startDocument() throws SAXException {}
-
-  @Override
-  public void endDocument() throws SAXException {}
-
-  @Override
-  public void startPrefixMapping(String prefix, String uri) throws SAXException {}
-
-  @Override
-  public void endPrefixMapping(String prefix) throws SAXException {}
-
-  @Override
-  public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {}
-
-  @Override
-  public void processingInstruction(String target, String data) throws SAXException {}
-
-  @Override
-  public void skippedEntity(String name) throws SAXException {}
-
-  //////////////////////// Main Program ////////////////////////
-
-  // private static final PrintStream out = System.out;
-  private static final PrintStream err = System.err;
-
-  /**
-   * Prints usage information about this program
-   */
-  private static void usage(String s) {
-    err.println("\n** " + s + "\n");
-    err.println("usage: java GenerateMBeanHTML xmlFile htmlFile");
-    err.println("");
-    err.println("Converts an MBeans description XML file into an HTML");
-    err.println("file suitable for documentation");
-
-    err.println("");
-
-    System.exit(1);
-  }
-
-  public static void main(String[] args) throws Exception {
-    String xmlFileName = null;
-    String htmlFileName = null;
-
-    for (int i = 0; i < args.length; i++) {
-      if (xmlFileName == null) {
-        xmlFileName = args[i];
-
-      } else if (htmlFileName == null) {
-        htmlFileName = args[i];
-
-      } else {
-        usage("Extraneous command line argument: " + args[i]);
-      }
-    }
-
-    if (xmlFileName == null) {
-      usage("Missing XML file name");
-
-    } else if (htmlFileName == null) {
-      usage("Missing HTML file name");
-    }
-
-    File xmlFile = new File(xmlFileName);
-    if (!xmlFile.exists()) {
-      usage("XML file \"" + xmlFile + "\" does not exist");
-    }
-
-    File htmlFile = new File(htmlFileName);
-    convert(new FileInputStream(xmlFile), new PrintWriter(new FileWriter(htmlFile), true));
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MBeanUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MBeanUtil.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MBeanUtil.java
deleted file mode 100755
index b2c5883..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MBeanUtil.java
+++ /dev/null
@@ -1,767 +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.admin.jmx.internal;
-
-import java.net.URL;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.JMException;
-import javax.management.JMRuntimeException;
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerNotification;
-import javax.management.MalformedObjectNameException;
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.management.timer.TimerMBean;
-
-import org.apache.commons.modeler.ManagedBean;
-import org.apache.commons.modeler.Registry;
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.LogWriter;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.RuntimeAdminException;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
-import org.apache.geode.internal.ClassPathLoader;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.InternalLogWriter;
-import org.apache.geode.internal.logging.LogService;
-
-/**
- * Common support for MBeans and {@link ManagedResource}s. Static loading of this class creates the
- * MBeanServer and Modeler Registry.
- *
- * @since GemFire 3.5
- *
- */
-public class MBeanUtil {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /** The default MBeanServer domain name is "GemFire" */
-  private static final String DEFAULT_DOMAIN = "GemFire";
-
-  /** MBean Name for refreshTimer */
-  private static String REFRESH_TIMER_NAME = DEFAULT_DOMAIN + ":type=RefreshTimer";
-
-  /* indicates whether the mbeanServer, registry & refreshTimer are started */
-  private static boolean isStarted;
-
-  /** The Commons-Modeler configuration registry for our managed beans */
-  private static Registry registry;
-
-  /** The <code>MBeanServer</code> for this application */
-  private static MBeanServer mbeanServer;
-
-  /** MBean name of the Timer which handles refresh notifications */
-  private static ObjectName refreshTimerObjectName;
-
-  /** Actual TimerMBean responsible for refresh notifications */
-  private static TimerMBean refreshTimer;
-
-  /**
-   * Map of ObjectNames to current timerNotificationIds
-   * <p>
-   * map: key=ObjectName, value=map: key=RefreshNotificationType, value=timerNotificationId
-   */
-  private static Map<NotificationListener, Map<RefreshNotificationType, Integer>> refreshClients =
-      new HashMap<NotificationListener, Map<RefreshNotificationType, Integer>>();
-
-  /** key=ObjectName, value=ManagedResource */
-  private final static Map<ObjectName, ManagedResource> managedResources =
-      new HashMap<ObjectName, ManagedResource>();
-
-  static {
-    try {
-      refreshTimerObjectName = ObjectName.getInstance(REFRESH_TIMER_NAME);
-    } catch (Exception e) {
-      logStackTrace(Level.ERROR, e);
-    }
-  }
-
-  /**
-   * Initializes Mbean Server, Registry, Refresh Timer & registers Server Notification Listener.
-   * 
-   * @return reference to the mbeanServer
-   */
-  static MBeanServer start() {
-    if (!isStarted) {
-      mbeanServer = createMBeanServer();
-      registry = createRegistry();
-
-      registerServerNotificationListener();
-      createRefreshTimer();
-      isStarted = true;
-    }
-
-    return mbeanServer;
-  }
-
-  /**
-   * Stops Registry, Refresh Timer. Releases Mbean Server after.
-   */
-  static void stop() {
-    if (isStarted) {
-      stopRefreshTimer();
-
-      registry.stop();
-      registry = null;
-      releaseMBeanServer();// makes mbeanServer null
-      isStarted = false;
-    }
-  }
-
-  /**
-   * Create and configure (if necessary) and return the <code>MBeanServer</code> with which we will
-   * be registering our <code>ModelMBean</code> implementations.
-   *
-   * @see javax.management.MBeanServer
-   */
-  static synchronized MBeanServer createMBeanServer() {
-    if (mbeanServer == null) {
-      mbeanServer = MBeanServerFactory.createMBeanServer(DEFAULT_DOMAIN);
-    }
-    return mbeanServer;
-  }
-
-  /**
-   * Create and configure (if necessary) and return the Commons-Modeler registry of managed object
-   * descriptions.
-   *
-   * @see org.apache.commons.modeler.Registry
-   */
-  static synchronized Registry createRegistry() {
-    if (registry == null) {
-      try {
-        registry = Registry.getRegistry(null, null);
-        if (mbeanServer == null) {
-          throw new IllegalStateException(
-              LocalizedStrings.MBeanUtil_MBEAN_SERVER_NOT_INITIALIZED_YET.toLocalizedString());
-        }
-        registry.setMBeanServer(mbeanServer);
-
-        String mbeansResource = getOSPath("/org/apache/geode/admin/jmx/mbeans-descriptors.xml");
-        // System.out.println(LocalizedStrings.MBeanUtil_LOADING_RESOURCE_0.toLocalizedString(mbeansResource));
-
-        URL url = ClassPathLoader.getLatest().getResource(MBeanUtil.class, mbeansResource);
-        raiseOnFailure(url != null, LocalizedStrings.MBeanUtil_FAILED_TO_FIND_0
-            .toLocalizedString(new Object[] {mbeansResource}));
-        registry.loadMetadata(url);
-
-        // simple test to make sure the xml was actually loaded and is valid...
-        String[] test = registry.findManagedBeans();
-        raiseOnFailure(test != null && test.length > 0, LocalizedStrings.MBeanUtil_FAILED_TO_LOAD_0
-            .toLocalizedString(new Object[] {mbeansResource}));
-      } catch (Exception e) {
-        logStackTrace(Level.WARN, e);
-        throw new RuntimeAdminException(
-            LocalizedStrings.MBeanUtil_FAILED_TO_GET_MBEAN_REGISTRY.toLocalizedString(), e);
-      }
-    }
-    return registry;
-  }
-
-  /**
-   * Creates and registers a <code>ModelMBean</code> for the specified <code>ManagedResource</code>.
-   * State changing callbacks into the <code>ManagedResource</code> will also be made.
-   *
-   * @param resource the ManagedResource to create a managing MBean for
-   *
-   * @return The object name of the newly-created MBean
-   *
-   * @see ManagedResource#setModelMBean
-   */
-  static ObjectName createMBean(ManagedResource resource) {
-    return createMBean(resource, lookupManagedBean(resource));
-  }
-
-  /**
-   * Creates and registers a <code>ModelMBean</code> for the specified <code>ManagedResource</code>.
-   * State changing callbacks into the <code>ManagedResource</code> will also be made.
-   *
-   * @param resource the ManagedResource to create a managing MBean for
-   * @param managed the ManagedBean definition to create the MBean with
-   * @see ManagedResource#setModelMBean
-   */
-  static ObjectName createMBean(ManagedResource resource, ManagedBean managed) {
-
-    try {
-      DynamicManagedBean mb = new DynamicManagedBean(managed);
-      resource.setModelMBean(mb.createMBean(resource));
-
-      // create the ObjectName and register the MBean...
-      final ObjectName objName;
-      try {
-        objName = ObjectName.getInstance(resource.getMBeanName());
-      } catch (MalformedObjectNameException e) {
-        throw new MalformedObjectNameException(LocalizedStrings.MBeanUtil_0_IN_1
-            .toLocalizedString(new Object[] {e.getMessage(), resource.getMBeanName()}));
-      }
-
-      synchronized (MBeanUtil.class) {
-        // Only register a bean once. Otherwise, you risk race
-        // conditions with things like the RMI connector accessing it.
-
-        if (mbeanServer != null && !mbeanServer.isRegistered(objName)) {
-          mbeanServer.registerMBean(resource.getModelMBean(), objName);
-          synchronized (managedResources) {
-            managedResources.put(objName, resource);
-          }
-        }
-      }
-      return objName;
-    } catch (java.lang.Exception e) {
-      throw new RuntimeAdminException(LocalizedStrings.MBeanUtil_FAILED_TO_CREATE_MBEAN_FOR_0
-          .toLocalizedString(new Object[] {resource.getMBeanName()}), e);
-    }
-  }
-
-  /**
-   * Ensures that an MBean is registered for the specified <code>ManagedResource</code>. If an MBean
-   * cannot be found in the <code>MBeanServer</code>, then this creates and registers a
-   * <code>ModelMBean</code>. State changing callbacks into the <code>ManagedResource</code> will
-   * also be made.
-   *
-   * @param resource the ManagedResource to create a managing MBean for
-   *
-   * @return The object name of the MBean that manages the ManagedResource
-   *
-   * @see ManagedResource#setModelMBean
-   */
-  static ObjectName ensureMBeanIsRegistered(ManagedResource resource) {
-    try {
-      ObjectName objName = ObjectName.getInstance(resource.getMBeanName());
-      synchronized (MBeanUtil.class) {
-        if (mbeanServer != null && !mbeanServer.isRegistered(objName)) {
-          return createMBean(resource);
-        }
-      }
-      raiseOnFailure(mbeanServer.isRegistered(objName),
-          LocalizedStrings.MBeanUtil_COULDNT_FIND_MBEAN_REGISTERED_WITH_OBJECTNAME_0
-              .toLocalizedString(new Object[] {objName.toString()}));
-      return objName;
-    } catch (java.lang.Exception e) {
-      throw new RuntimeAdminException(e);
-    }
-  }
-
-  /**
-   * Retrieves the <code>ManagedBean</code> configuration from the Registry for the specified
-   * <code>ManagedResource</code>
-   *
-   * @param resource the ManagedResource to find the configuration for
-   */
-  static ManagedBean lookupManagedBean(ManagedResource resource) {
-    // find the registry defn for our MBean...
-    ManagedBean managed = null;
-    if (registry != null) {
-      managed = registry.findManagedBean(resource.getManagedResourceType().getClassTypeName());
-    } else {
-      throw new IllegalArgumentException(
-          LocalizedStrings.MBeanUtil_MANAGEDBEAN_IS_NULL.toLocalizedString());
-    }
-
-    if (managed == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.MBeanUtil_MANAGEDBEAN_IS_NULL.toLocalizedString());
-    }
-
-    // customize the defn...
-    managed.setClassName("org.apache.geode.admin.jmx.internal.MX4JModelMBean");
-
-    return managed;
-  }
-
-  /**
-   * Registers a refresh notification for the specified client MBean. Specifying zero for the
-   * refreshInterval disables notification for the refresh client. Note: this does not currently
-   * support remote connections.
-   *
-   * @param client client to listen for refresh notifications
-   * @param userData userData to register with the Notification
-   * @param type refresh notification type the client will use
-   * @param refreshInterval the seconds between refreshes
-   */
-  static void registerRefreshNotification(NotificationListener client, Object userData,
-      RefreshNotificationType type, int refreshInterval) {
-    if (client == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.MBeanUtil_NOTIFICATIONLISTENER_IS_REQUIRED.toLocalizedString());
-    }
-    if (type == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.MBeanUtil_REFRESHNOTIFICATIONTYPE_IS_REQUIRED.toLocalizedString());
-    }
-    if (refreshTimerObjectName == null || refreshTimer == null) {
-      throw new IllegalStateException(
-          LocalizedStrings.MBeanUtil_REFRESHTIMER_HAS_NOT_BEEN_PROPERLY_INITIALIZED
-              .toLocalizedString());
-    }
-
-    try {
-      // get the notifications for the specified client...
-      Map<RefreshNotificationType, Integer> notifications = null;
-      synchronized (refreshClients) {
-        notifications = (Map<RefreshNotificationType, Integer>) refreshClients.get(client);
-      }
-
-      if (notifications == null) {
-        // If refreshInterval is being set to zero and notifications is removed return
-        if (refreshInterval <= 0) {
-          return;
-        }
-
-        // never registered before, so add client...
-        notifications = new HashMap<RefreshNotificationType, Integer>();
-        synchronized (refreshClients) {
-          refreshClients.put(client, notifications);
-        }
-        validateRefreshTimer();
-        try {
-          // register client as a listener with MBeanServer...
-          mbeanServer.addNotificationListener(refreshTimerObjectName, // timer to listen to
-              client, // the NotificationListener object
-              null, // optional NotificationFilter TODO: convert to using
-              new Object() // not used but null throws IllegalArgumentException
-          );
-        } catch (InstanceNotFoundException e) {
-          // should not happen since we already checked refreshTimerObjectName
-          logStackTrace(Level.WARN, e,
-              LocalizedStrings.MBeanUtil_COULD_NOT_FIND_REGISTERED_REFRESHTIMER_INSTANCE
-                  .toLocalizedString());
-        }
-      }
-
-      // TODO: change to manipulating timer indirectly thru mserver...
-
-      // check for pre-existing refresh notification entry...
-      Integer timerNotificationId = (Integer) notifications.get(type);
-      if (timerNotificationId != null) {
-        try {
-          // found one, so let's remove it...
-          refreshTimer.removeNotification(timerNotificationId);
-        } catch (InstanceNotFoundException e) {
-          // that's ok cause we just wanted to remove it anyway
-        } finally {
-          // null out the map entry for that notification type...
-          notifications.put(type, null);
-        }
-      }
-
-      if (refreshInterval > 0) {
-        // add notification to the refresh timer...
-        timerNotificationId = refreshTimer.addNotification(type.getType(), // type
-            type.getMessage(), // message = "refresh"
-            userData, // userData
-            new Date(System.currentTimeMillis() + refreshInterval * 1000), // first occurence
-            refreshInterval * 1000); // period to repeat
-
-        // put an entry into the map for the listener...
-        notifications.put(type, timerNotificationId);
-      } else {
-        // do nothing! refreshInterval must be over 0 to do anything...
-      }
-    } catch (java.lang.RuntimeException e) {
-      logStackTrace(Level.WARN, e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (java.lang.Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      logStackTrace(Level.ERROR, e);
-      throw e;
-    }
-  }
-
-  /**
-   * Verifies a refresh notification for the specified client MBean. If notification is not
-   * registered, then returns a false
-   *
-   * @param client client to listen for refresh notifications
-   * @param type refresh notification type the client will use
-   *
-   * @return isRegistered boolean indicating if a notification is registered
-   */
-  static boolean isRefreshNotificationRegistered(NotificationListener client,
-      RefreshNotificationType type) {
-    boolean isRegistered = false;
-
-    // get the notifications for the specified client...
-    Map<RefreshNotificationType, Integer> notifications = null;
-    synchronized (refreshClients) {
-      notifications = (Map<RefreshNotificationType, Integer>) refreshClients.get(client);
-    }
-
-    // never registered before if null ...
-    if (notifications != null) {
-      // check for pre-existing refresh notification entry...
-      Integer timerNotificationId = notifications.get(type);
-      if (timerNotificationId != null) {
-        isRegistered = true;
-      }
-    }
-
-    return isRegistered;
-  }
-
-  /**
-   * Validates refreshTimer has been registered without problems and attempts to re-register if
-   * there is a problem.
-   */
-  static void validateRefreshTimer() {
-    if (refreshTimerObjectName == null || refreshTimer == null) {
-      // if (refreshTimerObjectName == null) System.out.println("refreshTimerObjectName is null");
-      // if (refreshTimer == null) System.out.println("refreshTimer is null");
-      // System.out.println("[validateRefreshTimer] createRefreshTimer");
-      createRefreshTimer();
-    }
-
-    raiseOnFailure(refreshTimer != null, "Failed to validate Refresh Timer");
-
-    if (mbeanServer != null && !mbeanServer.isRegistered(refreshTimerObjectName)) {
-      // System.out.println("[validateRefreshTimer] registerMBean");
-      try {
-        mbeanServer.registerMBean(refreshTimer, refreshTimerObjectName);
-      } catch (JMException e) {
-        logStackTrace(Level.WARN, e);
-      } catch (JMRuntimeException e) {
-        logStackTrace(Level.WARN, e);
-      }
-    }
-  }
-
-  /**
-   * Initializes the timer for sending refresh notifications.
-   */
-  static void createRefreshTimer() {
-    try {
-      refreshTimer = new javax.management.timer.Timer();
-      mbeanServer.registerMBean(refreshTimer, refreshTimerObjectName);
-
-      refreshTimer.start();
-    } catch (JMException e) {
-      logStackTrace(Level.WARN, e,
-          LocalizedStrings.MBeanUtil_FAILED_TO_CREATE_REFRESH_TIMER.toLocalizedString());
-    } catch (JMRuntimeException e) {
-      logStackTrace(Level.WARN, e,
-          LocalizedStrings.MBeanUtil_FAILED_TO_CREATE_REFRESH_TIMER.toLocalizedString());
-    } catch (Exception e) {
-      logStackTrace(Level.WARN, e,
-          LocalizedStrings.MBeanUtil_FAILED_TO_CREATE_REFRESH_TIMER.toLocalizedString());
-    }
-  }
-
-  /**
-   * Initializes the timer for sending refresh notifications.
-   */
-  static void stopRefreshTimer() {
-    try {
-      if (refreshTimer != null && mbeanServer != null) {
-        mbeanServer.unregisterMBean(refreshTimerObjectName);
-
-        refreshTimer.stop();
-      }
-    } catch (JMException e) {
-      logStackTrace(Level.WARN, e);
-    } catch (JMRuntimeException e) {
-      logStackTrace(Level.WARN, e);
-    } catch (Exception e) {
-      logStackTrace(Level.DEBUG, e, "Failed to stop refresh timer for MBeanUtil");
-    }
-  }
-
-  /**
-   * Return a String that been modified to be compliant as a property of an ObjectName.
-   * <p>
-   * The property name of an ObjectName may not contain any of the following characters: <b><i>: , =
-   * * ?</i></b>
-   * <p>
-   * This method will replace the above non-compliant characters with a dash: <b><i>-</i></b>
-   * <p>
-   * If value is empty, this method will return the string "nothing".
-   * <p>
-   * Note: this is <code>public</code> because certain tests call this from outside of the package.
-   * TODO: clean this up
-   *
-   * @param value the potentially non-compliant ObjectName property
-   * @return the value modified to be compliant as an ObjectName property
-   */
-  public static String makeCompliantMBeanNameProperty(String value) {
-    value = value.replace(':', '-');
-    value = value.replace(',', '-');
-    value = value.replace('=', '-');
-    value = value.replace('*', '-');
-    value = value.replace('?', '-');
-    if (value.length() < 1) {
-      value = "nothing";
-    }
-    return value;
-  }
-
-  /**
-   * Unregisters all GemFire MBeans and then releases the MBeanServer for garbage collection.
-   */
-  static void releaseMBeanServer() {
-    try {
-      // unregister all GemFire mbeans...
-      Iterator iter = mbeanServer.queryNames(null, null).iterator();
-      while (iter.hasNext()) {
-        ObjectName name = (ObjectName) iter.next();
-        if (name.getDomain().startsWith(DEFAULT_DOMAIN)) {
-          unregisterMBean(name);
-        }
-      }
-
-      // last, release the mbean server...
-      MBeanServerFactory.releaseMBeanServer(mbeanServer);
-      mbeanServer = null;
-    } catch (JMRuntimeException e) {
-      logStackTrace(Level.WARN, e);
-    }
-    /*
-     * See #42391. Cleaning up the static maps which might be still holding references to
-     * ManagedResources
-     */
-    synchronized (MBeanUtil.managedResources) {
-      MBeanUtil.managedResources.clear();
-    }
-    synchronized (refreshClients) {
-      refreshClients.clear();
-    }
-    /*
-     * See #42391. Cleaning up the static maps which might be still holding references to
-     * ManagedResources
-     */
-    synchronized (MBeanUtil.managedResources) {
-      MBeanUtil.managedResources.clear();
-    }
-    synchronized (refreshClients) {
-      refreshClients.clear();
-    }
-  }
-
-  /**
-   * Returns true if a MBean with given ObjectName is registered.
-   * 
-   * @param objectName ObjectName to use for checking if MBean is registered
-   * @return true if MBeanServer is not null & MBean with given ObjectName is registered with the
-   *         MBeanServer
-   */
-  static boolean isRegistered(ObjectName objectName) {
-    return mbeanServer != null && mbeanServer.isRegistered(objectName);
-  }
-
-  /**
-   * Unregisters the identified MBean if it's registered.
-   */
-  static void unregisterMBean(ObjectName objectName) {
-    try {
-      if (mbeanServer != null && mbeanServer.isRegistered(objectName)) {
-        mbeanServer.unregisterMBean(objectName);
-      }
-    } catch (MBeanRegistrationException e) {
-      logStackTrace(Level.WARN, null,
-          LocalizedStrings.MBeanUtil_FAILED_WHILE_UNREGISTERING_MBEAN_WITH_OBJECTNAME_0
-              .toLocalizedString(new Object[] {objectName}));
-    } catch (InstanceNotFoundException e) {
-      logStackTrace(Level.WARN, null,
-          LocalizedStrings.MBeanUtil_WHILE_UNREGISTERING_COULDNT_FIND_MBEAN_WITH_OBJECTNAME_0
-              .toLocalizedString(new Object[] {objectName}));
-    } catch (JMRuntimeException e) {
-      logStackTrace(Level.WARN, null,
-          LocalizedStrings.MBeanUtil_COULD_NOT_UNREGISTER_MBEAN_WITH_OBJECTNAME_0
-              .toLocalizedString(new Object[] {objectName}));
-    }
-  }
-
-  static void unregisterMBean(ManagedResource resource) {
-    if (resource != null) {
-      unregisterMBean(resource.getObjectName());
-
-      // call cleanup on managedResource here and not rely on listener
-      // since it is possible that notification listener not deliver
-      // all notifications of un-registration. If resource is
-      // cleaned here, another call from the listener should be as good as a no-op
-      cleanupResource(resource);
-    }
-  }
-
-  // cleanup resource
-  private static void cleanupResource(ManagedResource resource) {
-    synchronized (MBeanUtil.managedResources) {
-      MBeanUtil.managedResources.remove(resource.getObjectName());
-    }
-    resource.cleanupResource();
-
-    // get the notifications for the specified client...
-    Map<RefreshNotificationType, Integer> notifications = null;
-    synchronized (refreshClients) {
-      notifications = (Map<RefreshNotificationType, Integer>) refreshClients.remove(resource);
-    }
-
-    // never registered before if null ...
-    // Also as of current, there is ever only 1 Notification type per
-    // MBean, so we do need need a while loop here
-    if (notifications != null) {
-
-      // Fix for findbugs reported inefficiency with keySet().
-      Set<Map.Entry<RefreshNotificationType, Integer>> entries = notifications.entrySet();
-
-      for (Map.Entry<RefreshNotificationType, Integer> e : entries) {
-        Integer timerNotificationId = e.getValue();
-        if (null != timerNotificationId) {
-          try {
-            // found one, so let's remove it...
-            refreshTimer.removeNotification(timerNotificationId);
-          } catch (InstanceNotFoundException xptn) {
-            // that's ok cause we just wanted to remove it anyway
-            logStackTrace(Level.DEBUG, xptn);
-          }
-        }
-      }
-
-      try {
-        if (mbeanServer != null && mbeanServer.isRegistered(refreshTimerObjectName)) {
-          // remove client as a listener with MBeanServer...
-          mbeanServer.removeNotificationListener(refreshTimerObjectName, // timer to listen to
-              (NotificationListener) resource // the NotificationListener object
-          );
-        }
-      } catch (ListenerNotFoundException xptn) {
-        // should not happen since we already checked refreshTimerObjectName
-        logStackTrace(Level.WARN, null, xptn.getMessage());
-      } catch (InstanceNotFoundException xptn) {
-        // should not happen since we already checked refreshTimerObjectName
-        logStackTrace(Level.WARN, null,
-            LocalizedStrings.MBeanUtil_WHILE_UNREGISTERING_COULDNT_FIND_MBEAN_WITH_OBJECTNAME_0
-                .toLocalizedString(new Object[] {refreshTimerObjectName}));
-      }
-    }
-  }
-
-  // ----- borrowed the following from admin.internal.RemoteCommand -----
-  /** Translates the path between Windows and UNIX. */
-  static String getOSPath(String path) {
-    if (pathIsWindows(path)) {
-      return path.replace('/', '\\');
-    } else {
-      return path.replace('\\', '/');
-    }
-  }
-
-  /** Returns true if the path is on Windows. */
-  static boolean pathIsWindows(String path) {
-    if (path != null && path.length() > 1) {
-      return (Character.isLetter(path.charAt(0)) && path.charAt(1) == ':')
-          || (path.startsWith("//") || path.startsWith("\\\\"));
-    }
-    return false;
-  }
-
-  static void registerServerNotificationListener() {
-    if (mbeanServer == null) {
-      return;
-    }
-    try {
-      // the MBeanServerDelegate name is spec'ed as the following...
-      ObjectName delegate = ObjectName.getInstance("JMImplementation:type=MBeanServerDelegate");
-      mbeanServer.addNotificationListener(delegate, new NotificationListener() {
-        public void handleNotification(Notification notification, Object handback) {
-          MBeanServerNotification serverNotification = (MBeanServerNotification) notification;
-          if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION
-              .equals(serverNotification.getType())) {
-            ObjectName objectName = serverNotification.getMBeanName();
-            synchronized (MBeanUtil.managedResources) {
-              Object entry = MBeanUtil.managedResources.get(objectName);
-              if (entry == null)
-                return;
-              if (!(entry instanceof ManagedResource)) {
-                throw new ClassCastException(LocalizedStrings.MBeanUtil_0_IS_NOT_A_MANAGEDRESOURCE
-                    .toLocalizedString(new Object[] {entry.getClass().getName()}));
-              }
-              ManagedResource resource = (ManagedResource) entry;
-              {
-                // call cleanup on managedResource
-                cleanupResource(resource);
-              }
-            }
-          }
-        }
-      }, null, null);
-    } catch (JMException e) {
-      logStackTrace(Level.WARN, e,
-          LocalizedStrings.MBeanUtil_FAILED_TO_REGISTER_SERVERNOTIFICATIONLISTENER
-              .toLocalizedString());
-    } catch (JMRuntimeException e) {
-      logStackTrace(Level.WARN, e,
-          LocalizedStrings.MBeanUtil_FAILED_TO_REGISTER_SERVERNOTIFICATIONLISTENER
-              .toLocalizedString());
-    }
-  }
-
-  /**
-   * Logs the stack trace for the given Throwable if logger is initialized else prints the stack
-   * trace using System.out.
-   * 
-   * @param level severity level to log at
-   * @param throwable Throwable to log stack trace for
-   */
-  public static void logStackTrace(Level level, Throwable throwable) {
-    logStackTrace(level, throwable, null);
-  }
-
-  /**
-   * Logs the stack trace for the given Throwable if logger is initialized else prints the stack
-   * trace using System.out.
-   * 
-   * @param level severity level to log at
-   * @param throwable Throwable to log stack trace for
-   * @param message user friendly error message to show
-   */
-  public static void logStackTrace(Level level, Throwable throwable, String message) {
-    logger.log(level, message, throwable);
-  }
-
-  /**
-   * Raises RuntimeAdminException with given 'message' if given 'condition' is false.
-   * 
-   * @param condition condition to evaluate
-   * @param message failure message
-   */
-  private static void raiseOnFailure(boolean condition, String message) {
-    if (!condition) {
-      throw new RuntimeAdminException(message);
-    }
-  }
-}
-


[14/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml
----------------------------------------------------------------------
diff --git a/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml b/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml
new file mode 100755
index 0000000..1735f5f
--- /dev/null
+++ b/geode-core/src/main/resources/org/apache/geode/admin/api/jmx/mbeans-descriptors.xml
@@ -0,0 +1,1452 @@
+<?xml version="1.0"?>
+<!DOCTYPE mbeans-descriptors PUBLIC
+ "-//Apache Software Foundation//DTD Model MBeans Configuration File"
+ "http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd">
+
+<!--
+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.
+-->
+
+<!-- ===================================================================== -->
+<!-- MBeans are defined in this file for these components:                 -->
+<!--   Agent                                -->
+<!--   org.apache.geode.internal.admin.api.AdminDistributedSystem          -->
+<!--   org.apache.geode.internal.admin.api.SystemMember                    -->
+<!--   org.apache.geode.internal.admin.api.GemFireManager                  -->
+<!--   org.apache.geode.internal.admin.api.StatisticResource               -->
+<!--   org.apache.geode.internal.admin.api.DistributionLocator             -->
+<!--   org.apache.geode.internal.admin.api.SystemMemberCache               -->
+<!--   org.apache.geode.internal.admin.api.SystemMemberRegion              -->
+<!--   org.apache.geode.internal.admin.api.SystemMemberCacheServer         -->
+<!--   org.apache.geode.internal.admin.api.CacheVm                         -->
+<!--   org.apache.geode.internal.admin.api.GemFireHealth                   -->
+<!--   org.apache.geode.internal.admin.api.DistributedSystemHealthConfig   -->
+<!--   org.apache.geode.internal.admin.api.GemFireHealthConfig             -->
+<!--                                                                       -->
+<!-- Each component is a managed resource wrapped by a Model MBean built   -->
+<!-- by Jakarta Commons-Modeler.                                           -->
+<!--                                                                       -->
+<!-- author    Kirk Lund                                                   -->
+<!-- since     3.5                                                         -->
+<!-- ===================================================================== -->
+<mbeans-descriptors>
+
+  <!-- =================================================================== -->
+  <!-- Agent                                -->
+  <!-- =================================================================== -->
+  <mbean          name="GemFireAgent"
+           description="GemFire JMX Agent"
+                  type="org.apache.geode.internal.admin.api.jmx.Agent">
+                 
+    <attribute    name="logFileSizeLimit"
+           description="The maximum size of the JMX Agent log file; a value (in megabytes) in the range 0..1000000."
+                  type="int"
+            writeable="true"/>
+    <attribute    name="logDiskSpaceLimit"
+           description="The maximum disk space to allocate for logging; a value (in megabytes) in the range 0..1000000."
+                  type="int"
+             writeable="true"/>
+    <attribute    name="logFile"
+           description="The name and path of this Agent's log file."
+                  type="java.lang.String"
+             writeable="true"/>
+    <attribute    name="logLevel"
+           description="A keyword or integer that defines the minimum level of alerts to be written to the log - for example, only those alerts that are at level WARNING or higher."
+                  type="java.lang.String"
+             writeable="true"/>
+    <attribute    name="autoConnect"
+           description="If true, the JMX Agent will automatically connect to the distributed system when the Agent is started. The distributed system is specified by the following arguments: mcast-port, mcast-address, locators, remote-command. You can specify these arguments on the agent command line or in the Agent properties file."
+                  type="boolean"
+             writeable="true"/>
+    <attribute    name="connected"
+           description="True if this Agent is connected to a distributed system."
+                  type="boolean"
+                    is="true"
+             writeable="false"/>
+    <attribute    name="propertyFile"
+           description="Name and path of this Agent's properties file. Identical to the argument on the agent command line."
+                  type="java.lang.String"
+             writeable="true"/>
+    <attribute    name="version"
+           description="The Agent's version."
+                  type="java.lang.String"
+             writeable="false"/>
+
+    <attribute    name="systemId"
+           description="A string that describes the associated distributed system."
+                  type="java.lang.String"
+             writeable="true"/>
+    <attribute    name="mcastAddress"
+           description="Multicast address of the associated distributed system."
+                  type="java.lang.String"
+             writeable="true"/>
+    <attribute    name="mcastPort"
+           description="Multicast port of the associated distributed system."
+                  type="int"
+             writeable="true"/>
+    <attribute    name="locators"
+           description="List of locators for connecting to the distributed system. Each locator is uniquely identified by the host on which it is running and the port on which it is listening."
+                  type="java.lang.String"
+             writeable="true"/>
+    <attribute    name="membershipPortRange"
+           description="The allowed range of UDP ports for use in forming an unique membership identifier."
+                  type="java.lang.String"                 
+             writeable="true"/>
+    <attribute    name="bindAddress"
+           description="An IP address that the JMX Agent uses to communicate with members of the distributed system. On a multi-homed host - a machine with multiple network cards - you must explicitly specify the bind address."
+                  type="java.lang.String"
+             writeable="true"/>
+             
+    <attribute    name="sslEnabled"
+           description="Indicates whether to use the Secure Sockets Layer (SSL) protocol for communication between members of this distributed system. Valid values are &quot;true&quot; and &quot;false&quot;. A &quot;true&quot; setting requires the use of locators."
+                  type="boolean"
+             getMethod="isSSLEnabled"
+             setMethod="setSSLEnabled"
+             writeable="true"/>
+    <attribute    name="sslProtocols"
+           description="A space-separated list of the valid SSL protocols for this connection. You can specify &quot;any&quot; to use any protocol that is enabled by default in the configured Java Secure Sockets Extension (JSSE) provider."
+                  type="java.lang.String"
+             getMethod="getSSLProtocols"
+             setMethod="setSSLProtocols"
+             writeable="true"/>
+    <attribute    name="sslCiphers"
+           description="A space-separated list of the valid SSL ciphers for this connection. You can specify &quot;any&quot; to use any ciphers that are enabled by default in the configured JSSE provider."
+                  type="java.lang.String"
+             getMethod="getSSLCiphers"
+             setMethod="setSSLCiphers"
+             writeable="true"/>
+    <attribute    name="sslAuthenticationRequired"
+           description="Indicates whether to require SSL authentication for communication between members of the distributed system. Valid values are &quot;true&quot; and &quot;false&quot;."
+                  type="boolean"
+             getMethod="isSSLAuthenticationRequired"
+             setMethod="setSSLAuthenticationRequired"
+             writeable="true"/>
+    <attribute    name="sslProperties"
+           description="The SSL vendor properties to use for the distributed system."
+                  type="java.util.Properties"
+             getMethod="getSSLProperties"
+             writeable="false"/>
+
+    <operation    name="addSSLProperty"
+           description="Add an SSL vendor property with the specified key and value."
+                impact="ACTION"
+            returnType="void">
+      <parameter name="key" 
+          description="Property key"
+                 type="java.lang.String" />
+      <parameter name="value" 
+          description="Property value"
+                 type="java.lang.String" />
+    </operation>
+    <operation    name="removeSSLProperty"
+           description="Remove the specified SSL vendor property."
+                impact="ACTION"
+            returnType="void">
+      <parameter name="key" 
+          description="Property key"
+                 type="java.lang.String" />
+    </operation>
+
+    <operation    name="getLog"
+           description="Display the tail of the Agent's log file."
+                impact="INFO"
+            returnType="java.lang.String"/>
+    <operation    name="stop"
+           description="Stop the Agent after closing all managed resources"
+                impact="ACTION"
+            returnType="void"/>
+    <operation    name="saveProperties"
+           description="Persist the Agent's current configuration to its properties file"
+                impact="ACTION"
+            returnType="void"/>
+    <operation    name="connectToSystem"
+           description="Connect to the distributed system described by this Agent. Returns the ObjectName of the corresponding DistributedSystem MBean."
+                impact="ACTION_INFO"
+            returnType="javax.management.ObjectName"/>
+    <operation    name="disconnectFromSystem"
+           description="Disconnect from the currently connected distributed system."
+                impact="ACTION"
+            returnType="void"/>
+    <operation    name="manageDistributedSystem"
+           description="Return the ObjectName of the currently connected distributed system. If not connected, return null."
+                impact="INFO"
+            returnType="javax.management.ObjectName"/>
+  </mbean>
+
+  <!-- =================================================================== -->
+  <!-- org.apache.geode.internal.admin.api.AdminDistributedSystem          -->
+  <!-- =================================================================== -->
+  <mbean          name="AdminDistributedSystem"
+           description="GemFire distributed system"
+                  type="org.apache.geode.internal.admin.api.AdminDistributedSystem">
+                  
+    <attribute    name="id"
+           description="A string that uniquely identifies this distributed system."
+                  type="java.lang.String"
+             writeable="false"/>
+
+    <attribute    name="systemName"
+           description="Display name of the distributed system"
+                  type="java.lang.String"
+             writeable="true"/>
+
+    <attribute    name="remoteCommand"
+           description="A default remote command prefix to use for command invocation on remote machines."
+                  type="java.lang.String"/>
+
+    <attribute    name="alertLevel"
+           description="Minimum level for alerts to be delivered to listeners. Should be one of: WARNING, ERROR, SEVERE, OFF. It is not case-sensitive."
+                  type="java.lang.String"
+                  getMethod="getAlertLevelAsString"
+                  setMethod="setAlertLevelAsString"
+                  writeable="true"/>
+
+    <attribute    name="mcastAddress"
+           description="Multicast address of this distributed system."
+                  type="java.lang.String"
+             writeable="false"/>
+
+    <attribute    name="mcastPort"
+           description="Multicast port of this distributed system."
+                  type="int"
+             writeable="false"/>
+
+    <attribute    name="locators"
+           description="List of locators for connecting to this distributed system. Each locator is uniquely identified by the host on which it is running and the port on which it is listening."
+                  type="java.lang.String"
+             writeable="false"/>
+             
+    <attribute    name="membershipPortRange"
+           description="The allowed range of UDP ports for use in forming an unique membership identifier."
+                  type="java.lang.String"
+             writeable="false"/>
+    
+    <attribute   name="refreshIntervalForStatAlerts"
+          description="The interval (in seconds) between auto-polling for checking whether the Stat has exceeded a threshold for which the Stat Alert Definition is defined."
+                 type="int"/>
+
+    <attribute   name="refreshInterval"
+          description="The interval (in seconds) between auto-polling for updating AdminDistributedSystem constituents including SystemMember and StatisticResource. This applies only to the default interval set when the resource is created. This interval is read-only and retains the value set when the Agent config is created"
+                 type="int"
+            writeable="false"/>
+            
+    <attribute    name="canPersistStatAlertDefs"
+           description="Indicates whether Statistics Alert definitions could be persisted across runs/sessions of the JMX Agent."
+                  type="boolean"
+             getMethod="canPersistStatAlertDefs"
+             writeable="false"/>
+            
+    <attribute   name="missingPersistentMembers"
+            getMethod="getMissingPersistentMembersJMX"
+          description="Retrieve the set of persistent files that the existing members are waiting for."
+                 type="javax.management.openmbean.TabularData"
+            writeable="false"/>
+
+    <notification name="gemfire.distributedsystem.member.joined"
+           description="A GemFire manager, cache, or other member has joined this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.member.joined"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.member.joined</notification-type>
+    </notification>
+            
+    <notification name="gemfire.distributedsystem.member.left"
+           description="A GemFire manager, cache, or other member has left the distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.member.left"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.member.left</notification-type>
+    </notification>
+
+    <notification name="gemfire.distributedsystem.member.crashed"
+           description="A member of this distributed system has crashed instead of leaving cleanly.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.member.crashed"/>
+        <field    name="severity"       value="4"/><!-- 4: minor, marginal, error -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.member.crashed</notification-type>
+    </notification>
+            
+    <notification name="gemfire.distributedsystem.alert"
+           description="A member of this distributed system has generated an alert.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.alert"/>
+        <field    name="severity"       value="0"/><!-- unknown until runtime -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.alert</notification-type>
+    </notification>
+            
+    <operation   name="waitToBeConnected"
+          description="Wait for the connection to the distributed system to be established"
+               impact="ACTION"
+           returnType="boolean">
+      <parameter name="timeout" 
+          description="Number of milliseconds to wait to be connected"
+                 type="long" />
+    </operation>
+
+    <operation   name="start"
+          description="Start all locators defined for this distributed system."
+               impact="ACTION"
+           returnType="void"/>
+
+    <operation   name="stop"
+          description="Stop all locators defined for this distributed system."
+               impact="ACTION"
+           returnType="void"/>
+
+    <operation   name="manageDistributionLocator"
+          description="Creates a new distribution locator that is ready to configure and start"
+               impact="ACTION_INFO"
+           returnType="javax.management.ObjectName"/>
+
+    <operation   name="manageDistributionLocators"
+          description="Return an array of JMX ObjectNames for all locators known to this distributed system."
+               impact="ACTION_INFO"
+           returnType="[Ljavax.management.ObjectName;"/>
+
+    <operation   name="manageCacheVm"
+          description="Create a new CacheVm MBean (that is, make this distributed system aware of a cache server that has not been started )."
+               impact="ACTION_INFO"
+           returnType="javax.management.ObjectName"/>
+
+    <operation   name="manageCacheVms"
+          description="Return an array of JMX ObjectNames for all cache vms known to this distributed system."
+               impact="ACTION_INFO"
+           returnType="[Ljavax.management.ObjectName;"/>
+
+    <operation   name="manageCacheServer"
+          description="Create a new CacheVm MBean (that is, make this distributed system aware of a cache vm that has not been started ). This action is deprecated as of 5.7 use manageCacheVm instead."
+               impact="ACTION_INFO"
+           returnType="javax.management.ObjectName"/>
+
+    <operation   name="manageCacheServers"
+          description="Return an array of JMX ObjectNames for all cache vms known to this distributed system. This action is deprecated as of 5.7 use manageCacheVm instead."
+               impact="ACTION_INFO"
+           returnType="[Ljavax.management.ObjectName;"/>
+
+    <operation   name="manageSystemMemberApplications"
+          description="Return an array of JMX ObjectNames for all applications that are members of this distributed system."
+               impact="ACTION_INFO"
+           returnType="[Ljavax.management.ObjectName;"/>
+
+    <operation   name="monitorGemFireHealth"
+          description="Return the ObjectName for the GemFireHealth MBean."
+               impact="ACTION_INFO"
+           returnType="javax.management.ObjectName"/>
+
+    <operation   name="displayMergedLogs"
+          description="Combine the tails of all system members' logs into a merged log, with the entries ordered by timestamp."
+               impact="ACTION_INFO"
+           returnType="java.lang.String"/>
+
+    <operation   name="getLicense"
+          description="Display GemFire licensing information."
+               impact="INFO"
+           returnType="java.util.Properties"/>
+
+    <operation   name="getLatestAlert"
+          description="Display the most recent system alert."
+               impact="INFO"
+           returnType="java.lang.String"/>
+           
+    <operation   name="createDistributionLocator"
+          description="Create a DistributionLocator MBean. The parameters specify the locator's host machine, the port on which it listens, the working directory hosting the locator, and product directory used by the locator."
+               impact="ACTION_INFO"
+           returnType="javax.management.ObjectName">
+      <parameter name="host" 
+          description="Host machine for the Locator"
+                 type="java.lang.String" />
+      <parameter name="port" 
+          description="Port for the Locator to listen on"
+                 type="int" />
+      <parameter name="workingDirectory" 
+          description="The working directory hosting the Locator"
+                 type="java.lang.String" />
+      <parameter name="productDirectory" 
+          description="The GemFire product directory used by the Locator"
+                 type="java.lang.String" />
+    </operation>
+    
+    <operation   name="manageSystemMember"
+          description="Return the ObjectName for the SystemMemberMBean representing the specified distributed member or null if the member is not found."
+               impact="ACTION_INFO"
+           returnType="javax.management.ObjectName">
+      <parameter name="distributedMember" 
+          description="The distributed member to manage"
+                 type="org.apache.geode.distributed.DistributedMember" />
+    </operation>
+    
+    <operation   name="getAllStatAlertDefinitions"
+          description="Return an array of all available Stat Alert Definitions objects."
+               impact="INFO"
+           returnType="[Lorg.apache.geode.internal.admin.StatAlertDefinition;">
+    </operation>
+    
+    <operation   name="updateAlertDefinition"
+          description="Update/Add an Admin Stat Alert Definition to the Aggregator. Sends the updated definition to all the Managers/Members."
+               impact="ACTION_INFO"
+           returnType="void">
+      <parameter name="alertDefinition" 
+          description="The Admin Stat Alert Definition to be updated/added to the Aggregator"
+                 type="org.apache.geode.internal.admin.StatAlertDefinition" />
+    </operation>
+    
+    <operation   name="removeAlertDefinition"
+          description="Remove an Admin Stat Alert Definition from the Aggregator and all the Managers/Members."
+               impact="ACTION_INFO"
+           returnType="void">
+      <parameter name="defId" 
+          description="The unique id of the Admin Stat Alert Definition to be removed from the Aggregator"
+                 type="java.lang.Integer" />
+    </operation>
+    
+    <operation   name="isAlertDefinitionCreated"
+          description="Check whether the alert definition is already created."
+               impact="INFO"
+           returnType="boolean">
+      <parameter name="alertDefinition" 
+          description="The Admin Stat Alert Definition to be checked"
+                 type="org.apache.geode.internal.admin.StatAlertDefinition" />
+    </operation>
+    <operation   name="revokePersistentMember"
+          description="Indicate to the distributed system that persistent files have been lost."
+               impact="ACTION_INFO"
+           returnType="void">
+      <parameter name="host" 
+          description="The host of the members to revoke. If null, it will match all hosts"
+                 type="java.lang.String" />
+      <parameter name="directory" 
+          description="The directory on the members to revoke. If null, it will match all directories"
+                 type="java.lang.String" />
+    </operation>
+    <operation   name="shutDownAllMembers"
+          description="Shutting down all members with cache in the distributed system gracefully."
+               impact="ACTION_INFO"
+           returnType="java.util.Set">
+    </operation>
+    <operation   name="shutDownAllMembers"
+          description="Shutting down all members with cache in the distributed system gracefully."
+               impact="ACTION_INFO"
+           returnType="java.util.Set">
+	<parameter name="timeout"
+		description="The amount of time to wait (in milliseconds) for the shutdown all to complete."
+		type="long" />
+    </operation>
+  </mbean>
+
+  <!-- =================================================================== -->
+  <!-- org.apache.geode.internal.admin.api.SystemMember                    -->
+  <!-- =================================================================== -->
+  <mbean         name="SystemMember"
+          description="GemFire system member"
+                 type="org.apache.geode.internal.admin.api.SystemMember">
+
+    <attribute   name="id"
+          description="A string that uniquely identifies the application within the distributed system."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="name"
+          description="The application-defined member name."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="host"
+          description="The host machine on which this application is running."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="refreshInterval"
+          description="The interval (in seconds) between auto-refreshes of this application;s configuration attributes, as defined in the gemfire.properties file. To disable the JMX Timer service's auto-refresh feature, set this attribute to zero or less. Effective 6.0, any changes to this parameter wil not affect the current refreshInterval. To change the refreshInterval use AdminDistributedSystem.refreshInterval"
+                 type="int"/>
+
+    <attribute    name="version"
+           description="Display GemFire version information."
+                  type="java.lang.String"
+             writeable="false"/>
+             
+    <attribute    name="hasCache"
+           description="Does the system member host a GemFire Cache?"
+                  type="boolean"
+                    is="false"
+             getMethod="hasCache"
+             writeable="false"/>
+
+    <attribute    name="distributedMember"
+           description="Distributed membership identity."
+                  type="org.apache.geode.distributed.DistributedMember"
+             writeable="false"/>
+    
+    <notification name="gemfire.distributedsystem.cache.created"
+           description="A cache got created on a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.created"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.created</notification-type>
+    </notification>
+
+    <notification name="gemfire.distributedsystem.cache.closed"
+           description="A cache is closed on a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.closed"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.closed</notification-type>
+    </notification>
+    
+    <notification name="gemfire.distributedsystem.cache.region.created"
+           description="A region is created in a cache on a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.region.created"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.region.created</notification-type>
+    </notification>
+    
+    <notification name="gemfire.distributedsystem.cache.region.lost"
+           description="A region was removed from a cache on a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.region.lost"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.region.lost</notification-type>
+    </notification>
+    
+    <notification name="gemfire.distributedsystem.cache.client.joined"
+           description="A cache client established a connection with a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.client.joined"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.client.joined</notification-type>
+    </notification>
+    
+    <notification name="gemfire.distributedsystem.cache.client.left"
+           description="A cache client gracefully closed a connection with a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.client.left"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.client.left</notification-type>
+    </notification>
+    
+    <notification name="gemfire.distributedsystem.cache.client.crashed"
+           description="A cache client crashed and abruptly lost connection with a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.client.crashed"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.client.crashed</notification-type>
+    </notification>
+             
+    <operation    name="getRoles"
+           description="Get the membership roles filled by this member."
+                impact="INFO"
+            returnType="[Ljava.lang.String;">
+    </operation>
+             
+    <operation   name="getLog"
+          description="Display the main log for this system member."
+               impact="INFO"
+           returnType="java.lang.String">
+    </operation>
+
+    <operation   name="getLicense"
+          description="Display GemFire licensing information."
+               impact="INFO"
+           returnType="java.util.Properties">
+    </operation>
+
+    <operation   name="manageCache"
+          description="Create a SystemMemberCache MBean for this application."
+               impact="ACTION_INFO"
+           returnType="javax.management.ObjectName">
+    </operation>
+    
+    <operation   name="manageStats"
+          description="Create a StatisticResource MBean for each statistic resource in this member."
+               impact="ACTION_INFO"
+           returnType="[Ljavax.management.ObjectName;">
+    </operation>
+
+    <operation   name="manageStat"
+          description="Create a StatisticResource MBean for each statistic resource in this member, given the underlying Statistics Type name."
+               impact="ACTION_INFO"
+           returnType="[Ljavax.management.ObjectName;">
+      <parameter name="statisticsTypeName" 
+          description="Name of the underlying Statistics Type eg. DistributionStats"
+                 type="java.lang.String" />           
+    </operation>
+    
+    <operation   name="refreshConfig"
+          description="Refresh configuration attributes for this application, using the gemfire.properties file."
+               impact="ACTION"
+           returnType="void">
+    </operation>
+    
+    <operation   name="getConfiguration"
+          description="Returns the current configuration attributes for this application, using the gemfire.properties file."
+               impact="ACTION"
+           returnType="[Lorg.apache.geode.internal.admin.api.ConfigurationParameter;">
+    </operation>
+  </mbean>
+
+  <!-- =================================================================== -->
+  <!-- org.apache.geode.internal.admin.api.StatisticResource               -->
+  <!-- =================================================================== -->
+  <mbean         name="StatisticResource"
+          description="GemFire statistic resource"
+                 type="org.apache.geode.internal.admin.api.StatisticResource">
+
+    <attribute   name="name"
+          description="The JMX ObjectName of this statistic resource."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="description"
+          description="Description of this statistic resource."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="type"
+          description="Classification type of this statistic resource."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="owner"
+          description="Name of the source process."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="refreshInterval"
+          description="The interval (in seconds) between auto-refreshes of statistical information. To turn off the JMX Timer service's auto-refresh feature, set this attribute to zero or less. If you're concerned about system performance, leave this set to zero. Effective 6.0, any changes to this parameter wil not affect the current refreshInterval. To change the refreshInterval use AdminDistributedSystem.refreshInterval"
+                 type="int"/>
+
+    <operation   name="refresh"
+          description="Refresh values of statistics."
+               impact="ACTION"
+           returnType="void">
+    </operation>
+    
+    <operation   name="getStatistics"
+          description="Returns a current snapshot of statistics."
+               impact="INFO"
+           returnType="[Lorg.apache.geode.internal.admin.api.Statistic;">
+    </operation>
+    
+  </mbean>
+
+  <!-- =================================================================== -->
+  <!-- org.apache.geode.internal.admin.api.DistributionLocator             -->
+  <!-- =================================================================== -->
+  <mbean         name="DistributionLocator"
+          description="GemFire distribution locator service"
+                 type="org.apache.geode.internal.admin.api.DistributionLocator">
+
+    <attribute   name="id"
+          description="Id of the distribution locator."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="host"
+          description="The host machine on which this locator is running."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="workingDirectory"
+          description="The current working directory of the locator."
+                 type="java.lang.String"
+            writeable="true"/>
+
+    <attribute   name="productDirectory"
+          description="The location of the GemFire installation used to run this locator."
+                 type="java.lang.String"
+            writeable="true"/>
+
+    <attribute   name="port"
+          description="The port on which this locator is listening: a value in the range 0..65535."
+                 type="int"
+            writeable="true"/>
+
+    <attribute    name="bindAddress"
+           description="The interface address to which the locator binds."
+                  type="java.lang.String"
+             writeable="true"/>
+             
+    <attribute   name="running"
+          description="True if this locator is running."
+                 type="boolean"
+            writeable="false"
+                   is="true"/>
+
+    <operation   name="start"
+          description="Start this distribution locator."
+               impact="ACTION"
+           returnType="void"/>
+
+    <operation   name="waitToStart"
+          description="Wait for the distribution locator to start"
+               impact="ACTION"
+           returnType="boolean">
+      <parameter name="timeout" 
+          description="Number of milliseconds to wait to start"
+                 type="long" />
+    </operation>
+
+    <operation   name="waitToStop"
+          description="Wait for the distribution locator to stop"
+               impact="ACTION"
+           returnType="boolean">
+      <parameter name="timeout" 
+          description="Number of milliseconds to wait to stop"
+                 type="long" />
+    </operation>
+
+    <operation   name="stop"
+          description="Stop this distribution locator."
+               impact="ACTION"
+           returnType="void"/>
+
+    <operation    name="getLog"
+           description="Display the tail of the locator service's log."
+                impact="INFO"
+            returnType="java.lang.String"/>
+            
+    <operation   name="remove"
+          description="Remove this distribution locator."
+               impact="ACTION"
+           returnType="void"/>
+           
+  </mbean>
+
+  <!-- =================================================================== -->
+  <!-- org.apache.geode.internal.admin.api.SystemMemberCache               -->
+  <!-- =================================================================== -->
+  <mbean         name="SystemMemberCache"
+          description="GemFire system member cache"
+                 type="org.apache.geode.internal.admin.api.SystemMemberCache">
+                 
+    <attribute   name="name"
+          description="The name of the Cache"
+                 type="java.lang.String"
+            writeable="false"/>
+    <attribute   name="closed"
+          description="True if this cache has been closed."
+                 type="boolean"
+                 is="true"
+            writeable="false"/>
+    <attribute   name="lockTimeout"
+          description="Seconds that a cache operation will wait to obtain a distributed lock lease."
+                 type="int"
+            writeable="true"/>
+    <attribute   name="lockLease"
+          description="The length, in seconds, of distributed lock leases obtained by this cache."
+                 type="int"
+            writeable="true"/>
+    <attribute   name="searchTimeout"
+          description="Seconds that a cache get operation can spend searching for a value before it times out."
+                 type="int"
+            writeable="true"/>
+    <attribute   name="upTime"
+          description="Seconds that this cache has been open."
+                 type="int"
+            writeable="false"/>
+    <attribute   name="rootRegionNames"
+          description="A set of the names of each root region currently in this cache."
+                 type="java.util.Set"
+            writeable="false"/>
+    <attribute   name="server"
+          description="Is this a cache server?"
+                 type="boolean"
+                   is="true"
+            writeable="true"/>
+
+    <operation   name="getSnapshot"
+          description="Get Member Cache Status"
+               impact="INFO"
+           returnType="org.apache.geode.internal.admin.api.GemFireMemberStatus">
+    </operation>
+    <operation   name="getRegionSnapshot"
+          description="Get Member Cache's Region Snapshot"
+               impact="INFO"
+           returnType="org.apache.geode.internal.admin.api.RegionSubRegionSnapshot">
+    </operation>
+    <operation   name="manageRegion"
+          description="Creates a SystemMemberRegion MBean for the region with the specified path."
+               impact="ACTION_INFO"
+           returnType="javax.management.ObjectName">
+      <parameter name="path" 
+          description="Full path of region to create an mbean for."
+                 type="java.lang.String" />
+    </operation>
+    <operation   name="getStatistics"
+          description="Returns a current snapshot of cache statistics."
+               impact="INFO"
+           returnType="[Lorg.apache.geode.internal.admin.api.Statistic;">
+    </operation>
+    <operation   name="refresh"
+          description="Updates each attribute in this MBean."
+               impact="ACTION"
+           returnType="void">
+    </operation>
+    <operation   name="manageBridgeServer"
+          description="Creates a new, unstarted bridge server for the cache. Deprecated as of 5.7 use manageCacheServer instead."
+               impact="ACTION"
+           returnType="javax.management.ObjectName">
+    </operation>
+    <operation   name="manageBridgeServers"
+          description="Returns the names of the MBeans for the cache's bridge servers. Deprecated as of 5.7 use manageCacheServer instead."
+               impact="ACTION"
+           returnType="[Ljavax.management.ObjectName;">
+    </operation>
+    <operation   name="manageCacheServer"
+          description="Creates a new, unstarted cache server for the cache"
+               impact="ACTION"
+           returnType="javax.management.ObjectName">
+    </operation>
+    <operation   name="manageCacheServers"
+          description="Returns the names of the MBeans for the cache's cache servers"
+               impact="ACTION"
+           returnType="[Ljavax.management.ObjectName;">
+    </operation>
+  </mbean>
+
+  <!-- =================================================================== -->
+  <!-- org.apache.geode.internal.admin.api.SystemMemberRegion              -->
+  <!-- =================================================================== -->
+  <mbean         name="SystemMemberRegion"
+          description="View of a GemFire system member cache's region"
+                 type="org.apache.geode.internal.admin.api.SystemMemberRegion">
+                 
+    <attribute   name="name"
+          description="The name (not the full-path) of this region."
+                 type="java.lang.String"
+            writeable="false"/>
+    <attribute   name="fullPath"
+          description="The full path name of this region"
+                 type="java.lang.String"
+            writeable="false"/>
+    <attribute   name="userAttribute"
+          description="Description of the region's user attribute object."
+                 type="java.lang.String"
+            writeable="false"/>
+    <attribute   name="cacheLoader"
+          description="Description of the region's cache loader."
+                 type="java.lang.String"
+            writeable="false"/>
+    <attribute   name="cacheWriter"
+          description="Description of the region's cache writer."
+                 type="java.lang.String"
+            writeable="false"/>
+    <attribute   name="evictionAttributes"
+          description="Description of the region's eviction attributes."
+                 type="org.apache.geode.cache.EvictionAttributes"
+            writeable="false"/>
+    <attribute   name="cacheListener"
+          description="Description of the region's cache listener. This attribute is deprecated as of 6.0. Use getCacheListeners method instead."
+                 type="java.lang.String"
+            writeable="false"/>
+    <attribute   name="keyConstraint"
+          description="Name of the class that keys in this region are constrained to be"
+                 type="java.lang.String"
+            writeable="false"/>
+    <attribute   name="regionTimeToLiveTimeLimit"
+          description="This region's time to live time limit."
+                 type="int"
+            writeable="false"/>
+    <attribute   name="regionTimeToLiveAction"
+          description="This region's time to live action."
+                 type="java.lang.Object"
+            writeable="false"/>
+    <attribute   name="entryTimeToLiveTimeLimit"
+          description="This region's entry time to live time limit."
+                 type="int"
+            writeable="false"/>
+    <attribute   name="entryTimeToLiveAction"
+          description="This region's entry time to live action."
+                 type="java.lang.Object"
+            writeable="false"/>
+    <attribute   name="regionIdleTimeoutTimeLimit"
+          description="This region's idle timeout time limit."
+                 type="int"
+            writeable="false"/>
+    <attribute   name="regionIdleTimeoutAction"
+          description="This region's idle timeout action."
+                 type="java.lang.Object"
+            writeable="false"/>
+    <attribute   name="entryIdleTimeoutTimeLimit"
+          description="This region's entry idle timeout time limit."
+                 type="int"
+            writeable="false"/>
+    <attribute   name="entryIdleTimeoutAction"
+          description="This region's entry idle timeout action."
+                 type="java.lang.Object"
+            writeable="false"/>
+    <attribute   name="mirrorType"
+          description="This region's mirror type."
+                 type="java.lang.Object"
+            writeable="false"/>
+    <attribute   name="dataPolicy"
+          description="This region's data policy."
+                 type="java.lang.Object"
+            writeable="false"/>
+    <attribute   name="scope"
+          description="This region's scope."
+                 type="java.lang.Object"
+            writeable="false"/>
+    <attribute   name="initialCapacity"
+          description="This region's initial capacity."
+                 type="int"
+            writeable="false"/>
+    <attribute   name="loadFactor"
+          description="This region's load factor."
+                 type="float"
+            writeable="false"/>
+    <attribute   name="concurrencyLevel"
+          description="This region's concurrency level."
+                 type="int"
+            writeable="false"/>
+    <attribute   name="statisticsEnabled"
+          description="True if statistics are enabled on this region."
+                 type="boolean"
+            writeable="false"/>
+    <attribute   name="persistBackup"
+          description="true if the contents of the region are persisted to disk"
+                 type="boolean"
+                   is="false"
+            writeable="false"/>
+    <attribute   name="earlyAck"
+          description="false if ack is sent after processing update; true if sent early"
+                 type="boolean"
+                   is="false"
+            writeable="false"/>
+    <attribute   name="diskWriteAttributes"
+          description="Description of how the region's contents is written to disk "
+                 type="org.apache.geode.cache.DiskWriteAttributes"
+            writeable="false"/>
+    <attribute   name="diskDirs"
+          description="Directories to which the region's contents are written"
+                 type="[Ljava.io.File;"
+            writeable="false"/>
+    <attribute   name="entryCount"
+          description="Number of entries in this region."
+                 type="int"
+            writeable="false"/>
+    <attribute   name="subregionCount"
+          description="Number of subregions in this region."
+                 type="int"
+            writeable="false"/>
+    <attribute   name="lastModifiedTime"
+          description="Last time an entry's value in this region or one of its subregions was modified."
+                 type="long"
+            writeable="false"/>
+    <attribute   name="lastAccessedTime"
+          description="Last time an entry in this region or one of its subregions was accessed."
+                 type="long"
+            writeable="false"/>
+    <attribute   name="hitCount"
+          description="Number of times that a get on this region found a local value."
+                 type="long"
+            writeable="false"/>
+    <attribute   name="missCount"
+          description="Number of times that a get on this region did not find a local value."
+                 type="long"
+            writeable="false"/>
+    <attribute   name="hitRatio"
+          description="Ratio of hits to total get calls."
+                 type="float"
+            writeable="false"/>
+    <attribute   name="subregionNames"
+          description="A set of the names of each subregion of this region."
+                 type="java.util.Set"
+            writeable="false"/>
+    <attribute   name="subregionFullPaths"
+          description="A set of the full paths of each subregion of this region."
+                 type="java.util.Set"
+            writeable="false"/>
+    <attribute   name="membershipAttributes"
+          description="Description of the region's membership attributes."
+                 type="org.apache.geode.cache.MembershipAttributes"
+            writeable="false"/>
+    <attribute   name="subscriptionAttributes"
+          description="Description of the region's subscription attributes."
+                 type="org.apache.geode.cache.SubscriptionAttributes"
+            writeable="false"/>
+    <attribute   name="partitionAttributes"
+          description="Description of the region's partition attributes."
+                 type="org.apache.geode.cache.PartitionAttributes"
+            writeable="false"/>        
+    <attribute   name="concurrencyChecksEnabled"
+          description="True if concurrent modifications are handled on this region."
+                 type="boolean"
+            writeable="false"/>
+
+    <operation   name="refresh"
+          description="Updates each attribute in this MBean."
+               impact="ACTION"
+           returnType="void">
+    </operation>
+    <operation   name="getCacheListeners"
+          description="Descriptions of all CacheListeners on this region as a String array. If there are no cacheListeners defined on the region an empty array is returned."
+               impact="INFO"
+           returnType="[Ljava.lang.String;">
+    </operation>
+  </mbean>
+
+  <!-- =================================================================== -->
+  <!-- org.apache.geode.internal.admin.api.SystemMemberCacheServer         -->
+  <!-- =================================================================== -->
+  <mbean         name="SystemMemberCacheServer"
+          description="View of a GemFire system member's cache server"
+                 type="org.apache.geode.internal.admin.api.SystemMemberCacheServer">
+                 
+    <attribute   name="port"
+          description="The port on which this cache server listens for clients."
+                 type="int"
+            writeable="true"/>
+    <attribute   name="bindAddress"
+          description="The address on which this cache server listens for clients."
+                 type="java.lang.String"
+            writeable="true"/>
+    <attribute   name="hostnameForClients"
+          description="The host name or ip address that will be given to clients who discover this cache server"
+                 type="java.lang.String"
+            writeable="true"/>
+    <attribute   name="notifyBySubscription"
+          description="Whether or not this cache server should notify clients based on key subscription."
+                 type="boolean"
+            writeable="true"/>
+    <attribute   name="socketBufferSize"
+          description="The socket buffer size in bytes for connections made by clients to this server."
+                 type="int"
+            writeable="true"/>
+    <attribute   name="maximumTimeBetweenPings"
+          description="The maximum amount of time, in milliseconds, between pinging a client to determine its health."
+                 type="int"
+            writeable="true"/>
+    <attribute   name="maxConnections"
+          description="The maxium number of client connections allowed by this server."
+                 type="int"
+            writeable="true"/>
+    <attribute   name="maxThreads"
+          description="The maxium number of threads allowed in this server to service client requests."
+                 type="int"
+            writeable="true"/>
+    <attribute   name="maximumMessageCount"
+          description="The maximum number of messages that can be enqueued in a client-queue on this server."
+                 type="int"
+            writeable="true"/>
+    <attribute   name="messageTimeToLive"
+          description="The time, in seconds, after which a message in a client-queue on this server will expire."
+                 type="int"
+            writeable="true"/>
+    <attribute   name="groups"
+          description="The list of server groups that this cache server belongs to."
+                 type="[Ljava.lang.String;"
+            writeable="true"/>
+	<attribute   name="loadPollInterval"
+          description="The period, in milliseconds, to test the load for this cache server using the load probe"
+                 type="long"
+            writeable="true"/>
+	<attribute   name="loadProbe"
+          description="The period, in milliseconds, to test the load for this cache server using the load probe"
+                 type="java.lang.String"
+            writeable="false"/>
+	  
+
+    <attribute   name="running"
+          description="True if cache server is running."
+                 type="boolean"
+                   is="true"
+            writeable="false"/>
+
+    <operation   name="start"
+          description="Starts the cache server."
+               impact="ACTION"
+           returnType="void">
+    </operation>
+    <operation   name="stop"
+          description="Stops the cache server."
+               impact="ACTION"
+           returnType="void">
+    </operation>
+    <operation   name="refresh"
+          description="Updates each attribute in this MBean."
+               impact="ACTION"
+           returnType="void">
+    </operation>
+  </mbean>
+
+  <!-- =================================================================== -->
+  <!-- org.apache.geode.internal.admin.api.CacheVm                         -->
+  <!-- =================================================================== -->
+  <mbean         name="CacheVm"
+          description="A dedicated Server VM that contains a GemFire Cache"
+                 type="org.apache.geode.internal.admin.api.CacheVm">
+                 
+    <attribute   name="id"
+          description="A string that uniquely identifies the cache vm."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="name"
+          description="The JMX ObjectName of this managed resource."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="host"
+          description="The host machine on which the cache vm is running."
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <attribute   name="refreshInterval"
+          description="The interval (in seconds) between auto-refreshes of this application;s configuration attributes, as defined in the gemfire.properties file. To disable the JMX Timer service's auto-refresh feature, set this attribute to zero or less."
+                 type="int"/>
+
+    <attribute    name="version"
+           description="Display GemFire version information."
+                  type="java.lang.String"
+             writeable="false"/>
+             
+    <attribute    name="hasCache"
+           description="Does the cache vm host a GemFire Cache?"
+                  type="boolean"
+                    is="false"
+             getMethod="hasCache"
+             writeable="false"/>
+             
+    <attribute    name="distributedMember"
+           description="Distributed membership identity."
+                  type="org.apache.geode.distributed.DistributedMember"
+             writeable="false"/>             
+
+    <attribute   name="productDirectory"
+          description="The location of the GemFire installation used to run this cache vm."
+                 type="java.lang.String"
+            writeable="true"/>
+
+    <attribute   name="workingDirectory"
+          description="The directory in which the cache vm was launched."
+                 type="java.lang.String"
+            writeable="true"/>
+
+    <attribute   name="running"
+          description="True if this cache vm is running."
+                 type="boolean"
+            writeable="false"
+                   is="true"/>
+
+    <attribute   name="cacheXMLFile"
+          description="The declarative caching file user to configure this cache vm."
+                 type="java.lang.String"
+            writeable="true"/>
+
+    <attribute   name="classPath"
+          description="Location(s) of user classes required by cache vm"
+                 type="java.lang.String"
+            writeable="true"/>
+            
+    <notification name="gemfire.distributedsystem.cache.created"
+           description="A cache got created on a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.created"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.created</notification-type>
+    </notification>
+
+    <notification name="gemfire.distributedsystem.cache.closed"
+           description="A cache is closed on a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.closed"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.closed</notification-type>
+    </notification>
+    
+    <notification name="gemfire.distributedsystem.cache.region.created"
+           description="A region is created in a cache on a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.region.created"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.region.created</notification-type>
+    </notification>
+    
+    <notification name="gemfire.distributedsystem.cache.region.lost"
+           description="A region was removed from a cache on a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.region.lost"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.region.lost</notification-type>
+    </notification>
+    
+    <notification name="gemfire.distributedsystem.cache.client.joined"
+           description="A cache client established a connection with a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.client.joined"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.client.joined</notification-type>
+    </notification>
+    
+    <notification name="gemfire.distributedsystem.cache.client.left"
+           description="A cache client gracefully closed a connection with a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.client.left"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.client.left</notification-type>
+    </notification>
+    
+    <notification name="gemfire.distributedsystem.cache.client.crashed"
+           description="A cache client crashed and abruptly lost connection with a member of this distributed system.">
+      <descriptor>
+        <field    name="name"           value="gemfire.distributedsystem.cache.client.crashed"/>
+        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
+        <field    name="descriptorType" value="notification"/>
+      </descriptor>
+      <notification-type>gemfire.distributedsystem.cache.client.crashed</notification-type>
+    </notification>
+ 
+    <operation    name="getRoles"
+           description="Get the membership roles filled by this member."
+                impact="INFO"
+            returnType="[Ljava.lang.String;">
+    </operation>
+
+    <operation   name="start"
+          description="Start this cache vm."
+               impact="ACTION"
+           returnType="void">
+    </operation>
+
+    <operation   name="waitToStart"
+          description="Wait for the cache vm to start"
+               impact="ACTION"
+           returnType="boolean">
+      <parameter name="timeout" 
+          description="Number of milliseconds to wait to start"
+                 type="long" />
+    </operation>
+
+    <operation   name="waitToStop"
+          description="Wait for the cache vm to stop"
+               impact="ACTION"
+           returnType="boolean">
+      <parameter name="timeout" 
+          description="Number of milliseconds to wait to stop"
+                 type="long" />
+    </operation>
+
+    <operation   name="stop"
+          description="Stop this cache vm."
+               impact="ACTION"
+           returnType="void">
+    </operation>
+
+    <operation   name="getLog"
+          description="Display the log for this cache vm."
+               impact="INFO"
+           returnType="java.lang.String">
+    </operation>
+
+    <operation   name="getLicense"
+          description="Display GemFire licensing information."
+               impact="INFO"
+           returnType="java.util.Properties">
+    </operation>
+
+    <operation   name="manageCache"
+          description="Create a SystemMemberCache MBean for the cache in this cache vm."
+               impact="ACTION_INFO"
+           returnType="javax.management.ObjectName">
+    </operation>
+    
+    <operation   name="manageStats"
+          description="Create a StatisticResource MBean for each statistic resource in this member."
+               impact="ACTION_INFO"
+           returnType="[Ljavax.management.ObjectName;">
+    </operation>
+
+    <operation   name="manageStat"
+          description="Create a StatisticResource MBean for each statistic resource in this member, given the underlying Statistics Type name."
+               impact="ACTION_INFO"
+           returnType="[Ljavax.management.ObjectName;">
+      <parameter name="statisticsTypeName" 
+          description="Name of the underlying Statistics Type eg. DistributionStats"
+                 type="java.lang.String" />           
+    </operation>
+
+    <operation   name="refreshConfig"
+          description="Refresh configuration attributes for this application, using the gemfire.properties file."
+               impact="ACTION"
+           returnType="void">
+    </operation>
+    
+    <operation   name="getConfiguration"
+          description="Returns the current configuration attributes for this application, using the gemfire.properties file."
+               impact="ACTION"
+           returnType="[Lorg.apache.geode.internal.admin.api.ConfigurationParameter;">
+    </operation>
+    
+  </mbean>
+
+  <!-- =================================================================== -->
+  <!-- org.apache.geode.internal.admin.api.GemFireHealth                   -->
+  <!-- =================================================================== -->
+  <mbean         name="GemFireHealth"
+          description="Monitors the Health of GemFire"
+                 type="org.apache.geode.internal.admin.api.GemFireHealth">
+
+    <attribute   name="health"
+          description="The overall health of the distributed system: Good, Okay, or Poor."
+                 type="org.apache.geode.internal.admin.api.GemFireHealth$Health"
+            writeable="false"/>
+
+    <attribute   name="healthStatus"
+          description="The current status of the overall health of GemFire"
+                 type="java.lang.String"
+            writeable="false"/>
+
+    <operation   name="resetHealth"
+          description="Resets the overall health of the distributed system to Good (optimal)."
+               impact="ACTION_INFO"
+           returnType="void">
+    </operation>
+
+    <operation   name="getDiagnosis"
+          description="Returns a description of any causes of ill health in the distributed system."
+               impact="ACTION_INFO"
+           returnType="java.lang.String">
+    </operation>
+    
+    <operation   name="manageGemFireHealthConfig"
+          description="Registers a new GemFireHealthConfig MBean and returns its ObjectName"
+               impact="ACTION_INFO"
+           returnType="javax.management.ObjectName">
+      <parameter name="host" 
+          description="The host to monitor the health of"
+                 type="java.lang.String" />
+    </operation>
+
+  </mbean>
+
+  <!-- =================================================================== -->
+  <!-- org.apache.geode.internal.admin.api.DistributedSystemHealthConfig   -->
+  <!-- =================================================================== -->
+  <mbean         name="DistributedSystemHealthConfig"
+          description="Configures how the health of a distributed system is determined"
+                 type="org.apache.geode.internal.admin.api.DistributedSystemHealthConfig">
+
+    <attribute   name="maxDepartedApplications"
+          description="The maximum number of system members that can unexpectedly leave a healthy distributed system."
+                 type="long"
+            writeable="true"/>
+
+    <operation   name="applyChanges"
+          description="Applies these configuration attributes to the GemFire health monitor."
+               impact="ACTION_INFO"
+           returnType="void">
+    </operation>
+
+  </mbean>
+
+  <!-- =================================================================== -->
+  <!-- org.apache.geode.internal.admin.api.GemFireHealthConfig             -->
+  <!-- =================================================================== -->
+  <mbean         name="GemFireHealthConfig"
+          description="Configures how the health of GemFire components is determined"
+                 type="org.apache.geode.internal.admin.api.GemFireHealthConfig">
+
+    <attribute   name="healthEvaluationInterval"
+          description="The number of seconds to wait between two health assessments of this distributed system."
+                 type="int"
+            writeable="true"/>
+
+    <!--  CacheHealthConfig  -->
+
+    <attribute   name="maxNetSearchTime"
+          description="The maximum time (in milliseconds) that a netSearch operation can take before the cache member is considered to be unhealthy."
+                 type="long"
+            writeable="true"/>
+
+    <attribute   name="maxLoadTime"
+          description="The maximum time (in milliseconds) that a cache load operation can take before the cache member is considered to be unhealthy."
+                 type="long"
+            writeable="true"/>
+
+    <attribute   name="minHitRatio"
+          description="The minimum hit ratio in order for a cache member to be considered healthy."
+                 type="double"
+            writeable="true"/>
+
+    <attribute   name="maxEventQueueSize"
+          description="The maximum number of entries in the event delivery queue of a healthy cache member."
+                 type="long"
+            writeable="true"/>
+
+    <!--  MemberHealthConfig  -->
+
+    <attribute   name="maxVMProcessSize"
+          description="The maximum process size (in megabytes) of a healthy member of the distributed system."
+                 type="long"
+            writeable="true"/>
+
+    <attribute   name="maxMessageQueueSize"
+          description="The maximum number of enqueued incoming or outgoing messages that a healthy member of a distributed system can have."
+                 type="long"
+            writeable="true"/>
+
+    <attribute   name="maxReplyTimeouts"
+          description="The maximum number of message replies that can time out in a healthy member."
+                 type="long"
+            writeable="true"/>
+
+    <!--  Operations  -->
+
+    <operation   name="applyChanges"
+          description="Applies this configuration to the GemFire health monitor."
+               impact="ACTION_INFO"
+           returnType="void">
+    </operation>
+
+  </mbean>
+
+</mbeans-descriptors>
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/resources/org/apache/geode/admin/jmx/internal/doc-files/mbeans-descriptors.dtd
----------------------------------------------------------------------
diff --git a/geode-core/src/main/resources/org/apache/geode/admin/jmx/internal/doc-files/mbeans-descriptors.dtd b/geode-core/src/main/resources/org/apache/geode/admin/jmx/internal/doc-files/mbeans-descriptors.dtd
deleted file mode 100644
index 7c41bc2..0000000
--- a/geode-core/src/main/resources/org/apache/geode/admin/jmx/internal/doc-files/mbeans-descriptors.dtd
+++ /dev/null
@@ -1,247 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-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.
--->
-
-<!--
-     DTD for the Model MBeans Configuration File
-
-     To support validation of your configuration file, include the following
-     DOCTYPE element at the beginning (after the "xml" declaration):
-
-     <!DOCTYPE mbeans-descriptors PUBLIC
-      "-//Apache Software Foundation//DTD Model MBeans Configuration File"
-      "http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd">
-
--->
-
-
-<!-- ========== Defined Types ============================================= -->
-
-
-<!-- A "Boolean" is the string representation of a boolean (true or false)
-     variable.
--->
-<!ENTITY % Boolean "(true|false|yes|no)">
-
-
-<!-- A "ClassName" is the fully qualified name of a Java class that is
-     instantiated to provide the functionality of the enclosing element.
--->
-<!ENTITY % ClassName "CDATA">
-
-
-<!-- A "MethodName" is the name of a constructor or method, which must
-     be legal according to the syntax requirements of the Java language.
--->
-<!ENTITY % MethodName "CDATA">
-
-
-<!-- A "VariableName" is the name of a variable or parameter, which must
-     be legal according to the syntax requirements of the Java language.
--->
-<!ENTITY % VariableName "CDATA">
-
-
-<!-- ========== Element Definitions ======================================= -->
-
-
-<!-- The "mbeans-descriptors" element is the root of the configuration file
-     hierarchy, and contains nested elements for all of the other
-     configuration settings.  Remaining element definitions are listed
-     in alphabetical order.
--->
-<!ELEMENT mbeans-descriptors (mbean*)>
-<!ATTLIST mbeans-descriptors id          ID             #IMPLIED>
-
-
-<!-- The "attribute" element describes a JavaBeans property of an MBean.
-     The following attributes are supported:
-
-     description      Human-readable description of this attribute.
-
-     displayName      Display name of this attribute.
-
-     getMethod        Name of the property getter method, if it does
-                      not follow standard JavaBeans naming patterns.
-
-     is               Boolean value indicating whether or not this
-                      attribute is a boolean with an "is" getter method.
-                      By default, this is set to "false".
-
-     name             Name of this JavaBeans property, conforming to
-                      standard naming design patterns.
-
-     readable         Boolean value indicating whether or not this
-                      attribute is readable by management applications.
-                      By default, this is set to "true".
-
-     setMethod        Name of the property setter method, if it does
-                      not follow standard JavaBeans naming patterns.
-
-     type             Fully qualified Java class name of this attribute.
-
-     writeable        Boolean value indicating whether or not this
-                      attribute is writeable by management applications.
-                      By default, this is set to "true".
--->
-<!ELEMENT attribute (descriptor?)>
-<!ATTLIST attribute         id           ID             #IMPLIED>
-<!ATTLIST attribute         description  CDATA          #IMPLIED>
-<!ATTLIST attribute         displayName  CDATA          #IMPLIED>
-<!ATTLIST attribute         getMethod    %MethodName;   #IMPLIED>
-<!ATTLIST attribute         is           %Boolean;      #IMPLIED>
-<!ATTLIST attribute         name         %VariableName; #IMPLIED>
-<!ATTLIST attribute         readable     %Boolean;      #IMPLIED>
-<!ATTLIST attribute         setMethod    %MethodName;   #IMPLIED>
-<!ATTLIST attribute         type         %ClassName;    #IMPLIED>
-<!ATTLIST attribute         writeable    %Boolean;      #IMPLIED>
-
-
-<!-- The "constructor" element describes a public constructor for the
-     underlying actual class.  It may contain nested "parameter" elements
-     for the various arguments to this constructor.  The following attributes
-     are supported:
-
-     displayName      Display name of this constructor.
-
-     name             Name of this constructor (by Java convention, this must
-                      be the same as the base class name).
--->
-<!ELEMENT constructor (descriptor?, parameter*)>
-<!ATTLIST constructor       id           ID             #IMPLIED>
-<!ATTLIST constructor       displayName  CDATA          #IMPLIED>
-<!ATTLIST constructor       name         %VariableName; #IMPLIED>
-
-
-<!-- The "descriptor" element groups a set of descriptor fields whose
-     values will be included in the Descriptor for the corresponding
-     metatdata info classes.
--->
-<!ELEMENT descriptor (field*)>
-<!ATTLIST descriptor        id           ID             #IMPLIED>
-
-
-<!-- The "field" element represents a single name/value pair that will
-     be included in the Descriptor corresponding to our enclosing
-     "descriptor" element.  The following attributes are supported:
-
-     name             Field name of the field to be included
-
-     value            Field value of the field to be included
-                      (will be stored as a String)
--->
-<!ELEMENT field EMPTY>
-<!ATTLIST field             id           ID             #IMPLIED>
-<!ATTLIST field             name         CDATA          #REQUIRED>
-<!ATTLIST field             value        CDATA          #REQUIRED>
-
-
-
-<!-- The "mbean" element describes a particular JMX ModelMBean implementation,
-     including the information necessary to construct the corresponding
-     ModelMBeanInfo structures.  The following attributes are supported:
-
-     className        Fully qualified Java class name of the ModelMBean
-                      implementation class.  If not specified, the standard
-                      implementation provided by JMX will be utilized.
-
-     description      Human-readable description of this managed bean.
-
-     domain           The JMX MBeanServer domain in which the ModelMBean
-                      created by this managed bean should be registered,
-                      when creating its ObjectName.
-
-     group            Optional name of a "grouping classification" that can
-                      be used to select groups of similar MBean implementation
-                      classes.
-
-     name             Unique name of this MBean (normally corresponds to the
-                      base class name of the corresponding server component).
-
-     type             Fully qualified Java class name of the underlying
-                      managed resource implementation class.
--->
-<!ELEMENT mbean (descriptor?, attribute*, constructor*, notification*, operation*)>
-<!ATTLIST mbean             id           ID             #IMPLIED>
-<!ATTLIST mbean             className    %ClassName;    #IMPLIED>
-<!ATTLIST mbean             description  CDATA          #IMPLIED>
-<!ATTLIST mbean             domain       CDATA          #IMPLIED>
-<!ATTLIST mbean             group        CDATA          #IMPLIED>
-<!ATTLIST mbean             name         %MethodName;   #IMPLIED>
-<!ATTLIST mbean             type         %ClassName;    #IMPLIED>
-
-
-<!-- The "notification" element describes the notification types that are
-     generated by a particular managed bean.  The following attributes
-     are supported:
-
-     description      Human-readable description of these notification events.
-
-     name             Name of this set of notification event types.
--->
-<!ELEMENT notification (descriptor?, notification-type*)>
-<!ATTLIST notification      id           ID             #IMPLIED>
-<!ATTLIST notification      description  CDATA          #IMPLIED>
-<!ATTLIST notification      name         %VariableName; #IMPLIED>
-
-
-<!-- The nested content of the "notification-type" element is the event string
-     of an event that can be emitted by this MBean.
--->
-<!ELEMENT notification-type (#PCDATA)>
-<!ATTLIST notification-type id           ID             #IMPLIED>
-
-
-<!-- The "operation" element describes a the signature of a public method
-     that is accessible to management applications.  The following attributes
-     are supported:
-
-     description      Human-readable description of this operation.
-
-     impact           Indication of the impact of this method:
-                      ACTION (write like), ACTION-INFO (write+read like)
-                      INFO (read like), or UNKNOWN.
-
-     name             Name of this public method.
-
-     returnType       Fully qualified Java class name of the return
-                      type of this method.
--->
-<!ELEMENT operation   (descriptor?, parameter*)>
-<!ATTLIST operation         id           ID             #IMPLIED>
-<!ATTLIST operation         description  CDATA          #IMPLIED>
-<!ATTLIST operation         impact       CDATA          #IMPLIED>
-<!ATTLIST operation         name         %VariableName; #IMPLIED>
-<!ATTLIST operation         returnType   %ClassName;    #IMPLIED>
-
-
-<!-- The "parameter" element describes a single argument that will be passed
-     to a constructor or operation.  The following attributes are supported:
-
-     description      Human-readable description of this parameter.
-
-     name             Java language name of this parameter.
-
-     type             Fully qualified Java class name of this parameter.
--->
-<!ELEMENT parameter EMPTY>
-<!ATTLIST parameter         id           ID             #IMPLIED>
-<!ATTLIST parameter         description  CDATA          #IMPLIED>
-<!ATTLIST parameter         name         %VariableName; #IMPLIED>
-<!ATTLIST parameter         type         %ClassName;    #IMPLIED>
-
-


[40/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
deleted file mode 100644
index 4e53b07..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java
+++ /dev/null
@@ -1,1915 +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.admin.jmx.internal;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.apache.geode.distributed.internal.DistributionConfig.*;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.InetAddress;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import org.apache.geode.GemFireIOException;
-import org.apache.geode.admin.DistributedSystemConfig;
-import org.apache.geode.admin.DistributionLocatorConfig;
-import org.apache.geode.admin.internal.DistributedSystemConfigImpl;
-import org.apache.geode.admin.internal.InetAddressUtil;
-import org.apache.geode.admin.jmx.Agent;
-import org.apache.geode.admin.jmx.AgentConfig;
-import org.apache.geode.internal.ClassPathLoader;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.util.IOUtils;
-
-/**
- * Provides the JMX Agent configuration properties.
- * <p>
- * Supports importing of persisted properties from an external configuration file.
- * <p>
- * Select values can also be overridden with command line arguments. See remarks on individual
- * properties for further information.
- * <p>
- * Extends and implements DistributedSystemConfig.
- * 
- * @since GemFire 3.5 (in which it was named AgentConfig)
- */
-public class AgentConfigImpl extends DistributedSystemConfigImpl implements AgentConfig {
-
-  // -------------------------------------------------------------------------
-  // Static class variable(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Command-line arg to enable agent debugging
-   */
-  public static final String AGENT_DEBUG = "agent-debug";
-
-  /**
-   * The name of the "propertyFile" property. May specify as cmd-line arg
-   */
-  public static final String PROPERTY_FILE_NAME = "property-file";
-
-  /**
-   * The name of the "gfAgentPropertyFile" property, can be specified as System Property
-   */
-  public static final String AGENT_PROPSFILE_PROPERTY_NAME = "gfAgentPropertyFile";
-
-  // -------------------------------------------------------------------------
-  // DistributionLocator properties...
-  // -------------------------------------------------------------------------
-
-  /**
-   * The name of the "locator.host-" property
-   */
-  public static final String LOCATOR_HOST_NAME = "locator.host-";
-  /**
-   * The name of the "locator.port-" property
-   */
-  public static final String LOCATOR_PORT_NAME = "locator.port-";
-  /**
-   * The name of the "locator.product-directory-" property
-   */
-  public static final String LOCATOR_PRODUCT_DIRECTORY_NAME = "locator.product-directory-";
-  /**
-   * The name of the "locator.working-directory-" property
-   */
-  public static final String LOCATOR_WORKING_DIRECTORY_NAME = "locator.working-directory-";
-  /**
-   * The name of the "locator.remote-command-" property
-   */
-  public static final String LOCATOR_REMOTE_COMMAND = "locator.remote-command-";
-  /**
-   * The name of the "locator.bind-address-" property
-   */
-  public static final String LOCATOR_BIND_ADDRESS = "locator.bind-address-";
-  /**
-   * the properties used in configuring a locator's distributed system
-   */
-  public static final String LOCATOR_DS_PROPERTIES = "locator.ds-properties";
-
-  /**
-   * The default log file for stand-alone JMX agents
-   */
-  /* package scope */
-  static final String DEFAULT_LOG_FILE = "agent.log";
-
-  /**
-   * The default startup log file to be used by agent launcher
-   */
-  /* package scope */
-  static final String DEFAULT_STARTUP_LOG_FILE = "start_agent.log";
-
-  private static String OBFUSCATED_STRING = "********";
-
-  ////////////////////// Static Methods //////////////////////
-
-  /**
-   * The <code>propertyFile</code> is the name of the property file that will be loaded on startup
-   * of the Agent.
-   * <p>
-   * The file will be searched for, in order, in the following directories:
-   * <ol>
-   * <li>the current directory
-   * <li>the home directory
-   * <li>the class path
-   * </ol>
-   * Only the first file found will be used.
-   * <p>
-   * The default value of propertyFile is <code>"agent.properties"</code>. However if the
-   * "gfAgentPropertyFile" system property is set then its value is the value of propertyFile. If
-   * this value is a relative file system path then the above search is done. If its an absolute
-   * file system path then that file must exist; no search for it is done.
-   */
-  static String retrievePropertyFile() {
-    return System.getProperty(AGENT_PROPSFILE_PROPERTY_NAME, DEFAULT_PROPERTY_FILE);
-  }
-
-  /**
-   * Creates a new <code>Properties</code> object that contains all of the default values.
-   */
-  private static Properties getDefaultProperties() {
-    Properties props = new Properties();
-
-    props.setProperty(AUTO_CONNECT_NAME, String.valueOf(DEFAULT_AUTO_CONNECT));
-
-    props.setProperty(HTTP_ENABLED_NAME, String.valueOf(DEFAULT_HTTP_ENABLED));
-    props.setProperty(HTTP_BIND_ADDRESS_NAME, String.valueOf(DEFAULT_HTTP_BIND_ADDRESS));
-    props.setProperty(HTTP_PORT_NAME, String.valueOf(DEFAULT_HTTP_PORT));
-    props.setProperty(HTTP_AUTHENTICATION_ENABLED_NAME,
-        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_ENABLED));
-    props.setProperty(HTTP_AUTHENTICATION_USER_NAME,
-        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_USER));
-    props.setProperty(HTTP_AUTHENTICATION_PASSWORD_NAME,
-        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_PASSWORD));
-
-    props.setProperty(RMI_ENABLED_NAME, String.valueOf(DEFAULT_RMI_ENABLED));
-    props.setProperty(RMI_REGISTRY_ENABLED_NAME, String.valueOf(DEFAULT_RMI_REGISTRY_ENABLED));
-    props.setProperty(RMI_BIND_ADDRESS_NAME, String.valueOf(DEFAULT_RMI_BIND_ADDRESS));
-    props.setProperty(RMI_PORT_NAME, String.valueOf(DEFAULT_RMI_PORT));
-    props.setProperty(RMI_SERVER_PORT_NAME, String.valueOf(DEFAULT_RMI_SERVER_PORT));
-
-    props.setProperty(SNMP_ENABLED_NAME, String.valueOf(DEFAULT_SNMP_ENABLED));
-    props.setProperty(SNMP_DIRECTORY_NAME, String.valueOf(DEFAULT_SNMP_DIRECTORY));
-
-    props.setProperty(AGENT_SSL_ENABLED_NAME, String.valueOf(DEFAULT_AGENT_SSL_ENABLED));
-    props.setProperty(AGENT_SSL_PROTOCOLS_NAME, String.valueOf(DEFAULT_AGENT_SSL_PROTOCOLS));
-    props.setProperty(AGENT_SSL_CIPHERS_NAME, String.valueOf(DEFAULT_AGENT_SSL_CIPHERS));
-    props.setProperty(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME,
-        String.valueOf(DEFAULT_AGENT_SSL_REQUIRE_AUTHENTICATION));
-    props.setProperty(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME,
-        String.valueOf(DEFAULT_HTTP_SSL_REQUIRE_AUTHENTICATION));
-
-    return props;
-  }
-
-  /**
-   * Returns default values for all valid agent properties as a Properties object.
-   * 
-   * @return default values for all valid agent properties
-   */
-  static Properties getDefaultValuesForAllProperties() {
-    Properties props = new Properties();
-
-    props.setProperty(AUTO_CONNECT_NAME, String.valueOf(DEFAULT_AUTO_CONNECT));
-
-    props.setProperty(HTTP_ENABLED_NAME, String.valueOf(DEFAULT_HTTP_ENABLED));
-
-    props.setProperty(HTTP_BIND_ADDRESS_NAME, String.valueOf(DEFAULT_HTTP_BIND_ADDRESS));
-
-    props.setProperty(HTTP_PORT_NAME, String.valueOf(DEFAULT_HTTP_PORT));
-
-    props.setProperty(HTTP_AUTHENTICATION_ENABLED_NAME,
-        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_ENABLED));
-
-    props.setProperty(HTTP_AUTHENTICATION_USER_NAME,
-        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_USER));
-
-    props.setProperty(HTTP_AUTHENTICATION_PASSWORD_NAME,
-        String.valueOf(DEFAULT_HTTP_AUTHENTICATION_PASSWORD));
-
-    props.setProperty(RMI_ENABLED_NAME, String.valueOf(DEFAULT_RMI_ENABLED));
-
-    props.setProperty(RMI_REGISTRY_ENABLED_NAME, String.valueOf(DEFAULT_RMI_REGISTRY_ENABLED));
-
-    props.setProperty(RMI_BIND_ADDRESS_NAME, String.valueOf(DEFAULT_RMI_BIND_ADDRESS));
-
-    props.setProperty(RMI_PORT_NAME, String.valueOf(DEFAULT_RMI_PORT));
-
-    props.setProperty(RMI_SERVER_PORT_NAME, String.valueOf(DEFAULT_RMI_SERVER_PORT));
-
-    props.setProperty(SNMP_ENABLED_NAME, String.valueOf(DEFAULT_SNMP_ENABLED));
-
-    props.setProperty(SNMP_DIRECTORY_NAME, String.valueOf(DEFAULT_SNMP_DIRECTORY));
-
-    props.setProperty(AGENT_SSL_ENABLED_NAME, String.valueOf(DEFAULT_AGENT_SSL_ENABLED));
-
-    props.setProperty(AGENT_SSL_PROTOCOLS_NAME, String.valueOf(DEFAULT_AGENT_SSL_PROTOCOLS));
-
-    props.setProperty(AGENT_SSL_CIPHERS_NAME, String.valueOf(DEFAULT_AGENT_SSL_CIPHERS));
-
-    props.setProperty(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME,
-        String.valueOf(DEFAULT_AGENT_SSL_REQUIRE_AUTHENTICATION));
-
-    props.setProperty(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME,
-        String.valueOf(DEFAULT_HTTP_SSL_REQUIRE_AUTHENTICATION));
-
-    props.setProperty(SNMP_BIND_ADDRESS_NAME, String.valueOf(DEFAULT_SNMP_BIND_ADDRESS));
-
-    props.setProperty(EMAIL_NOTIFICATIONS_ENABLED_NAME,
-        String.valueOf(DEFAULT_EMAIL_NOTIFICATIONS_ENABLED));
-
-    props.setProperty(EMAIL_NOTIFICATIONS_HOST_NAME, String.valueOf(DEFAULT_EMAIL_HOST));
-
-    props.setProperty(EMAIL_NOTIFICATIONS_FROM_NAME, String.valueOf(DEFAULT_EMAIL_FROM));
-
-    props.setProperty(EMAIL_NOTIFICATIONS_TO_LIST_NAME, String.valueOf(DEFAULT_EMAIL_TO_LIST));
-
-    props.setProperty(STATE_SAVE_FILE_NAME, String.valueOf(DEFAULT_STATE_SAVE_FILE));
-
-    props.setProperty(CLUSTER_SSL_ENABLED, String.valueOf(DEFAULT_SSL_ENABLED));
-
-    props.setProperty(CLUSTER_SSL_PROTOCOLS, String.valueOf(DEFAULT_SSL_PROTOCOLS));
-
-    props.setProperty(CLUSTER_SSL_CIPHERS, String.valueOf(DEFAULT_SSL_CIPHERS));
-
-    props.setProperty(CLUSTER_SSL_REQUIRE_AUTHENTICATION,
-        String.valueOf(DEFAULT_SSL_REQUIRE_AUTHENTICATION));
-
-    props.setProperty(ENTITY_CONFIG_XML_FILE_NAME, String.valueOf(DEFAULT_ENTITY_CONFIG_XML_FILE));
-
-    props.setProperty(MCAST_PORT, String.valueOf(DEFAULT_MCAST_PORT));
-
-    props.setProperty(MCAST_ADDRESS, String.valueOf(DEFAULT_MCAST_ADDRESS));
-
-    props.setProperty(LOCATORS, String.valueOf(DEFAULT_LOCATORS));
-
-    props.setProperty(BIND_ADDRESS, String.valueOf(DEFAULT_BIND_ADDRESS));
-
-    props.setProperty(REMOTE_COMMAND_NAME, String.valueOf(DEFAULT_REMOTE_COMMAND));
-
-    props.setProperty(LOG_FILE_NAME, String.valueOf(DEFAULT_LOG_FILE));
-
-    props.setProperty(LOG_LEVEL_NAME, String.valueOf(DEFAULT_LOG_LEVEL));
-
-    props.setProperty(LOG_DISK_SPACE_LIMIT_NAME, String.valueOf(DEFAULT_LOG_DISK_SPACE_LIMIT));
-
-    props.setProperty(LOG_FILE_SIZE_LIMIT_NAME, String.valueOf(DEFAULT_LOG_FILE_SIZE_LIMIT));
-
-    props.setProperty(REFRESH_INTERVAL_NAME, String.valueOf(DEFAULT_REFRESH_INTERVAL));
-
-    return props;
-
-  }
-
-  // -------------------------------------------------------------------------
-  // Member variable(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Does agent automatically connect to the distributed system?
-   */
-  private boolean autoConnect;
-
-  /**
-   * True if Agent adaptors should use SSL
-   */
-  private boolean agentSSLEnabled;
-
-  /**
-   * The SSL Protocols that the Agent adaptors will use
-   */
-  private String agentSSLProtocols;
-
-  /**
-   * The SSL Ciphers that the Agent adaptors will use
-   */
-  private String agentSSLCiphers;
-
-  /**
-   * True if Agent adaptors require authentication when SSL is enabled
-   */
-  private boolean agentSSLRequireAuth;
-
-  /**
-   * HttpAdaptor won't work with ssl authentication required, so this attribute allows this option
-   * to be turned on for RMI but off for HTTP in the event that both adaptors are being used with
-   * ssl.
-   */
-  private boolean httpSSLRequireAuth;
-
-  /**
-   * True if HttpAdaptor authentication is enabled
-   */
-  private boolean httpAuthEnabled;
-
-  /**
-   * The login user for HttpAdaptor authentication
-   */
-  private String httpAuthUser;
-
-  /**
-   * The login password for HttpAdaptor authentication
-   */
-  private String httpAuthPassword;
-
-  /**
-   * True if the HttpAdaptor is enabled
-   */
-  private boolean httpEnabled;
-
-  /**
-   * The port for the MX4J HttpAdatper
-   */
-  private int httpPort;
-
-  /**
-   * The host for the MX4J HttpAdatper
-   */
-  private String httpBindAddress;
-
-  /**
-   * True if the RMIConnectorServer is enabled
-   */
-  private boolean rmiEnabled;
-
-  /**
-   * True if the Agent is to create its own RMI registry
-   */
-  private boolean rmiRegistryEnabled;
-
-  /**
-   * The host for the MX4J RMIConnectorServer
-   */
-  private String rmiBindAddress;
-
-  /**
-   * The port for the RMI Registry created by the Agent
-   */
-  private int rmiPort;
-
-  /**
-   * The port for the MX4J RMIConnectorServer
-   */
-  private int rmiServerPort;
-
-  /**
-   * True if the SnmpAdaptor is enabled
-   */
-  private boolean snmpEnabled;
-
-  /**
-   * The bind address for sockets used by the SNMP adapter
-   */
-  private String snmpBindAddress;
-
-  /**
-   * Path to the directory containing the SNMP Adaptor and its sub-dirs
-   */
-  private String snmpDirectory;
-
-  /**
-   * Is Email notification enabled
-   */
-  private boolean isEmailNotificationEnabled;
-
-  /**
-   * Email notification from: emailID
-   */
-  private String emailNotificationFrom;
-
-  /**
-   * The host name of the mail server to be used for email communication.
-   */
-  private String emailNotificationHostName;
-
-  /**
-   * Email notification to: emailIDs list
-   */
-  private String emailNotificationToList;
-
-  /**
-   * State Save File Name
-   */
-  private String stateSaveFile;
-
-  /**
-   * Describes the property file used to load configuration from. Null if no file was found.
-   */
-  private URL url;
-
-  /**
-   * Original command line arguments
-   */
-  private String[] originalCmdLineArgs = null;
-
-  /**
-   * The <code>Agent</code> that is configured by this <code>AgentConfigImpl</code>
-   */
-  private Agent agent;
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs new instance of <code>AgentConfigImpl</code> with the default configuration.
-   */
-  public AgentConfigImpl() {
-    this(getDefaultProperties());
-  }
-
-  /**
-   * Constructs new instance of AgentConfig. Supplied command-line arguments are used to create a
-   * set of non-default properties for initializing this AgentConfig.
-   * 
-   * @param args array of non-default configuration arguments
-   */
-  public AgentConfigImpl(String[] args) {
-    this(toProperties(args));
-    this.originalCmdLineArgs = args;
-  }
-
-  /**
-   * Creates a new <code>AgentConfig</code> with the given non-default configuration properties.
-   * 
-   * @param props overriding non-default configuration properties
-   */
-  public AgentConfigImpl(Properties props) {
-    // for admin bug #40434
-    super(filterOutAgentProperties(appendOptionalPropertyFileProperties(props)),
-        true/* ignore gemfire.properties */);
-
-    // first get any property values set in the optional property file
-    this.url = getPropertyFileURL(retrievePropertyFile());
-
-    initialize(appendOptionalPropertyFileProperties(props));
-  }
-
-  /**
-   * Constructs new instance of AgentConfig using the specified property file.
-   * 
-   * @param propFile the file to load configuration properties from
-   */
-  public AgentConfigImpl(File propFile) {
-    // Initialize default values
-    this();
-
-    Properties props = new Properties();
-    if (propFile.exists()) {
-      try {
-        FileInputStream in = new FileInputStream(propFile);
-        props.load(in);
-        in.close();
-      } catch (java.io.IOException e) {
-        throw new GemFireIOException(
-            LocalizedStrings.AgentConfigImpl_FAILED_READING_0.toLocalizedString(propFile), e);
-      }
-    } else {
-      throw new IllegalArgumentException(
-          LocalizedStrings.AgentConfigImpl_SPECIFIED_PROPERTIES_FILE_DOES_NOT_EXIST_0
-              .toLocalizedString(propFile));
-    }
-
-    initialize(props);
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Sets the <code>Agent</code> associated with this <code>AgentConfigImpl</code>.
-   */
-  void setAgent(Agent agent) {
-    this.agent = agent;
-  }
-
-  /**
-   * Checks to see if this config object is "read only". If it is, then an
-   * {@link IllegalStateException} is thrown.
-   * 
-   * @since GemFire 4.0
-   */
-  @Override
-  protected void checkReadOnly() {
-    if (this.agent != null) {
-      throw new IllegalStateException(
-          LocalizedStrings.AgentConfigImpl_AN_AGENTCONFIG_OBJECT_CANNOT_BE_MODIFIED_AFTER_IT_HAS_BEEN_USED_TO_CREATE_AN_AGENT
-              .toLocalizedString());
-    }
-
-    super.checkReadOnly();
-  }
-
-  // -------------------------------------------------------------------------
-  // Methods for handling Properties and the Properties file
-  // -------------------------------------------------------------------------
-
-  /**
-   * Returns a description of the property file used to load this config. If no property file was
-   * used then the description will say so.
-   */
-  public String getPropertyFileDescription() {
-    /*
-     * Checking if the specified or the default properties file exists. If not, just log this as an
-     * information.
-     */
-    if (this.url == null) {
-      return LocalizedStrings.AgentConfigImpl_USING_DEFAULT_CONFIGURATION_BECAUSE_PROPERTY_FILE_WAS_FOUND
-          .toLocalizedString();
-    } else {
-      return LocalizedStrings.AgentConfigImpl_CONFIGURATION_LOADED_FROM_0
-          .toLocalizedString(this.url);
-    }
-  }
-
-  /**
-   * Returns the default property file that will be used when configuration is saved.
-   */
-  public File getPropertyFile() {
-    File f;
-    if (this.url == null) {
-      f = new File(retrievePropertyFile());
-      if (!f.isAbsolute()) {
-        // save to <cwd>/propertyFile
-        f = new File(System.getProperty("user.dir"), retrievePropertyFile());
-      }
-    } else {
-      f = new File(this.url.getFile());
-    }
-    return f;
-  }
-
-  /**
-   * Converts the contents of this config to a property instance and Stringifies it
-   * 
-   * @return contents of this config as String
-   */
-  public String toPropertiesAsString() {
-    Properties p = toProperties(true /* include DS properties */);
-
-    StringWriter sw = new StringWriter();
-    PrintWriter pw = new PrintWriter(sw);
-    pw.println(LocalizedStrings.AgentConfigImpl_AGENT_CONFIGURATION.toLocalizedString());
-    Enumeration e = p.propertyNames();
-    while (e.hasMoreElements()) {
-      String pn = (String) e.nextElement();
-      String pv = p.getProperty(pn);
-      pw.println("  " + pn + " = " + pv);
-    }
-    pw.close();
-
-    return sw.toString();
-  }
-
-  /**
-   * Converts the contents of this config to a property instance.
-   * 
-   * @return contents of this config as java.util.Properties
-   */
-  public Properties toProperties() {
-    return toProperties(false /* include DS properties */);
-  }
-
-  /**
-   * Converts the contents of this config to a property instance.
-   * 
-   * @param includeDSProperties Should distributed system properties be included in the
-   *        <code>Properties</code> object? See bug 32682.
-   *
-   * @return contents of this config as java.util.Properties
-   */
-  public Properties toProperties(boolean includeDSProperties) {
-    Properties props = new Properties();
-
-    props.setProperty(AUTO_CONNECT_NAME, toString(AUTO_CONNECT_NAME, getAutoConnect()));
-
-    props.setProperty(HTTP_ENABLED_NAME, toString(HTTP_ENABLED_NAME, isHttpEnabled()));
-    props.setProperty(HTTP_BIND_ADDRESS_NAME,
-        toString(HTTP_BIND_ADDRESS_NAME, getHttpBindAddress()));
-    props.setProperty(HTTP_PORT_NAME, toString(HTTP_PORT_NAME, getHttpPort()));
-
-    props.setProperty(RMI_ENABLED_NAME, toString(RMI_ENABLED_NAME, isRmiEnabled()));
-    props.setProperty(RMI_REGISTRY_ENABLED_NAME,
-        toString(RMI_REGISTRY_ENABLED_NAME, isRmiRegistryEnabled()));
-    props.setProperty(RMI_BIND_ADDRESS_NAME, toString(RMI_BIND_ADDRESS_NAME, getRmiBindAddress()));
-    props.setProperty(RMI_PORT_NAME, toString(RMI_PORT_NAME, getRmiPort()));
-    props.setProperty(RMI_SERVER_PORT_NAME, toString(RMI_SERVER_PORT_NAME, getRmiServerPort()));
-
-    props.setProperty(SNMP_ENABLED_NAME, toString(SNMP_ENABLED_NAME, isSnmpEnabled()));
-    props.setProperty(SNMP_BIND_ADDRESS_NAME,
-        toString(SNMP_BIND_ADDRESS_NAME, getSnmpBindAddress()));
-    props.setProperty(SNMP_DIRECTORY_NAME, toString(SNMP_DIRECTORY_NAME, getSnmpDirectory()));
-
-    props.setProperty(AGENT_SSL_ENABLED_NAME,
-        toString(AGENT_SSL_ENABLED_NAME, isAgentSSLEnabled()));
-    props.setProperty(AGENT_SSL_PROTOCOLS_NAME,
-        toString(AGENT_SSL_PROTOCOLS_NAME, getAgentSSLProtocols()));
-    props.setProperty(AGENT_SSL_CIPHERS_NAME,
-        toString(AGENT_SSL_CIPHERS_NAME, getAgentSSLCiphers()));
-    props.setProperty(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME,
-        toString(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME, isAgentSSLRequireAuth()));
-    props.setProperty(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME,
-        toString(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME, isHttpSSLRequireAuth()));
-
-    props.setProperty(HTTP_AUTHENTICATION_ENABLED_NAME,
-        toString(HTTP_AUTHENTICATION_ENABLED_NAME, isHttpAuthEnabled()));
-    props.setProperty(HTTP_AUTHENTICATION_USER_NAME,
-        toString(HTTP_AUTHENTICATION_USER_NAME, getHttpAuthUser()));
-    props.setProperty(HTTP_AUTHENTICATION_PASSWORD_NAME,
-        toString(HTTP_AUTHENTICATION_PASSWORD_NAME, getHttpAuthPassword()));
-
-    props.setProperty(EMAIL_NOTIFICATIONS_ENABLED_NAME,
-        toString(EMAIL_NOTIFICATIONS_ENABLED_NAME, isEmailNotificationEnabled()));
-    props.setProperty(EMAIL_NOTIFICATIONS_HOST_NAME,
-        toString(EMAIL_NOTIFICATIONS_HOST_NAME, getEmailNotificationHost()));
-    props.setProperty(EMAIL_NOTIFICATIONS_FROM_NAME,
-        toString(EMAIL_NOTIFICATIONS_FROM_NAME, getEmailNotificationFrom()));
-    props.setProperty(EMAIL_NOTIFICATIONS_TO_LIST_NAME,
-        toString(EMAIL_NOTIFICATIONS_TO_LIST_NAME, getEmailNotificationToList()));
-
-    props.setProperty(STATE_SAVE_FILE_NAME, toString(STATE_SAVE_FILE_NAME, getStateSaveFile()));
-
-    props.setProperty(EMAIL_NOTIFICATIONS_ENABLED_NAME,
-        toString(EMAIL_NOTIFICATIONS_ENABLED_NAME, isEmailNotificationEnabled()));
-    props.setProperty(EMAIL_NOTIFICATIONS_HOST_NAME,
-        toString(EMAIL_NOTIFICATIONS_HOST_NAME, getEmailNotificationHost()));
-    props.setProperty(EMAIL_NOTIFICATIONS_FROM_NAME,
-        toString(EMAIL_NOTIFICATIONS_FROM_NAME, getEmailNotificationFrom()));
-    props.setProperty(EMAIL_NOTIFICATIONS_TO_LIST_NAME,
-        toString(EMAIL_NOTIFICATIONS_TO_LIST_NAME, getEmailNotificationToList()));
-
-    props.setProperty(CLUSTER_SSL_ENABLED, toString(CLUSTER_SSL_ENABLED, isSSLEnabled()));
-    props.setProperty(CLUSTER_SSL_PROTOCOLS, toString(CLUSTER_SSL_PROTOCOLS, getSSLProtocols()));
-    props.setProperty(CLUSTER_SSL_CIPHERS, toString(CLUSTER_SSL_CIPHERS, getSSLCiphers()));
-    props.setProperty(CLUSTER_SSL_REQUIRE_AUTHENTICATION,
-        toString(CLUSTER_SSL_REQUIRE_AUTHENTICATION, isSSLAuthenticationRequired()));
-
-    Properties sslProps = getSSLProperties();
-    if (sslProps.size() > 0) {
-      int sequence = 0;
-      for (Iterator iter = sslProps.keySet().iterator(); iter.hasNext();) {
-        String key = (String) iter.next();
-        String value = sslProps.getProperty(key);
-        props.setProperty("ssl-property-" + sequence, key + "=" + OBFUSCATED_STRING);
-        sequence++;
-      }
-    }
-
-    if (this.getDistributionLocatorConfigs().length > 0) {
-      DistributionLocatorConfig[] configs = this.getDistributionLocatorConfigs();
-      for (int i = 0; i < configs.length; i++) {
-        DistributionLocatorConfig locator = configs[i];
-        props.setProperty(LOCATOR_HOST_NAME + i, toString(LOCATOR_HOST_NAME, locator.getHost()));
-        props.setProperty(LOCATOR_PORT_NAME + i, toString(LOCATOR_PORT_NAME, locator.getPort()));
-        props.setProperty(LOCATOR_PRODUCT_DIRECTORY_NAME + i,
-            toString(LOCATOR_PRODUCT_DIRECTORY_NAME, locator.getProductDirectory()));
-        props.setProperty(LOCATOR_WORKING_DIRECTORY_NAME + i,
-            toString(LOCATOR_WORKING_DIRECTORY_NAME, locator.getWorkingDirectory()));
-        props.setProperty(LOCATOR_REMOTE_COMMAND + i,
-            toString(LOCATOR_REMOTE_COMMAND, locator.getRemoteCommand()));
-        props.setProperty(LOCATOR_BIND_ADDRESS + i,
-            toString(LOCATOR_BIND_ADDRESS, locator.getBindAddress()));
-        // props.setProperty(LOCATOR_DS_PROPERTIES + i,
-        // getdsPropertiesString(locator));
-      }
-    }
-
-    if (includeDSProperties) {
-      props.setProperty(ENTITY_CONFIG_XML_FILE_NAME,
-          toString(ENTITY_CONFIG_XML_FILE_NAME, getEntityConfigXMLFile()));
-      // This could be different each time agent is started
-      // props.setProperty(SYSTEM_ID_NAME, toString(getSystemId()));
-      props.setProperty(MCAST_PORT, toString(MCAST_PORT, getMcastPort()));
-      props.setProperty(MCAST_ADDRESS, toString(MCAST_ADDRESS, getMcastAddress()));
-      props.setProperty(LOCATORS, toString(LOCATORS, getLocators()));
-      props.setProperty(MEMBERSHIP_PORT_RANGE_NAME, getMembershipPortRange());
-      props.setProperty(TCP_PORT, "" + getTcpPort());
-      props.setProperty(BIND_ADDRESS, toString(BIND_ADDRESS, getBindAddress()));
-      props.setProperty(REMOTE_COMMAND_NAME, toString(REMOTE_COMMAND_NAME, getRemoteCommand()));
-      props.setProperty(LOG_FILE_NAME, toString(LOG_FILE_NAME, getLogFile()));
-      props.setProperty(LOG_LEVEL_NAME, toString(LOG_LEVEL_NAME, getLogLevel()));
-      props.setProperty(LOG_DISK_SPACE_LIMIT_NAME,
-          toString(LOG_DISK_SPACE_LIMIT_NAME, getLogDiskSpaceLimit()));
-      props.setProperty(LOG_FILE_SIZE_LIMIT_NAME,
-          toString(LOG_FILE_SIZE_LIMIT_NAME, getLogFileSizeLimit()));
-      props.setProperty(REFRESH_INTERVAL_NAME,
-          toString(REFRESH_INTERVAL_NAME, getRefreshInterval()));
-    }
-
-    return props;
-  }
-
-
-  // -------------------------------------------------------------------------
-  // Agent specific properties
-  // -------------------------------------------------------------------------
-
-  public boolean isAgentSSLEnabled() {
-    return this.agentSSLEnabled;
-  }
-
-  public void setAgentSSLEnabled(boolean agentSSLEnabled) {
-    checkReadOnly();
-    this.agentSSLEnabled = agentSSLEnabled;
-    configChanged();
-  }
-
-  public String getAgentSSLProtocols() {
-    return this.agentSSLProtocols;
-  }
-
-  public void setAgentSSLProtocols(String agentSSLProtocols) {
-    checkReadOnly();
-    this.agentSSLProtocols = agentSSLProtocols;
-    configChanged();
-  }
-
-  public String getAgentSSLCiphers() {
-    return this.agentSSLCiphers;
-  }
-
-  public void setAgentSSLCiphers(String agentSSLCiphers) {
-    checkReadOnly();
-    this.agentSSLCiphers = agentSSLCiphers;
-    configChanged();
-  }
-
-  public boolean isAgentSSLRequireAuth() {
-    return this.agentSSLRequireAuth;
-  }
-
-  public void setAgentSSLRequireAuth(boolean agentSSLRequireAuth) {
-    checkReadOnly();
-    this.agentSSLRequireAuth = agentSSLRequireAuth;
-    configChanged();
-  }
-
-  public boolean isHttpSSLRequireAuth() {
-    return this.httpSSLRequireAuth;
-  }
-
-  public void setHttpSSLRequireAuth(boolean httpSSLRequireAuth) {
-    checkReadOnly();
-    this.httpSSLRequireAuth = httpSSLRequireAuth;
-    configChanged();
-  }
-
-  public boolean isHttpAuthEnabled() {
-    return this.httpAuthEnabled;
-  }
-
-  public void setHttpAuthEnabled(boolean httpAuthEnabled) {
-    checkReadOnly();
-    this.httpAuthEnabled = httpAuthEnabled;
-    configChanged();
-  }
-
-  public String getHttpAuthUser() {
-    return this.httpAuthUser;
-  }
-
-  public void setHttpAuthUser(String httpAuthUser) {
-    checkReadOnly();
-    this.httpAuthUser = httpAuthUser;
-    configChanged();
-  }
-
-  public String getHttpAuthPassword() {
-    return this.httpAuthPassword;
-  }
-
-  public void setHttpAuthPassword(String httpAuthPassword) {
-    checkReadOnly();
-    this.httpAuthPassword = httpAuthPassword;
-    configChanged();
-  }
-
-  public boolean isSnmpEnabled() {
-    return this.snmpEnabled;
-  }
-
-  public void setSnmpEnabled(boolean snmpEnabled) {
-    checkReadOnly();
-    this.snmpEnabled = snmpEnabled;
-    configChanged();
-  }
-
-  public String getSnmpBindAddress() {
-    return this.snmpBindAddress;
-  }
-
-  public void setSnmpBindAddress(String snmpBindAddress) {
-    checkReadOnly();
-    this.snmpBindAddress = validateSnmpBindAddress(snmpBindAddress);
-    configChanged();
-  }
-
-  public String getSnmpDirectory() {
-    return this.snmpDirectory;
-  }
-
-  public void setSnmpDirectory(String snmpDirectory) {
-    checkReadOnly();
-    this.snmpDirectory = validateSnmpDirectory(snmpDirectory);
-    configChanged();
-  }
-
-  public boolean isRmiEnabled() {
-    return this.rmiEnabled;
-  }
-
-  public void setRmiEnabled(boolean rmiEnabled) {
-    checkReadOnly();
-    this.rmiEnabled = rmiEnabled;
-    configChanged();
-  }
-
-  public boolean isRmiRegistryEnabled() {
-    return this.rmiRegistryEnabled;
-  }
-
-  public void setRmiRegistryEnabled(boolean rmiRegistryEnabled) {
-    checkReadOnly();
-    this.rmiRegistryEnabled = rmiRegistryEnabled;
-    configChanged();
-  }
-
-  public String getRmiBindAddress() {
-    return this.rmiBindAddress;
-  }
-
-  public void setRmiBindAddress(String rmiBindAddress) {
-    checkReadOnly();
-    this.rmiBindAddress = validateRmiBindAddress(rmiBindAddress);
-    configChanged();
-  }
-
-  public int getRmiPort() {
-    return this.rmiPort;
-  }
-
-  public void setRmiPort(int rmiPort) {
-    checkReadOnly();
-    this.rmiPort = validateRmiPort(rmiPort);
-    configChanged();
-  }
-
-  /**
-   * Returns the port of the RMI Connector Server.
-   * <p>
-   * See <a href="#rmi-server-port">description</a> above.
-   * 
-   * @return the value set for rmi-server-port
-   *
-   * @since GemFire 6.5
-   */
-  public int getRmiServerPort() {
-    return this.rmiServerPort;
-  }
-
-  /**
-   * Sets the port of the RMI Connector Server.
-   * 
-   * @param port rmi-server-port to set.
-   *
-   * @since GemFire 6.5
-   */
-  public void setRmiServerPort(int port) {
-    checkReadOnly();
-    this.rmiServerPort = validateRmiServerPort(rmiServerPort);
-    configChanged();
-  }
-
-  public boolean isHttpEnabled() {
-    return this.httpEnabled;
-  }
-
-  public void setHttpEnabled(boolean httpEnabled) {
-    checkReadOnly();
-    this.httpEnabled = httpEnabled;
-    configChanged();
-  }
-
-  public int getHttpPort() {
-    return this.httpPort;
-  }
-
-  public void setHttpPort(int httpPort) {
-    checkReadOnly();
-    this.httpPort = validateHttpPort(httpPort);
-    configChanged();
-  }
-
-  public String getHttpBindAddress() {
-    return this.httpBindAddress;
-  }
-
-  public void setHttpBindAddress(String httpBindAddress) {
-    checkReadOnly();
-    this.httpBindAddress = validateHttpBindAddress(httpBindAddress);
-    configChanged();
-  }
-
-  public void setHttpBindAddress(InetAddress httpBindAddress) {
-    checkReadOnly();
-    this.httpBindAddress = validateHttpBindAddress(httpBindAddress);
-    configChanged();
-  }
-
-  public boolean getAutoConnect() {
-    return this.autoConnect;
-  }
-
-  public void setAutoConnect(boolean v) {
-    checkReadOnly();
-    this.autoConnect = v;
-    configChanged();
-  }
-
-  // -------------------------------------------------------------------------
-  // Implementation methods
-  // -------------------------------------------------------------------------
-
-  /**
-   * Initialize the values of this AgentConfig.
-   * 
-   * @param props the configuration values to use
-   */
-  private void initialize(Properties props) {
-    this.autoConnect = validateBoolean(props.getProperty(AUTO_CONNECT_NAME), DEFAULT_AUTO_CONNECT);
-
-    this.httpEnabled = validateBoolean(props.getProperty(HTTP_ENABLED_NAME), DEFAULT_HTTP_ENABLED);
-    this.httpBindAddress = validateHttpBindAddress(props.getProperty(HTTP_BIND_ADDRESS_NAME));
-    this.httpPort = validateHttpPort(props.getProperty(HTTP_PORT_NAME));
-
-    this.rmiEnabled = validateBoolean(props.getProperty(RMI_ENABLED_NAME), DEFAULT_RMI_ENABLED);
-    this.rmiRegistryEnabled =
-        validateBoolean(props.getProperty(RMI_REGISTRY_ENABLED_NAME), DEFAULT_RMI_REGISTRY_ENABLED);
-
-    this.rmiBindAddress = validateRmiBindAddress(props.getProperty(RMI_BIND_ADDRESS_NAME));
-    this.rmiPort = validateRmiPort(props.getProperty(RMI_PORT_NAME));
-    this.rmiServerPort = validateRmiServerPort(props.getProperty(RMI_SERVER_PORT_NAME));
-
-    this.snmpEnabled = validateBoolean(props.getProperty(SNMP_ENABLED_NAME), DEFAULT_SNMP_ENABLED);
-    this.snmpDirectory = validateSnmpDirectory(props.getProperty(SNMP_DIRECTORY_NAME));
-
-    this.agentSSLEnabled =
-        validateBoolean(props.getProperty(AGENT_SSL_ENABLED_NAME), DEFAULT_AGENT_SSL_ENABLED);
-    this.agentSSLProtocols = validateNonEmptyString(props.getProperty(AGENT_SSL_PROTOCOLS_NAME),
-        DEFAULT_AGENT_SSL_PROTOCOLS);
-    this.agentSSLCiphers = validateNonEmptyString(props.getProperty(AGENT_SSL_CIPHERS_NAME),
-        DEFAULT_AGENT_SSL_CIPHERS);
-    this.agentSSLRequireAuth =
-        validateBoolean(props.getProperty(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME),
-            DEFAULT_AGENT_SSL_REQUIRE_AUTHENTICATION);
-    this.httpSSLRequireAuth =
-        validateBoolean(props.getProperty(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME),
-            DEFAULT_HTTP_SSL_REQUIRE_AUTHENTICATION);
-
-    this.httpAuthEnabled = validateBoolean(props.getProperty(HTTP_AUTHENTICATION_ENABLED_NAME),
-        DEFAULT_HTTP_AUTHENTICATION_ENABLED);
-    this.httpAuthUser = validateNonEmptyString(props.getProperty(HTTP_AUTHENTICATION_USER_NAME),
-        DEFAULT_HTTP_AUTHENTICATION_USER);
-    this.httpAuthPassword = validateNonEmptyString(
-        props.getProperty(HTTP_AUTHENTICATION_PASSWORD_NAME), DEFAULT_HTTP_AUTHENTICATION_PASSWORD);
-
-    this.sslEnabled = validateBoolean(props.getProperty(CLUSTER_SSL_ENABLED), DEFAULT_SSL_ENABLED);
-    this.sslProtocols =
-        validateNonEmptyString(props.getProperty(CLUSTER_SSL_PROTOCOLS), DEFAULT_SSL_PROTOCOLS);
-    this.sslCiphers =
-        validateNonEmptyString(props.getProperty(CLUSTER_SSL_CIPHERS), DEFAULT_SSL_CIPHERS);
-    this.sslAuthenticationRequired = validateBoolean(
-        props.getProperty(CLUSTER_SSL_REQUIRE_AUTHENTICATION), DEFAULT_SSL_REQUIRE_AUTHENTICATION);
-    this.sslProperties = new Properties();
-    for (int i = 0; true; i++) {
-      String key = "ssl-property-" + i;
-      String value = props.getProperty(key);
-      if (value == null) {
-        break;
-      }
-      StringTokenizer st = new StringTokenizer(value, "=");
-      if (!st.hasMoreTokens()) {
-        break;
-      }
-      String propKey = st.nextToken();
-      if (!st.hasMoreTokens()) {
-        break;
-      }
-      String propValue = st.nextToken();
-      this.sslProperties.put(propKey, propValue);
-    }
-
-    this.isEmailNotificationEnabled =
-        validateBoolean(props.getProperty(AgentConfig.EMAIL_NOTIFICATIONS_ENABLED_NAME),
-            DEFAULT_EMAIL_NOTIFICATIONS_ENABLED);
-    this.emailNotificationHostName = validateNonEmptyString(
-        props.getProperty(AgentConfig.EMAIL_NOTIFICATIONS_HOST_NAME), DEFAULT_EMAIL_HOST);
-    this.emailNotificationFrom = validateNonEmptyString(
-        props.getProperty(AgentConfig.EMAIL_NOTIFICATIONS_FROM_NAME), DEFAULT_EMAIL_FROM);
-    this.emailNotificationToList = validateNonEmptyString(
-        props.getProperty(AgentConfig.EMAIL_NOTIFICATIONS_TO_LIST_NAME), DEFAULT_EMAIL_TO_LIST);
-
-    this.stateSaveFile = validateNonEmptyString(props.getProperty(AgentConfig.STATE_SAVE_FILE_NAME),
-        DEFAULT_STATE_SAVE_FILE);
-
-    try {
-      for (int i = 0; true; i++) {
-        String hostProp = props.getProperty(LOCATOR_HOST_NAME + i);
-        if (isEmpty(hostProp)) {
-          break;
-        }
-        String host = hostProp;
-        int port = Integer.parseInt(props.getProperty(LOCATOR_PORT_NAME + i));
-        File workDir =
-            validateWorkingDirectory(props.getProperty(LOCATOR_WORKING_DIRECTORY_NAME + i));
-        File prodDir = new File(
-            validateProductDirectory(props.getProperty(LOCATOR_PRODUCT_DIRECTORY_NAME + i)));
-        String remoteCmd = props.getProperty(LOCATOR_REMOTE_COMMAND + i);
-        String bindAddr = props.getProperty(LOCATOR_BIND_ADDRESS + i);
-
-        DistributionLocatorConfig config = this.createDistributionLocatorConfig();
-        config.setHost(host);
-        config.setPort(port);
-        config.setBindAddress(bindAddr);
-        config.setWorkingDirectory(workDir.getAbsolutePath());
-        config.setProductDirectory(prodDir.getAbsolutePath());
-        config.setRemoteCommand(remoteCmd);
-      }
-    } catch (IllegalArgumentException e) {
-      // This is how we break out of the loop? Yuck!
-      /*
-       * LogWriter is initialized afterwards. Hence printing the stack trace. This is done to avoid
-       * creation of duplicate log writer.
-       */
-      e.printStackTrace();
-    }
-  }
-
-  /**
-   * Filter all agent configuration attributes out of the given <code>Properties</code> object.
-   * <p/>
-   * 
-   * @param props the <code>Properties</code> object of filter agent configuration attributes out
-   *        of.
-   *
-   * @see AgentConfigImpl#_getPropertyDescription(String)
-   */
-  private static Properties filterOutAgentProperties(final Properties props) {
-    final Properties filteredProps = new Properties();
-
-    for (final Object key : props.keySet()) {
-      if (_getPropertyDescription(key.toString()) == null) {
-        final String value = props.getProperty(key.toString());
-        if (value != null) {
-          filteredProps.setProperty(key.toString(), value);
-        }
-      }
-    }
-
-    appendLogFileProperty(filteredProps);
-
-    return filteredProps;
-  }
-
-  /**
-   * Appends the log-file property to the Properties object if set of properties does not already
-   * define the log-file property or the gemfire.agent.log-file property.
-   * <p/>
-   * 
-   * @param props the <code>Properties</code> to append the log-file property to if the property
-   *        does not exist.
-   */
-  private static void appendLogFileProperty(final Properties props) {
-    if (!(props.containsKey(DistributedSystemConfig.LOG_FILE_NAME)
-        || props.containsKey(SYSTEM_PROPERTY_PREFIX + DistributedSystemConfig.LOG_FILE_NAME))) {
-      props.put(DistributedSystemConfig.LOG_FILE_NAME, DEFAULT_LOG_FILE);
-    }
-  }
-
-  /**
-   * Appends any additional property-file specified properties to the supplied Properties. If the
-   * supplied property overrides the property in the property-file, then property-file value is
-   * ignored. System Properties always override the supplied properties
-   * 
-   * @return appendedProps Properties appened to from the property-file if any
-   */
-  private static Properties appendOptionalPropertyFileProperties(final Properties props) {
-    final URL url = getPropertyFileURL(retrievePropertyFile());
-    final Properties appendedProps = new Properties();
-
-    appendedProps.putAll(props);
-
-    // first, get any property values set in the optional property file
-    if (url != null) {
-      InputStream in = null;
-
-      try {
-        in = url.openStream();
-
-        final Properties agentPropertyFileProperties = new Properties();
-
-        agentPropertyFileProperties.load(in);
-
-        // don't let any properties from the file override those on the command-line
-        for (final Object key : agentPropertyFileProperties.keySet()) {
-          if (props.getProperty(key.toString()) == null) {
-            appendedProps.setProperty(key.toString(),
-                agentPropertyFileProperties.getProperty(key.toString()));
-          }
-        }
-      } catch (IOException e) {
-        throw new GemFireIOException(
-            LocalizedStrings.AgentConfigImpl_FAILED_READING_0.toLocalizedString(url.toString()), e);
-      } finally {
-        IOUtils.close(in);
-      }
-    }
-
-    // last override values with those from the system properties
-    // TODO this is not exactly overriding!
-    for (final Object propSuffix : props.keySet()) {
-      final String key = SYSTEM_PROPERTY_PREFIX + propSuffix;
-      final String value = System.getProperty(key);
-
-      if (value != null) {
-        appendedProps.put(key, value);
-      }
-    }
-
-    return appendedProps;
-  }
-
-  /**
-   * Returns a description of the given agent config property
-   * 
-   * @throws IllegalArgumentException If <code>prop</code> is not a recognized agent configuration
-   *         property
-   */
-  public static String getPropertyDescription(String prop) {
-    if (prop.equals(LOG_FILE_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_NAME_OF_THE_AGENTS_LOG_FILE.toLocalizedString();
-    } else if (prop.equals(LOG_LEVEL_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_MINIMUM_LEVEL_OF_LOGGING_PERFORMED_BY_AGENT
-          .toLocalizedString();
-    } else if (prop.equals(AGENT_DEBUG)) {
-      return LocalizedStrings.AgentConfigImpl_WHETHER_THE_AGENT_SHOULD_PRINT_DEBUGGING_INFORMATION
-          .toLocalizedString();
-    } else if (prop.equals(LOG_DISK_SPACE_LIMIT_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_LIMIT_IN_MEGABYTES_OF_HOW_MUCH_DISK_SPACE_CAN_BE_CONSUMED_BY_OLD_INACTIVE_LOG_FILES
-          .toLocalizedString();
-    } else if (prop.equals(LOG_FILE_SIZE_LIMIT_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_LIMIT_IN_MEGABYTES_OF_HOW_LARGE_THE_CURRENT_STATISTIC_ARCHIVE_FILE_CAN_GROW_BEFORE_IT_IS_CLOSED_AND_ARCHIVAL_ROLLS_ON_TO_A_NEW_FILE
-          .toLocalizedString();
-    } else if (prop.equals(MCAST_PORT)) {
-      return LocalizedStrings.AgentConfigImpl_MULTICAST_PORT_USED_TO_CONNECT_TO_DISTRIBUTED_SYSTEM
-          .toLocalizedString();
-    } else if (prop.equals(MCAST_ADDRESS)) {
-      return LocalizedStrings.AgentConfigImpl_MULTICAST_ADDRESS_USED_TO_CONNECT_TO_DISTRIBUTED_SYSTEM
-          .toLocalizedString();
-    } else if (prop.equals(BIND_ADDRESS)) {
-      return LocalizedStrings.AgentConfigImpl_IP_ADDRESS_OF_THE_AGENTS_DISTRIBUTED_SYSTEM
-          .toLocalizedString();
-    } else if (prop.equals(TCP_PORT)) {
-      return LocalizedStrings.AgentConfigImpl_TCP_PORT.toLocalizedString();
-    } else if (prop.equals(LOCATORS)) {
-      return LocalizedStrings.AgentConfigImpl_ADDRESSES_OF_THE_LOCATORS_OF_THE_DISTRIBUTED_SYSTEM
-          .toLocalizedString();
-    } else if (prop.equals(MEMBERSHIP_PORT_RANGE_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_ALLOWED_RANGE_OF_UDP_PORTS_TO_FORM_UNIQUE_MEMBERSHIP_ID
-          .toLocalizedString();
-      // } else if (prop.equals(SYSTEM_ID_NAME)) {
-      // return "The id of the distributed system";
-    } else if (prop.equals(ENTITY_CONFIG_XML_FILE_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_XML_CONFIGURATION_FILE_FOR_MANAGED_ENTITIES
-          .toLocalizedString();
-    } else if (prop.equals(REFRESH_INTERVAL_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_REFRESH_INTERVAL_IN_SECONDS_FOR_AUTOREFRESH_OF_MEMBERS_AND_STATISTIC_RESOURCES
-          .toLocalizedString();
-    } else if (prop.equals(REMOTE_COMMAND_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_COMMAND_PREFIX_USED_FOR_LAUNCHING_MEMBERS_OF_THE_DISTRIBUTED_SYSTEM
-          .toLocalizedString();
-    } else if (prop.equals(CLUSTER_SSL_ENABLED)) {
-      return LocalizedStrings.AgentConfigImpl_DOES_THE_DISTRIBUTED_SYSTEM_COMMUNICATE_USING_SSL
-          .toLocalizedString();
-    } else if (prop.equals(CLUSTER_SSL_PROTOCOLS)) {
-      return LocalizedStrings.AgentConfigImpl_SSL_PROTOCOLS_USED_TO_COMMUNICATE_WITH_DISTRIBUTED_SYSTEM
-          .toLocalizedString();
-    } else if (prop.equals(CLUSTER_SSL_CIPHERS)) {
-      return LocalizedStrings.AgentConfigImpl_SSL_CIPHERS_USED_TO_COMMUNICATE_WITH_DISTRIBUTED_SYSTEM
-          .toLocalizedString();
-    } else if (prop.equals(CLUSTER_SSL_REQUIRE_AUTHENTICATION)) {
-      return LocalizedStrings.AgentConfigImpl_DOES_CONNECTING_TO_THE_DISTRIBUTED_SYSTEM_REQUIRE_SSL_AUTHENTICATION
-          .toLocalizedString();
-    } else {
-      String description = _getPropertyDescription(prop);
-      if (description == null) {
-        throw new IllegalArgumentException(
-            LocalizedStrings.AgentConfigImpl_UNKNOWN_CONFIG_PROPERTY_0.toLocalizedString(prop));
-
-      } else {
-        return description;
-      }
-    }
-  }
-
-  /**
-   * Returns a description of the given agent config property or <code>null</code> if
-   * <code>prop</code> is not a recognized agent property.
-   */
-  public static String _getPropertyDescription(String prop) {
-    if (prop.equals(AUTO_CONNECT_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_AUTOMATICALLY_CONNECT_TO_THE_DISTRIBUTED_SYSTEM
-          .toLocalizedString();
-
-      // } else if (prop.equals(SYSTEM_NAME_NAME)) {
-      // return "The logical name of the distributed system";
-
-    } else if (prop.equals(HTTP_ENABLED_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_START_THE_HTTP_JMX_ADAPTER
-          .toLocalizedString();
-
-    } else if (prop.equals(HTTP_BIND_ADDRESS_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_BIND_ADDRESS_OF_HTTP_ADAPTERS_SOCKETS
-          .toLocalizedString();
-
-    } else if (prop.equals(HTTP_PORT_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_THE_PORT_ON_WHICH_THE_HTTP_ADAPTER_WILL_BE_STARTED
-          .toLocalizedString();
-
-    } else if (prop.equals(RMI_ENABLED_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_START_THE_RMI_JMX_ADAPTER
-          .toLocalizedString();
-
-    } else if (prop.equals(RMI_REGISTRY_ENABLED_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_HOST_AN_RMI_REGISTRY
-          .toLocalizedString();
-
-    } else if (prop.equals(RMI_BIND_ADDRESS_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_BIND_ADDRESS_OF_RMI_ADAPTERS_SOCKETS
-          .toLocalizedString();
-
-    } else if (prop.equals(RMI_PORT_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_THE_PORT_ON_WHICH_TO_CONTACT_THE_RMI_REGISTER
-          .toLocalizedString();
-
-    } else if (prop.equals(RMI_SERVER_PORT_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_THE_PORT_USED_TO_CONFIGURE_RMI_CONNECTOR_SERVER
-          .toLocalizedString();
-
-    } else if (prop.equals(SNMP_ENABLED_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_START_THE_SNMP_JMX_ADAPTER
-          .toLocalizedString();
-
-    } else if (prop.equals(SNMP_BIND_ADDRESS_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_BIND_ADDRESS_OF_SNMP_ADAPTERS_SOCKETS
-          .toLocalizedString();
-
-    } else if (prop.equals(SNMP_DIRECTORY_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_THE_DIRECTORY_IN_WHICH_SNMP_CONFIGURATION_RESIDES
-          .toLocalizedString();
-
-    } else if (prop.equals(AGENT_SSL_ENABLED_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_COMMUNICATE_USING_SSL
-          .toLocalizedString();
-
-    } else if (prop.equals(AGENT_SSL_PROTOCOLS_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_THE_SSL_PROTOCOLS_USED_BY_THE_AGENT
-          .toLocalizedString();
-
-    } else if (prop.equals(AGENT_SSL_CIPHERS_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_THE_SSL_CIPHERS_USED_BY_THE_AGENT.toLocalizedString();
-
-    } else if (prop.equals(AGENT_SSL_REQUIRE_AUTHENTICATION_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_WILL_THE_AGENT_REQUIRE_SSL_AUTHENTICATION
-          .toLocalizedString();
-
-    } else if (prop.equals(HTTP_SSL_REQUIRE_AUTHENTICATION_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_WILL_THE_HTTP_ADAPTER_REQUIRE_SSL_AUTHENTICATION
-          .toLocalizedString();
-
-    } else if (prop.equals(HTTP_AUTHENTICATION_ENABLED_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_WILL_THE_HTTP_JMX_ADAPTER_USE_HTTP_AUTHENTICATION
-          .toLocalizedString();
-
-    } else if (prop.equals(HTTP_AUTHENTICATION_USER_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_THE_USER_NAME_FOR_AUTHENTICATION_IN_THE_HTTP_JMX_ADAPTER
-          .toLocalizedString();
-
-    } else if (prop.equals(HTTP_AUTHENTICATION_PASSWORD_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_THE_PASSWORD_FOR_AUTHENTICATION_IN_THE_HTTP_JMX_ADAPTER
-          .toLocalizedString();
-
-    } else if (prop.equals(PROPERTY_FILE_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_PROPERTY_FILE_FROM_WHICH_AGENT_READS_CONFIGURATION
-          .toLocalizedString();
-
-    } else if (prop.equals(LOCATOR_HOST_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_HOST_ON_WHICH_THE_DISTRIBUTED_SYSTEMS_LOCATOR_RUNS
-          .toLocalizedString();
-
-    } else if (prop.equals(LOCATOR_PORT_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_HOST_ON_WHICH_THE_DISTRIBUTED_SYSTEMS_LOCATOR_RUNS
-          .toLocalizedString();
-
-    } else if (prop.equals(LOCATOR_PRODUCT_DIRECTORY_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_GEMFIRE_PRODUCT_DIRECTORY_USED_TO_LAUNCH_A_LOCATOR
-          .toLocalizedString();
-
-    } else if (prop.equals(LOCATOR_WORKING_DIRECTORY_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_DIRECTORY_IN_WHICH_A_LOCATOR_WILL_BE_LAUNCHED
-          .toLocalizedString();
-
-    } else if (prop.equals(LOCATOR_REMOTE_COMMAND)) {
-      return LocalizedStrings.AgentConfigImpl_COMMAND_PREFIX_USED_WHEN_LAUNCHING_A_LOCATOR
-          .toLocalizedString();
-
-    } else if (prop.equals(LOCATOR_BIND_ADDRESS)) {
-      return LocalizedStrings.AgentConfigImpl_IP_ADDRESS_TO_USE_WHEN_CONTACTING_LOCATOR
-          .toLocalizedString();
-
-    } else if (prop.equals(LOCATOR_DS_PROPERTIES)) {
-      return LocalizedStrings.AgentConfigImpl_PROPERTIES_FOR_CONFIGURING_A_LOCATORS_DISTRIBUTED_SYSTEM
-          .toLocalizedString();
-
-    } else if (prop.equals(EMAIL_NOTIFICATIONS_ENABLED_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_IDENTIFY_IF_EMAIL_NOTIFICATIONS_ARE_ENABLED_OR_NOT
-          .toLocalizedString();
-
-    } else if (prop.equals(EMAIL_NOTIFICATIONS_FROM_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_IDENTIFY_THE_EMAIL_ADDRESS_USING_WHICH_EMAIL_NOTIFICATIONS_ARE_SENT
-          .toLocalizedString();
-
-    } else if (prop.equals(EMAIL_NOTIFICATIONS_HOST_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_IDENTIFY_THE_EMAIL_SERVER_HOST_USING_WHICH_EMAIL_NOTIFICATIONS_ARE_SENT
-          .toLocalizedString();
-
-    } else if (prop.equals(EMAIL_NOTIFICATIONS_TO_LIST_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_IDENTIFY_THE_COMMA_SEPARATED_EMAIL_ADDRESSES_LIST_TO_WHICH_EMAIL_NOTIFICATIONS_ARE_SENT
-          .toLocalizedString();
-
-    } else if (prop.equals(STATE_SAVE_FILE_NAME)) {
-      return LocalizedStrings.AgentConfigImpl_IDENTIFY_THE_NAME_OF_THE_FILE_TO_BE_USED_FOR_SAVING_AGENT_STATE
-          .toLocalizedString();
-
-    } else {
-      return null;
-    }
-  }
-
-  /**
-   * Parses the array of command-line arguments (format: key=value) into an instance of Properties.
-   * 
-   * @param args the command-line arguments to convert into a Properties
-   */
-  private static Properties toProperties(String[] args) {
-    Properties props = new Properties();
-    // loop all args and pick out key=value pairs...
-    for (int i = 0; i < args.length; i++) {
-      // VM args...
-      if (args[i].startsWith("-J")) {
-        int eq = args[i].indexOf("=");
-        String key = args[i].substring(2, eq);
-        String value = args[i].substring(eq + 1);
-        System.setProperty(key, value);
-      } else if (args[i].indexOf(AGENT_DEBUG) > 0) {
-        int eq = args[i].indexOf("=");
-        String key = args[i].substring(2, eq);
-        String value = args[i].substring(eq + 1);
-        System.setProperty(key, value);
-      }
-
-      // all other args
-      else if (args[i].indexOf("=") > 0) {
-        int eq = args[i].indexOf("=");
-        String key = args[i].substring(0, eq);
-        String value = args[i].substring(eq + 1);
-        props.setProperty(key, value);
-      }
-    }
-
-    return props;
-  }
-
-  /**
-   * Returns the original command-line arguments.
-   */
-  public String[] getOriginalArgs() {
-    return this.originalCmdLineArgs;
-  }
-
-  // -------------------------------------------------------------------------
-  // Validation methods for configuration options
-  // -------------------------------------------------------------------------
-
-  /**
-   * Makes sure that the mcast port and locators are correct and consistent.
-   * 
-   * @throws IllegalArgumentException If configuration is not valid
-   */
-  @Override
-  public void validate() {
-    super.validate();
-
-    if (this.httpPort < 0 || this.httpPort > MAX_HTTP_PORT) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
-              .toLocalizedString(new Object[] {HTTP_PORT_NAME, Integer.valueOf(MIN_HTTP_PORT),
-                  Integer.valueOf(MAX_HTTP_PORT)}));
-    }
-
-    if (this.rmiPort < 0 || this.rmiPort > MAX_RMI_PORT) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
-              .toLocalizedString(new Object[] {RMI_PORT_NAME, Integer.valueOf(MIN_RMI_PORT),
-                  Integer.valueOf(MAX_RMI_PORT)}));
-    }
-
-    if (this.rmiServerPort < 0 || this.rmiServerPort > MAX_RMI_PORT) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
-              .toLocalizedString(new Object[] {RMI_SERVER_PORT_NAME, Integer.valueOf(MIN_RMI_PORT),
-                  Integer.valueOf(MAX_RMI_PORT)}));
-    }
-
-  }
-
-  /**
-   * Returns defaultValue if value is empty.
-   */
-  private String validateNonEmptyString(String value, String defaultValue) {
-    return isEmpty(value) ? defaultValue : value;
-  }
-
-  /**
-   * Validates that systemHost can be used for an InetAddress.
-   */
-  private String validateSystemHost(String systemHost) {
-    return InetAddressUtil.validateHost(systemHost);
-  }
-
-  /**
-   * Returns null if productDir is empty; else converts it to File.
-   */
-  private String validateProductDirectory(String productDir) {
-    if (isEmpty(productDir)) {
-      return null;
-    }
-    return productDir;
-  }
-
-  /**
-   * Returns true if value parses as true; null value returns defaultValue.
-   */
-  private boolean validateBoolean(String value, boolean defaultValue) {
-    if (isEmpty(value)) {
-      return defaultValue;
-    }
-    return Boolean.valueOf(value).booleanValue();
-  }
-
-  // HttpAdaptor property validators...
-
-  /**
-   * Returns {@link org.apache.geode.admin.jmx.AgentConfig#DEFAULT_HTTP_PORT} if httpPort is empty;
-   * else validates that it's an integer and returns the int form.
-   */
-  private int validateHttpPort(String val) {
-    if (isEmpty(val)) {
-      return DEFAULT_HTTP_PORT;
-    } else {
-      return validateHttpPort(Integer.parseInt(val));
-    }
-  }
-
-  /**
-   * Validates that httpPort is either zero or within the
-   * {@link org.apache.geode.admin.jmx.AgentConfig#MIN_HTTP_PORT} and
-   * {@link org.apache.geode.admin.jmx.AgentConfig#MAX_HTTP_PORT} values.
-   */
-  private int validateHttpPort(int val) {
-    if (val < 0 || val > MAX_HTTP_PORT) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
-              .toLocalizedString(new Object[] {HTTP_PORT_NAME, Integer.valueOf(MIN_HTTP_PORT),
-                  Integer.valueOf(MAX_HTTP_PORT)}));
-    }
-    return val;
-  }
-
-  /**
-   * Returns {@link org.apache.geode.admin.jmx.AgentConfig#DEFAULT_HTTP_BIND_ADDRESS} unless
-   * httpBindAddress can be used to create a valid InetAddress.
-   */
-  private String validateHttpBindAddress(String val) {
-    String value = InetAddressUtil.validateHost(val);
-    if (value == null) {
-      return DEFAULT_HTTP_BIND_ADDRESS;
-    } else {
-      return value;
-    }
-  }
-
-  /**
-   * Validates that httpBindAddress is not null and then returns the string form of it.
-   */
-  private String validateHttpBindAddress(InetAddress val) {
-    if (val == null) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.AgentConfigImpl_HTTPBINDADDRESS_MUST_NOT_BE_NULL.toLocalizedString());
-    }
-    return toString("", val);
-  }
-
-  // SnmpAdaptor property validators...
-
-  /**
-   * Returns {@link org.apache.geode.admin.jmx.AgentConfig#DEFAULT_SNMP_BIND_ADDRESS} unless
-   * snmpBindAddress can be used to create a valid InetAddress.
-   */
-  private String validateSnmpBindAddress(String val) {
-    String value = InetAddressUtil.validateHost(val);
-    if (value == null) {
-      return DEFAULT_SNMP_BIND_ADDRESS;
-    } else {
-      return value;
-    }
-  }
-
-  // /**
-  // * Validates that snmpBindAddress is not null and then returns the string form of it.
-  // */
-  // private String validateSnmpBindAddress(InetAddress snmpBindAddress) {
-  // if (snmpBindAddress == null) {
-  // throw new IllegalArgumentException("SnmpBindAddress must not be null");
-  // }
-  // return toString(snmpBindAddress);
-  // }
-
-  /**
-   * SnmpDirectory must be specified if SNMP is enabled. This directory must also exist.
-   */
-  private String validateSnmpDirectory(String snmpDir) {
-    /*
-     * if (isSnmpEnabled() && isEmpty(snmpDir)) { throw new
-     * IllegalArgumentException(LocalizedStrings.
-     * AgentConfigImpl_SNMPDIRECTORY_MUST_BE_SPECIFIED_BECAUSE_SNMP_IS_ENABLED.toLocalizedString());
-     * } File root new File(snmpDir); if (!root.exists()) throw new
-     * IllegalArgumentException(LocalizedStrings.AgentConfigImpl_SNMPDIRECTORY_DOES_NOT_EXIST.
-     * toLocalizedString());
-     */
-
-    return snmpDir;
-  }
-
-  // RMIConnectorServer property validators...
-
-  /**
-   * Returns {@link org.apache.geode.admin.jmx.AgentConfig#DEFAULT_RMI_PORT} if rmiPort is empty;
-   * else validates that it's an integer and returns the int form.
-   */
-  private int validateRmiPort(String val) {
-    if (isEmpty(val)) {
-      return DEFAULT_RMI_PORT;
-    } else {
-      return validateRmiPort(Integer.parseInt(val));
-    }
-  }
-
-  /**
-   * Validates that rmiPort is either zero or within the
-   * {@link org.apache.geode.admin.jmx.AgentConfig#MIN_RMI_PORT} and
-   * {@link org.apache.geode.admin.jmx.AgentConfig#MAX_RMI_PORT} values.
-   */
-  private int validateRmiPort(int val) {
-    if (val < MIN_RMI_PORT || val > MAX_RMI_PORT) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
-              .toLocalizedString(new Object[] {RMI_PORT_NAME, Integer.valueOf(MIN_RMI_PORT),
-                  Integer.valueOf(MAX_RMI_PORT)}));
-    }
-    return val;
-  }
-
-  /**
-   * Returns {@link org.apache.geode.admin.jmx.AgentConfig#DEFAULT_RMI_SERVER_PORT} if
-   * rmi-server-port is empty; else validates that it's an integer within the allowed range and
-   * returns the int form.
-   */
-  private int validateRmiServerPort(String val) {
-    if (isEmpty(val)) {
-      return DEFAULT_RMI_SERVER_PORT;
-    } else {
-      return validateRmiServerPort(Integer.parseInt(val));
-    }
-  }
-
-  /**
-   * Validates that rmiPort is either zero or within the
-   * {@link org.apache.geode.admin.jmx.AgentConfig#MIN_RMI_PORT} and
-   * {@link org.apache.geode.admin.jmx.AgentConfig#MAX_RMI_PORT} values.
-   */
-  private int validateRmiServerPort(int val) {
-    if (val < MIN_RMI_PORT || val > MAX_RMI_PORT) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.AgentConfigImpl_0_MUST_BE_ZERO_OR_AN_INTEGER_BETWEEN_1_AND_2
-              .toLocalizedString(new Object[] {RMI_SERVER_PORT_NAME, Integer.valueOf(MIN_RMI_PORT),
-                  Integer.valueOf(MAX_RMI_PORT)}));
-    }
-    return val;
-  }
-
-  /**
-   * Returns {@link org.apache.geode.admin.jmx.AgentConfig#DEFAULT_RMI_BIND_ADDRESS} unless
-   * rmiBindAddress can be used to create a valid InetAddress.
-   */
-  private String validateRmiBindAddress(String val) {
-    String value = InetAddressUtil.validateHost(val);
-    if (value == null) {
-      return DEFAULT_RMI_BIND_ADDRESS;
-    } else {
-      return value;
-    }
-  }
-  // /**
-  // * Validates that rmiBindAddress is not null and then returns the string form of it.
-  // */
-  // private String validateRmiBindAddress(InetAddress rmiBindAddress) {
-  // if (rmiBindAddress == null) {
-  // throw new IllegalArgumentException("RmiBindAddress must not be null");
-  // }
-  // return toString(rmiBindAddress);
-  // }
-
-  /**
-   * Validates working directory is not null or empty.
-   */
-  private File validateWorkingDirectory(String workingDir) {
-    if (isEmpty(workingDir)) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.AgentConfigImpl_LOCATOR_WORKINGDIRECTORY_MUST_NOT_BE_NULL
-              .toLocalizedString());
-    }
-    return new File(workingDir);
-  }
-
-  // -------------------------------------------------------------------------
-  // Static utility methods
-  // -------------------------------------------------------------------------
-
-  /**
-   * Gets an <code>URL</code> for the property file, if one can be found, that the create method
-   * would use to determine the systemName and product home.
-   * <p>
-   * The file will be searched for, in order, in the following locations:
-   * <ol>
-   * <li>the current directory
-   * <li>the home directory
-   * <li>the class path
-   * </ol>
-   * Only the first file found will be used.
-   * 
-   * @return a <code>URL</code> that names the property file; otherwise Null if no property file was
-   *         found.
-   */
-  public static URL getPropertyFileURL(final String propFileLocation) {
-    File propFile = new File(propFileLocation);
-
-    // first, try the current directory...
-    if (propFile.exists()) {
-      propFile = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(propFile);
-
-      try {
-        return propFile.toURI().toURL();
-      } catch (java.net.MalformedURLException ignore) {
-      }
-    }
-
-    // next, try the user's home directory...
-    if (propFileLocation != null && propFileLocation.length() > 0) {
-      propFile = new File(System.getProperty("user.home"), propFileLocation);
-
-      if (propFile.exists()) {
-        propFile = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(propFile);
-
-        try {
-          return propFile.toURI().toURL();
-        } catch (java.net.MalformedURLException ignore) {
-        }
-      }
-    }
-
-    // finally, try the classpath...
-    return ClassPathLoader.getLatest().getResource(AgentConfigImpl.class, propFileLocation);
-  }
-
-  private static boolean okToDisplayPropertyValue(String attName) {
-    if (attName.startsWith(HTTP_AUTHENTICATION_USER_NAME)) {
-      return false;
-    }
-    if (attName.startsWith(HTTP_AUTHENTICATION_PASSWORD_NAME)) {
-      return false;
-    }
-    if (attName.startsWith(AGENT_SSL_PROTOCOLS_NAME)) {
-      return false;
-    }
-    if (attName.startsWith(AGENT_SSL_CIPHERS_NAME)) {
-      return false;
-    }
-    if (attName.toLowerCase().contains("javax.net.ssl")) {
-      return false;
-    }
-    if (attName.toLowerCase().contains("password")) {
-      return false;
-    }
-    return true;
-  }
-
-  /**
-   * Returns string representation of the specified object with special handling for InetAddress.
-   * 
-   * @param obj the object to convert to string
-   *
-   * @return string representation of the specified object
-   */
-  private static String toString(String attName, java.lang.Object obj) {
-    if (okToDisplayPropertyValue(attName)) {
-      if (obj == null) {
-        return "";
-      }
-      if (obj instanceof InetAddress) {
-        return InetAddressUtil.toString(obj);
-      }
-      return obj.toString();
-    } else {
-      return OBFUSCATED_STRING;
-    }
-  }
-
-  /**
-   * Returns string representation of the int.
-   */
-  private static String toString(String attName, int num) {
-    if (okToDisplayPropertyValue(attName)) {
-      return String.valueOf(num);
-    } else {
-      return OBFUSCATED_STRING;
-    }
-  }
-
-  /**
-   * Returns string representation of the boolean value.
-   */
-  private static String toString(String attName, boolean v) {
-    if (okToDisplayPropertyValue(attName)) {
-      return String.valueOf(v);
-    } else {
-      return OBFUSCATED_STRING;
-    }
-  }
-
-  /**
-   * Returns true if the string is null or empty.
-   */
-  public static boolean isEmpty(String string) {
-    return string == null || string.length() == 0;
-  }
-
-  // -------------------------------------------------------------------------
-  // SSL support...
-  // -------------------------------------------------------------------------
-  private boolean sslEnabled = DEFAULT_SSL_ENABLED;
-  private String sslProtocols = DEFAULT_SSL_PROTOCOLS;
-  private String sslCiphers = DEFAULT_SSL_CIPHERS;
-  private boolean sslAuthenticationRequired = DEFAULT_SSL_REQUIRE_AUTHENTICATION;
-  private Properties sslProperties = new Properties();
-
-  @Override
-  public boolean isSSLEnabled() {
-    return this.sslEnabled;
-  }
-
-  @Override
-  public void setSSLEnabled(boolean enabled) {
-    this.sslEnabled = enabled;
-    configChanged();
-  }
-
-  @Override
-  public String getSSLProtocols() {
-    return this.sslProtocols;
-  }
-
-  @Override
-  public void setSSLProtocols(String protocols) {
-    this.sslProtocols = protocols;
-    configChanged();
-  }
-
-  @Override
-  public String getSSLCiphers() {
-    return this.sslCiphers;
-  }
-
-  @Override
-  public void setSSLCiphers(String ciphers) {
-    this.sslCiphers = ciphers;
-    configChanged();
-  }
-
-  @Override
-  public boolean isSSLAuthenticationRequired() {
-    return this.sslAuthenticationRequired;
-  }
-
-  @Override
-  public void setSSLAuthenticationRequired(boolean authRequired) {
-    this.sslAuthenticationRequired = authRequired;
-    configChanged();
-  }
-
-  @Override
-  public Properties getSSLProperties() {
-    return this.sslProperties;
-  }
-
-  @Override
-  public void setSSLProperties(Properties sslProperties) {
-    this.sslProperties = sslProperties;
-    if (this.sslProperties == null) {
-      this.sslProperties = new Properties();
-    }
-    configChanged();
-  }
-
-  public String getStateSaveFile() {
-    return this.stateSaveFile;
-  }
-
-  public void setStateSaveFile(String file) {
-    checkReadOnly();
-    this.stateSaveFile = file;
-    configChanged();
-  }
-
-  public boolean isEmailNotificationEnabled() {
-    return this.isEmailNotificationEnabled;
-  }
-
-  public void setEmailNotificationEnabled(boolean enabled) {
-    checkReadOnly();
-    this.isEmailNotificationEnabled = enabled;
-    configChanged();
-  }
-
-  public String getEmailNotificationFrom() {
-    return this.emailNotificationFrom;
-  }
-
-  public void setEmailNotificationFrom(String emailID) {
-    this.emailNotificationFrom = emailID;
-    configChanged();
-  }
-
-  public String getEmailNotificationHost() {
-    return this.emailNotificationHostName;
-  }
-
-  public void setEmailNotificationHost(String hostName) {
-    this.emailNotificationHostName = hostName;
-    configChanged();
-  }
-
-  public String getEmailNotificationToList() {
-    return this.emailNotificationToList;
-  }
-
-  public void setEmailNotificationToList(String emailIDs) {
-    this.emailNotificationToList = emailIDs;
-    configChanged();
-  }
-
-  @Override
-  public Object clone() throws CloneNotSupportedException {
-    return super.clone();
-  }
-}
-


[30/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheServer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheServer.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheServer.java
new file mode 100755
index 0000000..ba31538
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheServer.java
@@ -0,0 +1,308 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.cache.server.ServerLoadProbe;
+
+/**
+ * Administrative interface that represents a {@link org.apache.geode.cache.server.CacheServer
+ * CacheServer} that serves the contents of a system member's cache to clients.
+ *
+ * @see SystemMemberCache#addCacheServer
+ *
+ * @since GemFire 5.7
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface SystemMemberCacheServer {
+
+  /**
+   * Returns the port on which this cache server listens for clients to connect.
+   */
+  public int getPort();
+
+  /**
+   * Sets the port on which this cache server listens for clients to connect.
+   *
+   * @throws AdminException If this cache server is running
+   */
+  public void setPort(int port) throws AdminException;
+
+  /**
+   * Starts this cache server. Once the server is running, its configuration cannot be changed.
+   *
+   * @throws AdminException If an error occurs while starting the cache server
+   */
+  public void start() throws AdminException;
+
+  /**
+   * Returns whether or not this cache server is running
+   */
+  public boolean isRunning();
+
+  /**
+   * Stops this cache server. Note that the <code>CacheServer</code> can be reconfigured and
+   * restarted if desired.
+   */
+  public void stop() throws AdminException;
+
+  /**
+   * Updates the information about this cache server.
+   */
+  public void refresh();
+
+  /**
+   * Returns a string representing the ip address or host name that this server will listen on.
+   * 
+   * @return the ip address or host name that this server is to listen on
+   * @since GemFire 5.7
+   */
+  public String getBindAddress();
+
+  /**
+   * Sets the ip address or host name that this server is to listen on for client connections.
+   * <p>
+   * Setting a specific bind address will cause the cache server to always use this address and
+   * ignore any address specified by "server-bind-address" or "bind-address" in the
+   * <code>gemfire.properties</code> file (see
+   * {@link org.apache.geode.distributed.DistributedSystem} for a description of these properties).
+   * <p>
+   * A <code>null</code> value will be treated the same as the default "".
+   * <p>
+   * The default value does not override the gemfire.properties. If you wish to override the
+   * properties and want to have your server bind to all local addresses then use this string
+   * <code>"0.0.0.0"</code>.
+   * 
+   * @param address the ip address or host name that this server is to listen on
+   * @throws AdminException if this cache server is running
+   * @since GemFire 5.7
+   */
+  public void setBindAddress(String address) throws AdminException;
+
+  /**
+   * Returns a string representing the ip address or host name that server locators will tell
+   * clients that this server is listening on.
+   * 
+   * @return the ip address or host name to give to clients so they can connect to this server
+   * @since GemFire 5.7
+   */
+  public String getHostnameForClients();
+
+  /**
+   * Sets the ip address or host name that this server is to listen on for client connections.
+   * <p>
+   * Setting a specific hostname-for-clients will cause server locators to use this value when
+   * telling clients how to connect to this server.
+   * <p>
+   * The default value causes the bind-address to be given to clients
+   * <p>
+   * A <code>null</code> value will be treated the same as the default "".
+   * 
+   * @param name the ip address or host name that will be given to clients so they can connect to
+   *        this server
+   * @throws AdminException if this cache server is running
+   * @since GemFire 5.7
+   */
+  public void setHostnameForClients(String name) throws AdminException;
+
+  /**
+   * Sets whether or not this cache server should notify clients based on key subscription.
+   *
+   * If false, then an update to any key on the server causes an update to be sent to all clients.
+   * This update does not push the actual data to the clients. Instead, it causes the client to
+   * locally invalidate or destroy the corresponding entry. The next time the client requests the
+   * key, it goes to the cache server for the value.
+   *
+   * If true, then an update to any key on the server causes an update to be sent to only those
+   * clients who have registered interest in that key. Other clients are not notified of the change.
+   * In addition, the actual value is pushed to the client. The client does not need to request the
+   * new value from the cache server.
+   * 
+   * @throws AdminException if this cache server is running
+   * @since GemFire 5.7
+   */
+  public void setNotifyBySubscription(boolean b) throws AdminException;
+
+  /**
+   * Answers whether or not this cache server should notify clients based on key subscription.
+   * 
+   * @since GemFire 5.7
+   */
+  public boolean getNotifyBySubscription();
+
+  /**
+   * Sets the buffer size in bytes of the socket connection for this <code>CacheServer</code>. The
+   * default is 32768 bytes.
+   *
+   * @param socketBufferSize The size in bytes of the socket buffer
+   * @throws AdminException if this cache server is running
+   * @since GemFire 5.7
+   */
+  public void setSocketBufferSize(int socketBufferSize) throws AdminException;
+
+  /**
+   * Returns the configured buffer size of the socket connection for this <code>CacheServer</code>.
+   * The default is 32768 bytes.
+   * 
+   * @return the configured buffer size of the socket connection for this <code>CacheServer</code>
+   * @since GemFire 5.7
+   */
+  public int getSocketBufferSize();
+
+  /**
+   * Sets the maximum amount of time between client pings. This value is used by the
+   * <code>ClientHealthMonitor</code> to determine the health of this <code>CacheServer</code>'s
+   * clients. The default is 60000 ms.
+   *
+   * @param maximumTimeBetweenPings The maximum amount of time between client pings
+   * @throws AdminException if this cache server is running
+   * @since GemFire 5.7
+   */
+  public void setMaximumTimeBetweenPings(int maximumTimeBetweenPings) throws AdminException;
+
+  /**
+   * Returns the maximum amount of time between client pings. This value is used by the
+   * <code>ClientHealthMonitor</code> to determine the health of this <code>CacheServer</code>'s
+   * clients. The default is 60000 ms.
+   * 
+   * @return the maximum amount of time between client pings.
+   * @since GemFire 5.7
+   */
+  public int getMaximumTimeBetweenPings();
+
+  /**
+   * Returns the maximum allowed client connections
+   * 
+   * @since GemFire 5.7
+   */
+  public int getMaxConnections();
+
+  /**
+   * Sets the maxium number of client connections allowed. When the maximum is reached the server
+   * will stop accepting connections.
+   * 
+   * @throws AdminException if this cache server is running
+   * @since GemFire 5.7
+   */
+  public void setMaxConnections(int maxCons) throws AdminException;
+
+  /**
+   * Returns the maxium number of threads allowed in this server to service client requests. The
+   * default of <code>0</code> causes the server to dedicate a thread for every client connection.
+   * 
+   * @since GemFire 5.7
+   */
+  public int getMaxThreads();
+
+  /**
+   * Sets the maxium number of threads allowed in this server to service client requests. The
+   * default of <code>0</code> causes the server to dedicate a thread for every client connection.
+   * 
+   * @throws AdminException if this cache server is running
+   * @since GemFire 5.7
+   */
+  public void setMaxThreads(int maxThreads) throws AdminException;
+
+  /**
+   * Returns the maximum number of messages that can be enqueued in a client-queue.
+   * 
+   * @since GemFire 5.7
+   */
+  public int getMaximumMessageCount();
+
+  /**
+   * Sets maximum number of messages that can be enqueued in a client-queue.
+   * 
+   * @throws AdminException if this cache server is running
+   * @since GemFire 5.7
+   */
+  public void setMaximumMessageCount(int maxMessageCount) throws AdminException;
+
+  /**
+   * Returns the time (in seconds ) after which a message in the client queue will expire.
+   * 
+   * @since GemFire 5.7
+   */
+  public int getMessageTimeToLive();
+
+  /**
+   * Sets the time (in seconds ) after which a message in the client queue will expire.
+   * 
+   * @throws AdminException if this cache server is running
+   * @since GemFire 5.7
+   */
+  public void setMessageTimeToLive(int messageTimeToLive) throws AdminException;
+
+  /**
+   * Sets the list of server groups this cache server will belong to. By default cache servers
+   * belong to the default global server group which all cache servers always belong to.
+   * 
+   * @param groups possibly empty array of <code>String</code> where each string is a server groups
+   *        that this cache server will be a member of.
+   * @throws AdminException if this cache server is running
+   * @since GemFire 5.7
+   */
+  public void setGroups(String[] groups) throws AdminException;
+
+  /**
+   * Returns the list of server groups that this cache server belongs to.
+   * 
+   * @return a possibly empty array of <code>String</code>s where each string is a server group.
+   *         Modifying this array will not change the server groups that this cache server belongs
+   *         to.
+   * @since GemFire 5.7
+   */
+  public String[] getGroups();
+
+  /**
+   * Get a description of the load probe for this cache server. {@link ServerLoadProbe} for details
+   * on the load probe.
+   * 
+   * @return the load probe used by this cache server.
+   * @since GemFire 5.7
+   */
+  public String getLoadProbe();
+
+  /**
+   * Set the load probe for this cache server. See {@link ServerLoadProbe} for details on how to
+   * implement a load probe.
+   * 
+   * The load probe should implement DataSerializable if it is used with this interface, because it
+   * will be sent to the remote VM.
+   * 
+   * @param loadProbe the load probe to use for this cache server.
+   * @throws AdminException if the cache server is running
+   * @since GemFire 5.7
+   */
+  public void setLoadProbe(ServerLoadProbe loadProbe) throws AdminException;
+
+  /**
+   * Get the frequency in milliseconds to poll the load probe on this cache server.
+   * 
+   * @return the frequency in milliseconds that we will poll the load probe.
+   */
+  public long getLoadPollInterval();
+
+  /**
+   * Set the frequency in milliseconds to poll the load probe on this cache server
+   * 
+   * @param loadPollInterval the frequency in milliseconds to poll the load probe. Must be greater
+   *        than 0.
+   * @throws AdminException if the cache server is running
+   */
+  public void setLoadPollInterval(long loadPollInterval) throws AdminException;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberRegion.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberRegion.java
new file mode 100644
index 0000000..fb5430d
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberRegion.java
@@ -0,0 +1,314 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.cache.*;
+import java.io.File;
+
+/**
+ * Administrative interface that represent's the {@link SystemMember}'s view of one of its cache's
+ * {@link org.apache.geode.cache.Region}s. If the region in the remote system member is closed or
+ * destroyed, the methods of <code>SystemMemberRegion</code> will throw
+ * {@link RegionNotFoundException}.
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface SystemMemberRegion {
+  // attributes
+  /**
+   * Returns the name that identifies this region in its cache.
+   *
+   * @see org.apache.geode.cache.Region#getName
+   */
+  public String getName();
+
+  /**
+   * Returns the full path name that identifies this region in its cache.
+   *
+   * @see org.apache.geode.cache.Region#getFullPath
+   */
+  public String getFullPath();
+
+  /**
+   * Returns the names of all the subregions of this region.
+   */
+  public java.util.Set getSubregionNames();
+
+  /**
+   * Returns the full path of each of the subregions of this region. These paths are suitable for
+   * use with {@link SystemMemberCache#getRegion}.
+   */
+  public java.util.Set getSubregionFullPaths();
+
+  /**
+   * Returns a description of any user attribute associated with this region. The description
+   * includes the classname of the user attribute object as well as its <code>toString</code>
+   * representation.
+   */
+  public String getUserAttribute();
+
+  /**
+   * Returns a description of any CacheLoader associated with this region.
+   */
+  public String getCacheLoader();
+
+  /**
+   * Returns a description of any CacheWriter associated with this region.
+   */
+  public String getCacheWriter();
+
+  /**
+   * Returns the <code>EvictionAttributes</code> that configure how entries in the the region are
+   * evicted
+   */
+  public EvictionAttributes getEvictionAttributes();
+
+  /**
+   * Returns a description of the CacheListener in this region's attributes. If there is more than 1
+   * CacheListener defined for a region this method will return the description of the 1st
+   * CacheListener returned from {@link #getCacheListeners}
+   * 
+   * @deprecated as of 6.0 use getCacheListeners() instead
+   */
+  @Deprecated
+  public String getCacheListener();
+
+  /**
+   * This method will return an empty array if there are no CacheListeners defined on the region. If
+   * there are one or more than 1 CacheListeners defined, this method will return an array which has
+   * the names of all the CacheListeners
+   * 
+   * @return String[] the region's <code>CacheListeners</code> as a String array
+   * @since GemFire 6.0
+   */
+  public String[] getCacheListeners();
+
+  /**
+   * Returns the KeyConstraint in this region's attributes.
+   */
+  public String getKeyConstraint();
+
+  /**
+   * Returns the ValueConstraint in this region's attributes.
+   */
+  public String getValueConstraint();
+
+  /**
+   * Returns the RegionTimeToLive time limit in this region's attributes.
+   */
+  public int getRegionTimeToLiveTimeLimit();
+
+  /**
+   * Returns the RegionTimeToLive action in this region's attributes.
+   */
+  public ExpirationAction getRegionTimeToLiveAction();
+
+  /**
+   * Returns the EntryTimeToLive time limit in this region's attributes.
+   */
+  public int getEntryTimeToLiveTimeLimit();
+
+  /**
+   * Returns the EntryTimeToLive action in this region's attributes.
+   */
+  public ExpirationAction getEntryTimeToLiveAction();
+
+  /**
+   * string describing the CustomExpiry for entry-time-to-live
+   * 
+   * @return the CustomExpiry for entry-time-to-live
+   */
+  public String getCustomEntryTimeToLive();
+
+  /**
+   * Returns the RegionIdleTimeout time limit in this region's attributes.
+   */
+  public int getRegionIdleTimeoutTimeLimit();
+
+  /**
+   * Returns the RegionIdleTimeout action in this region's attributes.
+   */
+  public ExpirationAction getRegionIdleTimeoutAction();
+
+  /**
+   * Returns the EntryIdleTimeout time limit in this region's attributes.
+   */
+  public int getEntryIdleTimeoutTimeLimit();
+
+  /**
+   * Returns the EntryIdleTimeout action in this region's attributes.
+   */
+  public ExpirationAction getEntryIdleTimeoutAction();
+
+  /**
+   * string describing the CustomExpiry for entry-idle-timeout
+   * 
+   * @return the CustomExpiry for entry-idle-timeout
+   */
+  public String getCustomEntryIdleTimeout();
+
+  /**
+   * Returns the MirrorType in this region's attributes.
+   * 
+   * @deprecated as of 5.0, you should use getDataPolicy instead
+   */
+  @Deprecated
+  public MirrorType getMirrorType();
+
+  /**
+   * Returns the DataPolicy in this region's attributes.
+   */
+  public DataPolicy getDataPolicy();
+
+  /**
+   * 
+   * /** Returns the Scope in this region's attributes.
+   */
+  public Scope getScope();
+
+  /**
+   * Returns the InitialCapacity in this region's attributes.
+   */
+  public int getInitialCapacity();
+
+  /**
+   * Returns the LoadFactor in this region's attributes.
+   */
+  public float getLoadFactor();
+
+  /**
+   * Returns the ConcurrencyLevel in this region's attributes.
+   */
+  public int getConcurrencyLevel();
+
+  /**
+   * Returns whether or not conflicting concurrent operations on this region are prevented
+   */
+  public boolean getConcurrencyChecksEnabled();
+
+  /**
+   * Returns the StatisticsEnabled in this region's attributes.
+   */
+  public boolean getStatisticsEnabled();
+
+  /**
+   * Returns whether or not a persistent backup should be made of the region (as opposed to just
+   * writing the overflow data to disk).
+   */
+  public boolean getPersistBackup();
+
+  /**
+   * Returns the <code>DiskWriteAttributes</code> that configure how the region is written to disk.
+   */
+  public DiskWriteAttributes getDiskWriteAttributes();
+
+  /**
+   * Returns the directories to which the region's data are written. If multiple directories are
+   * used, GemFire will attempt to distribute the data evenly amongst them.
+   */
+  public File[] getDiskDirs();
+
+  /**
+   * Returns the number of entries currently in this region.
+   */
+  public int getEntryCount();
+
+  /**
+   * Returns the number of subregions currently in this region.
+   */
+  public int getSubregionCount();
+
+  /**
+   * Returns the LastModifiedTime obtained from this region's statistics.
+   */
+  public long getLastModifiedTime();
+
+  /**
+   * Returns the LastAccessedTime obtained from this region's statistics.
+   */
+  public long getLastAccessedTime();
+
+  /**
+   * Returns the HitCount obtained from this region's statistics.
+   */
+  public long getHitCount();
+
+  /**
+   * Returns the MissCount obtained from this region's statistics.
+   */
+  public long getMissCount();
+
+  /**
+   * Returns the HitRatio obtained from this region's statistics.
+   */
+  public float getHitRatio();
+
+  /**
+   * Returns whether or not acks are sent after an update is processed.
+   * 
+   * @return False if acks are sent after updates are processed; true if acks are sent before
+   *         updates are processed.
+   *
+   * @since GemFire 4.1
+   */
+  public boolean getEarlyAck();
+
+  // operations
+  /**
+   * Updates the state of this region instance. Note that once a cache instance is closed refresh
+   * will never change the state of its regions.
+   */
+  public void refresh();
+
+  /**
+   * Creates a subregion of this region.
+   *
+   * @param name The name of the region to create
+   * @param attrs The attributes of the root region
+   *
+   * @throws AdminException If the region cannot be created
+   *
+   * @since GemFire 4.0
+   */
+  public SystemMemberRegion createSubregion(String name, RegionAttributes attrs)
+      throws AdminException;
+
+  /**
+   * Returns the <code>MembershipAttributes</code> that configure required roles for reliable access
+   * to the region.
+   * 
+   * @deprecated this API is scheduled to be removed
+   */
+  public MembershipAttributes getMembershipAttributes();
+
+  /**
+   * Returns the <code>SubscriptionAttributes</code> for the region.
+   * 
+   * @since GemFire 5.0
+   */
+  public SubscriptionAttributes getSubscriptionAttributes();
+
+  /**
+   * Returns the <code>PartitionAttributes</code> for the region.
+   * 
+   * @since GemFire 5.7
+   */
+  public PartitionAttributes getPartitionAttributes();
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberRegionEvent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberRegionEvent.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberRegionEvent.java
new file mode 100644
index 0000000..6921392
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberRegionEvent.java
@@ -0,0 +1,31 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * An event that describes an operation on a region. Instances of this are delivered to a
+ * {@link SystemMemberCacheListener} when a a region comes or goes.
+ *
+ * @since GemFire 5.0
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface SystemMemberRegionEvent extends SystemMemberCacheEvent {
+  /**
+   * Returns the full path of the region the event was done on.
+   */
+  public String getRegionPath();
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberType.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberType.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberType.java
new file mode 100755
index 0000000..775ea9f
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberType.java
@@ -0,0 +1,150 @@
+/*
+ * 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.internal.admin.api;
+
+// import java.io.*;
+
+/**
+ * Type-safe definition for system members.
+ *
+ * @since GemFire 3.5
+ *
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class SystemMemberType implements java.io.Serializable {
+  private static final long serialVersionUID = 3284366994485749302L;
+
+  /** GemFire shared-memory manager connected to the distributed system */
+  public static final SystemMemberType MANAGER = new SystemMemberType("GemFireManager");
+
+  /** Application connected to the distributed system */
+  public static final SystemMemberType APPLICATION = new SystemMemberType("Application");
+
+  /** GemFire Cache VM connected to the distributed system */
+  public static final SystemMemberType CACHE_VM = new SystemMemberType("CacheVm");
+
+  /**
+   * GemFire Cache Server connected to the distributed system
+   * 
+   * @deprecated as of 5.7 use {@link #CACHE_VM} instead.
+   */
+  @Deprecated
+  public static final SystemMemberType CACHE_SERVER = CACHE_VM;
+
+
+  /** The display-friendly name of this system member type. */
+  private final transient String name;
+
+  // The 4 declarations below are necessary for serialization
+  /** int used as ordinal to represent this Scope */
+  public final int ordinal = nextOrdinal++;
+
+  private static int nextOrdinal = 0;
+
+  private static final SystemMemberType[] VALUES = {MANAGER, APPLICATION, CACHE_VM};
+
+  private Object readResolve() throws java.io.ObjectStreamException {
+    return VALUES[ordinal]; // Canonicalize
+  }
+
+  /** Creates a new instance of SystemMemberType. */
+  private SystemMemberType(String name) {
+    this.name = name;
+  }
+
+  /** Return the SystemMemberType represented by specified ordinal */
+  public static SystemMemberType fromOrdinal(int ordinal) {
+    return VALUES[ordinal];
+  }
+
+  public String getName() {
+    return this.name;
+  }
+
+  /** Return whether this is <code>MANAGER</code>. */
+  public boolean isManager() {
+    return this.equals(MANAGER);
+  }
+
+  /** Return whether this is <code>APPLICATION</code>. */
+  public boolean isApplication() {
+    return this.equals(APPLICATION);
+  }
+
+  /**
+   * Return whether this is <code>CACHE_SERVER</code>.
+   * 
+   * @deprecated as of 5.7 use {@link #isCacheVm} instead.
+   */
+  @Deprecated
+  public boolean isCacheServer() {
+    return isCacheVm();
+  }
+
+  /**
+   * Return whether this is <code>CACHE_VM</code>.
+   */
+  public boolean isCacheVm() {
+    return this.equals(CACHE_VM);
+  }
+
+  /**
+   * Returns a string representation for this system member type.
+   *
+   * @return the name of this system member type
+   */
+  @Override
+  public String toString() {
+    return this.name;
+  }
+
+  /**
+   * Indicates whether some other object is "equal to" this one.
+   *
+   * @param other the reference object with which to compare.
+   * @return true if this object is the same as the obj argument; false otherwise.
+   */
+  @Override
+  public boolean equals(Object other) {
+    if (other == this)
+      return true;
+    if (other == null)
+      return false;
+    if (!(other instanceof SystemMemberType))
+      return false;
+    final SystemMemberType that = (SystemMemberType) other;
+    if (this.ordinal != that.ordinal)
+      return false;
+    return true;
+  }
+
+  /**
+   * Returns a hash code for the object. This method is supported for the benefit of hashtables such
+   * as those provided by java.util.Hashtable.
+   *
+   * @return the integer 0 if description is null; otherwise a unique integer.
+   */
+  @Override
+  public int hashCode() {
+    int result = 17;
+    final int mult = 37;
+    result = mult * result + this.ordinal;
+    return result;
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMembershipEvent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMembershipEvent.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMembershipEvent.java
new file mode 100644
index 0000000..4507e96
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMembershipEvent.java
@@ -0,0 +1,42 @@
+/*
+ * 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.internal.admin.api;
+
+import org.apache.geode.distributed.DistributedMember;
+
+/**
+ * An event that describes the distributed member originated this event. Instances of this are
+ * delivered to a {@link SystemMembershipListener} when a member has joined or left the distributed
+ * system.
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface SystemMembershipEvent {
+  /**
+   * Returns the distributed member as a String.
+   */
+  public String getMemberId();
+
+  /**
+   * Returns the {@link DistributedMember} that this event originated in.
+   * 
+   * @return the member that performed the operation that originated this event.
+   * @since GemFire 5.0
+   */
+  public DistributedMember getDistributedMember();
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMembershipListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMembershipListener.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMembershipListener.java
new file mode 100644
index 0000000..60720ac
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMembershipListener.java
@@ -0,0 +1,59 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * A listener whose callback methods are invoked when members join or leave the GemFire distributed
+ * system.
+ *
+ * @see AdminDistributedSystem#addMembershipListener
+ *
+ * @since GemFire 3.5
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public interface SystemMembershipListener {
+
+  /**
+   * Invoked when a member has joined the distributed system
+   */
+  public void memberJoined(SystemMembershipEvent event);
+
+  /**
+   * Invoked when a member has gracefully left the distributed system. This occurs when the member
+   * took action to remove itself from the distributed system.
+   */
+  public void memberLeft(SystemMembershipEvent event);
+
+  /**
+   * Invoked when a member has unexpectedly left the distributed system. This occurs when a member
+   * is forcibly removed from the distributed system by another process, such as from <a
+   * href=../distributed/DistributedSystem.html#member-timeout> failure detection</a>, or <a
+   * href=../distributed/DistributedSystem.html#enable-network-partition-detection> network
+   * partition detection</a> processing.
+   */
+  public void memberCrashed(SystemMembershipEvent event);
+
+  // /**
+  // * Invoked when a member broadcasts an informational message.
+  // *
+  // * @see org.apache.geode.distributed.DistributedSystem#fireInfoEvent
+  // *
+  // * @since GemFire 4.0
+  // */
+  // public void memberInfo(SystemMembershipEvent event);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/UnmodifiableConfigurationException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/UnmodifiableConfigurationException.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/UnmodifiableConfigurationException.java
new file mode 100755
index 0000000..b4d1668
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/UnmodifiableConfigurationException.java
@@ -0,0 +1,81 @@
+/*
+ * 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.internal.admin.api;
+
+/**
+ * An <code>UnmodifiableConfigurationException</code> is thrown when an attempt is made to modify
+ * the value of an unmodifiable {@link ConfigurationParameter}.
+ *
+ * @since GemFire 3.5
+ *
+ * @deprecated as of 7.0 use the <code><a href=
+ *             "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code>
+ *             package instead
+ */
+public class UnmodifiableConfigurationException extends AdminException {
+  private static final long serialVersionUID = -7653547392992060646L;
+
+  /**
+   * Constructs a new exception with <code>null</code> as its detail message. The cause is not
+   * initialized, and may subsequently be initialized by a call to {@link Throwable#initCause}.
+   */
+  public UnmodifiableConfigurationException() {
+    super();
+  }
+
+  /**
+   * Constructs a new exception with the specified detail message. The cause is not initialized, and
+   * may subsequently be initialized by a call to {@link Throwable#initCause}.
+   *
+   * @param message the detail message. The detail message is saved for later retrieval by the
+   *        {@link #getMessage()} method.
+   */
+  public UnmodifiableConfigurationException(String message) {
+    super(message);
+  }
+
+  /**
+   * Constructs a new exception with the specified detail message and cause.
+   * <p>
+   * Note that the detail message associated with <code>cause</code> is <i>not</i> automatically
+   * incorporated in this exception's detail message.
+   *
+   * @param message the detail message (which is saved for later retrieval by the
+   *        {@link #getMessage()} method).
+   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
+   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
+   *        unknown.)
+   */
+  public UnmodifiableConfigurationException(String message, Throwable cause) {
+    super(message, cause);
+  }
+
+  /**
+   * Constructs a new exception with the specified cause and a detail message of
+   * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail
+   * message of <tt>cause</tt>). This constructor is useful for exceptions that are little more than
+   * wrappers for other throwables (for example, {@link java.security.PrivilegedActionException}).
+   *
+   * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
+   *        (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or
+   *        unknown.)
+   */
+  public UnmodifiableConfigurationException(Throwable cause) {
+    super(cause);
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AbstractHealthEvaluator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AbstractHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AbstractHealthEvaluator.java
new file mode 100644
index 0000000..983c834
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/AbstractHealthEvaluator.java
@@ -0,0 +1,170 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.util.List;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+
+/**
+ * The abstract superclass of all GemFire health evaluators. Basically, this class specifies what
+ * the health evaluators need and what they should do.
+ *
+ * <P>
+ *
+ * Note that evaluators never reside in the administration VM, they only in member VMs. They are not
+ * <code>Serializable</code> and aren't meant to be.
+ *
+ *
+ * @since GemFire 3.5
+ */
+public abstract class AbstractHealthEvaluator {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /**
+   * The number of times this evaluator has been evaluated. Certain checks are not made the first
+   * time an evaluation occurs.
+   */
+  private int numEvaluations;
+
+  ////////////////////// Constructors //////////////////////
+
+  /**
+   * Creates a new <code>AbstractHealthEvaluator</code> with the given
+   * <code>GemFireHealthConfig</code> and <code>DistributionManager</code>.
+   *
+   * Originally, this method took an <code>InternalDistributedSystem</code>, but we found there were
+   * race conditions during initialization. Namely, that a <code>DistributionMessage</code> can be
+   * processed before the <code>InternalDistributedSystem</code>'s <code>DistributionManager</code>
+   * is set.
+   */
+  protected AbstractHealthEvaluator(GemFireHealthConfig config, DM dm) {
+    this.numEvaluations = 0;
+  }
+
+  ///////////////////// Instance Methods /////////////////////
+
+  /**
+   * Evaluates the health of a component of a GemFire distributed system.
+   *
+   * @param status A list of {@link AbstractHealthEvaluator.HealthStatus HealthStatus} objects that
+   *        is populated when ill health is detected.
+   */
+  public final void evaluate(List status) {
+    this.numEvaluations++;
+    check(status);
+  }
+
+  /**
+   * Checks the health of a component of a GemFire distributed system.
+   *
+   * @see #evaluate
+   */
+  protected abstract void check(List status);
+
+  /**
+   * Returns whether or not this is the first evaluation
+   */
+  protected final boolean isFirstEvaluation() {
+    return this.numEvaluations <= 1;
+  }
+
+  /**
+   * A factory method that creates a {@link AbstractHealthEvaluator.HealthStatus HealthStats} with
+   * {@linkplain GemFireHealth#OKAY_HEALTH okay} status.
+   */
+  protected HealthStatus okayHealth(String diagnosis) {
+    logger.info(LocalizedMessage.create(LocalizedStrings.AbstractHealthEvaluator_OKAY_HEALTH__0,
+        diagnosis));
+    return new HealthStatus(GemFireHealth.OKAY_HEALTH, diagnosis);
+  }
+
+  /**
+   * A factory method that creates a {@link AbstractHealthEvaluator.HealthStatus HealthStats} with
+   * {@linkplain GemFireHealth#POOR_HEALTH poor} status.
+   */
+  protected HealthStatus poorHealth(String diagnosis) {
+    logger.info(LocalizedMessage.create(LocalizedStrings.AbstractHealthEvaluator_POOR_HEALTH__0,
+        diagnosis));
+    return new HealthStatus(GemFireHealth.POOR_HEALTH, diagnosis);
+  }
+
+  /**
+   * Returns a <code>String</code> describing the component whose health is evaluated by this
+   * evaluator.
+   */
+  protected abstract String getDescription();
+
+  /**
+   * Closes this evaluator and releases all of its resources
+   */
+  abstract void close();
+
+  /////////////////////// Inner Classes //////////////////////
+
+  /**
+   * Represents the health of a GemFire component.
+   */
+  public class HealthStatus {
+    /** The health of a GemFire component */
+    private GemFireHealth.Health healthCode;
+
+    /** The diagnosis of the illness */
+    private String diagnosis;
+
+    ////////////////////// Constructors //////////////////////
+
+    /**
+     * Creates a new <code>HealthStatus</code> with the give <code>health</code> code and
+     * <code>dianosis</code> message.
+     *
+     * @see GemFireHealth#OKAY_HEALTH
+     * @see GemFireHealth#POOR_HEALTH
+     */
+    HealthStatus(GemFireHealth.Health healthCode, String diagnosis) {
+      this.healthCode = healthCode;
+      this.diagnosis = "[" + AbstractHealthEvaluator.this.getDescription() + "] " + diagnosis;
+    }
+
+    ///////////////////// Instance Methods /////////////////////
+
+    /**
+     * Returns the health code
+     *
+     * @see GemFireHealth#OKAY_HEALTH
+     * @see GemFireHealth#POOR_HEALTH
+     */
+    public GemFireHealth.Health getHealthCode() {
+      return this.healthCode;
+    }
+
+    /**
+     * Returns the diagnosis prepended with a description of the component that is ill.
+     */
+    public String getDiagnosis() {
+      return this.diagnosis;
+    }
+
+  }
+
+}



[35/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
deleted file mode 100644
index 40a514a..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MemberInfoWithStatsMBean.java
+++ /dev/null
@@ -1,1347 +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.admin.jmx.internal;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.admin.jmx.Agent;
-import org.apache.geode.cache.InterestPolicy;
-import org.apache.geode.cache.SubscriptionAttributes;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.GemFireVersion;
-import org.apache.geode.internal.admin.remote.ClientHealthStats;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import mx4j.AbstractDynamicMBean;
-import org.apache.logging.log4j.Logger;
-
-import javax.management.*;
-import java.net.InetAddress;
-import java.text.MessageFormat;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * This class uses the JMX Attributes/Operations that use (return/throw) GemFire types. This is the
- * single MBean accessible with ObjectName string {@link MemberInfoWithStatsMBean#MBEAN_NAME}}. This
- * MBean can be used to retrieve the all member details as plain java types.
- * 
- * This MBean also acts as a Notification Hub for all the Notifications that are defined for Admin
- * Distributed System.
- * 
- * 
- * @since GemFire 6.5
- */
-public class MemberInfoWithStatsMBean extends AbstractDynamicMBean implements NotificationEmitter {
-  private static final Logger logger = LogService.getLogger();
-
-  /* constants defining max no of attributes/operations/notifications */
-  private static final int MAX_ATTRIBUTES_COUNT = 3;
-  private static final int MAX_OPERATIONS_COUNT = 3;
-  private static final int MAX_NOTIFICATIONS_COUNT = 9;
-
-  private static final String NOT_AVAILABLE_STR = "N/A";
-  private static final String NOT_AVAILABLE = null;
-  private static final Number NOT_AVAILABLE_NUMBER = null;
-
-  /*
-   * String constant used for a region that is used on admin side just as a root for rootRegions
-   * defined on the member
-   */
-  private static final String PLACE_HOLDER_ROOT_REGION = "/Root/";
-
-  /* String that are used to form QueryExp/ObjectName for querying MBeanServer */
-  private static final String REGION_QUERY_EXPRESSION = "*GemFire.Cache*:*,owner={0},type=Region";
-  private static final String STATS_QUERY_EXPRESSION = "*GemFire.Statistic*:*,source={0},name={1}";
-
-  /** mbean name string for this MBean */
-  /* default */static final String MBEAN_NAME = "GemFire:type=MemberInfoWithStatsMBean";
-
-  /** ObjectName handle for this MBean */
-  private ObjectName objectName;
-
-  /** version of the GemFire Enterprise system that is running */
-  private String version;
-  private int refreshInterval;
-  private String id;
-
-  private Agent agent;
-  private AdminDistributedSystemJmxImpl adminDSJmx;
-
-  private NotificationForwarder forwarder;
-  private boolean isInitialized;// needs synchronization?
-
-  /**
-   * Default Constructor
-   * 
-   * @param agent Admin Agent instance
-   * @throws OperationsException if ObjectName can't be formed for this MBean
-   * @throws MBeanRegistrationException
-   * @throws AdminException
-   */
-  MemberInfoWithStatsMBean(Agent agent)
-      throws OperationsException, MBeanRegistrationException, AdminException {
-    this.agent = agent;
-    this.objectName = ObjectName.getInstance(MBEAN_NAME);
-    this.version = GemFireVersion.getGemFireVersion();
-    this.refreshInterval = -1;
-    this.id = NOT_AVAILABLE_STR;
-    this.forwarder = new NotificationForwarder(agent.getMBeanServer());
-  }
-
-  /**
-   * Returns attributes defined for this MBean as an array of MBeanAttributeInfo objects.
-   * 
-   * @return attributes defined as an array of MBeanAttributeInfo objects.
-   */
-  @Override
-  protected MBeanAttributeInfo[] createMBeanAttributeInfo() {
-    MBeanAttributeInfo[] attributesInfo = new MBeanAttributeInfo[MAX_ATTRIBUTES_COUNT];
-
-    /*
-     * First letter in attribute name has to be 'V' so that getVersion is called. With 'v' it looks
-     * for getversion, same for others
-     */
-    attributesInfo[0] = new MBeanAttributeInfo("Version", String.class.getName(),
-        "GemFire Enterprise Version", true, /* readable */
-        false, /* writable */
-        false);/* has getter with name like 'is****' */
-
-    attributesInfo[1] = new MBeanAttributeInfo("RefreshInterval", String.class.getName(),
-        "The interval (in seconds) between auto-polling for updating member & statistics resources. If this is '-1', it means the this MBean has not yet been initialized. First call to getMembers operation will initialize this MBean.",
-        true, /* readable */
-        false, /* writable */
-        false);/* has getter with name like 'is****' */
-
-    attributesInfo[2] = new MBeanAttributeInfo("Id", String.class.getName(),
-        "Identifier of the GemFire Enterprise. If this is 'N/A', it means the this MBean has not yet been initialized. First call to getMembers operation will initialize this MBean.",
-        true, /* readable */
-        false, /* writable */
-        false);/* has getter with name like 'is****' */
-
-
-    return attributesInfo;
-  }
-
-  /**
-   * Returns operations defined for this MBean as an array of MBeanOperationInfo objects.
-   * 
-   * @return operations defined as an array of MBeanOperationInfo objects.
-   */
-  @Override
-  protected MBeanOperationInfo[] createMBeanOperationInfo() {
-    MBeanOperationInfo[] operationsInfo = new MBeanOperationInfo[MAX_OPERATIONS_COUNT];
-
-    operationsInfo[0] = new MBeanOperationInfo("getMembers",
-        "Returns ids as strings for all the members - Application Peers & Cache Servers.",
-        new MBeanParameterInfo[] {}, String[].class.getName(), MBeanOperationInfo.ACTION_INFO);
-
-    MBeanParameterInfo[] getMemberDetailsArgs = new MBeanParameterInfo[1];
-    getMemberDetailsArgs[0] = new MBeanParameterInfo("memberId", String.class.getName(),
-        "Id of the member for all the details are to be retrieved.");
-    operationsInfo[1] =
-        new MBeanOperationInfo("getMemberDetails", "Returns details for a given member",
-            getMemberDetailsArgs, Map.class.getName(), MBeanOperationInfo.ACTION_INFO);
-
-    /*
-     * For retrieving ObjectNames of existing Region MBeans, MBeanServerConnection.queryMBeans(),
-     * could be called
-     */
-    MBeanParameterInfo[] getRegionSnapArgs = new MBeanParameterInfo[1];
-    getRegionSnapArgs[0] = new MBeanParameterInfo("memberId", String.class.getName(),
-        "Id of the member on which we want to discover all the region MBean.");
-    operationsInfo[2] = new MBeanOperationInfo("getRegions",
-        "Returns a java.util.Map of details of regions on a member", getRegionSnapArgs,
-        Map.class.getName(), MBeanOperationInfo.ACTION_INFO);
-
-
-    return operationsInfo;
-  }
-
-  /**
-   * Returns notifications defined for this MBean as an array of MBeanNotificationInfo objects.
-   * 
-   * @return notification definitions as an array of MBeanNotificationInfo objects.
-   */
-  @Override
-  protected MBeanNotificationInfo[] createMBeanNotificationInfo() {
-    MBeanNotificationInfo[] notificationsInfo = new MBeanNotificationInfo[MAX_NOTIFICATIONS_COUNT];
-
-    String[] notificationTypes = new String[] {AdminDistributedSystemJmxImpl.NOTIF_MEMBER_JOINED};
-    notificationsInfo[0] =
-        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
-            "A GemFire manager, cache, or other member has joined this distributed system.");
-
-    notificationTypes = new String[] {AdminDistributedSystemJmxImpl.NOTIF_MEMBER_LEFT};
-    notificationsInfo[1] =
-        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
-            "A GemFire manager, cache, or other member has left the distributed system.");
-
-    notificationTypes = new String[] {AdminDistributedSystemJmxImpl.NOTIF_MEMBER_CRASHED};
-    notificationsInfo[2] =
-        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
-            "A member of this distributed system has crashed instead of leaving cleanly.");
-
-    notificationTypes = new String[] {AdminDistributedSystemJmxImpl.NOTIF_ALERT};
-    notificationsInfo[3] =
-        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
-            "A member of this distributed system has generated an alert.");
-
-    notificationTypes = new String[] {AdminDistributedSystemJmxImpl.NOTIF_ADMIN_SYSTEM_DISCONNECT};
-    notificationsInfo[4] =
-        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
-            "A GemFire manager, cache, or other member has joined this distributed system.");
-
-    notificationTypes = new String[] {SystemMemberJmx.NOTIF_CACHE_CREATED};
-    notificationsInfo[5] =
-        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
-            "A cache got created on a member of this distributed system.");
-
-    notificationTypes = new String[] {SystemMemberJmx.NOTIF_CACHE_CLOSED};
-    notificationsInfo[6] = new MBeanNotificationInfo(notificationTypes,
-        Notification.class.getName(), "A cache is closed on a member of this distributed system.");
-
-    notificationTypes = new String[] {SystemMemberJmx.NOTIF_REGION_CREATED};
-    notificationsInfo[7] =
-        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
-            "A region is created in a cache on a member of this distributed system.");
-
-    notificationTypes = new String[] {SystemMemberJmx.NOTIF_REGION_LOST};
-    notificationsInfo[8] =
-        new MBeanNotificationInfo(notificationTypes, Notification.class.getName(),
-            "A region was removed from a cache on a member of this distributed system.");
-
-    // String[] notificationTypes5 = new String[] {AdminDistributedSystemJmxImpl.NOTIF_STAT_ALERT};
-    // notificationsInfo[9] = new MBeanNotificationInfo(notificationTypes5,
-    // Notification.class.getName(),
-    // "An alert based on statistic(s) has been raised.");
-
-    return notificationsInfo;
-  }
-
-  /**
-   * 
-   * @return ObjectName of this MBean
-   */
-  /* default */ ObjectName getObjectName() {
-    return objectName;
-  }
-
-  /**
-   * Returns the version of the GemFire Enterprise instance as a string.
-   * 
-   * @return GemFire Enterprise version string derived from {@link GemFireVersion}
-   */
-  /* getter for attribute - Version */
-  public String getVersion() {
-    return version;
-  }
-
-  /**
-   * @return the refreshInterval
-   */
-  public int getRefreshInterval() {
-    return refreshInterval;
-  }
-
-  /**
-   * @return the id
-   */
-  public String getId() {
-    return id;
-  }
-
-  /**
-   * Connects the Admin Agent in the DS
-   * 
-   * @return AdminDistributedSystem MBean ObjectName
-   * @throws OperationsException if connection to the DS fails
-   * @throws AdminException if connection to the DS fails
-   */
-  private ObjectName connectToSystem() throws OperationsException, AdminException {
-    ObjectName adminDsObjName = agent.connectToSystem();
-
-    AdminDistributedSystem adminDS = agent.getDistributedSystem();
-    if (adminDSJmx == null && adminDS instanceof AdminDistributedSystemJmxImpl) {// instanceof
-                                                                                 // checks for null
-      adminDSJmx = (AdminDistributedSystemJmxImpl) adminDS;
-      refreshInterval = adminDSJmx.getRefreshInterval();
-      id = adminDSJmx.getId();
-      forwarder.registerNotificationListener(adminDSJmx.getObjectName());
-    }
-
-    return adminDsObjName;
-  }
-
-  /**
-   * 
-   * @param memberId
-   * @return SystemMemberJmx instance for given memberId
-   * @throws AdminException
-   */
-  private SystemMemberJmx findMember(String memberId) throws AdminException {
-    SystemMemberJmx foundMember = null;
-
-    if (agent.isConnected()) {
-      SystemMember[] members = adminDSJmx.getSystemMemberApplications();
-      for (SystemMember app : members) {
-        if (app.getId().equals(memberId)) {
-          foundMember = (SystemMemberJmx) app;
-          break;
-        }
-      }
-
-      if (foundMember == null) {
-        members = adminDSJmx.getCacheVms();
-        for (SystemMember cacheVm : members) {
-          if (cacheVm.getId().equals(memberId)) {
-            foundMember = (SystemMemberJmx) cacheVm;
-            break;
-          }
-        }
-      }
-    }
-
-    return foundMember;
-  }
-
-  /**
-   * Return ObjectNames for all the Member MBeans in the DS.
-   * 
-   * @return Array of ObjectNames of all Member MBeans
-   * @throws OperationsException if (1)agent could not connect in the DS OR (2)Notification Listener
-   *         could not be registered for the Admin DS MBean OR (3)fails to retrieve information from
-   *         Admin DS
-   */
-  public String[] getMembers() throws OperationsException {
-    String[] members = new String[0];
-
-    try {
-      if (!isInitialized) {
-        initializeAll(); // initialize if not yet
-      }
-
-      if (adminDSJmx != null) {
-        CacheVm[] cacheVms = adminDSJmx.getCacheVms();
-        SystemMember[] appVms = adminDSJmx.getSystemMemberApplications();
-
-        List<String> membersList = new ArrayList<String>();
-        if (cacheVms != null && cacheVms.length != 0) {
-          for (SystemMember cacheVm : cacheVms) {
-            membersList.add(cacheVm.getId());
-          }
-        }
-        if (appVms != null && appVms.length != 0) {
-          for (SystemMember appVm : appVms) {
-            membersList.add(appVm.getId());
-          }
-        }
-        members = new String[membersList.size()];
-        members = membersList.toArray(members);
-      }
-    } catch (AdminException e) {
-      logger.warn(
-          LocalizedMessage.create(
-              LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0, "getMembers"),
-          e);
-      throw new OperationsException(e.getMessage());
-    } catch (Exception e) {
-      logger.warn(
-          LocalizedMessage.create(
-              LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0, "getMembers"),
-          e);
-      throw new OperationsException(e.getMessage());
-    }
-
-    return members;
-  }
-
-  /**
-   * Returns information including ObjectNames for all regions on a member with given member id.
-   * 
-   * @param memberId member identifier as a String
-   * @return Map of details of all regions on a member with given id
-   * @throws OperationsException if fails to retrieve the regions information
-   */
-  public Map<String, Map<String, ?>> getRegions(String memberId) throws OperationsException {
-    Map<String, Map<String, ?>> regionsInfo = new LinkedHashMap<String, Map<String, ?>>();
-
-    if (memberId != null) {
-      try {
-        SystemMemberJmx foundMember = findMember(memberId);
-        if (foundMember != null) {
-          SystemMemberCacheJmxImpl cache = (SystemMemberCacheJmxImpl) foundMember.getCache();
-          if (cache != null) {
-            Map<String, ObjectName> existingRegionMbeans =
-                getExistingRegionMbeansFullPaths(memberId);
-            // TODO: this is in-efficient
-            // Can a region.create JMX notification be used?
-            regionsInfo = getAllRegionsDetails(cache, existingRegionMbeans);
-            existingRegionMbeans.clear();
-          }
-        }
-      } catch (AdminException e) {
-        logger.warn(LocalizedMessage.create(
-            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0_FOR_MEMBER_1,
-            new Object[] {"getRegions", memberId}), e);
-        throw new OperationsException(e.getMessage());
-      } catch (Exception e) {
-        logger.warn(LocalizedMessage.create(
-            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0_FOR_MEMBER_1,
-            new Object[] {"getRegions", memberId}), e);
-        throw new OperationsException(e.getMessage());
-      }
-    }
-
-    return regionsInfo;
-  }
-
-  /* **************************************************************************/
-  /* ************* INITIALIZE THE ENTIRE ADMIN DS AT A TIME *******************/
-  /* **************************************************************************/
-  /**
-   * Initializes all the possible MBeans for all the members.
-   * 
-   */
-  private void initializeAll() throws OperationsException {
-    try {
-      connectToSystem();
-      if (adminDSJmx != null) {
-        // Members are already inited after connectToSystem. Now init Cache, Region & Stats MBeans
-        SystemMember[] cacheVms = adminDSJmx.getCacheVms();
-        for (int i = 0; i < cacheVms.length; i++) {
-          try {
-            initializeCacheRegionsAndStats((SystemMemberJmx) cacheVms[i]);
-          } catch (AdminException e) {
-            logger.info(LocalizedMessage.create(
-                LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INTIALIZING_0_CONTINUING,
-                cacheVms[i].getId()), e);
-          }
-        }
-        SystemMember[] appVms = adminDSJmx.getSystemMemberApplications();
-        for (int i = 0; i < appVms.length; i++) {
-          try {
-            initializeCacheRegionsAndStats((SystemMemberJmx) appVms[i]);
-          } catch (AdminException e) {
-            logger.info(LocalizedMessage.create(
-                LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INTIALIZING_0_CONTINUING,
-                appVms[i].getId()), e);
-          }
-        }
-      }
-    } catch (AdminException e) {
-      logger.warn(LocalizedMessage
-          .create(LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INTIALIZING), e);
-      throw new OperationsException(e.getMessage());
-    } catch (Exception e) {
-      logger.warn(LocalizedMessage
-          .create(LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INTIALIZING), e);
-      throw new OperationsException(e.getMessage());
-    }
-
-    isInitialized = true;
-  }
-
-  /**
-   * Initializes Cache, Regions & Statistics Types MBeans for the given Member.
-   * 
-   * @param memberJmx Member Mbean instance
-   * @throws OperationsException if fails to initialize required MBeans
-   * @throws AdminException if fails to initialize required MBeans
-   */
-  private void initializeCacheRegionsAndStats(SystemMemberJmx memberJmx)
-      throws OperationsException, AdminException {
-    if (memberJmx != null) {
-      SystemMemberCacheJmxImpl cache = (SystemMemberCacheJmxImpl) memberJmx.getCache();
-      if (cache != null) {
-        RegionSubRegionSnapshot regionSnapshot = cache.getRegionSnapshot();
-        initializeRegionSubRegions(cache, regionSnapshot);
-      }
-      initStats(memberJmx);
-    }
-  }
-
-  /**
-   * Initializes statistics for a member with the given mbean.
-   * 
-   * @param memberJmx Member Mbean instance
-   * @throws AdminException if fails to initialize required statistic MBeans
-   */
-  private void initStats(SystemMemberJmx memberJmx) throws AdminException {
-    StatisticResource[] statResources = memberJmx.getStats();
-    for (StatisticResource statResource : statResources) {
-      statResource.getStatistics();
-    }
-  }
-
-  /**
-   * Initializes all regions & its subregions using the Cache MBean and the RegionSubRegionSnapshot
-   * for this cache MBean.
-   * 
-   * @param cache Cache MBean resource
-   * @param regionSnapshot RegionSubRegionSnapshot instance for the cache
-   * @throws MalformedObjectNameException if fails to initialize the region MBean
-   * @throws AdminException if fails to initialize the region MBean
-   */
-  @SuppressWarnings("rawtypes")
-  private void initializeRegionSubRegions(SystemMemberCacheJmxImpl cache,
-      RegionSubRegionSnapshot regionSnapshot) throws MalformedObjectNameException, AdminException {
-    String fullPath = regionSnapshot.getFullPath();
-    if (!fullPath.equals(PLACE_HOLDER_ROOT_REGION)) {
-      fullPath = fullPath.substring(PLACE_HOLDER_ROOT_REGION.length() - 1);
-
-      cache.manageRegion(fullPath);
-    }
-
-    Set subRegionSnapshots = regionSnapshot.getSubRegionSnapshots();
-
-    for (Iterator iterator = subRegionSnapshots.iterator(); iterator.hasNext();) {
-      RegionSubRegionSnapshot subRegion = (RegionSubRegionSnapshot) iterator.next();
-      try {
-        initializeRegionSubRegions(cache, subRegion);
-      } catch (AdminException e) {
-        logger.info(LocalizedMessage.create(
-            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INTIALIZING_0_CONTINUING,
-            subRegion.getFullPath()), e);
-      }
-    }
-  }
-
-
-  /* **************************************************************************/
-  /* ********************** EVERYTHING HYPERIC NEEDS **************************/
-  /* **************************************************************************/
-
-  /* constants defined that could be used simply retrieve needed info from Map */
-  private static final String TYPE_NAME_CACHESERVER = "Cache Server";
-  private static final String TYPE_NAME_APPLICATION = "Application Peer";
-  /*
-   * NOTE - (My Understanding about the followings - abhishek) 1. CacheVM - a VM started using Cache
-   * Server Launcher. This is considered to be a dedicated cache VM because there is only GemFire
-   * Cache code running here. 2. ApplicationVM - a VM started with a written code using APIs and we
-   * can not guarantee that there will be ONLY GemFire code running in this VM. 3. Cache Server -
-   * Responsible for serving requests from the clients. There could be multiple of these per Cache
-   * and hence per VM - one of 1 or 2 above. These could be specified by <cache-server> (or
-   * deprecated <bridge-server>) element(s) in the cache-xml file or using an API
-   * Cache.addCacheServer().
-   */
-
-  // private static final String VERSION = "gemfire.version.string";
-  // private static final String MEMBER_COUNT = "gemfire.membercount.int";
-  // private static final String GATEWAYHUB_COUNT = "gemfire.gatewayhubcount.int";
-  // private static final String CLIENT_COUNT = "gemfire.clientcount.int";
-
-  private static final String MEMBER_ID = DistributionConfig.GEMFIRE_PREFIX + "member.id.string";
-  private static final String MEMBER_NAME =
-      DistributionConfig.GEMFIRE_PREFIX + "member.name.string";
-  private static final String MEMBER_HOST =
-      DistributionConfig.GEMFIRE_PREFIX + "member.host.string";
-  private static final String MEMBER_PORT = DistributionConfig.GEMFIRE_PREFIX + "member.port.int";
-  private static final String MEMBER_UPTIME =
-      DistributionConfig.GEMFIRE_PREFIX + "member.uptime.long";
-  private static final String MEMBER_CLIENTS =
-      DistributionConfig.GEMFIRE_PREFIX + "member.clients.map";
-  private static final String MEMBER_REGIONS =
-      DistributionConfig.GEMFIRE_PREFIX + "member.regions.map";
-  private static final String MEMBER_TYPE =
-      DistributionConfig.GEMFIRE_PREFIX + "member.type.string";
-  private static final String IS_SERVER =
-      DistributionConfig.GEMFIRE_PREFIX + "member.isserver.boolean";
-  private static final String IS_GATEWAY =
-      DistributionConfig.GEMFIRE_PREFIX + "member.isgateway.boolean";
-
-  private static final String MEMBER_STATSAMPLING_ENABLED =
-      DistributionConfig.GEMFIRE_PREFIX + "member.config.statsamplingenabled.boolean";
-  private static final String MEMBER_TIME_STATS_ENABLED =
-      DistributionConfig.GEMFIRE_PREFIX + "member.config.timestatsenabled.boolean";
-
-  private static final String STATS_PROCESSCPUTIME =
-      DistributionConfig.GEMFIRE_PREFIX + "member.stat.processcputime.long";
-  private static final String STATS_CPUS =
-      DistributionConfig.GEMFIRE_PREFIX + "member.stat.cpus.int";
-  private static final String STATS_USEDMEMORY =
-      DistributionConfig.GEMFIRE_PREFIX + "member.stat.usedmemory.long";
-  private static final String STATS_MAXMEMORY =
-      DistributionConfig.GEMFIRE_PREFIX + "member.stat.maxmemory.long";
-  private static final String STATS_GETS =
-      DistributionConfig.GEMFIRE_PREFIX + "member.stat.gets.int";
-  private static final String STATS_GETTIME =
-      DistributionConfig.GEMFIRE_PREFIX + "member.stat.gettime.long";
-  private static final String STATS_PUTS =
-      DistributionConfig.GEMFIRE_PREFIX + "member.stat.puts.int";
-  private static final String STATS_PUTTIME =
-      DistributionConfig.GEMFIRE_PREFIX + "member.stat.puttime.long";
-
-  private static final String REGION_NAME =
-      DistributionConfig.GEMFIRE_PREFIX + "region.name.string";
-  private static final String REGION_PATH =
-      DistributionConfig.GEMFIRE_PREFIX + "region.path.string";
-  private static final String REGION_SCOPE =
-      DistributionConfig.GEMFIRE_PREFIX + "region.scope.string";
-  private static final String REGION_DATAPOLICY =
-      DistributionConfig.GEMFIRE_PREFIX + "region.datapolicy.string";
-  private static final String REGION_INTERESTPOLICY =
-      DistributionConfig.GEMFIRE_PREFIX + "region.interestpolicy.string";
-  private static final String REGION_ENTRYCOUNT =
-      DistributionConfig.GEMFIRE_PREFIX + "region.entrycount.int";
-  private static final String REGION_DISKATTRS =
-      DistributionConfig.GEMFIRE_PREFIX + "region.diskattrs.string";
-
-  private static final String CLIENT_ID = DistributionConfig.GEMFIRE_PREFIX + "client.id.string";
-  private static final String CLIENT_NAME =
-      DistributionConfig.GEMFIRE_PREFIX + "client.name.string";
-  private static final String CLIENT_HOST =
-      DistributionConfig.GEMFIRE_PREFIX + "client.host.string";
-  private static final String CLIENT_QUEUESIZE =
-      DistributionConfig.GEMFIRE_PREFIX + "client.queuesize.int";
-  private static final String CLIENT_STATS_GETS =
-      DistributionConfig.GEMFIRE_PREFIX + "client.stats.gets.int";
-  private static final String CLIENT_STATS_PUTS =
-      DistributionConfig.GEMFIRE_PREFIX + "client.stats.puts.int";
-  private static final String CLIENT_STATS_CACHEMISSES =
-      DistributionConfig.GEMFIRE_PREFIX + "client.stats.cachemisses.int";
-  private static final String CLIENT_STATS_CPUUSAGE =
-      DistributionConfig.GEMFIRE_PREFIX + "client.stats.cpuusage.long";
-  private static final String CLIENT_STATS_CPUS =
-      DistributionConfig.GEMFIRE_PREFIX + "client.stats.cpus.int";
-  private static final String CLIENT_STATS_UPDATETIME =
-      DistributionConfig.GEMFIRE_PREFIX + "client.stats.updatetime.long";
-  private static final String CLIENT_STATS_THREADS =
-      DistributionConfig.GEMFIRE_PREFIX + "client.stats.threads.int";
-
-  /**
-   * 
-   * @param memberId
-   * @return All the required details for a member with given memberId
-   * @throws OperationsException
-   */
-  public Map<String, Object> getMemberDetails(String memberId) throws OperationsException {
-    Map<String, Object> allDetails = new TreeMap<String, Object>();
-
-    if (memberId != null) {
-      try {
-        SystemMemberJmx member = findMember(memberId);
-        if (member != null) {
-          SystemMemberCacheJmxImpl cache = (SystemMemberCacheJmxImpl) member.getCache();
-          GemFireMemberStatus snapshot = cache.getSnapshot();
-          boolean isServer = snapshot.getIsServer();
-          boolean isGatewayHub = snapshot.getIsGatewayHub();
-
-          // 1. Member info
-          allDetails.put(MEMBER_ID, member.getId());
-          allDetails.put(MEMBER_NAME, member.getName());
-          String host = member.getHost();// from of GemFireVM.getHost
-          InetAddress hostAddr = member.getHostAddress();
-          // possibility of null host address
-          if (hostAddr != null) {
-            host = hostAddr.getHostName();
-          }
-          allDetails.put(MEMBER_HOST, host);
-          allDetails.put(MEMBER_UPTIME, snapshot.getUpTime());
-          allDetails.put(IS_SERVER, isServer);
-          allDetails.put(IS_GATEWAY, isGatewayHub);
-
-          String memberType = "";
-          if (member instanceof CacheServerJmxImpl) {
-            memberType = TYPE_NAME_CACHESERVER;
-          } else {// Mark it of Application type if neither a gateway hub nor a server
-            memberType = TYPE_NAME_APPLICATION;
-          }
-          // if (isGatewayHub) {
-          // memberType = TYPE_NAME_GATEWAYHUB;
-          // } else if (isServer) {
-          // memberType = TYPE_NAME_CACHESERVER;
-          // } else {//Mark it of Application type if neither a gateway nor a server
-          // memberType = TYPE_NAME_APPLICATION;
-          // }
-          allDetails.put(MEMBER_TYPE, memberType);
-
-          // 2. Region info
-          Map<String, ObjectName> existingRegionMbeans = getExistingRegionMbeansFullPaths(memberId);
-          allDetails.put(MEMBER_REGIONS, getAllRegionsDetails(cache, existingRegionMbeans));
-          existingRegionMbeans.clear();
-
-          // 3. Clients info
-          allDetails.put(MEMBER_CLIENTS, getClientDetails(snapshot));
-
-          boolean statSamplingEnabled = true;
-          // assuming will never return as per current implementation
-          ConfigurationParameter[] configParams = member.getConfiguration();
-          for (ConfigurationParameter configParam : configParams) {
-            if (STATISTIC_SAMPLING_ENABLED.equals(configParam.getName())) {
-              allDetails.put(MEMBER_STATSAMPLING_ENABLED, configParam.getValue());
-              statSamplingEnabled = Boolean.parseBoolean("" + configParam.getValue());
-            } else if (ENABLE_TIME_STATISTICS.equals(configParam.getName())) {
-              allDetails.put(MEMBER_TIME_STATS_ENABLED, configParam.getValue());
-            }
-          }
-
-          // 5. Stats info
-          allDetails.putAll(getRequiredStats(member, statSamplingEnabled));
-
-          SystemMemberCacheServer[] cacheServers = cache.getCacheServers();
-          // attempt refreshing the cache info once
-          if (cacheServers.length == 0) {
-            cache.refresh();
-            cacheServers = cache.getCacheServers();
-          }
-          Integer memberCacheServerPort = Integer.valueOf(0);
-          if (cacheServers.length != 0) {
-            /*
-             * Taking the first cache server port. We don't recommend multiple cache severs for a
-             * cache.
-             */
-            memberCacheServerPort = Integer.valueOf(cacheServers[0].getPort());
-          }
-          allDetails.put(MEMBER_PORT, memberCacheServerPort);
-        }
-
-      } catch (AdminException e) {
-        logger.warn(LocalizedMessage.create(
-            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0_FOR_MEMBER_1,
-            new Object[] {"getMemberDetails", memberId}), e);
-        throw new OperationsException(e.getMessage());
-      } catch (Exception e) {
-        logger.warn(LocalizedMessage.create(
-            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_FOR_OPERATION_0_FOR_MEMBER_1,
-            new Object[] {"getMemberDetails", memberId}), e);
-        throw new OperationsException(e.getMessage());
-      }
-    }
-
-    return allDetails;
-  }
-
-  /**
-   * 
-   * @param snapshot
-   * @return Map of client details
-   */
-  @SuppressWarnings("rawtypes")
-  private Map<String, Map<String, ?>> getClientDetails(GemFireMemberStatus snapshot) {
-    Map<String, Map<String, ?>> clientsInfo = new LinkedHashMap<String, Map<String, ?>>();
-
-    Set connectedClients = snapshot.getConnectedClients();
-    if (!connectedClients.isEmpty()) {
-      Map clientHealthStatsMap = snapshot.getClientHealthStats();
-
-      for (Iterator iterator = connectedClients.iterator(); iterator.hasNext();) {
-        Map<String, Object> clientData = new HashMap<String, Object>();
-        String clientId = (String) iterator.next();
-        String host = snapshot.getClientHostName(clientId);
-        clientData.put(CLIENT_ID, clientId);
-        clientData.put(CLIENT_NAME, extractClientName(clientId, host));
-        clientData.put(CLIENT_HOST, host);
-        clientData.put(CLIENT_QUEUESIZE, snapshot.getClientQueueSize(clientId));
-
-        ClientHealthStats clientHealthStats =
-            (ClientHealthStats) clientHealthStatsMap.get(clientId);
-        if (clientHealthStats != null) {
-          clientData.put(CLIENT_STATS_GETS, clientHealthStats.getNumOfGets());
-          clientData.put(CLIENT_STATS_PUTS, clientHealthStats.getNumOfPuts());
-          clientData.put(CLIENT_STATS_CACHEMISSES, clientHealthStats.getNumOfMisses());
-          clientData.put(CLIENT_STATS_CPUUSAGE, clientHealthStats.getProcessCpuTime());
-          clientData.put(CLIENT_STATS_CPUS, clientHealthStats.getCpus());
-          clientData.put(CLIENT_STATS_UPDATETIME, clientHealthStats.getUpdateTime().getTime());
-          clientData.put(CLIENT_STATS_THREADS, clientHealthStats.getNumOfThreads());
-        } else {
-          clientData.put(CLIENT_STATS_GETS, Integer.valueOf(0));
-          clientData.put(CLIENT_STATS_PUTS, Integer.valueOf(0));
-          clientData.put(CLIENT_STATS_CACHEMISSES, Integer.valueOf(0));
-          clientData.put(CLIENT_STATS_CPUUSAGE, Long.valueOf(0));
-          clientData.put(CLIENT_STATS_CPUS, Integer.valueOf(0));
-          clientData.put(CLIENT_STATS_UPDATETIME, Long.valueOf(0));
-          clientData.put(CLIENT_STATS_THREADS, Integer.valueOf(0));
-        }
-
-        clientsInfo.put(clientId, clientData);
-      }
-    }
-
-    return clientsInfo;
-  }
-
-  /**
-   * Returns a Map containing information about regions.
-   * 
-   * @param cache Reference to an MBean representing a Cache on a member
-   * @param existingRegionMbeans Map of Path against Region MBean ObjectNames
-   * @return Map of all region details
-   * @throws OperationsException if fails to retrieve
-   */
-  private Map<String, Map<String, ?>> getAllRegionsDetails(SystemMemberCacheJmxImpl cache,
-      Map<String, ObjectName> existingRegionMbeans) throws OperationsException {
-    Map<String, Map<String, ?>> regionsInfo = new TreeMap<String, Map<String, ?>>();
-
-    if (cache != null) {
-      try {
-        RegionSubRegionSnapshot regionSnapshot = cache.getRegionSnapshot();
-        collectAllRegionsDetails(cache, regionSnapshot, regionsInfo, existingRegionMbeans);
-      } catch (AdminException e) {
-        logger.warn(LocalizedMessage.create(LocalizedStrings.ONE_ARG,
-            "Exception occurred while getting region details."), e);
-        throw new OperationsException(e.getMessage());
-      } catch (Exception e) {
-        logger.warn(LocalizedMessage.create(LocalizedStrings.ONE_ARG,
-            "Exception occurred while getting region details."), e);
-        throw new OperationsException(e.getMessage());
-      }
-    }
-
-    return regionsInfo;
-  }
-
-  /**
-   * Collects all the region details from the RegionSubRegionSnapshot instance passed and the Cache
-   * MBean. Checks in the set of existingRegionMbeans before initializing Region Mbeans if there are
-   * not initialized yet.
-   * 
-   * @param cache Cache MBean instance
-   * @param regionSnapshot RegionSubRegionSnapshot instance
-   * @param regionsInfo Map of regions information that gets populated recursively
-   * @param existingRegionMbeans Map of ObjectNames of existing region MBeans
-   * @throws AdminException if unable to initialize region MBean
-   * @throws OperationsException if fails to retrieve the Region MBean attribute info
-   * @throws MBeanException if fails to retrieve the Region MBean attribute info
-   * @throws ReflectionException if fails to retrieve the Region MBean attribute info
-   */
-  @SuppressWarnings("rawtypes")
-  private void collectAllRegionsDetails(SystemMemberCacheJmxImpl cache,
-      RegionSubRegionSnapshot regionSnapshot, Map<String, Map<String, ?>> regionsInfo,
-      Map<String, ObjectName> existingRegionMbeans)
-      throws AdminException, OperationsException, MBeanException, ReflectionException {
-    String fullPath = regionSnapshot.getFullPath();
-    if (!fullPath.equals(PLACE_HOLDER_ROOT_REGION)) {
-      fullPath = fullPath.substring(PLACE_HOLDER_ROOT_REGION.length() - 1);
-      String name = regionSnapshot.getName();
-      Integer entryCount = Integer.valueOf(regionSnapshot.getEntryCount());
-      Map<String, Object> details = new TreeMap<String, Object>();
-      details.put(REGION_NAME, name);
-      details.put(REGION_PATH, fullPath);
-      details.put(REGION_ENTRYCOUNT, entryCount);
-
-      ObjectName regionObjectName = existingRegionMbeans.get(fullPath);
-      if (regionObjectName == null) {// initialize if has not yet been
-        regionObjectName = cache.manageRegion(fullPath);
-      }
-
-      Object attribute = getAttribute(regionObjectName, "scope", NOT_AVAILABLE);
-      attribute = attribute != null ? attribute.toString() : attribute;
-      details.put(REGION_SCOPE, attribute);
-
-      attribute = getAttribute(regionObjectName, "dataPolicy", NOT_AVAILABLE);
-      attribute = attribute != null ? attribute.toString() : attribute;
-      details.put(REGION_DATAPOLICY, attribute);
-
-      SubscriptionAttributes interestPolicyAttr =
-          (SubscriptionAttributes) getAttribute(regionObjectName, "subscriptionAttributes", null);
-      String interestPolicyStr = NOT_AVAILABLE;
-      if (interestPolicyAttr != null) {
-        InterestPolicy interestPolicy = interestPolicyAttr.getInterestPolicy();
-        if (interestPolicy != null) {
-          interestPolicyStr = interestPolicy.toString();
-        }
-      }
-      details.put(REGION_INTERESTPOLICY, interestPolicyStr);
-
-      attribute = getAttribute(regionObjectName, "diskWriteAttributes", NOT_AVAILABLE);
-      attribute = attribute != null ? attribute.toString() : attribute;
-      details.put(REGION_DISKATTRS, attribute);
-
-      regionsInfo.put(fullPath, details);
-    }
-
-    Set subRegionSnapshots = regionSnapshot.getSubRegionSnapshots();
-
-    for (Iterator iterator = subRegionSnapshots.iterator(); iterator.hasNext();) {
-      RegionSubRegionSnapshot subRegion = (RegionSubRegionSnapshot) iterator.next();
-      collectAllRegionsDetails(cache, subRegion, regionsInfo, existingRegionMbeans);
-    }
-  }
-
-  /**
-   * Checks if the given host name string contains ':' as in IPv6 host address.
-   * 
-   * @param host host name string
-   * @return true if the host string contains ':', false otherwise
-   */
-  private static boolean isIPv6(String host) {
-    return host.contains(":");
-  }
-
-  /**
-   * Checks if the given host name is actually a String representation of an IPv4 address.
-   * 
-   * @param host host name string
-   * @return true if given host name is a String representation of an IPv4 address, false otherwise
-   */
-  private static boolean isIPv4(String host) {
-    String regex = "\\d{1,3}.\\d{1,3}.\\d{1,3}.\\d{1,3}";
-
-    return host.matches(regex);
-  }
-
-  /**
-   * Excludes the host name from the client id and returns the String. If the host name can not be
-   * detected, returns an empty string. Typically, the client id looks like:
-   * HOST(VM_PID:VM_KIND):PORT:RANDOM_STRING:CLIENT_NAME
-   * 
-   * Extracts the client name from the client id. If the client id is not in the expected format,
-   * returns 'N/A'
-   * 
-   * @param clientId string identifier for a client
-   * @param host host name (FQDN) the client is running on
-   * @return name extracted from given client id
-   */
-  /*
-   * Some examples of Client Id format: (1) Java Client:
-   * nase(21716:loner):51789:42e9a0bf:client_nase_21716 nase(2560:loner):2:7a84729a:Feeder
-   * 
-   * (2) Native Client: nase(21045:loner):2:GFNative_OnNnEpyRWL:ExampleDistributedSystem
-   * 
-   * (3) IPv6 Host whose name can not be resolved:
-   * fdf0:76cf:a0ed:9449:0:0:0:1001(21716:loner):51789:42e9a0b:client_nase_21716
-   * fdf0:76cf:a0ed:9449:0:0:0:1001:51789:42e9a0b:client_nase_21716
-   */
-  private static String extractClientName(String clientId, String host) {
-    /* This isIPv6, isIPv4, extractClientName is taken from GFMon code base */
-    String hostExcludedId = "";
-    if ((isIPv6(host) || isIPv4(host)) && clientId.startsWith(host)) {
-      hostExcludedId = clientId.substring(host.length());
-    } else {
-      int firstDotIndex = host.indexOf(".");
-      if (firstDotIndex != -1) {
-        String hostShortName = host.substring(0, firstDotIndex);
-        hostExcludedId = clientId.substring(hostShortName.length());
-      }
-    }
-
-    String vmPIDAndKindRegex = "\\(\\w+:\\w+\\)";
-    String regex = "(\\<ec\\>)?:[0-9]+(:\\w+){2}+";
-    String name = NOT_AVAILABLE;
-    String temp = hostExcludedId;
-
-    int openIndex = temp.indexOf("(");
-    if (openIndex != -1) {
-      regex = vmPIDAndKindRegex + regex;
-    }
-
-    if (temp.matches(regex)) {
-      String[] splitted = temp.split(":");
-      name = splitted[splitted.length - 1];
-    }
-
-    return name;
-  }
-
-  /**
-   * Returns a Map of all the statistics required for Hyperic currently. It relies on the attribute
-   * of the StatisticsResource Mbeans.
-   * 
-   * @param member instance for which the stats are needed
-   * @return Map of all the statistics required for Hyperic currently.
-   * @throws OperationsException exceptions thrown while retrieving the attributes
-   */
-  private Map<String, Object> getRequiredStats(SystemMemberJmx member, boolean statSamplingEnabled)
-      throws OperationsException {
-    Map<String, Object> statDetails = new TreeMap<String, Object>();
-
-    try {
-      if (!statSamplingEnabled) {
-        statDetails.put(STATS_PROCESSCPUTIME, NOT_AVAILABLE_NUMBER);
-        statDetails.put(STATS_CPUS, NOT_AVAILABLE_NUMBER);
-        statDetails.put(STATS_MAXMEMORY, NOT_AVAILABLE_NUMBER);
-        statDetails.put(STATS_USEDMEMORY, NOT_AVAILABLE_NUMBER);
-        statDetails.put(STATS_GETS, NOT_AVAILABLE_NUMBER);
-        statDetails.put(STATS_GETTIME, NOT_AVAILABLE_NUMBER);
-        statDetails.put(STATS_PUTS, NOT_AVAILABLE_NUMBER);
-        statDetails.put(STATS_PUTTIME, NOT_AVAILABLE_NUMBER);
-      } else {
-        MBeanServer mBeanServer = agent.getMBeanServer();
-        Number defaultVal = NOT_AVAILABLE_NUMBER;
-        Number processCpuTime = defaultVal;
-        Number cpus = defaultVal;
-        Number maxMemory = defaultVal;
-        Number usedMemory = defaultVal;
-        Number gets = defaultVal;
-        Number getTime = defaultVal;
-        Number puts = defaultVal;
-        Number putTime = defaultVal;
-
-        ObjectName[] vmMemoryUsageStats = getExistingStats(member.getId(), "vmHeapMemoryStats");
-        ObjectName[] vmStats = getExistingStats(member.getId(), "vmStats");
-        ObjectName[] cachePerfStats = getExistingStats(member.getId(), "cachePerfStats");
-        boolean needToReinit = false;
-        if (vmMemoryUsageStats.length == 0 || vmStats.length == 0 || cachePerfStats.length == 0) {
-          // if the StatisticResource MBeans are not created
-          needToReinit = true;
-        }
-        if (!needToReinit) {
-          /*
-           * To handle a case when the StatisticResource MBeans are created but not registered with
-           * RefreshTimer. If VMMemoryUsageStats are present, maxMemory should always be non-zero.
-           */
-          for (int i = 0; i < vmMemoryUsageStats.length; i++) {// ideally there should be a single
-                                                               // instance
-            String type = (String) mBeanServer.getAttribute(vmMemoryUsageStats[i], "type");
-
-            if ("VMMemoryUsageStats".equals(type)) { // first instance that has Statistics Type name
-              maxMemory = (Number) getAttribute(vmMemoryUsageStats[i], "maxMemory", defaultVal);
-              break;
-            }
-          }
-
-          needToReinit = 0 == maxMemory.longValue();
-        }
-
-        if (needToReinit) {
-          logger.info(LocalizedMessage.create(
-              LocalizedStrings.MemberInfoWithStatsMBean_REINITIALIZING_STATS_FOR_0,
-              member.getId()));
-          initStats(member);
-
-          vmMemoryUsageStats = getExistingStats(member.getId(), "vmHeapMemoryStats");
-          vmStats = getExistingStats(member.getId(), "vmStats");
-          cachePerfStats = getExistingStats(member.getId(), "cachePerfStats");
-        }
-
-        for (int i = 0; i < vmMemoryUsageStats.length; i++) {// ideally there should be a single
-                                                             // instance
-          String type = (String) mBeanServer.getAttribute(vmMemoryUsageStats[i], "type");
-
-          if ("VMMemoryUsageStats".equals(type)) { // first instance that has Statistics Type name
-            maxMemory = (Number) getAttribute(vmMemoryUsageStats[i], "maxMemory", defaultVal);
-            usedMemory = (Number) getAttribute(vmMemoryUsageStats[i], "usedMemory", defaultVal);
-            break;
-          }
-        }
-
-        for (int i = 0; i < vmStats.length; i++) {// ideally there should be a single instance
-          String type = (String) mBeanServer.getAttribute(vmStats[i], "type");
-
-          if ("VMStats".equals(type)) { // first instance that has Statistics Type name
-            processCpuTime = (Number) getAttribute(vmStats[i], "processCpuTime", defaultVal);
-            cpus = (Number) getAttribute(vmStats[i], "cpus", defaultVal);
-            break;
-          }
-        }
-
-        for (int i = 0; i < cachePerfStats.length; i++) {// ideally there should be a single
-                                                         // instance
-          String type = (String) mBeanServer.getAttribute(cachePerfStats[i], "type");
-
-          if ("CachePerfStats".equals(type)) { // first instance that has Statistics Type name
-            gets = (Number) getAttribute(cachePerfStats[i], "gets", defaultVal);
-            getTime = (Number) getAttribute(cachePerfStats[i], "getTime", defaultVal);
-            puts = (Number) getAttribute(cachePerfStats[i], "puts", defaultVal);
-            putTime = (Number) getAttribute(cachePerfStats[i], "putTime", defaultVal);
-            break;
-          }
-        }
-
-        statDetails.put(STATS_PROCESSCPUTIME, processCpuTime == NOT_AVAILABLE_NUMBER
-            ? NOT_AVAILABLE_NUMBER : processCpuTime.longValue());
-        statDetails.put(STATS_CPUS,
-            cpus == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : cpus.intValue());
-        statDetails.put(STATS_MAXMEMORY,
-            maxMemory == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : maxMemory.longValue());
-        statDetails.put(STATS_USEDMEMORY,
-            usedMemory == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : usedMemory.longValue());
-        statDetails.put(STATS_GETS,
-            gets == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : gets.intValue());
-        statDetails.put(STATS_GETTIME,
-            getTime == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : getTime.intValue());
-        statDetails.put(STATS_PUTS,
-            puts == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : puts.intValue());
-        statDetails.put(STATS_PUTTIME,
-            putTime == NOT_AVAILABLE_NUMBER ? NOT_AVAILABLE_NUMBER : putTime.longValue());
-      }
-    } catch (Exception e) {
-      logger.warn(e.getMessage(), e);
-      throw new OperationsException(e.getMessage());
-    }
-
-    return statDetails;
-  }
-
-  /**
-   * Returns attribute with given attribute name on MBean with given ObjectName.
-   * 
-   * 
-   * @param objectName ObjectName for the MBean
-   * @param attribute attribute name
-   * @param unavailableValue return this value if the attribute value is null
-   * @return value of attribute with given attribute name
-   * @throws OperationsException if attribute is not found for MBean with this ObjectName or MBean
-   *         instance is not found
-   * @throws MBeanException if MBeans getter throws exception
-   * @throws ReflectionException thrown when trying to invoke the setter.
-   */
-  private Object getAttribute(ObjectName objectName, String attribute, Object unavailableValue)
-      throws OperationsException, MBeanException, ReflectionException {
-    /* NOTE: callers methods rely on non-null value being returned */
-    Object value = null;
-
-    MBeanServer mBeanServer = agent.getMBeanServer();
-    value = mBeanServer.getAttribute(objectName, attribute);
-
-    value = (value != null) ? value : unavailableValue;
-
-    return value;
-  }
-
-  /**
-   * Return Map of region full against the ObjectName of existing region MBeans.
-   * 
-   * @param memberId string identifier of a member
-   * @return Map of region path vs ObjectName for existing region MBeans
-   * @throws MalformedObjectNameException If the query expression used is not valid
-   */
-  private Map<String, ObjectName> getExistingRegionMbeansFullPaths(String memberId)
-      throws MalformedObjectNameException {
-    Map<String, ObjectName> pathsToObjName = new HashMap<String, ObjectName>();
-
-    if (memberId != null && memberId.trim().length() != 0) {
-      Object[] params = new Object[] {MBeanUtil.makeCompliantMBeanNameProperty(memberId)};
-      Set<ObjectName> queryNames = queryObjectNames(REGION_QUERY_EXPRESSION, params);
-      for (ObjectName objectName : queryNames) {
-        pathsToObjName.put(objectName.getKeyProperty("path"), objectName);
-      }
-    }
-
-    return pathsToObjName;
-  }
-
-  /**
-   * Returns an array of ObjectNames existing statistics types MBeans
-   * 
-   * @param memberId string identifier of a member
-   * @param name text id of the stats which appears in the stats ObjectName as name keyProperty
-   * @return Array of Stats MBean ObjectNames
-   * @throws MalformedObjectNameException If the query expression used is not valid
-   */
-  private ObjectName[] getExistingStats(String memberId, String name)
-      throws MalformedObjectNameException {
-    ObjectName[] statObjectNames = new ObjectName[0];
-
-    if (memberId != null && memberId.trim().length() != 0) {
-      Object[] params = new Object[] {MBeanUtil.makeCompliantMBeanNameProperty(memberId), name};
-      Set<ObjectName> queryNames = queryObjectNames(STATS_QUERY_EXPRESSION, params);
-      statObjectNames = new ObjectName[queryNames.size()];
-      statObjectNames = queryNames.toArray(statObjectNames);
-    }
-
-    return statObjectNames;
-  }
-
-  /**
-   * Queries the MBean server with the string formed using placing the params in the parameterized
-   * string passed as queryStr.
-   * 
-   * @param queryStr parameterized string
-   * @param params params to put in the string
-   * @return results of an ObjectName query
-   * @throws MalformedObjectNameException If the query expression ObjectName formed is not valid
-   */
-  private Set<ObjectName> queryObjectNames(String queryStr, Object... params)
-      throws MalformedObjectNameException {
-    Set<ObjectName> queried = Collections.emptySet();
-
-    queryStr = MessageFormat.format(queryStr, params);
-    ObjectName queryExp = ObjectName.getInstance(queryStr);
-    queried = agent.getMBeanServer().queryNames(null, queryExp);
-
-    return queried;
-  }
-
-
-  /* *************************************************************************/
-  /* **************** NOTIFICATION EMITTER IMPLEMENTATION ********************/
-  /* *************************************************************************/
-
-  /**
-   * @see NotificationEmitter#addNotificationListener(NotificationListener, NotificationFilter,
-   *      Object)
-   */
-  public void addNotificationListener(NotificationListener listener, NotificationFilter filter,
-      Object handback) throws IllegalArgumentException {
-    forwarder.addNotificationListener(listener, filter, handback);
-  }
-
-  /**
-   * @see NotificationEmitter#removeNotificationListener(NotificationListener)
-   */
-  public void removeNotificationListener(NotificationListener listener)
-      throws ListenerNotFoundException {
-    forwarder.removeNotificationListener(listener);
-  }
-
-  /**
-   * @see NotificationEmitter#getNotificationInfo()
-   */
-  public MBeanNotificationInfo[] getNotificationInfo() {
-    return getMBeanInfo().getNotifications();
-  }
-
-  /**
-   * @see NotificationEmitter#removeNotificationListener(NotificationListener, NotificationFilter,
-   *      Object)
-   */
-  public void removeNotificationListener(NotificationListener listener, NotificationFilter filter,
-      Object handback) throws ListenerNotFoundException {
-    forwarder.removeNotificationListener(listener, filter, handback);
-  }
-
-}
-
-
-/**
- * This class acts as a hub for the Notifications defined on AdminDistributedSystem & SystemMember
- * MBeans. This acts as a listener for these notifications and broadcasts them as notifications from
- * the {@link MemberInfoWithStatsMBean} MBean. This class extends
- * {@link NotificationBroadcasterSupport} only to have the functionality to send notifications.
- * 
- * 
- * @since GemFire 6.5
- */
-class NotificationForwarder extends NotificationBroadcasterSupport implements NotificationListener {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /* sequence generator for notifications from GemFireTypesWrapper MBean */
-  private static AtomicLong notificationSequenceNumber = new AtomicLong();
-
-  /* reference to the MBeanServer instance */
-  private MBeanServer mBeanServer;
-
-  /**
-   * Default Constructor
-   * 
-   * @param mBeanServer reference to the MBeanServer instance
-   */
-  /* default */ NotificationForwarder(MBeanServer mBeanServer) {
-    this.mBeanServer = mBeanServer;
-  }
-
-  /**
-   * Handles notifications as: 1. Member Joined: Registers this NotificationForwarder as a
-   * notification listener for Cache/Region Notifications. 2. Member Left/Crashed: Unregisters this
-   * NotificationForwarder as a notification listener for Cache/Region Notifications. 3.
-   * AdminDistributedSystem Disconnected: Unregisters this NotificationForwarder as a notification
-   * listener for member Notifications.
-   * 
-   * Forwards the notifications to the JMX Clients that have registered for notifications on this
-   * MBean
-   * 
-   * @param notification notification to be handled
-   * @param handback handback object used while NotificationForwarder was registered
-   * 
-   * @see NotificationListener#handleNotification(Notification, Object)
-   */
-  public void handleNotification(Notification notification, Object handback) {
-    Object notifSource = notification.getSource();
-    if (AdminDistributedSystemJmxImpl.NOTIF_MEMBER_JOINED.equals(notification.getType())) {
-      ObjectName source = (ObjectName) notifSource;
-      // initialize statistics/register with refreshTimer for new member
-      String[] noArgs = {};
-      try {
-        ObjectName[] stats =
-            (ObjectName[]) mBeanServer.invoke(source, "manageStats", noArgs, noArgs);
-        if (stats != null) {
-          for (ObjectName stat : stats) {
-            mBeanServer.invoke(stat, "getStatistics", noArgs, noArgs);
-          }
-        }
-        logger.debug("getStatistics call completed with no exceptions.");
-      } catch (ReflectionException e) {
-        logger.info(LocalizedMessage.create(
-            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INITIALIZING_STATISICS_FOR_0,
-            source.toString()), e);
-      } catch (MBeanException e) {
-        logger.info(LocalizedMessage.create(
-            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INITIALIZING_STATISICS_FOR_0,
-            source.toString()), e);
-      } catch (InstanceNotFoundException e) {
-        logger.info(LocalizedMessage.create(
-            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_INITIALIZING_STATISICS_FOR_0,
-            source.toString()), e);
-      }
-      // register this listener for joined member's cache/region notifications
-      try {
-        registerNotificationListener(source);
-      } catch (OperationsException e) {
-        logger.info(LocalizedMessage.create(
-            LocalizedStrings.MemberInfoWithStatsMBean_EXCEPTION_WHILE_REGISTERING_NOTIFICATION_LISTENER_FOR_0,
-            source.toString()), e);
-      }
-    } /*
-       * else if (AdminDistributedSystemJmxImpl.NOTIF_MEMBER_LEFT.equals(notification.getType()) ||
-       * AdminDistributedSystemJmxImpl.NOTIF_MEMBER_CRASHED.equals(notification.getType())) {
-       * ObjectName source = (ObjectName) notifSource; //unregister this listener from left member's
-       * cache/region notifications try { unregisterNotificationListener(source); } catch
-       * (OperationsException e) { logwriter.info(LocalizedMessage.create(LocalizedStrings.
-       * MemberInfoWithStatsMBean_EXCEPTION_WHILE_UNREGISTERING_NOTIFICATION_LISTENER_FOR_0,
-       * source.toString(), e); } } else if
-       * (AdminDistributedSystemJmxImpl.NOTIF_ADMIN_SYSTEM_DISCONNECT.equals(notification.getType())
-       * ) { String source = (String) notifSource; //This notification does not have ObjectName as a
-       * source. try { ObjectName instance = ObjectName.getInstance(source);
-       * unregisterNotificationListener(instance); } catch (OperationsException e) {
-       * logwriter.info(LocalizedMessage.create(LocalizedStrings.
-       * MemberInfoWithStatsMBean_EXCEPTION_WHILE_UNREGISTERING_NOTIFICATION_LISTENER_FOR_0,
-       * source.toString(), e); } catch (NullPointerException e) {
-       * logwriter.info(LocalizedMessage.create(LocalizedStrings.
-       * MemberInfoWithStatsMBean_EXCEPTION_WHILE_UNREGISTERING_NOTIFICATION_LISTENER_FOR_0,
-       * source.toString(), e); } }
-       */
-    // NOTIF_ALERT is sent as is
-
-    // TODO: Check if same notification instance can be reused by simply changing the sequence
-    // number
-    notification = new Notification(notification.getType(), notifSource,
-        notificationSequenceNumber.addAndGet(1L), notification.getTimeStamp(),
-        notification.getMessage());
-
-    sendNotification(notification);
-  }
-
-  /**
-   * Registers itself as a NotificationListener for Notifications sent from MBean with the
-   * ObjectName given as source.
-   * 
-   * @param source source of notifications
-   * @throws InstanceNotFoundException The MBean name provided does not match any of the registered
-   *         MBeans.
-   */
-  /* default */void registerNotificationListener(ObjectName source)
-      throws InstanceNotFoundException {
-    mBeanServer.addNotificationListener(source, this, null/* handback */, source);
-  }
-
-  /**
-   * Unregisters itself as a NotificationListener for Notifications sent from MBean with the
-   * ObjectName given as source.
-   * 
-   * @param source source of notifications
-   * @throws InstanceNotFoundException The MBean name provided does not match any of the registered
-   *         MBeans.
-   * @throws ListenerNotFoundException The listener is not registered in the MBean.
-   */
-  /* default */void unregisterNotificationListener(ObjectName source)
-      throws InstanceNotFoundException, ListenerNotFoundException {
-    mBeanServer.removeNotificationListener(source, this);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryService.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryService.java
deleted file mode 100644
index 1ba6b84..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryService.java
+++ /dev/null
@@ -1,221 +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.admin.jmx.internal;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.ServerSocket;
-import java.net.UnknownHostException;
-import java.rmi.NoSuchObjectException;
-import java.rmi.NotBoundException;
-import java.rmi.RemoteException;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.RMIServerSocketFactory;
-import java.rmi.server.UnicastRemoteObject;
-
-/**
- * This MBean is an implementation of {@link RMIRegistryServiceMBean}.
- * 
- */
-public class RMIRegistryService implements RMIRegistryServiceMBean {
-  /* RMI Registry host */
-  private String host;
-  /* RMI Registry port */
-  private int port;
-  /* RMI Registry */
-  private Registry registry;
-  /* RMI Server Socket Factory */
-  private RMIServerSocketFactory ssf;
-  /* Whether RMI Registry is started & running */
-  private boolean isRunning;
-
-  /**
-   * Constructor to configure RMI Registry to start using default RMI Registry port:
-   * {@link Registry#REGISTRY_PORT}
-   */
-  public RMIRegistryService() {
-    this(Registry.REGISTRY_PORT);
-  }
-
-  /**
-   * Constructor to configure RMI Registry to start using given RMI Registry port.
-   * 
-   * @param port to run RMI Registry on
-   */
-  public RMIRegistryService(int port) {
-    setPort(port);
-  }
-
-  /**
-   * Constructor to configure RMI Registry to start using given RMI Registry port & host bind
-   * address.
-   * 
-   * @param host to bind RMI Registry to
-   * @param port to run RMI Registry on
-   * 
-   * @throws UnknownHostException if IP Address can not be resolved for the given host string while
-   *         creating the RMIServerSocketFactory
-   */
-  public RMIRegistryService(String host, int port) throws UnknownHostException {
-    setPort(port);
-    setHost(host);
-    if (host != null && !host.trim().equals("")) {
-      ssf = new RMIServerSocketFactoryImpl(host);
-    }
-  }
-
-  /**
-   * Returns the host on which rmiregistry listens for incoming connections
-   *
-   * @return the host on which rmiregistry listens for incoming connections
-   */
-  public String getHost() {
-    return host;
-  }
-
-  /**
-   * Sets the host on which rmiregistry listens for incoming connections
-   * 
-   * @param host the host on which rmiregistry listens for incoming connections
-   */
-  protected void setHost(String host) {
-    if (isRunning()) {
-      throw new IllegalStateException("RMIRegistryService is running, cannot change the host");
-    }
-    this.host = host;
-  }
-
-  /**
-   * Returns the port on which rmiregistry listens for incoming connections
-   * 
-   * @return the port on which rmiregistry listens for incoming connections
-   */
-  public int getPort() {
-    return port;
-  }
-
-  /**
-   * Sets the port on which rmiregistry listens for incoming connections
-   * 
-   * @param port the port on which rmiregistry listens for incoming connections
-   */
-  protected void setPort(int port) {
-    if (isRunning()) {
-      throw new IllegalStateException("RMIRegistryService is running, cannot change the port");
-    }
-    this.port = port;
-  }
-
-  /**
-   * Starts this MBean: rmiregistry can now accept incoming calls
-   * 
-   * @see #stop
-   * @see #isRunning
-   */
-  public synchronized void start() throws RemoteException {
-    if (!isRunning()) {
-      if (ssf != null) {
-        registry = LocateRegistry.createRegistry(port, null, // RMIClientSocketFactory
-            ssf); // RMIServerSocketFactory
-      } else {
-        registry = LocateRegistry.createRegistry(port);
-      }
-
-      isRunning = true;
-    }
-  }
-
-  /**
-   * Returns whether this MBean has been started and not yet stopped.
-   * 
-   * @return whether this MBean has been started and not yet stopped.
-   * @see #start
-   */
-  public synchronized boolean isRunning() {
-    return isRunning;
-  }
-
-  /**
-   * Stops this MBean: rmiregistry cannot accept anymore incoming calls
-   * 
-   * @see #start
-   */
-  public synchronized void stop() throws NoSuchObjectException {
-    if (isRunning()) {
-      isRunning = !UnicastRemoteObject.unexportObject(registry, true);
-    }
-  }
-
-  /**
-   * Returns an array of the names bound in the rmiregistry
-   * 
-   * @return an array of the names bound in the rmiregistry
-   * @see java.rmi.registry.Registry#list()
-   */
-  public String[] list() throws RemoteException {
-    if (!isRunning()) {
-      throw new IllegalStateException("RMIRegistryService is not running");
-    }
-    return registry.list();
-  }
-
-  /**
-   * Removes the binding for the specified <code>name</code> in the rmiregistry
-   * 
-   * @see java.rmi.registry.Registry#unbind(String)
-   */
-  public void unbind(String name) throws RemoteException, NotBoundException {
-    if (!isRunning()) {
-      throw new IllegalStateException("RMIRegistryService is not running");
-    }
-    registry.unbind(name);
-  }
-}
-
-
-/**
- * Custom implementation of the {@link RMIServerSocketFactory}
- * 
- */
-class RMIServerSocketFactoryImpl implements RMIServerSocketFactory {
-  /* IP address to use for creating ServerSocket */
-  private InetAddress bindAddress;
-
-  /**
-   * Constructs a RMIServerSocketFactory. The given rmiBindAddress is used to bind the ServerSockets
-   * created from this factory.
-   * 
-   * @param rmiBindAddress String representation of the address to bind the ServerSockets to
-   * 
-   * @throws UnknownHostException if IP Address can not be resolved for the given host string
-   */
-  /* default */ RMIServerSocketFactoryImpl(String rmiBindAddress) throws UnknownHostException {
-    this.bindAddress = InetAddress.getByName(rmiBindAddress);
-  }
-
-  /**
-   * Create a server socket on the specified port (port 0 indicates an anonymous port).
-   * 
-   * @param port the port number
-   * @return the server socket on the specified port
-   * @exception IOException if an I/O error occurs during server socket creation
-   */
-  public ServerSocket createServerSocket(int port) throws IOException {
-    return new ServerSocket(port, 0/* backlog - for '0' internally uses the default */,
-        bindAddress);
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryServiceMBean.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryServiceMBean.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryServiceMBean.java
deleted file mode 100644
index 9d9bfb4..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryServiceMBean.java
+++ /dev/null
@@ -1,80 +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.admin.jmx.internal;
-
-import java.rmi.NoSuchObjectException;
-import java.rmi.NotBoundException;
-import java.rmi.RemoteException;
-
-/**
- * This interface is similar to mx4j.tools.naming.NamingServiceMBean. Features that differ are: 1.
- * This MBean interface additionally provides a way to specify the host that the RMI Registry should
- * get bound to. 2. Port property can not be changed once set.
- * 
- */
-public interface RMIRegistryServiceMBean {
-
-  /**
-   * Returns the host on which rmiregistry listens for incoming connections
-   *
-   * @return the host on which rmiregistry listens for incoming connections
-   */
-  public String getHost();
-
-  /**
-   * Returns the port on which rmiregistry listens for incoming connections
-   * 
-   * @return the port on which rmiregistry listens for incoming connections
-   */
-  public int getPort();
-
-  /**
-   * Returns whether this MBean has been started and not yet stopped.
-   * 
-   * @return whether this MBean has been started and not yet stopped.
-   * @see #start
-   */
-  public boolean isRunning();
-
-  /**
-   * Starts this MBean: rmiregistry can now accept incoming calls
-   * 
-   * @see #stop
-   * @see #isRunning
-   */
-  public void start() throws RemoteException;
-
-  /**
-   * Stops this MBean: rmiregistry cannot accept anymore incoming calls
-   * 
-   * @see #start
-   */
-  public void stop() throws NoSuchObjectException;
-
-  /**
-   * Returns an array of the names bound in the rmiregistry
-   * 
-   * @return an array of the names bound in the rmiregistry
-   * @see java.rmi.registry.Registry#list()
-   */
-  public String[] list() throws RemoteException;
-
-  /**
-   * Removes the binding for the specified <code>name</code> in the rmiregistry
-   * 
-   * @see java.rmi.registry.Registry#unbind(String)
-   */
-  public void unbind(String name) throws RemoteException, NotBoundException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RefreshNotificationType.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RefreshNotificationType.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RefreshNotificationType.java
deleted file mode 100755
index 14be6cb..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RefreshNotificationType.java
+++ /dev/null
@@ -1,126 +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.admin.jmx.internal;
-
-import org.apache.commons.lang.StringUtils;
-
-/**
- * Type-safe definition for refresh notifications.
- *
- * @since GemFire 3.5
- *
- */
-public class RefreshNotificationType implements java.io.Serializable {
-  private static final long serialVersionUID = 4376763592395613794L;
-
-  /** Notify StatisticResource to refresh statistics */
-  public static final RefreshNotificationType STATISTIC_RESOURCE_STATISTICS =
-      new RefreshNotificationType("GemFire.Timer.StatisticResource.statistics.refresh", "refresh");
-
-  /** Notify SystemMember to refresh config */
-  public static final RefreshNotificationType SYSTEM_MEMBER_CONFIG =
-      new RefreshNotificationType("GemFire.Timer.SystemMember.config.refresh", "refresh");
-
-  /** Notification type for the javax.management.Notification */
-  private final transient String type;
-
-  /** Notification msg for the javax.management.Notification */
-  private final transient String msg;
-
-  // The 4 declarations below are necessary for serialization
-  /** int used as ordinal to represent this Scope */
-  public final int ordinal = nextOrdinal++;
-
-  private static int nextOrdinal = 0;
-
-  private static final RefreshNotificationType[] VALUES =
-      {STATISTIC_RESOURCE_STATISTICS, SYSTEM_MEMBER_CONFIG};
-
-  private Object readResolve() throws java.io.ObjectStreamException {
-    return VALUES[ordinal]; // Canonicalize
-  }
-
-  /** Creates a new instance of RefreshNotificationType. */
-  private RefreshNotificationType(String type, String msg) {
-    this.type = type;
-    this.msg = msg;
-  }
-
-  /** Return the RefreshNotificationType represented by specified ordinal */
-  public static RefreshNotificationType fromOrdinal(int ordinal) {
-    return VALUES[ordinal];
-  }
-
-  public String getType() {
-    return this.type;
-  }
-
-  public String getMessage() {
-    return this.msg;
-  }
-
-  /**
-   * Returns a string representation for this notification type.
-   *
-   * @return the type string for this Notification
-   */
-  @Override
-  public String toString() {
-    return this.type;
-  }
-
-  /**
-   * Indicates whether some other object is "equal to" this one.
-   *
-   * @param other the reference object with which to compare.
-   * @return true if this object is the same as the obj argument; false otherwise.
-   */
-  @Override
-  public boolean equals(Object other) {
-    if (other == this)
-      return true;
-    if (other == null)
-      return false;
-    if (!(other instanceof RefreshNotificationType))
-      return false;
-    final RefreshNotificationType that = (RefreshNotificationType) other;
-
-    if (!StringUtils.equals(this.type, that.type))
-      return false;
-    if (!StringUtils.equals(this.msg, that.msg))
-      return false;
-
-    return true;
-  }
-
-  /**
-   * Returns a hash code for the object. This method is supported for the benefit of hashtables such
-   * as those provided by java.util.Hashtable.
-   *
-   * @return the integer 0 if description is null; otherwise a unique integer.
-   */
-  @Override
-  public int hashCode() {
-    int result = 17;
-    final int mult = 37;
-
-    result = mult * result + (this.type == null ? 0 : this.type.hashCode());
-    result = mult * result + (this.msg == null ? 0 : this.msg.hashCode());
-
-    return result;
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertNotification.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertNotification.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertNotification.java
deleted file mode 100644
index 40ca11b..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertNotification.java
+++ /dev/null
@@ -1,150 +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.admin.jmx.internal;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.Serializable;
-import java.io.IOException;
-
-import org.apache.geode.DataSerializer;
-import org.apache.geode.DataSerializable;
-import org.apache.geode.internal.DataSerializableFixedID;
-import org.apache.geode.internal.Version;
-import org.apache.geode.internal.admin.StatAlert;
-import org.apache.geode.internal.admin.StatAlertDefinition;
-
-/**
- * Notification to be sent to clients (e.g GFMon2.0 ). It incorporates
- * 
- * @see StatAlert raised and also Gemfire member id which raised the alert
- * 
- * 
- * @since GemFire 5.7
- */
-public class StatAlertNotification extends StatAlert
-    implements Serializable, DataSerializable, DataSerializableFixedID {
-  private static final long serialVersionUID = -1634729103430107871L;
-  private String memberId;
-
-  public StatAlertNotification() {}
-
-  public StatAlertNotification(StatAlert statAlert, String memberId) {
-    this.setDefinitionId(statAlert.getDefinitionId());
-    this.setValues(statAlert.getValues());
-    this.setTime(statAlert.getTime());
-    this.memberId = memberId;
-  }
-
-  public int getDSFID() {
-    return DataSerializableFixedID.STAT_ALERT_NOTIFICATION;
-  }
-
-  /**
-   * @return the memberId
-   */
-  public String getMemberId() {
-    return memberId;
-  }
-
-  /**
-   * 
-   * @param id of gemfire member which raised the alert
-   */
-  public void setMemberId(String id) {
-    memberId = id;
-  }
-
-  /**
-   * @return String representation of this object
-   */
-  @Override
-  public String toString() {
-    StringBuffer buf = new StringBuffer();
-    buf.append("[");
-    for (int i = 0; i < getValues().length; i++) {
-      buf.append(getValues()[i] + ", ");
-    }
-    buf.append("]");
-    return Integer.valueOf(getDefinitionId()) + ":" + buf.toString();
-  }
-
-  /**
-   * The notification is something like this "For Member ID: <ID> [ <StatName> = <Value> .. ]"
-   * 
-   * @param defn {@link StatAlertDefinition}
-   * @return String representation of this object based on {@link StatAlertDefinition}
-   */
-  public String toString(StatAlertDefinition defn) {
-    StringBuffer buf = new StringBuffer();
-    buf.append("For Member ID: ");
-    buf.append(this.memberId);
-    buf.append("\n");
-    buf.append("[ ");
-    for (int i = 0; i < getValues().length; i++) {
-      buf.append(defn.getStatisticInfo()[i].toString() + "=" + getValues()[i] + "\n");
-    }
-    buf.append("]");
-    return getTime().toString() + ":" + buf.toString();
-  }
-
-  @Override
-  public boolean equals(Object object) {
-    if (object != null && !(object instanceof StatAlertNotification)) {
-      return false;
-    }
-
-    StatAlertNotification other = (StatAlertNotification) object;
-
-    int defId = getDefinitionId();
-
-    if (defId != -1 && defId == other.getDefinitionId() && memberId != null
-        && memberId.equals(other.getMemberId())) {
-      return true;
-    }
-
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    return memberId.hashCode();
-  }
-
-  public void toData(DataOutput out) throws IOException {
-    // Do not modify StatAlert to allow 57 cacheservers to function with 57+ agent
-    // However, update of a new StatAlertDefn on 57 server from 57+ agent not covered with this
-    DataSerializer.writePrimitiveInt(this.getDefinitionId(), out);
-    DataSerializer.writeDate(this.getTime(), out);
-    DataSerializer.writeObjectArray(this.getValues(), out);
-
-    DataSerializer.writeString(this.memberId, out);
-  }
-
-  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
-    // Do not modify StatAlert to allow 57 cacheservers to function with 57+ agent
-    // However, update of a new StatAlertDefn on 57 server from 57+ agent not covered with this
-    this.setDefinitionId(DataSerializer.readPrimitiveInt(in));
-    this.setTime(DataSerializer.readDate(in));
-    this.setValues((Number[]) DataSerializer.readObjectArray(in));
-
-    this.memberId = DataSerializer.readString(in);
-  }
-
-  @Override
-  public Version[] getSerializationVersions() {
-    return null;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertsAggregator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertsAggregator.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertsAggregator.java
deleted file mode 100644
index 106fa35..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/StatAlertsAggregator.java
+++ /dev/null
@@ -1,111 +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.admin.jmx.internal;
-
-import org.apache.geode.internal.admin.GemFireVM;
-import org.apache.geode.internal.admin.StatAlert;
-import org.apache.geode.internal.admin.StatAlertDefinition;
-
-/**
- * This interface represents an Aggregator entity and resides in JMXAgent. Responsibilities are as
- * follows:
- * <ol>
- * <li>set AlertsManager in the newly joined members
- * <li>create/update/remove alert
- * <li>manage refresh interval
- * <li>process notification from members
- * <li>Aggregate stats & make available for clients thro' JMXAgent
- * </ol>
- * 
- */
-public interface StatAlertsAggregator {
-
-  /**
-   * This method can be used to get an alert definition.
-   * 
-   * @param alertDefinition StatAlertDefinition to retrieve
-   * @return StatAlertDefinition
-   */
-  public StatAlertDefinition getAlertDefinition(StatAlertDefinition alertDefinition);
-
-  /**
-   * This method can be used to retrieve all available stat alert definitions.
-   * 
-   * @return An array of all available StatAlertDefinition objects
-   */
-  public StatAlertDefinition[] getAllStatAlertDefinitions();
-
-  /**
-   * This method can be used to update alert definition for the Stat mentioned. This method should
-   * update the collection maintained at the aggregator and should notify members for the newly
-   * added alert definitions.
-   * <p>
-   * A new alert definition will be created if matching one not found.
-   * 
-   * @param alertDefinition alertDefinition to be updated
-   */
-  public void updateAlertDefinition(StatAlertDefinition alertDefinition);
-
-  /**
-   * This method can be used to remove alert definition for the Stat mentioned.
-   * <p>
-   * This method should update the collection maintained at the aggregator and should notify members
-   * for the newly added alert definitions.
-   * 
-   * @param defId id of the alert definition to be removed
-   */
-  public void removeAlertDefinition(Integer defId);
-
-  /**
-   * Convenience method to check whether an alert definition is created.
-   * 
-   * @param alert alert definition to check whether already created
-   * @return true if the alert definition is already created, false otherwise
-   */
-  public boolean isAlertDefinitionCreated(StatAlertDefinition alert);
-
-  /**
-   * This method can be used to set the AlertManager for the newly joined member VM.
-   * 
-   * @param memberVM Member VM to set AlertsManager for
-   */
-  public void setAlertsManager(GemFireVM memberVM);
-
-  /**
-   * Returns the refresh interval for the Stats in seconds.
-   * 
-   * @return refresh interval for the Stats(in seconds)
-   */
-  public int getRefreshIntervalForStatAlerts();
-
-  /**
-   * This method is used to set the refresh interval for the Stats Alerts in seconds
-   * 
-   * @param refreshInterval refresh interval for the Stats(in seconds)
-   */
-  public void setRefreshIntervalForStatAlerts(int refreshInterval);
-
-  /**
-   * This method can be used to process the notifications sent by the member(s). Actual aggregation
-   * of stats can occur here. The array contains alert objects with alert def. ID & value.
-   * AlertHelper class can be used to retrieve the corresponding alert definition.
-   * 
-   * @param alerts array of Alert class(contains alert def. ID & value)
-   * @param remoteVM
-   */
-  public void processNotifications(StatAlert[] alerts, GemFireVM remoteVM);
-
-  public void processSystemwideNotifications();
-}


[26/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthImpl.java
new file mode 100644
index 0000000..fc40261
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/GemFireHealthImpl.java
@@ -0,0 +1,514 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.admin.*;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.DistributedSystemHealthConfig;
+import org.apache.geode.internal.admin.api.GemFireHealth;
+import org.apache.geode.internal.admin.api.GemFireHealthConfig;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.*;
+
+/**
+ * Provides the implementation of the <code>GemFireHealth</code> administration API. This class is
+ * responsible for {@linkplain GemFireVM#addHealthListener sending} the {@link GemFireHealthConfig}s
+ * to the remote member VM in which the health is calcualted.
+ *
+ *
+ * @since GemFire 3.5
+ */
+public class GemFireHealthImpl implements GemFireHealth, JoinLeaveListener, HealthListener {
+
+  /** The distributed system whose health is being monitored */
+  private final GfManagerAgent agent;
+
+  /** The default configuration for checking GemFire health */
+  protected GemFireHealthConfig defaultConfig;
+
+  /**
+   * Maps the name of a host to its <code>GemFireHealthConfig</code>. Note that the mappings are
+   * created lazily.
+   */
+  private final Map hostConfigs;
+
+  /**
+   * Maps the name of a host to all of the members (<code>GemFireVM</code>s) that run on that host.
+   */
+  private final Map hostMembers;
+
+  /** The members that are known to be in {@link #OKAY_HEALTH}. */
+  private Collection okayHealth;
+
+  /** The members that are known to be in {@link #POOR_HEALTH}. */
+  private Collection poorHealth;
+
+  /** The overall health of GemFire */
+  private GemFireHealth.Health overallHealth;
+
+  /** Is this GemFireHealthImpl closed? */
+  private boolean isClosed;
+
+  /**
+   * The configuration specifying how the health of the distributed system should be computed.
+   */
+  protected volatile DistributedSystemHealthConfig dsHealthConfig;
+
+  /** Monitors the health of the entire distributed system */
+  private DistributedSystemHealthMonitor dsHealthMonitor = null;
+
+  /**
+   * The distributed system whose health is monitored by this <Code>GemFireHealth</code>.
+   */
+  private final AdminDistributedSystem system;
+
+
+  /////////////////////// Constructors ///////////////////////
+
+  /**
+   * Creates a new <code>GemFireHealthImpl</code> that monitors the health of member of the given
+   * distributed system.
+   */
+  protected GemFireHealthImpl(GfManagerAgent agent, AdminDistributedSystem system) {
+    // agent.getDM().getLogger().info("Creating GemFireHealthImpl",
+    // new Exception("Stack trace"));
+
+    this.agent = agent;
+    this.system = system;
+
+    this.hostConfigs = new HashMap();
+    this.hostMembers = new HashMap();
+    this.okayHealth = new HashSet();
+    this.poorHealth = new HashSet();
+    this.overallHealth = GOOD_HEALTH;
+    this.isClosed = false;
+
+    GemFireVM[] apps = this.agent.listApplications();
+    for (int i = 0; i < apps.length; i++) {
+      GemFireVM member = apps[i];
+      this.noteNewMember(member);
+    }
+
+    agent.addJoinLeaveListener(this);
+    setDefaultGemFireHealthConfig(createGemFireHealthConfig(null));
+    setDistributedSystemHealthConfig(createDistributedSystemHealthConfig());
+  }
+
+  @Override
+  public String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.append("closed=" + isClosed);
+    sb.append("; hostMembers=" + hostMembers);
+    sb.append("; okayHealth=" + okayHealth);
+    sb.append("; poorHealth=" + poorHealth);
+    sb.append("; overallHealth=" + overallHealth);
+    sb.append("; diagnosis=" + getDiagnosis());
+    return sb.toString();
+  }
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Returns the <code>DistributedSystem</code> whose health this <code>GemFireHealth</code>
+   * monitors.
+   */
+  public AdminDistributedSystem getDistributedSystem() {
+    return this.system;
+  }
+
+  /**
+   * A "template factory" method for creating a <code>DistributedSystemHealthConfig</code>. It can
+   * be overridden by subclasses to produce instances of different
+   * <code>DistributedSystemHealthConfig</code> implementations.
+   */
+  protected DistributedSystemHealthConfig createDistributedSystemHealthConfig() {
+
+    return new DistributedSystemHealthConfigImpl();
+  }
+
+  /**
+   * A "template factory" method for creating a <code>GemFireHealthConfig</code>. It can be
+   * overridden by subclasses to produce instances of different <code>GemFireHealthConfig</code>
+   * implementations.
+   *
+   * @param hostName The host whose health we are configuring
+   */
+  protected GemFireHealthConfig createGemFireHealthConfig(String hostName) {
+
+    return new GemFireHealthConfigImpl(hostName);
+  }
+
+  /**
+   * Throws an {@link IllegalStateException} if this <code>GemFireHealthImpl</code> is closed.
+   */
+  private void checkClosed() {
+    if (this.isClosed) {
+      throw new IllegalStateException(
+          LocalizedStrings.GemFireHealthImpl_CANNOT_ACCESS_A_CLOSED_GEMFIREHEALTH_INSTANCE
+              .toLocalizedString());
+    }
+  }
+
+  /**
+   * Returns the overall health of GemFire. Note that this method does not contact any of the member
+   * VMs. Instead, it relies on the members to alert it of changes in its health via a
+   * {@link HealthListener}.
+   */
+  public GemFireHealth.Health getHealth() {
+    checkClosed();
+    return this.overallHealth;
+  }
+
+  /**
+   * Resets the overall health to be {@link #GOOD_HEALTH}. It also resets the health in the member
+   * VMs.
+   *
+   * @see GemFireVM#resetHealthStatus
+   */
+  public void resetHealth() {
+    checkClosed();
+
+    this.overallHealth = GOOD_HEALTH;
+    this.okayHealth.clear();
+    this.poorHealth.clear();
+
+    synchronized (this) {
+      for (Iterator iter = hostMembers.values().iterator(); iter.hasNext();) {
+        List members = (List) iter.next();
+        for (Iterator iter2 = members.iterator(); iter2.hasNext();) {
+          GemFireVM member = (GemFireVM) iter2.next();
+          member.resetHealthStatus();
+        }
+      }
+    }
+  }
+
+  /**
+   * Aggregates the diagnoses from all members of the distributed system.
+   */
+  public String getDiagnosis() {
+    checkClosed();
+
+    StringBuffer sb = new StringBuffer();
+
+    synchronized (this) {
+      for (Iterator iter = hostMembers.values().iterator(); iter.hasNext();) {
+        List members = (List) iter.next();
+        for (Iterator iter2 = members.iterator(); iter2.hasNext();) {
+          GemFireVM member = (GemFireVM) iter2.next();
+          String[] diagnoses = member.getHealthDiagnosis(this.overallHealth);
+          for (int i = 0; i < diagnoses.length; i++) {
+            sb.append(diagnoses[i]).append("\n");;
+          }
+        }
+      }
+    }
+
+    return sb.toString();
+  }
+
+  /**
+   * Starts a new {@link DistributedSystemHealthMonitor}
+   */
+  public void setDistributedSystemHealthConfig(DistributedSystemHealthConfig config) {
+    synchronized (this.hostConfigs) {
+      // If too many threads are changing the health config, then we
+      // will might get an OutOfMemoryError trying to start a new
+      // health monitor thread.
+
+      if (this.dsHealthMonitor != null) {
+        this.dsHealthMonitor.stop();
+      }
+
+      this.dsHealthConfig = config;
+
+      DistributedSystemHealthEvaluator eval =
+          new DistributedSystemHealthEvaluator(config, this.agent.getDM());
+      int interval = this.getDefaultGemFireHealthConfig().getHealthEvaluationInterval();
+      this.dsHealthMonitor = new DistributedSystemHealthMonitor(eval, this, interval);
+      this.dsHealthMonitor.start();
+    }
+  }
+
+  public DistributedSystemHealthConfig getDistributedSystemHealthConfig() {
+
+    checkClosed();
+    return this.dsHealthConfig;
+  }
+
+  public GemFireHealthConfig getDefaultGemFireHealthConfig() {
+    checkClosed();
+    return this.defaultConfig;
+  }
+
+  public void setDefaultGemFireHealthConfig(GemFireHealthConfig config) {
+    checkClosed();
+
+    if (config.getHostName() != null) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.GemFireHealthImpl_THE_GEMFIREHEALTHCONFIG_FOR_FOR_0_CANNOT_SERVE_AS_THE_DEFAULT_HEALTH_CONFIG
+              .toLocalizedString(config.getHostName()));
+    }
+
+    this.defaultConfig = config;
+
+    synchronized (this) {
+      for (Iterator iter = this.hostMembers.entrySet().iterator(); iter.hasNext();) {
+        Map.Entry entry = (Map.Entry) iter.next();
+        InetAddress hostIpAddress = (InetAddress) entry.getKey();
+        List members = (List) entry.getValue();
+
+        GemFireHealthConfig hostConfig = (GemFireHealthConfig) hostConfigs.get(hostIpAddress);
+        if (hostConfig == null) {
+          hostConfig = config;
+        }
+
+        for (Iterator iter2 = members.iterator(); iter2.hasNext();) {
+          GemFireVM member = (GemFireVM) iter2.next();
+          Assert.assertTrue(member.getHost().equals(hostIpAddress));
+          member.addHealthListener(this, hostConfig);
+        }
+      }
+    }
+
+    // We only need to do this if the health monitoring interval has
+    // change. This is probably not the most efficient way of doing
+    // things.
+    if (this.dsHealthConfig != null) {
+      setDistributedSystemHealthConfig(this.dsHealthConfig);
+    }
+  }
+
+  /**
+   * Returns the GemFireHealthConfig object for the given host name.
+   * 
+   * @param hostName host name for which the GemFire Health Config is needed
+   * 
+   * @throws IllegalArgumentException if host with given name could not be found
+   */
+  public synchronized GemFireHealthConfig getGemFireHealthConfig(String hostName) {
+
+    checkClosed();
+
+    InetAddress hostIpAddress = null;
+    try {
+      hostIpAddress = InetAddress.getByName(hostName);
+    } catch (UnknownHostException e) {
+      throw new IllegalArgumentException(
+          LocalizedStrings.GemFireHealthImpl_COULD_NOT_FIND_A_HOST_WITH_NAME_0
+              .toLocalizedString(hostName),
+          e);
+    }
+
+    GemFireHealthConfig config = (GemFireHealthConfig) this.hostConfigs.get(hostIpAddress);
+    if (config == null) {
+      config = createGemFireHealthConfig(hostName);
+      this.hostConfigs.put(hostIpAddress, config);
+    }
+
+    return config;
+  }
+
+  /**
+   * Sets the GemFireHealthConfig object for the given host name.
+   * 
+   * @param hostName host name for which the GemFire Health Config is needed
+   * @param config GemFireHealthConfig object to set
+   * 
+   * @throws IllegalArgumentException if (1) given host name & the host name in the given config do
+   *         not match OR (2) host with given name could not be found OR (3) there are no GemFire
+   *         components running on the given host
+   */
+  public void setGemFireHealthConfig(String hostName, GemFireHealthConfig config) {
+    checkClosed();
+
+    synchronized (this) {
+      String configHost = config.getHostName();
+      if (configHost == null || !configHost.equals(hostName)) {
+        StringBuffer sb = new StringBuffer();
+        sb.append("The GemFireHealthConfig configures ");
+        if (configHost == null) {
+          sb.append("the default host ");
+
+        } else {
+          sb.append("host \"");
+          sb.append(config.getHostName());
+          sb.append("\" ");
+        }
+        sb.append("not \"" + hostName + "\"");
+        throw new IllegalArgumentException(sb.toString());
+      }
+      InetAddress hostIpAddress = null;
+      try {
+        hostIpAddress = InetAddress.getByName(hostName);
+      } catch (UnknownHostException e) {
+        throw new IllegalArgumentException(
+            LocalizedStrings.GemFireHealthImpl_COULD_NOT_FIND_A_HOST_WITH_NAME_0
+                .toLocalizedString(hostName),
+            e);
+      }
+
+      List members = (List) this.hostMembers.get(hostIpAddress);
+      if (members == null || members.isEmpty()) {
+        throw new IllegalArgumentException(
+            LocalizedStrings.GemFireHealthImpl_THERE_ARE_NO_GEMFIRE_COMPONENTS_ON_HOST_0
+                .toLocalizedString(hostName));
+      }
+
+      for (Iterator iter = members.iterator(); iter.hasNext();) {
+        GemFireVM member = (GemFireVM) iter.next();
+        member.addHealthListener(this, config);
+      }
+    }
+  }
+
+  /**
+   * Tells the members of the distributed system that we are no longer interested in monitoring
+   * their health.
+   *
+   * @see GemFireVM#removeHealthListener
+   */
+  public void close() {
+    this.agent.removeJoinLeaveListener(this);
+
+    synchronized (this) {
+      if (this.isClosed) {
+        return;
+      }
+
+      this.isClosed = true;
+
+      if (this.dsHealthMonitor != null) {
+        this.dsHealthMonitor.stop();
+        this.dsHealthMonitor = null;
+      }
+
+      try {
+        for (Iterator iter = hostMembers.values().iterator(); iter.hasNext();) {
+          List members = (List) iter.next();
+          for (Iterator iter2 = members.iterator(); iter2.hasNext();) {
+            GemFireVM member = (GemFireVM) iter2.next();
+            member.removeHealthListener();
+          }
+        }
+      } catch (CancelException e) {
+        // if the DS is disconnected, stop trying to distribute to other members
+      }
+
+      hostConfigs.clear();
+      hostMembers.clear();
+      okayHealth.clear();
+      poorHealth.clear();
+    }
+  }
+
+  public boolean isClosed() {
+    return this.isClosed;
+  }
+
+  /**
+   * Makes note of the newly-joined member
+   */
+  private void noteNewMember(GemFireVM member) {
+    InetAddress hostIpAddress = member.getHost();
+    List members = (List) this.hostMembers.get(hostIpAddress);
+    if (members == null) {
+      members = new ArrayList();
+      this.hostMembers.put(hostIpAddress, members);
+    }
+    members.add(member);
+
+  }
+
+  public synchronized void nodeJoined(GfManagerAgent source, GemFireVM joined) {
+    noteNewMember(joined);
+
+    InetAddress hostIpAddress = joined.getHost();
+
+    GemFireHealthConfig config = (GemFireHealthConfig) this.hostConfigs.get(hostIpAddress);
+    if (config == null) {
+      config = this.getDefaultGemFireHealthConfig();
+    }
+    joined.addHealthListener(this, config);
+  }
+
+  /**
+   * Makes note of the newly-left member
+   */
+  public synchronized void nodeLeft(GfManagerAgent source, GemFireVM left) {
+    InetAddress hostIpAddress = left.getHost();
+    List members = (List) this.hostMembers.get(hostIpAddress);
+    if (members != null) {
+      members.remove(left);
+      if (members.isEmpty()) {
+        // No more members on the host
+        this.hostConfigs.remove(hostIpAddress);
+        this.hostMembers.remove(hostIpAddress);
+      }
+    }
+
+    this.okayHealth.remove(left);
+    this.poorHealth.remove(left);
+
+    reevaluateHealth();
+  }
+
+  /**
+   * Does the same thing as {@link #nodeLeft}
+   */
+  public void nodeCrashed(GfManagerAgent source, GemFireVM crashed) {
+    nodeLeft(source, crashed);
+  }
+
+  /**
+   * Re-evaluates the overall health of GemFire
+   */
+  private void reevaluateHealth() {
+    if (!this.poorHealth.isEmpty()) {
+      this.overallHealth = POOR_HEALTH;
+
+    } else if (!this.okayHealth.isEmpty()) {
+      this.overallHealth = OKAY_HEALTH;
+
+    } else {
+      this.overallHealth = GOOD_HEALTH;
+    }
+  }
+
+  public void healthChanged(GemFireVM member, GemFireHealth.Health status) {
+    if (status == GOOD_HEALTH) {
+      this.okayHealth.remove(member);
+      this.poorHealth.remove(member);
+
+    } else if (status == OKAY_HEALTH) {
+      this.okayHealth.add(member);
+      this.poorHealth.remove(member);
+
+    } else if (status == POOR_HEALTH) {
+      this.okayHealth.remove(member);
+      this.poorHealth.add(member);
+
+    } else {
+      Assert.assertTrue(false, "Unknown health code: " + status);
+    }
+
+    reevaluateHealth();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/InetAddressUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/InetAddressUtil.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/InetAddressUtil.java
new file mode 100755
index 0000000..5a4d3ca
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/InetAddressUtil.java
@@ -0,0 +1,201 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.SocketException;
+import java.util.Enumeration;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.GemFireIOException;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.logging.LogService;
+
+
+/**
+ * Provides static utilities for manipulating, validating, and converting InetAddresses and host
+ * strings.
+ *
+ * @since GemFire 3.5
+ */
+@Deprecated
+public class InetAddressUtil {
+
+  private static final Logger logger = LogService.getLogger();
+
+  /** InetAddress instance representing the local host */
+  public static final InetAddress LOCALHOST = createLocalHost();
+
+  public static final String LOOPBACK_ADDRESS =
+      SocketCreator.preferIPv6Addresses() ? "::1" : "127.0.0.1";
+
+  public static final InetAddress LOOPBACK = InetAddressUtil.toInetAddress(LOOPBACK_ADDRESS);
+
+  /** Disallows InetAddressUtil instantiation. */
+  private InetAddressUtil() {}
+
+  /**
+   * Returns a string version of InetAddress which can be converted back to an InetAddress later.
+   * Essentially any leading slash is trimmed.
+   *
+   * @param val the InetAddress or String to return a formatted string of
+   * @return string version the InetAddress minus any leading slash
+   */
+  public static String toString(Object val) {
+    if (val instanceof String) {
+      return trimLeadingSlash((String) val);
+
+    } else if (val instanceof InetAddress) {
+      return ((InetAddress) val).getHostAddress();
+
+    } else {
+      return trimLeadingSlash(val.toString());
+    }
+  }
+
+  /**
+   * Converts the string host to an instance of InetAddress. Returns null if the string is empty.
+   * Fails Assertion if the conversion would result in <code>java.lang.UnknownHostException</code>.
+   * <p>
+   * Any leading slashes on host will be ignored.
+   *
+   * @param host string version the InetAddress
+   * @return the host converted to InetAddress instance
+   */
+  public static InetAddress toInetAddress(String host) {
+    if (host == null || host.length() == 0) {
+      return null;
+    }
+    try {
+      if (host.indexOf("/") > -1) {
+        return InetAddress.getByName(host.substring(host.indexOf("/") + 1));
+      } else {
+        return InetAddress.getByName(host);
+      }
+    } catch (java.net.UnknownHostException e) {
+      logStackTrace(e);
+      Assert.assertTrue(false, "Failed to get InetAddress: " + host);
+      return null; // will never happen since the Assert will fail
+    }
+  }
+
+  /**
+   * Creates an InetAddress representing the local host. The checked exception
+   * <code>java.lang.UnknownHostException</code> is captured and results in an Assertion failure
+   * instead.
+   *
+   * @return InetAddress instance representing the local host
+   */
+  public static InetAddress createLocalHost() {
+    try {
+      return SocketCreator.getLocalHost();
+    } catch (java.net.UnknownHostException e) {
+      logStackTrace(e);
+      Assert.assertTrue(false, "Failed to get local host");
+      return null; // will never happen
+    }
+  }
+
+  /**
+   * Validates the host by making sure it can successfully be used to get an instance of
+   * InetAddress. If the host string is null, empty or would result in
+   * <code>java.lang.UnknownHostException</code> then null is returned.
+   * <p>
+   * Any leading slashes on host will be ignored.
+   *
+   * @param host string version the InetAddress
+   * @return the host converted to InetAddress instance
+   */
+  public static String validateHost(String host) {
+    if (host == null || host.length() == 0) {
+      return null;
+    }
+    try {
+      InetAddress.getByName(trimLeadingSlash(host));
+      return host;
+    } catch (java.net.UnknownHostException e) {
+      logStackTrace(e);
+      return null;
+    }
+  }
+
+  /** Returns true if host matches the LOCALHOST. */
+  public static boolean isLocalHost(Object host) {
+    if (host instanceof InetAddress) {
+      if (LOCALHOST.equals(host)) {
+        return true;
+      } else {
+        // InetAddress hostAddr = (InetAddress)host;
+        try {
+          Enumeration en = NetworkInterface.getNetworkInterfaces();
+          while (en.hasMoreElements()) {
+            NetworkInterface i = (NetworkInterface) en.nextElement();
+            for (Enumeration en2 = i.getInetAddresses(); en2.hasMoreElements();) {
+              InetAddress addr = (InetAddress) en2.nextElement();
+              if (host.equals(addr)) {
+                return true;
+              }
+            }
+          }
+          return false;
+        } catch (SocketException e) {
+          throw new GemFireIOException(
+              LocalizedStrings.InetAddressUtil_UNABLE_TO_QUERY_NETWORK_INTERFACE
+                  .toLocalizedString(),
+              e);
+        }
+      }
+    } else {
+      return isLocalHost(InetAddressUtil.toInetAddress(host.toString()));
+    }
+  }
+
+  /** Returns true if host matches the LOOPBACK (127.0.0.1). */
+  public static boolean isLoopback(Object host) {
+    if (host instanceof InetAddress) {
+      return LOOPBACK.equals(host);
+    } else {
+      return isLoopback(InetAddressUtil.toInetAddress(host.toString()));
+    }
+  }
+
+  /** Returns a version of the value after removing any leading slashes */
+  private static String trimLeadingSlash(String value) {
+    if (value == null)
+      return "";
+    while (value.indexOf("/") > -1) {
+      value = value.substring(value.indexOf("/") + 1);
+    }
+    return value;
+  }
+
+  /**
+   * Logs the stack trace for the given Throwable if logger is initialized else prints the stack
+   * trace using System.out. If logged the logs are logged at WARNING level.
+   * 
+   * @param throwable Throwable to log stack trace for
+   */
+  private static void logStackTrace(Throwable throwable) {
+    AdminDistributedSystemImpl adminDS = AdminDistributedSystemImpl.getConnectedInstance();
+
+    logger.warn(throwable.getMessage(), throwable);
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/InternalManagedEntity.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/InternalManagedEntity.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/InternalManagedEntity.java
new file mode 100644
index 0000000..a1e9fb0
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/InternalManagedEntity.java
@@ -0,0 +1,96 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.ManagedEntity;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+
+/**
+ * Provides internal-only functionality that is expected of all <code>ManagedEntity<code>s. This
+ * functionality is used by the {@link ManagedEntityController} to manage the entity.
+ *
+ * @since GemFire 4.0
+ */
+public interface InternalManagedEntity extends ManagedEntity {
+
+  /** The state of a managed entity is unknown. */
+  public static final int UNKNOWN = 10;
+
+  /** A managed entity is stopped */
+  public static final int STOPPED = 11;
+
+  /** A managed entity is stopping (being stopped) */
+  public static final int STOPPING = 12;
+
+  /** A managed entity is starting */
+  public static final int STARTING = 13;
+
+  /** A managed entity is running (is started) */
+  public static final int RUNNING = 14;
+
+  ////////////////////// Instance Methods //////////////////////
+
+  /**
+   * Returns the <code>ManagedEntityConfig</code> for this <code>ManagedEntity</code>.
+   */
+  public ManagedEntityConfig getEntityConfig();
+
+  /**
+   * Returns a brief description (such as "locator") of this managed entity.
+   */
+  public String getEntityType();
+
+  /**
+   * Returns the (local) command to execute in order to start this managed entity. The command
+   * includes the full path to the executable (include <code>$GEMFIRE/bin</code>) and any
+   * command-line arguments. It does not take the {@linkplain ManagedEntityConfig#getRemoteCommand
+   * remote command} into account.
+   */
+  public String getStartCommand();
+
+  /**
+   * Returns the (local) command to execute in order to stop this managed entity.
+   */
+  public String getStopCommand();
+
+  /**
+   * Returns the (local) command to execute in order to determine whether or not this managed entity
+   * is runing.
+   */
+  public String getIsRunningCommand();
+
+  /**
+   * Returns a descriptive, one-word, unique id for a newly-created <code>ManagedEntity</code>. This
+   * ensures that we do not have collisions in the ids of entities.
+   */
+  public String getNewId();
+
+  /**
+   * Returns the distributed system to which this managed entity belongs.
+   */
+  public AdminDistributedSystem getDistributedSystem();
+
+  /**
+   * Sets the state of this managed entity and informs threads that are waiting for a state change.
+   * See bug 32455.
+   *
+   * @return The previous state of this managed entity.
+   *
+   * @see #RUNNING
+   */
+  public int setState(int state);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/LogCollator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/LogCollator.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/LogCollator.java
new file mode 100755
index 0000000..b3c2b9c
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/LogCollator.java
@@ -0,0 +1,121 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.GfManagerAgent;
+import org.apache.geode.internal.admin.GemFireVM;
+import org.apache.geode.internal.admin.ApplicationVM;
+import org.apache.geode.internal.logging.MergeLogFiles;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+public class LogCollator {
+
+  private GfManagerAgent system;
+  private List logTails;
+
+  public LogCollator() {}
+
+  public String collateLogs(GfManagerAgent system) {
+    try {
+      if (system == null) {
+        return "";
+      }
+      this.system = system;
+      this.logTails = new ArrayList();
+      gatherActiveLogs();
+      gatherInactiveLogs();
+      return mergeLogs();
+    } finally {
+      this.system = null;
+      this.logTails = null;
+    }
+  }
+
+  // -------------------------------------------------------------------------
+
+  private String mergeLogs() {
+    // combine logs...
+    InputStream[] logFiles = new InputStream[this.logTails.size()];
+    String[] logFileNames = new String[logFiles.length];
+    for (int i = 0; i < this.logTails.size(); i++) {
+      Loglet loglet = (Loglet) this.logTails.get(i);
+      logFiles[i] = new ByteArrayInputStream(loglet.tail.getBytes());
+      logFileNames[i] = loglet.name;
+    }
+
+    // delegate to MergeLogFiles...
+    StringWriter writer = new StringWriter();
+    PrintWriter mergedLog = new PrintWriter(writer);
+    if (!MergeLogFiles.mergeLogFiles(logFiles, logFileNames, mergedLog)) {
+      return writer.toString();
+    } else {
+      return "";
+    }
+  }
+
+  private void gatherActiveLogs() {
+    ApplicationVM[] runningsApps = this.system.listApplications();
+    for (int i = 0; i < runningsApps.length; i++) {
+      addLogFrom(runningsApps[i]);
+    }
+  }
+
+  private void gatherInactiveLogs() {
+    /*
+     * not yet supported.... if (useStopped) { LogViewHelper helper = new LogViewHelper(); for
+     * (Iterator iter = stoppedNodes.iterator(); iter.hasNext(); ) { Object adminEntity =
+     * iter.next(); helper.setAdminEntity(adminEntity); try { if (helper.logViewAvailable()) {
+     * String[] logs = helper.getSystemLogs(); addTail(allTails, logs, adminEntity.toString()); } }
+     * catch (Exception e) { Service.getService().reportSystemError(e); } } }
+     */
+  }
+
+  private void addLogFrom(GemFireVM vm) {
+    String name = null;
+    name = vm.toString();
+    String[] logs = vm.getSystemLogs();
+    addTail(name, logs);
+  }
+
+  private void addTail(String logName, String[] logs) {
+    if (logs.length > 0) {
+      String tail = (logs.length > 1) ? logs[1] : logs[0];
+      this.logTails.add(new Loglet(logName, tail));
+    }
+  }
+
+  /*
+   * public void setUseStoppedManagers(boolean useStopped) { this.useStopped = useStopped; }
+   */
+
+  private static class Loglet {
+    String name;
+    String tail;
+
+    Loglet(String name, String tail) {
+      this.name = name;
+      this.tail = tail;
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigImpl.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigImpl.java
new file mode 100644
index 0000000..3e27405
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigImpl.java
@@ -0,0 +1,254 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+import org.apache.geode.internal.admin.GemFireVM;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.apache.geode.internal.GemFireVersion;
+import org.apache.geode.internal.net.SocketCreator;
+
+import java.io.File;
+import java.net.*;
+
+/**
+ * The abstract superclass of objects that configure a managed entity such as a GemFire cache server
+ * or a distribution locator. It contains configuration state and behavior common to all managed
+ * entities.
+ *
+ * @since GemFire 4.0
+ */
+public abstract class ManagedEntityConfigImpl implements ManagedEntityConfig {
+
+  /** The name of the host on which the managed entity runs */
+  private String host;
+
+  /** Directory in which the locator runs */
+  private String workingDirectory;
+
+  /** The directory in which GemFire is installed */
+  private String productDirectory;
+
+  /** Command used to launch locator on remote machine */
+  private String remoteCommand;
+
+  /**
+   * The managed entity configured by this object.
+   *
+   * @see #isReadOnly
+   */
+  private InternalManagedEntity entity = null;
+
+  ///////////////////// Static Methods /////////////////////
+
+  /**
+   * Returns the {@linkplain InetAddress#getCanonicalHostName canonical name} of the local machine.
+   */
+  protected static String getLocalHostName() {
+    try {
+      return SocketCreator.getLocalHost().getCanonicalHostName();
+
+    } catch (UnknownHostException ex) {
+      IllegalStateException ex2 = new IllegalStateException(
+          LocalizedStrings.ManagedEntityConfigImpl_COULD_NOT_DETERMINE_LOCALHOST
+              .toLocalizedString());
+      ex2.initCause(ex);
+      throw ex2;
+    }
+  }
+
+  /**
+   * Returns the current working directory for this VM.
+   */
+  private static File getCurrentWorkingDirectory() {
+    File cwd = new File(System.getProperty("user.dir"));
+    return cwd.getAbsoluteFile();
+  }
+
+  /**
+   * Returns the location of the GemFire product installation. This is determined by finding the
+   * location of the gemfire jar and working backwards.
+   */
+  private static File getGemFireInstallation() {
+    URL url = GemFireVersion.getJarURL();
+    if (url == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.ManagedEntityConfigImpl_COULD_NOT_FIND_GEMFIREJAR.toLocalizedString());
+    }
+
+    File gemfireJar = new File(url.getPath());
+    File lib = gemfireJar.getParentFile();
+    File product = lib.getParentFile();
+
+    return product;
+  }
+
+  ////////////////////// Constructors //////////////////////
+
+  /**
+   * Creates a <code>ManagedEntityConfigImpl</code> with the default configuration.
+   */
+  protected ManagedEntityConfigImpl() {
+    this.host = getLocalHostName();
+    this.workingDirectory = getCurrentWorkingDirectory().getAbsolutePath();
+    this.productDirectory = getGemFireInstallation().getAbsolutePath();
+    this.remoteCommand = null; // Delegate to AdminDistributedSystem
+  }
+
+  /**
+   * Creates a new <code>ManagedEntityConfigImpl</code> based on the configuration of a running
+   * <code>GemFireVM</code>
+   */
+  protected ManagedEntityConfigImpl(GemFireVM vm) {
+    this.host = SocketCreator.getHostName(vm.getHost());
+    this.workingDirectory = vm.getWorkingDirectory().getAbsolutePath();
+    this.productDirectory = vm.getGemFireDir().getAbsolutePath();
+    this.remoteCommand = null;
+  }
+
+  /**
+   * A copy constructor that creates a new <code>ManagedEntityConfigImpl</code> with the same
+   * configuration as another <code>ManagedEntityConfig</code>.
+   */
+  protected ManagedEntityConfigImpl(ManagedEntityConfig other) {
+    this.host = other.getHost();
+    this.workingDirectory = other.getWorkingDirectory();
+    this.productDirectory = other.getProductDirectory();
+    this.remoteCommand = other.getRemoteCommand();
+  }
+
+  //////////////////// Instance Methods ////////////////////
+
+  /**
+   * Checks to see if this config object is "read only". If it is, then an
+   * {@link IllegalStateException} is thrown. It should be called by every setter method.
+   *
+   * @see #isReadOnly
+   */
+  public void checkReadOnly() {
+    if (this.isReadOnly()) {
+      throw new IllegalStateException(
+          LocalizedStrings.ManagedEntityConfigImpl_THIS_CONFIGURATION_CANNOT_BE_MODIFIED_WHILE_ITS_MANAGED_ENTITY_IS_RUNNING
+              .toLocalizedString());
+    }
+  }
+
+  /**
+   * Returns whether or not this <code>ManagedEntityConfigImpl</code> is read-only (can be
+   * modified).
+   */
+  protected boolean isReadOnly() {
+    return this.entity != null && this.entity.isRunning();
+  }
+
+  /**
+   * Sets the entity that is configured by this config object. Once the entity is running, the
+   * config object cannot be modified.
+   *
+   * @see #checkReadOnly
+   */
+  public void setManagedEntity(InternalManagedEntity entity) {
+    this.entity = entity;
+  }
+
+  /**
+   * Notifies any configuration listeners that this configuration has changed.
+   */
+  protected abstract void configChanged();
+
+  public String getHost() {
+    return this.host;
+  }
+
+  public void setHost(String host) {
+    checkReadOnly();
+    this.host = host;
+    configChanged();
+  }
+
+  public String getWorkingDirectory() {
+    String dir = this.workingDirectory;
+    return dir;
+  }
+
+  public void setWorkingDirectory(String workingDirectory) {
+    checkReadOnly();
+    this.workingDirectory = workingDirectory;
+    configChanged();
+  }
+
+  public String getProductDirectory() {
+    return this.productDirectory;
+  }
+
+  public void setProductDirectory(String productDirectory) {
+    checkReadOnly();
+    this.productDirectory = productDirectory;
+    configChanged();
+  }
+
+  public String getRemoteCommand() {
+    return this.remoteCommand;
+  }
+
+  public void setRemoteCommand(String remoteCommand) {
+    checkReadOnly();
+    this.remoteCommand = remoteCommand;
+    configChanged();
+  }
+
+  /**
+   * Validates this configuration.
+   *
+   * @throws IllegalStateException If this config is not valid
+   */
+  public void validate() {
+    if (InetAddressUtil.validateHost(this.host) == null) {
+      throw new IllegalStateException(
+          LocalizedStrings.ManagedEntityConfigImpl_INVALID_HOST_0.toLocalizedString(this.host));
+    }
+  }
+
+  @Override
+  public Object clone() throws CloneNotSupportedException {
+    // Since all fields are immutable objects, no deep cloning is
+    // necessary.
+    ManagedEntityConfigImpl clone = (ManagedEntityConfigImpl) super.clone();
+    clone.entity = null;
+    return clone;
+  }
+
+  @Override
+  public String toString() {
+    String className = this.getClass().getName();
+    int index = className.lastIndexOf('.');
+    className = className.substring(index + 1);
+
+    StringBuffer sb = new StringBuffer();
+    sb.append(className);
+
+    sb.append(" host=");
+    sb.append(this.getHost());
+    sb.append(" workingDirectory=");
+    sb.append(this.getWorkingDirectory());
+    sb.append(" productDirectory=");
+    sb.append(this.getProductDirectory());
+    sb.append(" remoteCommand=\"");
+    sb.append(this.getRemoteCommand());
+    sb.append("\"");
+
+    return sb.toString();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXml.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXml.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXml.java
new file mode 100644
index 0000000..b173c41
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXml.java
@@ -0,0 +1,170 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.distributed.ConfigurationProperties;
+import org.apache.geode.internal.ClassPathLoader;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+import org.xml.sax.*;
+
+import java.io.InputStream;
+
+/**
+ * The abstract superclass of classes that convert XML into a {@link DistributedSystemConfig} and
+ * vice versa. It provides helper methods and constants.
+ *
+ * @since GemFire 4.0
+ */
+abstract class ManagedEntityConfigXml implements EntityResolver, ErrorHandler {
+
+  /** The location of the DTD file */
+  protected static final String DTD_LOCATION =
+      "/org/apache/geode/internal/admin/doc-files/ds5_0.dtd";
+
+  /** The URL for the DTD */
+  protected static final String SYSTEM_ID = "http://www.gemstone.com/dtd/ds5_0.dtd";
+
+  /** The public ID for the DTD */
+  protected static final String PUBLIC_ID =
+      "-//GemStone Systems, Inc.//GemFire Distributed System 5.0//EN";
+
+  /** The name of the <code>distributed-system</code> element. */
+  public static final String DISTRIBUTED_SYSTEM = "distributed-system";
+
+  /** The name of the <code>id</code> attribute. */
+  public static final String ID = "id";
+
+  /** The name of the <code>disable-tcp</code> attribute. */
+  public static final String DISABLE_TCP = "disable-tcp";
+
+  /** The name of the <code>remote-command</code> element. */
+  public static final String REMOTE_COMMAND = "remote-command";
+
+  /** The name of the <code>locators</code> element. */
+  public static final String LOCATORS = ConfigurationProperties.LOCATORS;
+
+  /** The name of the <code>ssl</code> element. */
+  public static final String SSL = "ssl";
+
+  /** The name of the <code>cache-server</code> element */
+  public static final String CACHE_SERVER = "cache-server";
+
+  /** The name of the <code>multicast</code> element */
+  public static final String MULTICAST = "multicast";
+
+  /** The name of the <code>locator</code> element */
+  public static final String LOCATOR = "locator";
+
+  /** The name of the <code>port</code> attribute */
+  public static final String PORT = "port";
+
+  /** The name of the <code>address</code> attribute */
+  public static final String ADDRESS = "address";
+
+  /** The name of the <code>host</code> element. */
+  public static final String HOST = "host";
+
+  /** The name of the <code>working-directory</code> element */
+  public static final String WORKING_DIRECTORY = "working-directory";
+
+  /** The name of the <code>product-directory</code> element */
+  public static final String PRODUCT_DIRECTORY = "product-directory";
+
+  /** The name of the <code>protocols</code> element */
+  public static final String PROTOCOLS = "protocols";
+
+  /** The name of the <code>ciphers</code> element */
+  public static final String CIPHERS = "ciphers";
+
+  /** The name of the <code>property</code> element */
+  public static final String PROPERTY = "property";
+
+  /** Name of the <code>authentication-required</code> attribute */
+  public static final String AUTHENTICATION_REQUIRED = "authentication-required";
+
+  /** The name of the <code>key</code> element */
+  public static final String KEY = "key";
+
+  /** The name of the <code>value</code> element */
+  public static final String VALUE = "value";
+
+  /** The name of the <code>classpath</code> element */
+  public static final String CLASSPATH = "classpath";
+
+  /////////////////////// Instance Methods ///////////////////////
+
+  /**
+   * Given a public id, attempt to resolve it to a DTD. Returns an <code>InputSoure</code> for the
+   * DTD.
+   */
+  public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
+
+    if (publicId == null || systemId == null) {
+      throw new SAXException(LocalizedStrings.ManagedEntityConfigXml_PUBLIC_ID_0_SYSTEM_ID_1
+          .toLocalizedString(new Object[] {publicId, systemId}));
+    }
+
+    // Figure out the location for the publicId.
+    String location = DTD_LOCATION;
+
+    InputSource result;
+    // if (location != null) (cannot be null)
+    {
+      InputStream stream = ClassPathLoader.getLatest().getResourceAsStream(getClass(), location);
+      if (stream != null) {
+        result = new InputSource(stream);
+      } else {
+        throw new SAXNotRecognizedException(
+            LocalizedStrings.ManagedEntityConfigXml_DTD_NOT_FOUND_0.toLocalizedString(location));
+      }
+
+      // } else {
+      // throw new
+      // SAXNotRecognizedException(LocalizedStrings.ManagedEntityConfigXml_COULD_NOT_FIND_DTD_FOR_0_1.toLocalizedString(new
+      // Object[] {publicId, systemId}));
+    }
+
+    return result;
+  }
+
+  /**
+   * Warnings are ignored
+   */
+  public void warning(SAXParseException ex) throws SAXException {
+
+  }
+
+  /**
+   * Throws a {@link org.apache.geode.cache.CacheXmlException}
+   */
+  public void error(SAXParseException ex) throws SAXException {
+    IllegalArgumentException ex2 = new IllegalArgumentException(
+        LocalizedStrings.ManagedEntityConfigXml_ERROR_WHILE_PARSING_XML.toLocalizedString());
+    ex2.initCause(ex);
+    throw ex2;
+  }
+
+  /**
+   * Throws a {@link org.apache.geode.cache.CacheXmlException}
+   */
+  public void fatalError(SAXParseException ex) throws SAXException {
+    IllegalArgumentException ex2 = new IllegalArgumentException(
+        LocalizedStrings.ManagedEntityConfigXml_FATAL_ERROR_WHILE_PARSING_XML.toLocalizedString());
+    ex2.initCause(ex);
+    throw ex2;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXmlGenerator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXmlGenerator.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXmlGenerator.java
new file mode 100644
index 0000000..b31738d
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXmlGenerator.java
@@ -0,0 +1,371 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.AdminException;
+import org.apache.geode.internal.admin.api.CacheServer;
+import org.apache.geode.internal.admin.api.CacheServerConfig;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.DistributionLocator;
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+import javax.xml.transform.*;
+// import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+import org.xml.sax.*;
+// import org.xml.sax.ext.*;
+import org.xml.sax.helpers.AttributesImpl;
+import java.io.*;
+import java.util.*;
+
+/**
+ * Generates XML data that represents the managed entities in an
+ * <code>AdminDistributedSystem</code>. This class is used mainly for testing.
+ *
+ * @since GemFire 4.0
+ */
+public class ManagedEntityConfigXmlGenerator extends ManagedEntityConfigXml implements XMLReader {
+
+  /** An empty <code>Attributes</code> */
+  private static Attributes EMPTY = new AttributesImpl();
+
+  ///////////////////////// Instance Fields ////////////////////////
+
+  /**
+   * The <code>AdminDistributedSystem</code> for which we are generating XML
+   */
+  private AdminDistributedSystem system;
+
+  /** The content handler to which SAX events are generated */
+  private ContentHandler handler;
+
+  ///////////////////////// Static Methods ////////////////////////
+
+  /**
+   * Generates an XML representation of all of the managed entities in the given
+   * <code>AdminDistributedSystem</code>.
+   */
+  public static void generate(AdminDistributedSystem system, PrintWriter pw) {
+    (new ManagedEntityConfigXmlGenerator(system)).generate(pw);
+  }
+
+  ///////////////////////// Constructors //////////////////////////
+
+  /**
+   * Creates a new generator for the given <code>AdminDistributedSystem</code>.
+   */
+  private ManagedEntityConfigXmlGenerator(AdminDistributedSystem system) {
+    this.system = system;
+  }
+
+  /////////////////////// Instance Methods ///////////////////////
+
+  /**
+   * Generates XML and writes it to the given <code>PrintWriter</code>
+   */
+  private void generate(PrintWriter pw) {
+    // Use JAXP's transformation API to turn SAX events into pretty
+    // XML text
+    try {
+      Source src = new SAXSource(this, new InputSource());
+      Result res = new StreamResult(pw);
+
+      TransformerFactory xFactory = TransformerFactory.newInstance();
+      Transformer xform = xFactory.newTransformer();
+      xform.setOutputProperty(OutputKeys.METHOD, "xml");
+      xform.setOutputProperty(OutputKeys.INDENT, "yes");
+      xform.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, SYSTEM_ID);
+      xform.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, PUBLIC_ID);
+      xform.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
+      xform.transform(src, res);
+      pw.flush();
+
+    } catch (Exception ex) {
+      RuntimeException ex2 = new RuntimeException(
+          LocalizedStrings.ManagedEntityConfigXmlGenerator_EXCEPTION_THROWN_WHILE_GENERATING_XML
+              .toLocalizedString());
+      ex2.initCause(ex);
+      throw ex2;
+    }
+  }
+
+  /**
+   * Called by the transformer to parse the "input source". We ignore the input source and, instead,
+   * generate SAX events to the {@link #setContentHandler ContentHandler}.
+   */
+  public void parse(InputSource input) throws SAXException {
+    Assert.assertTrue(this.handler != null);
+
+    handler.startDocument();
+
+    AttributesImpl atts = new AttributesImpl();
+
+    atts.addAttribute("", "", ID, "", String.valueOf(this.system.getConfig().getSystemId()));
+
+    handler.startElement("", DISTRIBUTED_SYSTEM, DISTRIBUTED_SYSTEM, atts);
+
+    // Add generation methods here
+    try {
+      generateRemoteCommand();
+      generateDiscovery();
+      generateSSL();
+      generateCacheServers();
+
+    } catch (AdminException ex) {
+      throw new SAXException(
+          LocalizedStrings.ManagedEntityConfigXmlGenerator_AN_ADMINEXCEPTION_WAS_THROWN_WHILE_GENERATING_XML
+              .toLocalizedString(),
+          ex);
+    }
+
+    handler.endElement("", DISTRIBUTED_SYSTEM, DISTRIBUTED_SYSTEM);
+    handler.endDocument();
+  }
+
+  /**
+   * Generates XML for the remote command
+   */
+  private void generateRemoteCommand() throws SAXException {
+    String remoteCommand = this.system.getRemoteCommand();
+
+    handler.startElement("", REMOTE_COMMAND, REMOTE_COMMAND, EMPTY);
+
+    handler.characters(remoteCommand.toCharArray(), 0, remoteCommand.length());
+
+    handler.endElement("", REMOTE_COMMAND, REMOTE_COMMAND);
+  }
+
+  /**
+   * Generates XML for locators in the distributed system
+   */
+  private void generateDiscovery() throws SAXException {
+    handler.startElement("", LOCATORS, LOCATORS, EMPTY);
+
+    generateLocators();
+
+    handler.endElement("", LOCATORS, LOCATORS);
+  }
+
+  /**
+   * Generates XML for the distributed system's locators
+   */
+  private void generateLocators() throws SAXException {
+    DistributionLocator[] locators = this.system.getDistributionLocators();
+    for (int i = 0; i < locators.length; i++) {
+      generateLocator(locators[i].getConfig());
+    }
+  }
+
+  /**
+   * Generates XML for a locator
+   */
+  private void generateLocator(DistributionLocatorConfig config) throws SAXException {
+
+    AttributesImpl atts = new AttributesImpl();
+    atts.addAttribute("", "", PORT, "", String.valueOf(config.getPort()));
+
+    handler.startElement("", LOCATOR, LOCATOR, atts);
+
+    generateEntityConfig(config);
+
+    handler.endElement("", LOCATOR, LOCATOR);
+  }
+
+  /**
+   * Generates XML for attributes common to all managed entities.
+   */
+  private void generateEntityConfig(ManagedEntityConfig config) throws SAXException {
+
+    String host = config.getHost();
+    if (host != null) {
+      handler.startElement("", HOST, HOST, EMPTY);
+      handler.characters(host.toCharArray(), 0, host.length());
+      handler.endElement("", HOST, HOST);
+    }
+
+    String remoteCommand = config.getRemoteCommand();
+    if (remoteCommand != null) {
+      handler.startElement("", REMOTE_COMMAND, REMOTE_COMMAND, EMPTY);
+      handler.characters(remoteCommand.toCharArray(), 0, remoteCommand.length());
+      handler.endElement("", REMOTE_COMMAND, REMOTE_COMMAND);
+    }
+
+    String workingDirectory = config.getWorkingDirectory();
+    if (workingDirectory != null) {
+      handler.startElement("", WORKING_DIRECTORY, WORKING_DIRECTORY, EMPTY);
+      handler.characters(workingDirectory.toCharArray(), 0, workingDirectory.length());
+      handler.endElement("", WORKING_DIRECTORY, WORKING_DIRECTORY);
+    }
+
+    String productDirectory = config.getProductDirectory();
+    if (productDirectory != null) {
+      handler.startElement("", PRODUCT_DIRECTORY, PRODUCT_DIRECTORY, EMPTY);
+      handler.characters(productDirectory.toCharArray(), 0, productDirectory.length());
+      handler.endElement("", PRODUCT_DIRECTORY, PRODUCT_DIRECTORY);
+    }
+  }
+
+  /**
+   * Generates XML for the SSL configuration of the distributed system.
+   */
+  private void generateSSL() throws SAXException {
+    DistributedSystemConfig config = this.system.getConfig();
+
+    boolean sslEnabled = config.isSSLEnabled();
+    if (!sslEnabled) {
+      return;
+    }
+
+    AttributesImpl atts = new AttributesImpl();
+    atts.addAttribute("", "", AUTHENTICATION_REQUIRED, "",
+        String.valueOf(config.isSSLAuthenticationRequired()));
+
+    handler.startElement("", SSL, SSL, atts);
+
+    String protocols = config.getSSLProtocols();
+    if (protocols != null) {
+      handler.startElement("", PROTOCOLS, PROTOCOLS, EMPTY);
+      handler.characters(protocols.toCharArray(), 0, protocols.length());
+      handler.endElement("", PROTOCOLS, PROTOCOLS);
+    }
+
+    String ciphers = config.getSSLCiphers();
+    if (ciphers != null) {
+      handler.startElement("", CIPHERS, CIPHERS, EMPTY);
+      handler.characters(ciphers.toCharArray(), 0, ciphers.length());
+      handler.endElement("", CIPHERS, CIPHERS);
+    }
+
+    Properties sslProps = config.getSSLProperties();
+    for (Iterator iter = sslProps.entrySet().iterator(); iter.hasNext();) {
+      Map.Entry entry = (Map.Entry) iter.next();
+      String key = (String) entry.getKey();
+      String value = (String) entry.getValue();
+
+      handler.startElement("", PROPERTY, PROPERTY, EMPTY);
+
+      handler.startElement("", KEY, KEY, EMPTY);
+      handler.characters(key.toCharArray(), 0, key.length());
+      handler.endElement("", KEY, KEY);
+
+      handler.startElement("", VALUE, VALUE, EMPTY);
+      handler.characters(value.toCharArray(), 0, value.length());
+      handler.endElement("", VALUE, VALUE);
+
+      handler.endElement("", PROPERTY, PROPERTY);
+    }
+
+    handler.endElement("", SSL, SSL);
+  }
+
+  /**
+   * Generates an XML representation of the <code>CacheServer</code>s in the distributed system.
+   */
+  private void generateCacheServers() throws SAXException, AdminException {
+
+    CacheServer[] servers = this.system.getCacheServers();
+    for (int i = 0; i < servers.length; i++) {
+      generateCacheServer(servers[i].getConfig());
+    }
+  }
+
+  /**
+   * Generates an XML representation of a <code>CacheServerConfig</code>.
+   */
+  private void generateCacheServer(CacheServerConfig config) throws SAXException {
+
+    handler.startElement("", CACHE_SERVER, CACHE_SERVER, EMPTY);
+
+    generateEntityConfig(config);
+
+    String classpath = config.getClassPath();
+    if (classpath != null) {
+      handler.startElement("", CLASSPATH, CLASSPATH, EMPTY);
+      handler.characters(classpath.toCharArray(), 0, classpath.length());
+      handler.endElement("", CLASSPATH, CLASSPATH);
+    }
+
+    handler.endElement("", CACHE_SERVER, CACHE_SERVER);
+  }
+
+  /**
+   * Keep track of the content handler for use during {@link #parse(String)}.
+   */
+  public void setContentHandler(ContentHandler handler) {
+    this.handler = handler;
+  }
+
+  public ContentHandler getContentHandler() {
+    return this.handler;
+  }
+
+  public ErrorHandler getErrorHandler() {
+    return this;
+  }
+
+  ////////// Inherited methods that don't do anything //////////
+
+  public boolean getFeature(String name)
+      throws SAXNotRecognizedException, SAXNotSupportedException {
+    return false;
+  }
+
+  public void setFeature(String name, boolean value)
+      throws SAXNotRecognizedException, SAXNotSupportedException {
+
+  }
+
+  public Object getProperty(String name)
+      throws SAXNotRecognizedException, SAXNotSupportedException {
+
+    return null;
+  }
+
+  public void setProperty(String name, Object value)
+      throws SAXNotRecognizedException, SAXNotSupportedException {
+
+  }
+
+  public void setEntityResolver(EntityResolver resolver) {
+
+  }
+
+  public EntityResolver getEntityResolver() {
+    return this;
+  }
+
+  public void setDTDHandler(DTDHandler handler) {
+
+  }
+
+  public DTDHandler getDTDHandler() {
+    return null;
+  }
+
+  public void setErrorHandler(ErrorHandler handler) {
+
+  }
+
+  public void parse(String systemId) throws IOException, SAXException {
+
+  }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXmlParser.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXmlParser.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXmlParser.java
new file mode 100644
index 0000000..111c7fc
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityConfigXmlParser.java
@@ -0,0 +1,591 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.admin.api.AdminXmlException;
+import org.apache.geode.internal.admin.api.CacheServerConfig;
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.DistributionLocatorConfig;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import org.xml.sax.*;
+import org.xml.sax.helpers.DefaultHandler;
+import java.io.*;
+import java.util.*;
+
+/**
+ * Parses an XML file and configures a {@link DistributedSystemConfig} from it.
+ *
+ * @since GemFire 4.0
+ */
+public class ManagedEntityConfigXmlParser extends ManagedEntityConfigXml implements ContentHandler {
+
+  /** The <code>DistributedSystemConfig</code> to be configured */
+  private DistributedSystemConfig config;
+
+  /** The stack of intermediate values used while parsing */
+  private Stack stack = new Stack();
+
+  ////////////////////// Static Methods //////////////////////
+
+  /**
+   * Parses XML data and from it configures a <code>DistributedSystemConfig</code>.
+   *
+   * @throws AdminXmlException If an error is encountered while parsing the XML
+   */
+  public static void parse(InputStream is, DistributedSystemConfig config) {
+    ManagedEntityConfigXmlParser handler = new ManagedEntityConfigXmlParser();
+    handler.config = config;
+
+    try {
+      SAXParserFactory factory = SAXParserFactory.newInstance();
+      factory.setValidating(true);
+      SAXParser parser = factory.newSAXParser();
+      parser.parse(is, new DefaultHandlerDelegate(handler));
+
+    } catch (Exception ex) {
+      if (ex instanceof AdminXmlException) {
+        throw (AdminXmlException) ex;
+
+      } else if (ex.getCause() instanceof AdminXmlException) {
+        throw (AdminXmlException) ex.getCause();
+
+      } else if (ex instanceof SAXException) {
+        // Silly JDK 1.4.2 XML parser wraps RunTime exceptions in a
+        // SAXException. Pshaw!
+
+        SAXException sax = (SAXException) ex;
+        Exception cause = sax.getException();
+        if (cause instanceof AdminXmlException) {
+          throw (AdminXmlException) cause;
+        }
+      }
+
+      throw new AdminXmlException(
+          LocalizedStrings.ManagedEntityConfigXmlParser_WHILE_PARSING_XML.toLocalizedString(), ex);
+    }
+  }
+
+  /**
+   * Helper method for parsing an integer
+   *
+   * @throws org.apache.geode.cache.CacheXmlException If <code>s</code> is a malformed integer
+   */
+  private static int parseInt(String s) {
+    try {
+      return Integer.parseInt(s);
+
+    } catch (NumberFormatException ex) {
+      throw new AdminXmlException(
+          LocalizedStrings.ManagedEntityConfigXmlParser_MALFORMED_INTEGER_0.toLocalizedString(s),
+          ex);
+    }
+  }
+
+  ////////////////////// Instance Methods //////////////////////
+
+  // if (this.system.isMcastEnabled()) {
+  // generateMulticast();
+  // }
+
+  public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
+      throws SAXException {
+
+    if (qName.equals(DISTRIBUTED_SYSTEM)) {
+      startDistributedSystem(atts);
+
+    } else if (qName.equals(REMOTE_COMMAND)) {
+      startRemoteCommand(atts);
+
+    } else if (qName.equals(LOCATORS)) {
+      startLocators(atts);
+
+    } else if (qName.equals(MULTICAST)) {
+      startMulticast(atts);
+
+    } else if (qName.equals(LOCATOR)) {
+      startLocator(atts);
+
+    } else if (qName.equals(HOST)) {
+      startHost(atts);
+
+    } else if (qName.equals(WORKING_DIRECTORY)) {
+      startWorkingDirectory(atts);
+
+    } else if (qName.equals(PRODUCT_DIRECTORY)) {
+      startProductDirectory(atts);
+
+    } else if (qName.equals(SSL)) {
+      startSSL(atts);
+
+    } else if (qName.equals(PROTOCOLS)) {
+      startProtocols(atts);
+
+    } else if (qName.equals(CIPHERS)) {
+      startCiphers(atts);
+
+    } else if (qName.equals(PROPERTY)) {
+      startProperty(atts);
+
+    } else if (qName.equals(KEY)) {
+      startKey(atts);
+
+    } else if (qName.equals(VALUE)) {
+      startValue(atts);
+
+    } else if (qName.equals(CACHE_SERVER)) {
+      startCacheServer(atts);
+
+    } else if (qName.equals(CLASSPATH)) {
+      startClassPath(atts);
+
+    } else {
+      throw new AdminXmlException(
+          LocalizedStrings.ManagedEntityConfigXmlParser_UNKNOWN_XML_ELEMENT_0
+              .toLocalizedString(qName));
+    }
+  }
+
+  public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+
+    if (qName.equals(DISTRIBUTED_SYSTEM)) {
+      endDistributedSystem();
+
+    } else if (qName.equals(REMOTE_COMMAND)) {
+      endRemoteCommand();
+
+    } else if (qName.equals(LOCATORS)) {
+      endLocators();
+
+    } else if (qName.equals(MULTICAST)) {
+      endMulticast();
+
+    } else if (qName.equals(LOCATOR)) {
+      endLocator();
+
+    } else if (qName.equals(HOST)) {
+      endHost();
+
+    } else if (qName.equals(WORKING_DIRECTORY)) {
+      endWorkingDirectory();
+
+    } else if (qName.equals(PRODUCT_DIRECTORY)) {
+      endProductDirectory();
+
+    } else if (qName.equals(SSL)) {
+      endSSL();
+
+    } else if (qName.equals(PROTOCOLS)) {
+      endProtocols();
+
+    } else if (qName.equals(CIPHERS)) {
+      endCiphers();
+
+    } else if (qName.equals(PROPERTY)) {
+      endProperty();
+
+    } else if (qName.equals(KEY)) {
+      endKey();
+
+    } else if (qName.equals(VALUE)) {
+      endValue();
+
+    } else if (qName.equals(CACHE_SERVER)) {
+      endCacheServer();
+
+    } else if (qName.equals(CLASSPATH)) {
+      endClassPath();
+
+    } else {
+      throw new AdminXmlException(
+          LocalizedStrings.ManagedEntityConfigXmlParser_UNKNOWN_XML_ELEMENT_0
+              .toLocalizedString(qName));
+    }
+  }
+
+  /**
+   * When a <code>distributed-system</code> element is encountered, we push the
+   * <code>DistributedSystemConfig</code> on the stack.
+   */
+  private void startDistributedSystem(Attributes atts) {
+    Assert.assertTrue(stack.isEmpty());
+
+    String id = atts.getValue(ID);
+    if (id != null) {
+      this.config.setSystemId(id);
+    }
+
+    String disable_tcp = atts.getValue(DISABLE_TCP);
+    if (disable_tcp != null) {
+      this.config.setDisableTcp(DISABLE_TCP.equalsIgnoreCase("true"));
+    }
+
+    stack.push(this.config);
+  }
+
+  /**
+   * When a <code>distributed-system</code> element is finished
+   */
+  private void endDistributedSystem() {
+
+  }
+
+  /**
+   * When a <code>multicast</code> is first encountered, get the
+   * <code>DistributedSystemConfig</code> off of the top of the stack and set its multicast config
+   * appropriately.
+   */
+  private void startMulticast(Attributes atts) {
+    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
+
+    String port = atts.getValue(PORT);
+    config.setMcastPort(parseInt(port));
+
+    String address = atts.getValue(ADDRESS);
+    if (address != null) {
+      config.setMcastAddress(address);
+    }
+  }
+
+  private void endMulticast() {
+
+  }
+
+  /**
+   * Starts a <code>remote-command</code> element. The item on top of the stack may be a
+   * <code>DistributedSystemConfig</code> or it might be a <code>ManagedEntityConfig</code>.
+   */
+  private void startRemoteCommand(Attributes atts) {
+
+  }
+
+  /**
+   * Ends a <code>remote-command</code> element. Pop the command off the top of the stack and set it
+   * on the <code>DistributedSystemConfig</code> or it might be a <code>ManagedEntityConfig</code>
+   * on top of the stack.
+   */
+  private void endRemoteCommand() {
+    String remoteCommand = popString();
+    Object top = stack.peek();
+    Assert.assertTrue(top != null);
+
+    if (top instanceof DistributedSystemConfig) {
+      ((DistributedSystemConfig) top).setRemoteCommand(remoteCommand);
+
+    } else if (top instanceof ManagedEntityConfig) {
+      ((ManagedEntityConfig) top).setRemoteCommand(remoteCommand);
+
+    } else {
+      String s = "Did not expect a " + top.getClass().getName() + " on top of the stack";
+      Assert.assertTrue(false, s);
+    }
+  }
+
+  private void startLocators(Attributes atts) {
+
+  }
+
+  private void endLocators() {
+
+  }
+
+  private void startLocator(Attributes atts) {
+    String port = atts.getValue(PORT);
+
+    DistributedSystemConfig system = (DistributedSystemConfig) stack.peek();
+    system.setMcastPort(0);
+
+    DistributionLocatorConfig config = system.createDistributionLocatorConfig();
+
+    config.setPort(parseInt(port));
+
+    stack.push(config);
+  }
+
+  private void endLocator() {
+    Object o = stack.pop();
+    Assert.assertTrue(o instanceof DistributionLocatorConfig);
+  }
+
+  private void startHost(Attributes atts) {
+
+  }
+
+  /**
+   * We assume that there is a <code>ManagedEntityConfig</code> on top of the stack.
+   */
+  private void endHost() {
+    String host = popString();
+    ManagedEntityConfig config = (ManagedEntityConfig) stack.peek();
+    config.setHost(host);
+  }
+
+  private void startWorkingDirectory(Attributes atts) {
+
+  }
+
+  private void endWorkingDirectory() {
+    String workingDirectory = popString();
+    ManagedEntityConfig config = (ManagedEntityConfig) stack.peek();
+    config.setWorkingDirectory(workingDirectory);
+  }
+
+  private void startProductDirectory(Attributes atts) {
+
+  }
+
+  private void endProductDirectory() {
+    String productDirectory = popString();
+    ManagedEntityConfig config = (ManagedEntityConfig) stack.peek();
+    config.setProductDirectory(productDirectory);
+  }
+
+  private void startSSL(Attributes atts) {
+    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
+    config.setSSLEnabled(true);
+
+    String authenticationRequired = atts.getValue(AUTHENTICATION_REQUIRED);
+    config.setSSLAuthenticationRequired(Boolean.valueOf(authenticationRequired).booleanValue());
+  }
+
+  private void endSSL() {
+
+  }
+
+  private void startProtocols(Attributes atts) {
+
+  }
+
+  private void endProtocols() {
+    String protocols = popString();
+    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
+    config.setSSLProtocols(protocols);
+  }
+
+  private void startCiphers(Attributes atts) {
+
+  }
+
+  private void endCiphers() {
+    String ciphers = popString();
+    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
+    config.setSSLCiphers(ciphers);
+  }
+
+  private void startProperty(Attributes atts) {
+
+  }
+
+  private void endProperty() {
+    String value = popString();
+    String key = popString();
+    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
+    config.addSSLProperty(key, value);
+  }
+
+  private void startKey(Attributes atts) {
+
+  }
+
+  private void endKey() {
+    String key = popString();
+    stack.push(key);
+  }
+
+  private void startValue(Attributes atts) {
+
+  }
+
+  private void endValue() {
+    String value = popString();
+    stack.push(value);
+  }
+
+  private void startCacheServer(Attributes atts) {
+    DistributedSystemConfig config = (DistributedSystemConfig) stack.peek();
+    CacheServerConfig server = config.createCacheServerConfig();
+    stack.push(server);
+  }
+
+  private void endCacheServer() {
+    /* CacheServerConfig server = (CacheServerConfig) */ stack.pop();
+  }
+
+  private void startClassPath(Attributes atts) {
+
+  }
+
+  private void endClassPath() {
+    String classpath = popString();
+    CacheServerConfig server = (CacheServerConfig) stack.peek();
+    server.setClassPath(classpath);
+  }
+
+  /**
+   * Pops a <code>String</code> off of the stack.
+   */
+  private String popString() {
+    Object o = stack.pop();
+
+    if (o instanceof StringBuffer) {
+      StringBuffer sb = (StringBuffer) o;
+      return sb.toString();
+
+    } else {
+      return (String) o;
+    }
+  }
+
+  /**
+   * Long strings in XML files may generate multiple <code>characters</code> callbacks. Coalesce
+   * multiple callbacks into one big string by using a <code>StringBuffer</code>. See bug 32122.
+   */
+  public void characters(char[] ch, int start, int length) throws SAXException {
+
+    Object top = stack.peek();
+
+    StringBuffer sb;
+    if (top instanceof StringBuffer) {
+      sb = (StringBuffer) top;
+
+    } else {
+      sb = new StringBuffer();
+      stack.push(sb);
+    }
+
+    sb.append(ch, start, length);
+  }
+
+  ////////// Inherited methods that don't do anything //////////
+
+  public void setDocumentLocator(Locator locator) {}
+
+  public void startDocument() throws SAXException {}
+
+  public void endDocument() throws SAXException {}
+
+  public void startPrefixMapping(String prefix, String uri) throws SAXException {}
+
+  public void endPrefixMapping(String prefix) throws SAXException {}
+
+  public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {}
+
+  public void processingInstruction(String target, String data) throws SAXException {}
+
+  public void skippedEntity(String name) throws SAXException {}
+
+  /////////////////////// Inner Classes ///////////////////////
+
+  /**
+   * Class that delegates all of the methods of a {@link DefaultHandler} to a
+   * {@link ManagedEntityConfigXmlParser} that implements all of the methods of
+   * <code>DefaultHandler</code>, but <B>is not</B> a <code>DefaultHandler</code>.
+   */
+  static class DefaultHandlerDelegate extends DefaultHandler {
+    /**
+     * The <code>ManagedEntityConfigXmlParser</code> that does the real work
+     */
+    private ManagedEntityConfigXmlParser handler;
+
+    /**
+     * Creates a new <code>DefaultHandlerDelegate</code> that delegates to the given
+     * <code>ManagedEntityConfigXmlParser</code>.
+     */
+    public DefaultHandlerDelegate(ManagedEntityConfigXmlParser handler) {
+      this.handler = handler;
+    }
+
+    @Override
+    public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
+      return handler.resolveEntity(publicId, systemId);
+    }
+
+    @Override
+    public void setDocumentLocator(Locator locator) {
+      handler.setDocumentLocator(locator);
+    }
+
+    @Override
+    public void startDocument() throws SAXException {
+      handler.startDocument();
+    }
+
+    @Override
+    public void endDocument() throws SAXException {
+      handler.endDocument();
+    }
+
+    @Override
+    public void startPrefixMapping(String prefix, String uri) throws SAXException {
+      handler.startPrefixMapping(prefix, uri);
+    }
+
+    @Override
+    public void endPrefixMapping(String prefix) throws SAXException {
+      handler.endPrefixMapping(prefix);
+    }
+
+    @Override
+    public void startElement(String uri, String localName, String qName, Attributes attributes)
+        throws SAXException {
+      handler.startElement(uri, localName, qName, attributes);
+    }
+
+    @Override
+    public void endElement(String uri, String localName, String qName) throws SAXException {
+      handler.endElement(uri, localName, qName);
+    }
+
+    @Override
+    public void characters(char[] ch, int start, int length) throws SAXException {
+      handler.characters(ch, start, length);
+    }
+
+    @Override
+    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+      handler.ignorableWhitespace(ch, start, length);
+    }
+
+    @Override
+    public void processingInstruction(String target, String data) throws SAXException {
+      handler.processingInstruction(target, data);
+    }
+
+    @Override
+    public void skippedEntity(String name) throws SAXException {
+      handler.skippedEntity(name);
+    }
+
+    @Override
+    public void warning(SAXParseException e) throws SAXException {
+      handler.warning(e);
+    }
+
+    @Override
+    public void error(SAXParseException e) throws SAXException {
+      handler.error(e);
+    }
+
+    @Override
+    public void fatalError(SAXParseException e) throws SAXException {
+      handler.fatalError(e);
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityController.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityController.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityController.java
new file mode 100644
index 0000000..5876d0e
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityController.java
@@ -0,0 +1,66 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.geode.internal.admin.api.DistributedSystemConfig;
+import org.apache.geode.internal.admin.api.ManagedEntity;
+import org.apache.geode.internal.admin.api.ManagedEntityConfig;
+
+/**
+ * Defines the actual administration (starting, stopping, etc.) of GemFire {@link ManagedEntity}s.
+ * 
+ */
+interface ManagedEntityController {
+  /**
+   * Starts a managed entity.
+   */
+  public void start(final InternalManagedEntity entity);
+
+  /**
+   * Stops a managed entity.
+   */
+  public void stop(final InternalManagedEntity entity);
+
+  /**
+   * Returns whether or not a managed entity is running
+   */
+  public boolean isRunning(InternalManagedEntity entity);
+
+  /**
+   * Returns the contents of a locator's log file. Other APIs are used to get the log file of
+   * managed entities that are also system members.
+   */
+  public String getLog(DistributionLocatorImpl locator);
+
+  /**
+   * Returns the full path to the executable in <code>$GEMFIRE/bin</code> taking into account the
+   * {@linkplain ManagedEntityConfig#getProductDirectory product directory} and the platform's file
+   * separator.
+   *
+   * <P>
+   *
+   * Note: we should probably do a better job of determine whether or not the machine on which the
+   * entity runs is Windows or Linux.
+   *
+   * @param executable The name of the executable that resides in <code>$GEMFIRE/bin</code>.
+   */
+  public String getProductExecutable(InternalManagedEntity entity, String executable);
+
+  /**
+   * Builds optional SSL command-line arguments. Returns null if SSL is not enabled for the
+   * distributed system.
+   */
+  public String buildSSLArguments(DistributedSystemConfig config);
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityControllerFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityControllerFactory.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityControllerFactory.java
new file mode 100755
index 0000000..d9a93ef
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/impl/ManagedEntityControllerFactory.java
@@ -0,0 +1,63 @@
+/*
+ * 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.internal.admin.api.impl;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.internal.admin.api.AdminDistributedSystem;
+import org.apache.geode.internal.admin.api.ManagedEntity;
+import org.apache.geode.internal.ClassPathLoader;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.logging.log4j.LogMarker;
+
+/**
+ * Creates ManagedEntityController for administration (starting, stopping, etc.) of GemFire
+ * {@link ManagedEntity}s.
+ * 
+ */
+public class ManagedEntityControllerFactory {
+
+  private static final Logger logger = LogService.getLogger();
+
+  private static final String ENABLED_MANAGED_ENTITY_CONTROLLER_CLASS_NAME =
+      "EnabledManagedEntityController";
+
+  static ManagedEntityController createManagedEntityController(
+      final AdminDistributedSystem system) {
+    if (isEnabledManagedEntityController()) {
+      logger.info(LogMarker.CONFIG,
+          "Local and remote OS command invocations are enabled for the Admin API.");
+      return createEnabledManagedEntityController(system);
+    } else {
+      logger.info(LogMarker.CONFIG,
+          "Local and remote OS command invocations are disabled for the Admin API.");
+      return new DisabledManagedEntityController();
+    }
+  }
+
+  public static boolean isEnabledManagedEntityController() {
+    try {
+      ClassPathLoader.getLatest().forName(ENABLED_MANAGED_ENTITY_CONTROLLER_CLASS_NAME);
+      return true;
+    } catch (ClassNotFoundException e) {
+      return false;
+    }
+  }
+
+  private static ManagedEntityController createEnabledManagedEntityController(
+      final AdminDistributedSystem system) {
+    return new EnabledManagedEntityController(system);
+  }
+}


[38/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
deleted file mode 100644
index 6a1bd63..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java
+++ /dev/null
@@ -1,918 +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.admin.jmx.internal;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.PrintStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.SortedMap;
-import java.util.StringTokenizer;
-import java.util.TreeMap;
-
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.GemFireException;
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.jmx.Agent;
-import org.apache.geode.admin.jmx.AgentConfig;
-import org.apache.geode.admin.jmx.AgentFactory;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.internal.OSProcess;
-import org.apache.geode.internal.PureJavaMode;
-import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.util.IOUtils;
-import org.apache.geode.internal.util.JavaCommandBuilder;
-
-/**
- * A command line utility inspired by the <code>CacheServerLauncher</code> that is responsible for
- * administering a stand-along GemFire JMX {@link Agent}.
- * <p/>
- * 
- * @since GemFire 3.5
- */
-public class AgentLauncher {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /** Should the launch command be printed? */
-  public static final boolean PRINT_LAUNCH_COMMAND =
-      Boolean.getBoolean(AgentLauncher.class.getSimpleName() + ".PRINT_LAUNCH_COMMAND");
-
-  /* constants used to define state */
-  static final int SHUTDOWN = 0;
-  static final int STARTING = 1;
-  static final int RUNNING = 2;
-  static final int SHUTDOWN_PENDING = 3;
-  static final int SHUTDOWN_PENDING_AFTER_FAILED_STARTUP = 4;
-  static final int UNKNOWN = 6;
-
-  /** Agent configuration options */
-  static final String AGENT_PROPS = "agent-props";
-
-  /**
-   * A flag to indicate if the current log file should be kept. Used only when 'start' is used to
-   * fork off the 'server'
-   */
-  static final String APPENDTO_LOG_FILE = "appendto-log-file";
-
-  /** optional and additional classpath entries */
-  static final String CLASSPATH = "classpath";
-
-  /** The directory argument */
-  static final String DIR = "dir";
-
-  /** Extra VM arguments */
-  static final String VMARGS = "vmargs";
-
-  /** The directory in which the agent's output resides */
-  private File workingDirectory = null;
-
-  /** The Status object for the agent */
-  private Status status = null;
-
-  /** base name for the agent to be launched */
-  private final String basename;
-
-  /** The name for the start up log file */
-  private final String startLogFileName;
-
-  /** The name of the status file */
-  private final String statusFileName;
-
-  /**
-   * Instantiates an AgentLauncher for execution and control of the GemFire JMX Agent process. This
-   * constructor is package private to prevent direct instantiation or subclassing by classes
-   * outside this package, but does allow the class to be tested as needed.
-   * <p/>
-   * 
-   * @param basename base name for the application to be launched
-   */
-  AgentLauncher(final String basename) {
-    assert basename != null : "The base name used by the AgentLauncher to create files cannot be null!";
-    this.basename = basename;
-    final String formattedBasename = this.basename.toLowerCase().replace(" ", "");
-    this.startLogFileName = "start_" + formattedBasename + ".log";
-    this.statusFileName = "." + formattedBasename + ".ser";
-  }
-
-  /**
-   * Prints information about the agent configuration options
-   */
-  public void configHelp() {
-    PrintStream out = System.out;
-
-    Properties props = AgentConfigImpl.getDefaultValuesForAllProperties();
-
-    out.println("\n");
-    out.println(LocalizedStrings.AgentLauncher_AGENT_CONFIGURATION_PROPERTIES.toString());
-
-    SortedMap<String, String> map = new TreeMap<String, String>();
-
-    int maxLength = 0;
-    for (Iterator<Object> iter = props.keySet().iterator(); iter.hasNext();) {
-      String prop = (String) iter.next();
-      int length = prop.length();
-      if (length > maxLength) {
-        maxLength = length;
-      }
-
-      map.put(prop,
-          AgentConfigImpl.getPropertyDescription(prop) + " ("
-              + LocalizedStrings.AgentLauncher_DEFAULT.toLocalizedString() + "  \""
-              + props.getProperty(prop) + "\")");
-    }
-
-    Iterator<Entry<String, String>> entries = map.entrySet().iterator();
-    while (entries.hasNext()) {
-      Entry<String, String> entry = entries.next();
-      String prop = entry.getKey();
-      out.print("  ");
-      out.println(prop);
-
-      String description = entry.getValue();
-      StringTokenizer st = new StringTokenizer(description, " ");
-      out.print("    ");
-      int printed = 6;
-      while (st.hasMoreTokens()) {
-        String word = st.nextToken();
-        if (printed + word.length() > 72) {
-          out.print("\n    ");
-          printed = 6;
-        }
-        out.print(word);
-        out.print(" ");
-        printed += word.length() + 1;
-      }
-      out.println("");
-    }
-    out.println("");
-
-    System.exit(1);
-  }
-
-  /**
-   * Returns a map that maps the name of the start options to its value on the command line. If no
-   * value is specified on the command line, a default one is provided.
-   */
-  protected Map<String, Object> getStartOptions(final String[] args) throws Exception {
-    final Map<String, Object> options = new HashMap<String, Object>();
-
-    options.put(APPENDTO_LOG_FILE, "false");
-    options.put(DIR, IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(new File(".")));
-
-    final List<String> vmArgs = new ArrayList<String>();
-    options.put(VMARGS, vmArgs);
-
-    final Properties agentProps = new Properties();
-    options.put(AGENT_PROPS, agentProps);
-
-    for (final String arg : args) {
-      if (arg.startsWith("-classpath=")) {
-        options.put(CLASSPATH, arg.substring("-classpath=".length()));
-      } else if (arg.startsWith("-dir=")) {
-        final File workingDirectory = processDirOption(options, arg.substring("-dir=".length()));
-        System.setProperty(AgentConfigImpl.AGENT_PROPSFILE_PROPERTY_NAME,
-            new File(workingDirectory, AgentConfig.DEFAULT_PROPERTY_FILE).getPath());
-      } else if (arg.startsWith("-J")) {
-        vmArgs.add(arg.substring(2));
-      } else if (arg.contains("=")) {
-        final int index = arg.indexOf("=");
-        final String prop = arg.substring(0, index);
-        final String value = arg.substring(index + 1);
-
-        // if appendto-log-file is set, put it in options; it is not set as an agent prop
-        if (prop.equals(APPENDTO_LOG_FILE)) {
-          options.put(APPENDTO_LOG_FILE, value);
-          continue;
-        }
-
-        // verify the property is valid
-        AgentConfigImpl.getPropertyDescription(prop);
-
-        // Note, the gfAgentPropertyFile System property is ultimately read in the constructor of
-        // the AgentImpl class
-        // in order to make any properties defined in this file not only accessible to the
-        // DistributedSystem but to
-        // the GemFire Agent as well.
-        if (AgentConfigImpl.PROPERTY_FILE_NAME.equals(prop)) {
-          System.setProperty(AgentConfigImpl.AGENT_PROPSFILE_PROPERTY_NAME, value);
-        }
-
-        // The Agent properties file (specified with the command-line key=value) is used to pass
-        // configuration settings
-        // to the GemFire DistributedSystem. A property file can be passed using the property-file
-        // command-line switch
-        // is a large number of properties are specified, or the properties maybe individually
-        // specified on the
-        // command-line as property=value arguments.
-        agentProps.setProperty(prop, value);
-      }
-    }
-
-    return options;
-  }
-
-  /**
-   * After parsing the command line arguments, spawn the Java VM that will host the GemFire JMX
-   * Agent.
-   */
-  public void start(final String[] args) throws Exception {
-    final Map<String, Object> options = getStartOptions(args);
-
-    workingDirectory = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile((File) options.get(DIR));
-
-    // verify that any GemFire JMX Agent process has been properly shutdown and delete any remaining
-    // status files...
-    verifyAndClearStatus();
-
-    // start the GemFire JMX Agent process...
-    runCommandLine(options, buildCommandLine(options));
-
-    // wait for the GemFire JMX Agent process to complete startup and begin running...
-    // it is also possible the Agent process may fail to start, so this should not wait indefinitely
-    // unless
-    // the status file was not successfully written to
-    pollAgentUntilRunning();
-
-    System.exit(0);
-  }
-
-  private void verifyAndClearStatus() throws Exception {
-    final Status status = getStatus();
-
-    if (status != null && status.state != SHUTDOWN) {
-      throw new IllegalStateException(
-          LocalizedStrings.AgentLauncher_JMX_AGENT_EXISTS_BUT_WAS_NOT_SHUTDOWN.toLocalizedString());
-    }
-
-    deleteStatus();
-  }
-
-  private String[] buildCommandLine(final Map<String, Object> options) {
-    final List<String> commands = JavaCommandBuilder.buildCommand(AgentLauncher.class.getName(),
-        (String) options.get(CLASSPATH), null, (List<String>) options.get(VMARGS));
-
-    commands.add("server");
-    commands.add("-dir=" + workingDirectory);
-
-    final Properties agentProps = (Properties) options.get(AGENT_PROPS);
-
-    for (final Object key : agentProps.keySet()) {
-      commands.add(key + "=" + agentProps.get(key.toString()));
-    }
-
-    return commands.toArray(new String[commands.size()]);
-  }
-
-  private void printCommandLine(final String[] commandLine) {
-    if (PRINT_LAUNCH_COMMAND) {
-      System.out.print("Starting " + this.basename + " with command:\n");
-      for (final String command : commandLine) {
-        System.out.print(command);
-        System.out.print(' ');
-      }
-      System.out.println();
-    }
-  }
-
-  private int runCommandLine(final Map<String, Object> options, final String[] commandLine)
-      throws IOException {
-    // initialize the startup log starting with a fresh log file (where all startup messages are
-    // printed)
-    final File startLogFile = IOUtils
-        .tryGetCanonicalFileElseGetAbsoluteFile(new File(workingDirectory, startLogFileName));
-
-    if (startLogFile.exists() && !startLogFile.delete()) {
-      throw new IOException(LocalizedStrings.AgentLauncher_UNABLE_TO_DELETE_FILE_0
-          .toLocalizedString(startLogFile.getAbsolutePath()));
-    }
-
-    Map<String, String> env = new HashMap<String, String>();
-    // read the passwords from command line
-    SocketCreator.readSSLProperties(env, true);
-
-    printCommandLine(commandLine);
-
-    final int pid = OSProcess.bgexec(commandLine, workingDirectory, startLogFile, false, env);
-
-    System.out.println(
-        LocalizedStrings.AgentLauncher_STARTING_JMX_AGENT_WITH_PID_0.toLocalizedString(pid));
-
-    return pid;
-  }
-
-  private void pollAgentUntilRunning() throws Exception {
-    Status status = spinReadStatus();
-
-    // TODO this loop could recurse indefinitely if the GemFire JMX Agent's state never changes from
-    // STARTING
-    // to something else (like RUNNING), which could happen if server process fails to startup
-    // correctly
-    // and did not or could not write to the status file!
-    // TODO should we really allow the InterruptedException from the Thread.sleep call to break this
-    // loop (yeah, I
-    // think so given the fact this could loop indefinitely)?
-    while (status != null && status.state == STARTING) {
-      Thread.sleep(500);
-      status = spinReadStatus();
-    }
-
-    if (status == null) {
-      // TODO throw a more appropriate Exception here!
-      throw new Exception(LocalizedStrings.AgentLauncher_NO_AVAILABLE_STATUS.toLocalizedString());
-    } else {
-      System.out.println(status);
-    }
-  }
-
-  /**
-   * Starts the GemFire JMX Agent "server" process with the given command line arguments.
-   */
-  public void server(final String[] args) throws Exception {
-    final Map<String, Object> options = getStartOptions(args);
-
-    workingDirectory = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile((File) options.get(DIR));
-
-    writeStatus(createStatus(this.basename, STARTING, OSProcess.getId()));
-
-    final Agent agent = createAgent((Properties) options.get(AGENT_PROPS));
-
-    final Thread thread = createAgentProcessThread(createAgentProcessThreadGroup(), agent);
-    thread.setDaemon(true);
-    thread.start();
-
-    // periodically check and see if the JMX Agent has been told to stop
-    pollAgentForPendingShutdown(agent);
-  }
-
-  private Agent createAgent(final Properties props) throws IOException, AdminException {
-    DistributionManager.isDedicatedAdminVM = true;
-    SystemFailure.setExitOK(true);
-
-    final AgentConfigImpl config = new AgentConfigImpl(props);
-
-    // see bug 43760
-    if (config.getLogFile() == null || "".equals(config.getLogFile().trim())) {
-      config.setLogFile(AgentConfigImpl.DEFAULT_LOG_FILE);
-    }
-
-    // LOG:TODO: redirectOutput called here
-    OSProcess.redirectOutput(new File(config.getLogFile())); // redirect output to the configured
-                                                             // log file
-
-    return AgentFactory.getAgent(config);
-  }
-
-  private ThreadGroup createAgentProcessThreadGroup() {
-    return new ThreadGroup(LocalizedStrings.AgentLauncher_STARTING_AGENT.toLocalizedString()) {
-      @Override
-      public void uncaughtException(final Thread t, final Throwable e) {
-        if (e instanceof VirtualMachineError) {
-          SystemFailure.setFailure((VirtualMachineError) e);
-        }
-        setServerError(LocalizedStrings.AgentLauncher_UNCAUGHT_EXCEPTION_IN_THREAD_0
-            .toLocalizedString(t.getName()), e);
-      }
-    };
-  }
-
-  private Thread createAgentProcessThread(final ThreadGroup group, final Agent agent) {
-    return new Thread(group, createAgentProcessRunnable(agent), "Start agent");
-  }
-
-  private Runnable createAgentProcessRunnable(final Agent agent) {
-    return new Runnable() {
-      public void run() {
-        try {
-          agent.start();
-          writeStatus(createStatus(AgentLauncher.this.basename, RUNNING, OSProcess.getId()));
-        } catch (IOException e) {
-          e.printStackTrace();
-        } catch (GemFireException e) {
-          e.printStackTrace();
-          handleGemFireException(e);
-        }
-      }
-
-      private void handleGemFireException(final GemFireException e) {
-        String message = LocalizedStrings.AgentLauncher_SERVER_FAILED_TO_START_0
-            .toLocalizedString(e.getMessage());
-
-        if (e.getCause() != null) {
-          if (e.getCause().getCause() != null) {
-            message += ", " + e.getCause().getCause().getMessage();
-          }
-        }
-
-        setServerError(null, new Exception(message));
-      }
-    };
-  }
-
-
-  /**
-   * Notes that an error has occurred in the agent and that it has shut down because of it.
-   */
-  private void setServerError(final String message, final Throwable cause) {
-    try {
-      writeStatus(createStatus(this.basename, SHUTDOWN_PENDING_AFTER_FAILED_STARTUP,
-          OSProcess.getId(), message, cause));
-    } catch (Exception e) {
-      logger.fatal(e.getMessage(), e);
-      System.exit(1);
-    }
-  }
-
-  private void pollAgentForPendingShutdown(final Agent agent) throws Exception {
-    while (true) {
-      pause(500);
-      spinReadStatus();
-
-      if (isStatus(SHUTDOWN_PENDING, SHUTDOWN_PENDING_AFTER_FAILED_STARTUP)) {
-        agent.stop();
-        final int exitCode = (isStatus(SHUTDOWN_PENDING_AFTER_FAILED_STARTUP) ? 1 : 0);
-        writeStatus(createStatus(this.status, SHUTDOWN));
-        System.exit(exitCode);
-      }
-    }
-  }
-
-  /**
-   * Extracts configuration information for stopping a agent based on the contents of the command
-   * line. This method can also be used with getting the status of a agent.
-   */
-  protected Map<String, Object> getStopOptions(final String[] args) throws Exception {
-    final Map<String, Object> options = new HashMap<String, Object>();
-
-    options.put(DIR, IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(new File(".")));
-
-    for (final String arg : args) {
-      if (arg.equals("stop") || arg.equals("status")) {
-        // expected
-      } else if (arg.startsWith("-dir=")) {
-        processDirOption(options, arg.substring("-dir=".length()));
-      } else {
-        throw new Exception(
-            LocalizedStrings.AgentLauncher_UNKNOWN_ARGUMENT_0.toLocalizedString(arg));
-      }
-    }
-
-    return options;
-  }
-
-  /**
-   * Stops a running JMX Agent by setting the status to "shutdown pending".
-   */
-  public void stop(final String[] args) throws Exception {
-    final Map<String, Object> options = getStopOptions(args);
-
-    workingDirectory = IOUtils.tryGetCanonicalFileElseGetAbsoluteFile((File) options.get(DIR));
-
-    int exitStatus = 1;
-
-    if (new File(workingDirectory, statusFileName).exists()) {
-      spinReadStatus();
-
-      if (!isStatus(SHUTDOWN)) {
-        writeStatus(createStatus(this.basename, SHUTDOWN_PENDING, status.pid));
-      }
-
-      pollAgentForShutdown();
-
-      if (isStatus(SHUTDOWN)) {
-        System.out
-            .println(LocalizedStrings.AgentLauncher_0_HAS_STOPPED.toLocalizedString(this.basename));
-        deleteStatus();
-        exitStatus = 0;
-      } else {
-        System.out
-            .println(LocalizedStrings.AgentLauncher_TIMEOUT_WAITING_FOR_0_TO_SHUTDOWN_STATUS_IS_1
-                .toLocalizedString(this.basename, status));
-      }
-    } else {
-      System.out.println(
-          LocalizedStrings.AgentLauncher_THE_SPECIFIED_WORKING_DIRECTORY_0_CONTAINS_NO_STATUS_FILE
-              .toLocalizedString(workingDirectory));
-    }
-
-    System.exit(exitStatus);
-  }
-
-  private void pollAgentForShutdown() throws InterruptedException {
-    final long endTime = (System.currentTimeMillis() + 20000);
-    long clock = 0;
-
-    while (clock < endTime && !isStatus(SHUTDOWN)) {
-      pause(500);
-      spinReadStatus();
-      clock = System.currentTimeMillis();
-    }
-  }
-
-  /**
-   * Prints the status of the GemFire JMX Agent running in the configured working directory.
-   */
-  public void status(final String[] args) throws Exception {
-    this.workingDirectory =
-        IOUtils.tryGetCanonicalFileElseGetAbsoluteFile((File) getStopOptions(args).get(DIR));
-    System.out.println(getStatus());
-    System.exit(0);
-  }
-
-  /**
-   * Returns the <code>Status</code> of the GemFire JMX Agent in the <code>workingDirectory</code>.
-   */
-  protected Status getStatus() throws Exception {
-    Status status;
-
-    if (new File(workingDirectory, statusFileName).exists()) {
-      status = spinReadStatus();
-    } else {
-      status = createStatus(this.basename, SHUTDOWN, 0,
-          LocalizedStrings.AgentLauncher_0_IS_NOT_RUNNING_IN_SPECIFIED_WORKING_DIRECTORY_1
-              .toLocalizedString(this.basename, this.workingDirectory),
-          null);
-    }
-
-    return status;
-  }
-
-  /**
-   * Determines if the Status.state is one of the specified states in the given array of states.
-   * Note, the status of the Agent, as indicated in the .agent.ser status file, should never have a
-   * written value of UNKNOWN.
-   * <p/>
-   * 
-   * @param states an array of possible acceptable states satisfying the condition of the Agent's
-   *        status.
-   * @return a boolean value indicating whether the Agent's status satisfies one of the specified
-   *         states.
-   */
-  private boolean isStatus(final Integer... states) {
-    return (this.status != null
-        && Arrays.asList(defaultToUnknownStateIfNull(states)).contains(this.status.state));
-  }
-
-  /**
-   * Removes an agent's status file
-   */
-  protected void deleteStatus() throws IOException {
-    final File statusFile = new File(workingDirectory, statusFileName);
-
-    if (statusFile.exists() && !statusFile.delete()) {
-      throw new IOException("Could not delete status file (" + statusFile.getAbsolutePath() + ")");
-    }
-  }
-
-  /**
-   * Reads the GemFire JMX Agent's status from the status file (.agent.ser) in it's working
-   * directory.
-   * <p/>
-   * 
-   * @return a Status object containing the state persisted to the .agent.ser file in the working
-   *         directory and representing the status of the Agent
-   * @throws IOException if the status file was unable to be read.
-   * @throws RuntimeException if the class of the object written to the .agent.ser file is not of
-   *         type Status.
-   */
-  protected Status readStatus() throws IOException {
-    FileInputStream fileIn = null;
-    ObjectInputStream objectIn = null;
-
-    try {
-      fileIn = new FileInputStream(new File(workingDirectory, statusFileName));
-      objectIn = new ObjectInputStream(fileIn);
-      this.status = (Status) objectIn.readObject();
-      return this.status;
-    } catch (ClassNotFoundException e) {
-      throw new RuntimeException(e);
-    } finally {
-      IOUtils.close(objectIn);
-      IOUtils.close(fileIn);
-    }
-  }
-
-  /**
-   * A wrapper method for the readStatus method to make one last check for the GemFire JMX Agent
-   * process if running with the native libraries.
-   * 
-   * @return the Status object as returned from readStatus unless running in native mode and a
-   *         determination is made such that the Agent process is not running.
-   * @throws IOException if the state of the Agent process could not be read from the .agent.ser
-   *         status file.
-   * @see #readStatus()
-   */
-  protected Status nativeReadStatus() throws IOException {
-    Status status = readStatus();
-
-    // @see Bug #32760 - the bug is still possible in pure Java mode
-    if (status != null && !PureJavaMode.isPure() && !OSProcess.exists(status.pid)) {
-      status = createStatus(status, SHUTDOWN);
-    }
-
-    return status;
-  }
-
-  /**
-   * Reads the JMX Agent's status from the .agent.ser status file. If the status file cannot be read
-   * due to I/O problems, the method will keep attempting to read the file for up to 20 seconds.
-   * <p/>
-   * 
-   * @return the Status of the GemFire JMX Agent as determined by the .agent.ser status file, or
-   *         natively based on the presence/absence of the Agent process.
-   */
-  protected Status spinReadStatus() {
-    Status status = null;
-
-    final long endTime = (System.currentTimeMillis() + 20000);
-    long clock = 0;
-
-    while (status == null && clock < endTime) {
-      try {
-        status = nativeReadStatus();
-      } catch (Exception ignore) {
-        // see bug 31575
-        // see bug 36998
-        // try again after a short delay... the status file might have been read prematurely before
-        // it existed
-        // or while the server was trying to write to it resulting in a possible EOFException, or
-        // other IOException.
-        pause(500);
-      } finally {
-        clock = System.currentTimeMillis();
-      }
-    }
-
-    return status;
-  }
-
-  /**
-   * Sets the status of the GemFire JMX Agent by serializing a <code>Status</code> object to a
-   * status file in the Agent's working directory.
-   * <p/>
-   * 
-   * @param status the Status object representing the state of the Agent process to persist to disk.
-   * @return the written Status object.
-   * @throws IOException if the Status could not be successfully persisted to disk.
-   */
-  public Status writeStatus(final Status status) throws IOException {
-    FileOutputStream fileOut = null;
-    ObjectOutputStream objectOut = null;
-
-    try {
-      fileOut = new FileOutputStream(new File(workingDirectory, statusFileName));
-      objectOut = new ObjectOutputStream(fileOut);
-      objectOut.writeObject(status);
-      objectOut.flush();
-      this.status = status;
-      return this.status;
-    } finally {
-      IOUtils.close(objectOut);
-      IOUtils.close(fileOut);
-    }
-  }
-
-  protected static Status createStatus(final String basename, final int state, final int pid) {
-    return createStatus(basename, state, pid, null, null);
-  }
-
-  protected static Status createStatus(final String basename, final int state, final int pid,
-      final String msg, final Throwable t) {
-    final Status status = new Status(basename);
-    status.state = state;
-    status.pid = pid;
-    status.msg = msg;
-    status.exception = t;
-    return status;
-  }
-
-  protected static Status createStatus(final Status status, final int state) {
-    assert status != null : "The status to clone cannot be null!";
-    return createStatus(status.baseName, state, status.pid, status.msg, status.exception);
-  }
-
-  protected static Integer[] defaultToUnknownStateIfNull(final Integer... states) {
-    return (states != null ? states : new Integer[] {UNKNOWN});
-  }
-
-  protected static boolean pause(final int milliseconds) {
-    try {
-      Thread.sleep(milliseconds);
-      return true;
-    } catch (InterruptedException e) {
-      Thread.currentThread().interrupt();
-      return false;
-    }
-  }
-
-  protected static File processDirOption(final Map<String, Object> options, final String dirValue)
-      throws FileNotFoundException {
-    final File workingDirectory = new File(dirValue);
-
-    if (!workingDirectory.exists()) {
-      throw new FileNotFoundException(
-          LocalizedStrings.AgentLauncher_THE_INPUT_WORKING_DIRECTORY_DOES_NOT_EXIST_0
-              .toLocalizedString(dirValue));
-    }
-
-    options.put(DIR, workingDirectory);
-
-    return workingDirectory;
-  }
-
-  /**
-   * Prints usage information for the AgentLauncher to the command line.
-   * <p/>
-   * 
-   * @param message a String to output to the command line indicating the user error.
-   */
-  private static void usage(final String message) {
-    final PrintStream out = System.out;
-
-    out.println("\n** " + message + "\n");
-
-    out.println("agent start [-J<vmarg>]* [-dir=<dir>] [prop=value]*");
-    out.println(LocalizedStrings.AgentLauncher_STARTS_THE_GEMFIRE_JMX_AGENT.toLocalizedString());
-    out.println("\t" + LocalizedStrings.AgentLauncher_VMARG.toLocalizedString());
-    out.println("\t" + LocalizedStrings.AgentLauncher_DIR.toLocalizedString());
-    out.println("\t" + LocalizedStrings.AgentLauncher_PROP.toLocalizedString());
-    out.println("\t" + LocalizedStrings.AgentLauncher_SEE_HELP_CONFIG.toLocalizedString());
-    out.println();
-
-    out.println("agent stop [-dir=<dir>]");
-    out.println(LocalizedStrings.AgentLauncher_STOPS_A_GEMFIRE_JMX_AGENT.toLocalizedString());
-    out.println("\t" + LocalizedStrings.AgentLauncher_DIR.toLocalizedString());
-    out.println("");
-    out.println("agent status [-dir=<dir>]");
-    out.println(
-        LocalizedStrings.AgentLauncher_REPORTS_THE_STATUS_AND_THE_PROCESS_ID_OF_A_GEMFIRE_JMX_AGENT
-            .toLocalizedString());
-    out.println("\t" + LocalizedStrings.AgentLauncher_DIR.toLocalizedString());
-    out.println();
-
-    System.exit(1);
-  }
-
-  /**
-   * Bootstrap method to launch the GemFire JMX Agent process to monitor and manage a GemFire
-   * Distributed System/Cache. Main will read the arguments passed on the command line and dispatch
-   * the command to the appropriate handler.
-   */
-  public static void main(final String[] args) {
-    if (args.length < 1) {
-      usage(LocalizedStrings.AgentLauncher_MISSING_COMMAND.toLocalizedString());
-    }
-
-    // TODO is this only needed on 'agent server'? 'agent {start|stop|status}' technically do no run
-    // any GemFire Cache
-    // or DS code inside the current process.
-    SystemFailure.loadEmergencyClasses();
-
-    final AgentLauncher launcher = new AgentLauncher("Agent");
-
-    try {
-      final String command = args[0];
-
-      if (command.equalsIgnoreCase("start")) {
-        launcher.start(args);
-      } else if (command.equalsIgnoreCase("server")) {
-        launcher.server(args);
-      } else if (command.equalsIgnoreCase("stop")) {
-        launcher.stop(args);
-      } else if (command.equalsIgnoreCase("status")) {
-        launcher.status(args);
-      } else if (command.toLowerCase().matches("-{0,2}help")) {
-        if (args.length > 1) {
-          final String topic = args[1];
-
-          if (topic.equals("config")) {
-            launcher.configHelp();
-          } else {
-            usage(LocalizedStrings.AgentLauncher_NO_HELP_AVAILABLE_FOR_0.toLocalizedString(topic));
-          }
-        }
-
-        usage(LocalizedStrings.AgentLauncher_AGENT_HELP.toLocalizedString());
-      } else {
-        usage(LocalizedStrings.AgentLauncher_UNKNOWN_COMMAND_0.toLocalizedString(command));
-      }
-    } catch (VirtualMachineError e) {
-      SystemFailure.initiateFailure(e);
-      throw e;
-    } catch (Throwable t) {
-      SystemFailure.checkFailure();
-      t.printStackTrace();
-      System.err.println(
-          LocalizedStrings.AgentLauncher_ERROR_0.toLocalizedString(t.getLocalizedMessage()));
-      System.exit(1);
-    }
-  }
-
-  /**
-   * A class representing the current state of the GemFire JMX Agent process. Instances of this
-   * class are serialized to a {@linkplain #statusFileName file} on disk in the specified working
-   * directory {@linkplain #workingDirectory}.
-   * <p/>
-   * 
-   * @see #SHUTDOWN
-   * @see #STARTING
-   * @see #RUNNING
-   * @see #SHUTDOWN_PENDING
-   * @see #SHUTDOWN_PENDING_AFTER_FAILED_STARTUP
-   */
-  // TODO refactor this class and internalize the state
-  // TODO refactor the class and make immutable
-  static class Status implements Serializable {
-
-    private static final long serialVersionUID = -7758402454664266174L;
-
-    int pid = 0;
-    int state = 0;
-
-    final String baseName;
-    String msg;
-
-    Throwable exception;
-
-    public Status(final String baseName) {
-      this.baseName = baseName;
-    }
-
-    @Override
-    public String toString() {
-      final StringBuilder buffer = new StringBuilder();
-
-      if (pid == Integer.MIN_VALUE && state == SHUTDOWN && msg != null) {
-        buffer.append(msg);
-      } else {
-        buffer.append(
-            LocalizedStrings.AgentLauncher_0_PID_1_STATUS.toLocalizedString(this.baseName, pid));
-
-        switch (state) {
-          case SHUTDOWN:
-            buffer.append(LocalizedStrings.AgentLauncher_SHUTDOWN.toLocalizedString());
-            break;
-          case STARTING:
-            buffer.append(LocalizedStrings.AgentLauncher_STARTING.toLocalizedString());
-            break;
-          case RUNNING:
-            buffer.append(LocalizedStrings.AgentLauncher_RUNNING.toLocalizedString());
-            break;
-          case SHUTDOWN_PENDING:
-            buffer.append(LocalizedStrings.AgentLauncher_SHUTDOWN_PENDING.toLocalizedString());
-            break;
-          case SHUTDOWN_PENDING_AFTER_FAILED_STARTUP:
-            buffer.append(LocalizedStrings.AgentLauncher_SHUTDOWN_PENDING_AFTER_FAILED_STARTUP
-                .toLocalizedString());
-            break;
-          default:
-            buffer.append(LocalizedStrings.AgentLauncher_UNKNOWN.toLocalizedString());
-            break;
-        }
-
-        if (exception != null) {
-          if (msg != null) {
-            buffer.append("\n").append(msg).append(" - ");
-          } else {
-            buffer.append("\n " + LocalizedStrings.AgentLauncher_EXCEPTION_IN_0_1
-                .toLocalizedString(this.baseName, exception.getMessage()) + " - ");
-          }
-          buffer
-              .append(LocalizedStrings.AgentLauncher_SEE_LOG_FILE_FOR_DETAILS.toLocalizedString());
-        }
-      }
-
-      return buffer.toString();
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/CacheServerJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/CacheServerJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/CacheServerJmxImpl.java
deleted file mode 100644
index 5e6202d..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/CacheServerJmxImpl.java
+++ /dev/null
@@ -1,590 +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.admin.jmx.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.Notification;
-import javax.management.ObjectName;
-import javax.management.modelmbean.ModelMBean;
-import javax.naming.OperationNotSupportedException;
-
-import org.apache.commons.modeler.ManagedBean;
-import org.apache.logging.log4j.Logger;
-
-import org.apache.geode.admin.AdminException;
-import org.apache.geode.admin.CacheServerConfig;
-import org.apache.geode.admin.CacheVmConfig;
-import org.apache.geode.admin.ConfigurationParameter;
-import org.apache.geode.admin.StatisticResource;
-import org.apache.geode.admin.SystemMemberCache;
-import org.apache.geode.admin.SystemMemberCacheEvent;
-import org.apache.geode.admin.SystemMemberRegionEvent;
-import org.apache.geode.admin.internal.CacheServerImpl;
-import org.apache.geode.admin.internal.ConfigurationParameterImpl;
-import org.apache.geode.internal.admin.ClientMembershipMessage;
-import org.apache.geode.internal.admin.GemFireVM;
-import org.apache.geode.internal.admin.StatResource;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.internal.logging.LogService;
-
-/**
- * MBean representation of a {@link org.apache.geode.admin.CacheVm}.
- *
- * @since GemFire 4.0
- */
-public class CacheServerJmxImpl extends CacheServerImpl
-    implements ManagedResource, CacheVmConfig, CacheServerConfig, SystemMemberJmx {
-
-  private static final Logger logger = LogService.getLogger();
-
-  /**
-   * Interval in seconds between refreshes. Value less than one results in no refreshing
-   */
-  private int refreshInterval = 0;
-
-  /** The object name of this managed resource */
-  private ObjectName objectName;
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  /** Reference to the cache MBean representing a Cache in the Cache VM Member */
-  private SystemMemberCacheJmxImpl managedSystemMemberCache;
-
-  /** collection to collect all the resources created for this member */
-  private Map<StatResource, StatisticResourceJmxImpl> managedStatisticsResourcesMap =
-      new HashMap<StatResource, StatisticResourceJmxImpl>();
-
-  ////////////////////// Constructors //////////////////////
-
-  /**
-   * Creates a new <code>CacheServerJmxImpl</code> for an existing cache server.
-   */
-  CacheServerJmxImpl(AdminDistributedSystemJmxImpl system, GemFireVM vm) throws AdminException {
-
-    super(system, vm);
-    initializeMBean();
-  }
-
-  /**
-   * Creates a new <code>CacheServerJmxImpl</code> for an newly-created cache server.
-   */
-  CacheServerJmxImpl(AdminDistributedSystemJmxImpl system, CacheVmConfig config)
-      throws AdminException {
-
-    super(system, config);
-    initializeMBean();
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Creates and registers the MBean to manage this resource
-   */
-  private void initializeMBean() throws AdminException {
-    // initialize Managed Resources for stats & cache first.
-    // initializeManagedResources();
-
-    this.mbeanName = new StringBuffer("GemFire.CacheVm:").append("id=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(getId())).append(",type=")
-        .append(MBeanUtil.makeCompliantMBeanNameProperty(getType().getName())).toString();
-
-    this.objectName =
-        MBeanUtil.createMBean(this, addDynamicAttributes(MBeanUtil.lookupManagedBean(this)));
-
-    // Refresh Interval
-    AdminDistributedSystemJmxImpl sysJmx = (AdminDistributedSystemJmxImpl) system;
-    if (sysJmx.getRefreshInterval() > 0)
-      this.refreshInterval = sysJmx.getRefreshInterval();
-  }
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.CACHE_VM;
-  }
-
-  /**
-   * Un-registers all the statistics & cache managed resource created for this member. After
-   * un-registering the resource MBean instances, clears managedStatisticsResourcesMap collection &
-   * sets managedSystemMemberCache to null.
-   * 
-   * Creates ConfigurationParameterJmxImpl, StatisticResourceJmxImpl and SystemMemberCacheJmxImpl.
-   * But cleans up only StatisticResourceJmxImpl and SystemMemberCacheJmxImpl which are of type
-   * ManagedResource.
-   */
-  public void cleanupResource() {
-    synchronized (this.managedStatisticsResourcesMap) {
-      ConfigurationParameter[] names = getConfiguration();
-      if (names != null) {
-        for (int i = 0; i < names.length; i++) {
-          ConfigurationParameter parm = names[i];
-          ((ConfigurationParameterImpl) parm).removeConfigurationParameterListener(this);
-        }
-      }
-      this.parms.clear();
-
-      Collection<StatisticResourceJmxImpl> statisticResources =
-          managedStatisticsResourcesMap.values();
-
-      for (StatisticResourceJmxImpl statisticResource : statisticResources) {
-        MBeanUtil.unregisterMBean(statisticResource);
-      }
-
-      this.managedStatisticsResourcesMap.clear();
-    }
-
-    MBeanUtil.unregisterMBean(this.managedSystemMemberCache);
-    this.managedSystemMemberCache = null;
-  }
-
-  /////////////////////// Configuration ///////////////////////
-
-  @Override
-  public String getHost() {
-    return this.getConfig().getHost();
-  }
-
-  public void setHost(String host) {
-    this.getConfig().setHost(host);
-  }
-
-  @Override
-  public String getWorkingDirectory() {
-    return this.getConfig().getWorkingDirectory();
-  }
-
-  @Override
-  public void setWorkingDirectory(String dir) {
-    this.getConfig().setWorkingDirectory(dir);
-  }
-
-  @Override
-  public String getProductDirectory() {
-    return this.getConfig().getProductDirectory();
-  }
-
-  @Override
-  public void setProductDirectory(String dir) {
-    this.getConfig().setProductDirectory(dir);
-  }
-
-  public String getRemoteCommand() {
-    return this.getConfig().getRemoteCommand();
-  }
-
-  public void setRemoteCommand(String remoteCommand) {
-    this.getConfig().setRemoteCommand(remoteCommand);
-  }
-
-  public void validate() {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  @Override
-  public Object clone() throws CloneNotSupportedException {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public String getCacheXMLFile() {
-    return this.getConfig().getCacheXMLFile();
-  }
-
-  public void setCacheXMLFile(String cacheXMLFile) {
-    this.getConfig().setCacheXMLFile(cacheXMLFile);
-  }
-
-  public String getClassPath() {
-    return this.getConfig().getClassPath();
-  }
-
-  public void setClassPath(String classpath) {
-    this.getConfig().setClassPath(classpath);
-  }
-
-  // -------------------------------------------------------------------------
-  // MBean attribute accessors/mutators
-  // -------------------------------------------------------------------------
-
-  /**
-   * Gets the interval in seconds between config refreshes
-   *
-   * @return the current refresh interval in seconds
-   */
-  public int getRefreshInterval() {
-    return this.refreshInterval;
-  }
-
-  /**
-   * Sets interval in seconds between cache config refreshes; zero or less turns off auto
-   * refreshing. Manual refreshing has no effect on when the next scheduled refresh will occur.
-   *
-   * @param refreshInterval the new refresh interval in seconds
-   */
-  public void _setRefreshInterval(int refreshInterval) {
-    boolean isRegistered = MBeanUtil.isRefreshNotificationRegistered(this,
-        RefreshNotificationType.SYSTEM_MEMBER_CONFIG);
-
-    if (isRegistered && (getRefreshInterval() == refreshInterval))
-      return;
-
-    this.refreshInterval = Helper.setAndReturnRefreshInterval(this, refreshInterval);
-  }
-
-  /**
-   * RefreshInterval is now set only through the AdminDistributedSystem property refreshInterval.
-   * Attempt to set refreshInterval on CacheServerJmx MBean would result in an
-   * OperationNotSupportedException Auto-refresh is enabled on demand when a call to refreshConfig
-   * is made
-   * 
-   * @param refreshInterval the new refresh interval in seconds
-   * @deprecated since 6.0 use DistributedSystemConfig.refreshInterval instead
-   */
-  @Deprecated
-  public void setRefreshInterval(int refreshInterval) throws OperationNotSupportedException {
-    throw new OperationNotSupportedException(
-        LocalizedStrings.MANAGED_RESOURCE_REFRESH_INTERVAL_CANT_BE_SET_DIRECTLY
-            .toLocalizedString());
-  }
-
-  // -------------------------------------------------------------------------
-  // MBean Operations
-  // -------------------------------------------------------------------------
-
-  public void refreshConfig() throws org.apache.geode.admin.AdminException {
-    // 1st call to refreshConfig would trigger
-    // the auto-refresh if an interval is set
-    if (this.refreshInterval > 0) {
-      this._setRefreshInterval(this.refreshInterval);
-    }
-
-    super.refreshConfig();
-  }
-
-  /**
-   * Initializes Cache & Statistics managed resources.
-   * 
-   * @throws AdminException if initialization of managed resources fails
-   */
-  // private void initializeManagedResources() throws AdminException {
-  // try {
-  // manageCache();
-  // } catch (MalformedObjectNameException e) {
-  // throw new
-  // AdminException(LocalizedStrings.SystemMemberJmxImpl_EXCEPTION_OCCURRED_WHILE_INITIALIZING_0_MBEANS_FOR_1.toLocalizedString(
-  // new Object[] {"Cache", getId()}),
-  // e);
-  // } catch (AdminException ae) {
-  // if
-  // (LocalizedStrings.SystemMemberJmx_THIS_SYSTEM_MEMBER_DOES_NOT_HAVE_A_CACHE.toLocalizedString().equals(ae.getMessage()))
-  // {
-  // //ignore this exception for a cache-less peer
-  // } else {
-  // throw ae;
-  // }
-  // }
-  // try {
-  // manageStats();
-  // } catch (MalformedObjectNameException e) {
-  // throw new
-  // AdminException(LocalizedStrings.SystemMemberJmxImpl_EXCEPTION_OCCURRED_WHILE_INITIALIZING_0_MBEANS_FOR_1.toLocalizedString(
-  // new Object[] {"Statistics", getId()}),
-  // e);
-  // }
-  // }
-
-  /**
-   * Gets this member's cache.
-   *
-   * @return array of ObjectName for this member's cache
-   */
-  public ObjectName manageCache() throws AdminException, MalformedObjectNameException {
-    return Helper.manageCache(this);
-  }
-
-  /**
-   * Gets all active StatisticResources for this manager.
-   *
-   * @return array of ObjectName instances
-   */
-  public ObjectName[] manageStats() throws AdminException, MalformedObjectNameException {
-    return Helper.manageStats(this);
-  }
-
-  /**
-   * Gets the active StatisticResources for this manager, based on the typeName as the key
-   *
-   * @return ObjectName of StatisticResourceJMX instance
-   */
-  public ObjectName[] manageStat(String statisticsTypeName)
-      throws AdminException, MalformedObjectNameException {
-
-    return Helper.manageStat(this, statisticsTypeName);
-  }
-
-  // -------------------------------------------------------------------------
-  // JMX Notification listener
-  // -------------------------------------------------------------------------
-
-  /**
-   * Handles notification to refresh. Reacts by refreshing the values of this GemFireManager's
-   * ConfigurationParamaters. Any other notification is ignored. Given notification is handled only
-   * if there is any JMX client connected to the system.
-   * 
-   * @param notification the JMX notification being received
-   * @param hb handback object is unused
-   */
-  public void handleNotification(Notification notification, Object hb) {
-    AdminDistributedSystemJmxImpl systemJmx = (AdminDistributedSystemJmxImpl) this.system;
-
-    if (!systemJmx.isRmiClientCountZero()) {
-      Helper.handleNotification(this, notification, hb);
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // Template methods overriden from superclass...
-  // -------------------------------------------------------------------------
-
-  /**
-   * Template method for creating instance of ConfigurationParameter. Overridden to return
-   * ConfigurationParameterJmxImpl.
-   */
-  @Override
-  protected ConfigurationParameter createConfigurationParameter(String name, String description,
-      Object value, Class type, boolean userModifiable) {
-    return new ConfigurationParameterJmxImpl(name, description, value, type, userModifiable);
-  }
-
-
-
-  /**
-   * Override createStatisticResource by instantiating StatisticResourceJmxImpl if it was not
-   * created earlier otherwise returns the same instance.
-   * 
-   * @param stat StatResource reference for which this JMX resource is to be created
-   * @return StatisticResourceJmxImpl - JMX Implementation of StatisticResource
-   * @throws AdminException if constructing StatisticResourceJmxImpl instance fails
-   */
-  @Override
-  protected StatisticResource createStatisticResource(StatResource stat)
-      throws org.apache.geode.admin.AdminException {
-    StatisticResourceJmxImpl managedStatisticResource = null;
-
-    synchronized (this.managedStatisticsResourcesMap) {
-      /*
-       * Ensuring that a single instance of Statistic Resource is created per StatResource.
-       */
-      StatisticResourceJmxImpl statisticResourceJmxImpl = managedStatisticsResourcesMap.get(stat);
-      if (statisticResourceJmxImpl != null) {
-        managedStatisticResource = statisticResourceJmxImpl;
-      } else {
-        managedStatisticResource = new StatisticResourceJmxImpl(stat, this);
-        managedStatisticResource.getStatistics();// inits timer
-        managedStatisticsResourcesMap.put(stat, managedStatisticResource);
-      }
-    }
-    return managedStatisticResource;
-  }
-
-  /**
-   * Override createSystemMemberCache by instantiating SystemMemberCacheJmxImpl if it was not
-   * created earlier.
-   * 
-   * @param vm GemFireVM reference for which this JMX resource is to be created
-   * @return SystemMemberCacheJmxImpl - JMX Implementation of SystemMemberCache
-   * @throws AdminException if constructing SystemMemberCacheJmxImpl instance fails
-   */
-  @Override
-  protected SystemMemberCache createSystemMemberCache(GemFireVM vm)
-      throws org.apache.geode.admin.AdminException {
-    if (managedSystemMemberCache == null) {
-      managedSystemMemberCache = new SystemMemberCacheJmxImpl(vm);
-    }
-    return managedSystemMemberCache;
-  }
-
-  // -------------------------------------------------------------------------
-  // Create MBean attributes for each ConfigurationParameter
-  // -------------------------------------------------------------------------
-
-  /**
-   * Add MBean attribute definitions for each ConfigurationParameter.
-   *
-   * @param managed the mbean definition to add attributes to
-   * @return a new instance of ManagedBean copied from <code>managed</code> but with the new
-   *         attributes added
-   */
-  public ManagedBean addDynamicAttributes(ManagedBean managed)
-      throws org.apache.geode.admin.AdminException {
-    return Helper.addDynamicAttributes(this, managed);
-  }
-
-  /**
-   * Cleans up Managed Resources created for the client that was connected to the server represented
-   * by this class.
-   * 
-   * @param clientId id of the client to be removed
-   * @return List of ManagedResources associated with the client of given client id
-   */
-  /*
-   * This clean up is for the clients. The clients are started with a loner DM. Hence the clientId
-   * is not supposed to contain '/' as per InternalDistributedMember.toString().
-   */
-  public List<ManagedResource> cleanupBridgeClientResources(String clientId) {
-    List<ManagedResource> returnedResources = new ArrayList<ManagedResource>();
-
-    String compatibleId = "id_" + MBeanUtil.makeCompliantMBeanNameProperty(clientId);
-    synchronized (this.managedStatisticsResourcesMap) {
-      Set<Entry<StatResource, StatisticResourceJmxImpl>> entrySet =
-          this.managedStatisticsResourcesMap.entrySet();
-
-      for (Iterator<Entry<StatResource, StatisticResourceJmxImpl>> it = entrySet.iterator(); it
-          .hasNext();) {
-        Entry<StatResource, StatisticResourceJmxImpl> entry = it.next();
-        StatisticResourceJmxImpl resource = entry.getValue();
-        if (resource.getMBeanName().contains(compatibleId)) {
-          it.remove(); // remove matching entry
-          returnedResources.add(resource);
-        }
-      }
-    }
-    return returnedResources;
-  }
-
-  /**
-   * Implementation handles client membership changes.
-   * 
-   * @param clientId id of the client for whom membership change happened
-   * @param eventType membership change type; one of {@link ClientMembershipMessage#JOINED},
-   *        {@link ClientMembershipMessage#LEFT}, {@link ClientMembershipMessage#CRASHED}
-   */
-  public void handleClientMembership(String clientId, int eventType) {
-    String notifType = null;
-    List<ManagedResource> cleanedUp = null;
-
-    if (eventType == ClientMembershipMessage.LEFT) {
-      notifType = NOTIF_CLIENT_LEFT;
-      cleanedUp = cleanupBridgeClientResources(clientId);
-    } else if (eventType == ClientMembershipMessage.CRASHED) {
-      notifType = NOTIF_CLIENT_CRASHED;
-      cleanedUp = cleanupBridgeClientResources(clientId);
-    } else if (eventType == ClientMembershipMessage.JOINED) {
-      notifType = NOTIF_CLIENT_JOINED;
-    }
-
-    if (cleanedUp != null) {
-      for (ManagedResource resource : cleanedUp) {
-        MBeanUtil.unregisterMBean(resource);
-      }
-    }
-
-    Helper.sendNotification(this, new Notification(notifType, this.modelMBean,
-        Helper.getNextNotificationSequenceNumber(), clientId));
-  }
-
-  /**
-   * Implementation handles creation of cache by extracting the details from the given event object
-   * and sending the {@link SystemMemberJmx#NOTIF_CACHE_CREATED} notification to the connected JMX
-   * Clients.
-   * 
-   * @param event event object corresponding to the creation of the cache
-   */
-  public void handleCacheCreate(SystemMemberCacheEvent event) {
-    Helper.sendNotification(this, new Notification(NOTIF_CACHE_CREATED, this.modelMBean,
-        Helper.getNextNotificationSequenceNumber(), Helper.getCacheEventDetails(event)));
-  }
-
-  /**
-   * Implementation handles closure of cache by extracting the details from the given event object
-   * and sending the {@link SystemMemberJmx#NOTIF_CACHE_CLOSED} notification to the connected JMX
-   * Clients.
-   * 
-   * @param event event object corresponding to the closure of the cache
-   */
-  public void handleCacheClose(SystemMemberCacheEvent event) {
-    Helper.sendNotification(this, new Notification(NOTIF_CACHE_CLOSED, this.modelMBean,
-        Helper.getNextNotificationSequenceNumber(), Helper.getCacheEventDetails(event)));
-  }
-
-  /**
-   * Implementation handles creation of region by extracting the details from the given event object
-   * and sending the {@link SystemMemberJmx#NOTIF_REGION_CREATED} notification to the connected JMX
-   * Clients. Region Path is set as User Data in Notification.
-   * 
-   * @param event event object corresponding to the creation of a region
-   */
-  public void handleRegionCreate(SystemMemberRegionEvent event) {
-    Notification notification = new Notification(NOTIF_REGION_CREATED, this.modelMBean,
-        Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event));
-
-    notification.setUserData(event.getRegionPath());
-
-    Helper.sendNotification(this, notification);
-  }
-
-  /**
-   * Implementation should handle loss of region by extracting the details from the given event
-   * object and sending the {@link SystemMemberJmx#NOTIF_REGION_LOST} notification to the connected
-   * JMX Clients. Region Path is set as User Data in Notification. Additionally, it also clears the
-   * ManagedResources created for the region that is lost.
-   * 
-   * @param event event object corresponding to the loss of a region
-   */
-  public void handleRegionLoss(SystemMemberRegionEvent event) {
-    SystemMemberCacheJmxImpl cacheResource = this.managedSystemMemberCache;
-
-    if (cacheResource != null) {
-      ManagedResource cleanedUp = cacheResource.cleanupRegionResources(event.getRegionPath());
-
-      if (cleanedUp != null) {
-        MBeanUtil.unregisterMBean(cleanedUp);
-      }
-    }
-
-    Notification notification = new Notification(NOTIF_REGION_LOST, this.modelMBean,
-        Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event));
-
-    notification.setUserData(event.getRegionPath());
-
-    Helper.sendNotification(this, notification);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ConfigAttributeInfo.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ConfigAttributeInfo.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ConfigAttributeInfo.java
deleted file mode 100755
index 3273ccc..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ConfigAttributeInfo.java
+++ /dev/null
@@ -1,66 +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.admin.jmx.internal;
-
-// import org.apache.geode.admin.ConfigurationParameter;
-import org.apache.geode.internal.Assert;
-
-import javax.management.Descriptor;
-import javax.management.modelmbean.DescriptorSupport;
-import javax.management.modelmbean.ModelMBeanAttributeInfo;
-
-/**
- * Subclass of AttributeInfo with {@link org.apache.geode.admin.ConfigurationParameter} added for
- * use as the {@link javax.management.modelmbean.ModelMBeanAttributeInfo} descriptor's
- * <i>targetObject</i> value.
- *
- * @since GemFire 3.5
- *
- */
-class ConfigAttributeInfo extends org.apache.commons.modeler.AttributeInfo {
-  private static final long serialVersionUID = -1918437700841687078L;
-
-  private final ConfigurationParameterJmxImpl config;
-
-  public ConfigAttributeInfo(ConfigurationParameterJmxImpl config) {
-    super();
-    this.config = config;
-  }
-
-  public ConfigurationParameterJmxImpl getConfig() {
-    return this.config;
-  }
-
-  @Override
-  public ModelMBeanAttributeInfo createAttributeInfo() {
-    Descriptor desc = new DescriptorSupport(new String[] {"name=" + this.displayName,
-        "descriptorType=attribute", "currencyTimeLimit=-1", // always stale
-        "displayName=" + this.displayName, "getMethod=getJmxValue", "setMethod=setJmxValue"});
-
-    Assert.assertTrue(this.config != null, "Config target object is null!");
-    desc.setField("targetObject", this.config);
-
-    ModelMBeanAttributeInfo info = new ModelMBeanAttributeInfo(this.displayName, // name
-        this.type, // type
-        this.description, // description
-        this.readable, // isReadable
-        this.writeable, // isWritable
-        this.is, // isIs
-        desc);
-
-    return info;
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ConfigurationParameterJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ConfigurationParameterJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ConfigurationParameterJmxImpl.java
deleted file mode 100755
index f9add13..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/ConfigurationParameterJmxImpl.java
+++ /dev/null
@@ -1,163 +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.admin.jmx.internal;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.logging.log4j.Level;
-
-import org.apache.geode.SystemFailure;
-import org.apache.geode.admin.UnmodifiableConfigurationException;
-import org.apache.geode.internal.Assert;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-/**
- * Provides MBean support for managing accessing a ConfigurationParameter.
- * <p>
- * Implements java.io.Serializable because several MBeans have attributes of type
- * ConfigurationParameter. This means that calls to getMBeanInfo which may be serialized for remote
- * clients will be broken unless those attributes support serialization.
- * <p>
- * TODO: refactor to implement ConfigurationParameter and delegate to ConfigurationParameterImpl.
- * Wrap all delegate calls w/ e.printStackTrace() since the HttpAdaptor devours them
- *
- * @since GemFire 3.5
- *
- */
-public class ConfigurationParameterJmxImpl
-    extends org.apache.geode.admin.internal.ConfigurationParameterImpl implements Serializable {
-
-  private static final long serialVersionUID = -7822171853906772375L;
-  private boolean deserialized = false;
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  protected ConfigurationParameterJmxImpl(String name, String description, Object value, Class type,
-      boolean userModifiable) {
-    super(name, description, value, type, userModifiable);
-  }
-
-  protected ConfigurationParameterJmxImpl(String name, Object value) {
-    super(name, value);
-  }
-
-  /** Constructor to allow serialization */
-  protected ConfigurationParameterJmxImpl() {
-    super();
-  }
-
-  @Override
-  public void setValue(Object value) throws UnmodifiableConfigurationException {
-    if (deserialized) {
-      throw new UnsupportedOperationException(
-          LocalizedStrings.ConfigurationParameterJmxImpl_REMOTE_MUTATION_OF_CONFIGURATIONPARAMETER_IS_CURRENTLY_UNSUPPORTED
-              .toLocalizedString());
-    }
-    try {
-      super.setValue(value);
-    } catch (UnmodifiableConfigurationException e) {
-      MBeanUtil.logStackTrace(Level.WARN, e);
-      throw e;
-    } catch (java.lang.RuntimeException e) {
-      MBeanUtil.logStackTrace(Level.WARN, e);
-      throw e;
-    } catch (VirtualMachineError err) {
-      SystemFailure.initiateFailure(err);
-      // If this ever returns, rethrow the error. We're poisoned
-      // now, so don't let this thread continue.
-      throw err;
-    } catch (java.lang.Error e) {
-      // Whenever you catch Error or Throwable, you must also
-      // catch VirtualMachineError (see above). However, there is
-      // _still_ a possibility that you are dealing with a cascading
-      // error condition, so you also need to check to see if the JVM
-      // is still usable:
-      SystemFailure.checkFailure();
-      MBeanUtil.logStackTrace(Level.ERROR, e);
-      throw e;
-    }
-  }
-
-  // -------------------------------------------------------------------------
-  // HACK
-  // -------------------------------------------------------------------------
-  public void setJmxValue(Integer value) throws UnmodifiableConfigurationException {
-    setValue(value);
-  }
-
-  public void setJmxValue(String value) throws UnmodifiableConfigurationException {
-    setValue(value);
-  }
-
-  public void setJmxValue(java.io.File value) throws UnmodifiableConfigurationException {
-    setValue(value);
-  }
-
-  public void setJmxValue(Boolean value) throws UnmodifiableConfigurationException {
-    setValue(value);
-  }
-
-  public Class getJmxValueType() {
-    if (isInetAddress() || isFile() || isOctal()) {
-      return java.lang.String.class;
-    }
-    return getValueType();
-  }
-
-  public Object getJmxValue() {
-    if (isInetAddress() || isFile() || isOctal()) {
-      return getValueAsString();
-    }
-    return getValue();
-  }
-
-  /**
-   * Override writeObject which is used in serialization. This class is serialized when JMX client
-   * acquires MBeanInfo for ConfigurationParameter MBean. Super class is not serializable.
-   */
-  private void writeObject(java.io.ObjectOutputStream out) throws IOException {
-    out.writeObject(this.name);
-    out.writeObject(this.description);
-    out.writeObject(this.value);
-    out.writeObject(this.type);
-    out.writeBoolean(this.userModifiable);
-  }
-
-  /**
-   * Override readObject which is used in serialization. Customize serialization of this exception
-   * to avoid escape of InternalRole which is not Serializable.
-   */
-  private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
-    String inName = (String) in.readObject();
-    String inDescription = (String) in.readObject();
-    Object inValue = in.readObject();
-    Class inClass = (Class) in.readObject();
-    boolean inUserModifiable = in.readBoolean();
-
-    Assert.assertTrue(inName != null);
-    Assert.assertTrue(inDescription != null);
-    Assert.assertTrue(inValue != null);
-    Assert.assertTrue(inClass != null);
-
-    this.deserialized = true;
-    this.name = inName;
-    setInternalState(inDescription, inValue, inClass, inUserModifiable);
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributedSystemHealthConfigJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributedSystemHealthConfigJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributedSystemHealthConfigJmxImpl.java
deleted file mode 100644
index 54d3072..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributedSystemHealthConfigJmxImpl.java
+++ /dev/null
@@ -1,99 +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.admin.jmx.internal;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.admin.internal.*;
-// import org.apache.geode.internal.admin.*;
-import javax.management.*;
-import javax.management.modelmbean.*;
-// import org.apache.commons.modeler.ManagedBean;
-
-/**
- * The JMX "managed resource" that represents the configuration for the health of a distributed
- * system. Basically, it provides the behavior of <code>DistributedSystemHealthConfigImpl</code>,
- * but does some JMX stuff like registering beans with the agent.
- *
- * @see GemFireHealthJmxImpl#createDistributedSystemHealthConfig
- *
- *
- * @since GemFire 3.5
- */
-public class DistributedSystemHealthConfigJmxImpl extends DistributedSystemHealthConfigImpl
-    implements ManagedResource {
-
-  /** The <code>GemFireHealth</code> that we help configure */
-  private GemFireHealth health;
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  /** The JMX object name of the MBean for this managed resource */
-  private final ObjectName objectName;
-
-  /////////////////////// Constructors ///////////////////////
-
-  /**
-   * Creates a new <code>DistributedSystemHealthCOnfigJmxImpl</code> that configures the health of
-   * the distributed system monitored by <code>health</code>.
-   */
-  DistributedSystemHealthConfigJmxImpl(GemFireHealthJmxImpl health) throws AdminException {
-
-    super();
-    this.health = health;
-    this.mbeanName =
-        new StringBuffer().append(MBEAN_NAME_PREFIX).append("DistributedSystemHealthConfig,id=")
-            .append(MBeanUtil.makeCompliantMBeanNameProperty(health.getDistributedSystem().getId()))
-            .toString();
-    this.objectName = MBeanUtil.createMBean(this);
-  }
-
-  ////////////////////// Instance Methods //////////////////////
-
-  /**
-   * Applies the changes made to this config back to the health monitor.
-   *
-   * @see GemFireHealth#setDistributedSystemHealthConfig
-   */
-  public void applyChanges() {
-    this.health.setDistributedSystemHealthConfig(this);
-  }
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.DISTRIBUTED_SYSTEM_HEALTH_CONFIG;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public void cleanupResource() {}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributionLocatorJmxImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributionLocatorJmxImpl.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributionLocatorJmxImpl.java
deleted file mode 100755
index 65c2477..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DistributionLocatorJmxImpl.java
+++ /dev/null
@@ -1,183 +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.admin.jmx.internal;
-
-// import org.apache.geode.admin.AdminException;
-// import org.apache.geode.admin.DistributionLocator;
-import org.apache.geode.admin.DistributionLocatorConfig;
-import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-// import org.apache.geode.internal.Assert;
-
-// import org.apache.commons.modeler.ManagedBean;
-// import org.apache.commons.modeler.AttributeInfo;
-
-// import java.util.Date;
-// import java.util.Set;
-
-// import javax.management.Attribute;
-// import javax.management.AttributeList;
-// import javax.management.Descriptor;
-// import javax.management.JMException;
-// import javax.management.MBeanServer;
-// import javax.management.MalformedObjectNameException;
-// import javax.management.Notification;
-// import javax.management.NotificationListener;
-import javax.management.ObjectName;
-// import javax.management.modelmbean.DescriptorSupport;
-import javax.management.modelmbean.ModelMBean;
-// import javax.management.modelmbean.ModelMBeanAttributeInfo;
-
-/**
- * Provides MBean support for managing a distribution locator.
- *
- */
-public class DistributionLocatorJmxImpl
-    extends org.apache.geode.admin.internal.DistributionLocatorImpl
-    implements org.apache.geode.admin.jmx.internal.ManagedResource, DistributionLocatorConfig {
-
-  /** The JMX object name of this managed resource */
-  private ObjectName objectName;
-
-  // -------------------------------------------------------------------------
-  // Constructor(s)
-  // -------------------------------------------------------------------------
-
-  /**
-   * Constructs new instance of DistributionLocatorJmxImpl for managing a distribution locator
-   * service via JMX.
-   */
-  public DistributionLocatorJmxImpl(DistributionLocatorConfig config,
-      AdminDistributedSystemImpl system) {
-    super(config, system);
-    initializeMBean();
-  }
-
-  /** Create and register the MBean to manage this resource */
-  private void initializeMBean() {
-    this.mbeanName =
-        "GemFire:type=DistributionLocator,id=" + MBeanUtil.makeCompliantMBeanNameProperty(getId());
-    this.objectName = MBeanUtil.createMBean(this, MBeanUtil.lookupManagedBean(this));
-  }
-
-  //////////////////////// Configuration ////////////////////////
-
-  public String getHost() {
-    return this.getConfig().getHost();
-  }
-
-  public void setHost(String host) {
-    this.getConfig().setHost(host);
-  }
-
-  public String getWorkingDirectory() {
-    return this.getConfig().getWorkingDirectory();
-  }
-
-  public void setWorkingDirectory(String dir) {
-    this.getConfig().setWorkingDirectory(dir);
-  }
-
-  public String getProductDirectory() {
-    return this.getConfig().getProductDirectory();
-  }
-
-  public void setProductDirectory(String dir) {
-    this.getConfig().setProductDirectory(dir);
-  }
-
-  public String getRemoteCommand() {
-    return this.getConfig().getRemoteCommand();
-  }
-
-  public void setRemoteCommand(String remoteCommand) {
-    this.getConfig().setRemoteCommand(remoteCommand);
-  }
-
-  public java.util.Properties getDistributedSystemProperties() {
-    return this.getConfig().getDistributedSystemProperties();
-  }
-
-  public void setDistributedSystemProperties(java.util.Properties props) {
-    this.getConfig().setDistributedSystemProperties(props);
-  }
-
-  public void validate() {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  @Override
-  public Object clone() throws CloneNotSupportedException {
-    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-  }
-
-  public int getPort() {
-    return this.getConfig().getPort();
-  }
-
-  public void setPort(int port) {
-    this.getConfig().setPort(port);
-  }
-
-  public String getBindAddress() {
-    return this.getConfig().getBindAddress();
-  }
-
-  public void setBindAddress(String bindAddress) {
-    this.getConfig().setBindAddress(bindAddress);
-  }
-
-  // -------------------------------------------------------------------------
-  // MBean attributes - accessors/mutators
-  // -------------------------------------------------------------------------
-
-  // -------------------------------------------------------------------------
-  // JMX Notification listener
-  // -------------------------------------------------------------------------
-
-  // -------------------------------------------------------------------------
-  // ManagedResource implementation
-  // -------------------------------------------------------------------------
-
-  /** The name of the MBean that will manage this resource */
-  private String mbeanName;
-
-  /** The ModelMBean that is configured to manage this resource */
-  private ModelMBean modelMBean;
-
-  public String getMBeanName() {
-    return this.mbeanName;
-  }
-
-  public ModelMBean getModelMBean() {
-    return this.modelMBean;
-  }
-
-  public void setModelMBean(ModelMBean modelMBean) {
-    this.modelMBean = modelMBean;
-  }
-
-  public ObjectName getObjectName() {
-    return this.objectName;
-  }
-
-  public ManagedResourceType getManagedResourceType() {
-    return ManagedResourceType.DISTRIBUTION_LOCATOR;
-  }
-
-  public void cleanupResource() {}
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DynamicManagedBean.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DynamicManagedBean.java b/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DynamicManagedBean.java
deleted file mode 100755
index 32ee5b4..0000000
--- a/geode-core/src/main/java/org/apache/geode/admin/jmx/internal/DynamicManagedBean.java
+++ /dev/null
@@ -1,143 +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.admin.jmx.internal;
-
-
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.modeler.AttributeInfo;
-import org.apache.commons.modeler.OperationInfo;
-import org.apache.commons.modeler.ManagedBean;
-
-/**
- * Extends ManagedBean to allow for dynamically creating new instances of ManagedBean based on an
- * existing instance of ManagedBean.
- * 
- * @since GemFire 5.0.1
- */
-public class DynamicManagedBean extends org.apache.commons.modeler.ManagedBean {
-  private static final long serialVersionUID = 4051924500150228160L;
-
-  public DynamicManagedBean(ManagedBean managed) {
-    super();
-
-    this.attributes = managed.getAttributes();
-    this.className = managed.getClassName();
-    this.constructors = managed.getConstructors();
-    this.description = managed.getDescription();
-    this.domain = managed.getDomain();
-    this.group = managed.getGroup();
-    this.name = managed.getName();
-    this.fields = managed.getFields();
-    this.notifications = managed.getNotifications();
-    this.operations = managed.getOperations();
-    this.type = managed.getType();
-
-    /*
-     * we don't use modelerType and it's nice to remove it to keep the list of attributes cleaned
-     * up...
-     */
-    removeAttribute("modelerType");
-  }
-
-  /**
-   * Removes an attribute from this ManagedBean's attribute descriptor list.
-   *
-   * @param name the attribute to be removed
-   */
-  public void removeAttribute(String name) {
-    if (name == null || name.length() < 1) {
-      return;
-    }
-    synchronized (this.attributes) {
-      List attributesList = new ArrayList(this.attributes.length);
-      for (int i = 0; i < this.attributes.length; i++) {
-        if (!name.equals(this.attributes[i].getName())) {
-          attributesList.add(this.attributes[i]);
-        }
-      }
-      this.attributes =
-          (AttributeInfo[]) attributesList.toArray(new AttributeInfo[attributesList.size()]);
-
-      /*
-       * super.info should be nulled out anytime the structure is changed, such as altering the
-       * attributes, operations, or notifications
-       *
-       * however super.info is private, so we need the following hack to cause the super class to
-       * null it out for us...
-       */
-      setType(this.type); // causes this in super: "this.info = null;"
-    }
-  }
-
-  /**
-   * Removes the operation with the given name from thie <code>ManageBean</code>'s operation
-   * descriptor list.
-   *
-   * @since GemFire 4.0
-   */
-  public void removeOperation(String name) {
-    if (name == null || name.length() < 1) {
-      return;
-    }
-
-    synchronized (operations) {
-      List operationsList = new ArrayList(this.operations.length);
-      for (int i = 0; i < this.operations.length; i++) {
-        if (!name.equals(this.operations[i].getName())) {
-          operationsList.add(this.operations[i]);
-        }
-      }
-      this.operations =
-          (OperationInfo[]) operationsList.toArray(new OperationInfo[operationsList.size()]);
-
-      /*
-       * super.info should be nulled out anytime the structure is changed, such as altering the
-       * operations, operations, or notifications
-       *
-       * however super.info is private, so we need the following hack to cause the super class to
-       * null it out for us...
-       */
-      setType(this.type); // causes this in super: "this.info = null;"
-    }
-  }
-
-  /**
-   * Return a string representation of this managed bean.
-   */
-  @Override
-  public String toString() {
-    StringBuffer sb = new StringBuffer("DynamicManagedBean[");
-    sb.append("name=");
-    sb.append(name);
-    sb.append(", className=");
-    sb.append(className);
-    sb.append(", description=");
-    sb.append(description);
-    if (group != null) {
-      sb.append(", group=");
-      sb.append(group);
-    }
-    sb.append(", type=");
-    sb.append(type);
-    sb.append(", attributes=");
-    sb.append(Arrays.asList(attributes));
-    sb.append("]");
-    return (sb.toString());
-  }
-}
-


[13/50] [abbrv] incubator-geode git commit: GEODE-288: move admin packages to internal

Posted by kl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/resources/org/apache/geode/admin/jmx/mbeans-descriptors.xml
----------------------------------------------------------------------
diff --git a/geode-core/src/main/resources/org/apache/geode/admin/jmx/mbeans-descriptors.xml b/geode-core/src/main/resources/org/apache/geode/admin/jmx/mbeans-descriptors.xml
deleted file mode 100755
index b54716f..0000000
--- a/geode-core/src/main/resources/org/apache/geode/admin/jmx/mbeans-descriptors.xml
+++ /dev/null
@@ -1,1452 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE mbeans-descriptors PUBLIC
- "-//Apache Software Foundation//DTD Model MBeans Configuration File"
- "http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd">
-
-<!--
-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.
--->
-
-<!-- ===================================================================== -->
-<!-- MBeans are defined in this file for these components:                 -->
-<!--   org.apache.geode.admin.jmx.Agent                                -->
-<!--   org.apache.geode.admin.AdminDistributedSystem                   -->
-<!--   org.apache.geode.admin.SystemMember                             -->
-<!--   org.apache.geode.admin.GemFireManager                           -->
-<!--   org.apache.geode.admin.StatisticResource                        -->
-<!--   org.apache.geode.admin.DistributionLocator                      -->
-<!--   org.apache.geode.admin.SystemMemberCache                        -->
-<!--   org.apache.geode.admin.SystemMemberRegion                       -->
-<!--   org.apache.geode.admin.SystemMemberCacheServer                  -->
-<!--   org.apache.geode.admin.CacheVm                                  -->
-<!--   org.apache.geode.admin.GemFireHealth                            -->
-<!--   org.apache.geode.admin.DistributedSystemHealthConfig            -->
-<!--   org.apache.geode.admin.GemFireHealthConfig                      -->
-<!--                                                                       -->
-<!-- Each component is a managed resource wrapped by a Model MBean built   -->
-<!-- by Jakarta Commons-Modeler.                                           -->
-<!--                                                                       -->
-<!-- author    Kirk Lund                                                   -->
-<!-- since     3.5                                                         -->
-<!-- ===================================================================== -->
-<mbeans-descriptors>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.jmx.Agent                                -->
-  <!-- =================================================================== -->
-  <mbean          name="GemFireAgent"
-           description="GemFire JMX Agent"
-                  type="org.apache.geode.admin.jmx.Agent">
-                 
-    <attribute    name="logFileSizeLimit"
-           description="The maximum size of the JMX Agent log file; a value (in megabytes) in the range 0..1000000."
-                  type="int"
-            writeable="true"/>
-    <attribute    name="logDiskSpaceLimit"
-           description="The maximum disk space to allocate for logging; a value (in megabytes) in the range 0..1000000."
-                  type="int"
-             writeable="true"/>
-    <attribute    name="logFile"
-           description="The name and path of this Agent's log file."
-                  type="java.lang.String"
-             writeable="true"/>
-    <attribute    name="logLevel"
-           description="A keyword or integer that defines the minimum level of alerts to be written to the log - for example, only those alerts that are at level WARNING or higher."
-                  type="java.lang.String"
-             writeable="true"/>
-    <attribute    name="autoConnect"
-           description="If true, the JMX Agent will automatically connect to the distributed system when the Agent is started. The distributed system is specified by the following arguments: mcast-port, mcast-address, locators, remote-command. You can specify these arguments on the agent command line or in the Agent properties file."
-                  type="boolean"
-             writeable="true"/>
-    <attribute    name="connected"
-           description="True if this Agent is connected to a distributed system."
-                  type="boolean"
-                    is="true"
-             writeable="false"/>
-    <attribute    name="propertyFile"
-           description="Name and path of this Agent's properties file. Identical to the argument on the agent command line."
-                  type="java.lang.String"
-             writeable="true"/>
-    <attribute    name="version"
-           description="The Agent's version."
-                  type="java.lang.String"
-             writeable="false"/>
-
-    <attribute    name="systemId"
-           description="A string that describes the associated distributed system."
-                  type="java.lang.String"
-             writeable="true"/>
-    <attribute    name="mcastAddress"
-           description="Multicast address of the associated distributed system."
-                  type="java.lang.String"
-             writeable="true"/>
-    <attribute    name="mcastPort"
-           description="Multicast port of the associated distributed system."
-                  type="int"
-             writeable="true"/>
-    <attribute    name="locators"
-           description="List of locators for connecting to the distributed system. Each locator is uniquely identified by the host on which it is running and the port on which it is listening."
-                  type="java.lang.String"
-             writeable="true"/>
-    <attribute    name="membershipPortRange"
-           description="The allowed range of UDP ports for use in forming an unique membership identifier."
-                  type="java.lang.String"                 
-             writeable="true"/>
-    <attribute    name="bindAddress"
-           description="An IP address that the JMX Agent uses to communicate with members of the distributed system. On a multi-homed host - a machine with multiple network cards - you must explicitly specify the bind address."
-                  type="java.lang.String"
-             writeable="true"/>
-             
-    <attribute    name="sslEnabled"
-           description="Indicates whether to use the Secure Sockets Layer (SSL) protocol for communication between members of this distributed system. Valid values are &quot;true&quot; and &quot;false&quot;. A &quot;true&quot; setting requires the use of locators."
-                  type="boolean"
-             getMethod="isSSLEnabled"
-             setMethod="setSSLEnabled"
-             writeable="true"/>
-    <attribute    name="sslProtocols"
-           description="A space-separated list of the valid SSL protocols for this connection. You can specify &quot;any&quot; to use any protocol that is enabled by default in the configured Java Secure Sockets Extension (JSSE) provider."
-                  type="java.lang.String"
-             getMethod="getSSLProtocols"
-             setMethod="setSSLProtocols"
-             writeable="true"/>
-    <attribute    name="sslCiphers"
-           description="A space-separated list of the valid SSL ciphers for this connection. You can specify &quot;any&quot; to use any ciphers that are enabled by default in the configured JSSE provider."
-                  type="java.lang.String"
-             getMethod="getSSLCiphers"
-             setMethod="setSSLCiphers"
-             writeable="true"/>
-    <attribute    name="sslAuthenticationRequired"
-           description="Indicates whether to require SSL authentication for communication between members of the distributed system. Valid values are &quot;true&quot; and &quot;false&quot;."
-                  type="boolean"
-             getMethod="isSSLAuthenticationRequired"
-             setMethod="setSSLAuthenticationRequired"
-             writeable="true"/>
-    <attribute    name="sslProperties"
-           description="The SSL vendor properties to use for the distributed system."
-                  type="java.util.Properties"
-             getMethod="getSSLProperties"
-             writeable="false"/>
-
-    <operation    name="addSSLProperty"
-           description="Add an SSL vendor property with the specified key and value."
-                impact="ACTION"
-            returnType="void">
-      <parameter name="key" 
-          description="Property key"
-                 type="java.lang.String" />
-      <parameter name="value" 
-          description="Property value"
-                 type="java.lang.String" />
-    </operation>
-    <operation    name="removeSSLProperty"
-           description="Remove the specified SSL vendor property."
-                impact="ACTION"
-            returnType="void">
-      <parameter name="key" 
-          description="Property key"
-                 type="java.lang.String" />
-    </operation>
-
-    <operation    name="getLog"
-           description="Display the tail of the Agent's log file."
-                impact="INFO"
-            returnType="java.lang.String"/>
-    <operation    name="stop"
-           description="Stop the Agent after closing all managed resources"
-                impact="ACTION"
-            returnType="void"/>
-    <operation    name="saveProperties"
-           description="Persist the Agent's current configuration to its properties file"
-                impact="ACTION"
-            returnType="void"/>
-    <operation    name="connectToSystem"
-           description="Connect to the distributed system described by this Agent. Returns the ObjectName of the corresponding DistributedSystem MBean."
-                impact="ACTION_INFO"
-            returnType="javax.management.ObjectName"/>
-    <operation    name="disconnectFromSystem"
-           description="Disconnect from the currently connected distributed system."
-                impact="ACTION"
-            returnType="void"/>
-    <operation    name="manageDistributedSystem"
-           description="Return the ObjectName of the currently connected distributed system. If not connected, return null."
-                impact="INFO"
-            returnType="javax.management.ObjectName"/>
-  </mbean>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.AdminDistributedSystem                   -->
-  <!-- =================================================================== -->
-  <mbean          name="AdminDistributedSystem"
-           description="GemFire distributed system"
-                  type="org.apache.geode.admin.AdminDistributedSystem">
-                  
-    <attribute    name="id"
-           description="A string that uniquely identifies this distributed system."
-                  type="java.lang.String"
-             writeable="false"/>
-
-    <attribute    name="systemName"
-           description="Display name of the distributed system"
-                  type="java.lang.String"
-             writeable="true"/>
-
-    <attribute    name="remoteCommand"
-           description="A default remote command prefix to use for command invocation on remote machines."
-                  type="java.lang.String"/>
-
-    <attribute    name="alertLevel"
-           description="Minimum level for alerts to be delivered to listeners. Should be one of: WARNING, ERROR, SEVERE, OFF. It is not case-sensitive."
-                  type="java.lang.String"
-                  getMethod="getAlertLevelAsString"
-                  setMethod="setAlertLevelAsString"
-                  writeable="true"/>
-
-    <attribute    name="mcastAddress"
-           description="Multicast address of this distributed system."
-                  type="java.lang.String"
-             writeable="false"/>
-
-    <attribute    name="mcastPort"
-           description="Multicast port of this distributed system."
-                  type="int"
-             writeable="false"/>
-
-    <attribute    name="locators"
-           description="List of locators for connecting to this distributed system. Each locator is uniquely identified by the host on which it is running and the port on which it is listening."
-                  type="java.lang.String"
-             writeable="false"/>
-             
-    <attribute    name="membershipPortRange"
-           description="The allowed range of UDP ports for use in forming an unique membership identifier."
-                  type="java.lang.String"
-             writeable="false"/>
-    
-    <attribute   name="refreshIntervalForStatAlerts"
-          description="The interval (in seconds) between auto-polling for checking whether the Stat has exceeded a threshold for which the Stat Alert Definition is defined."
-                 type="int"/>
-
-    <attribute   name="refreshInterval"
-          description="The interval (in seconds) between auto-polling for updating AdminDistributedSystem constituents including SystemMember and StatisticResource. This applies only to the default interval set when the resource is created. This interval is read-only and retains the value set when the Agent config is created"
-                 type="int"
-            writeable="false"/>
-            
-    <attribute    name="canPersistStatAlertDefs"
-           description="Indicates whether Statistics Alert definitions could be persisted across runs/sessions of the JMX Agent."
-                  type="boolean"
-             getMethod="canPersistStatAlertDefs"
-             writeable="false"/>
-            
-    <attribute   name="missingPersistentMembers"
-            getMethod="getMissingPersistentMembersJMX"
-          description="Retrieve the set of persistent files that the existing members are waiting for."
-                 type="javax.management.openmbean.TabularData"
-            writeable="false"/>
-
-    <notification name="gemfire.distributedsystem.member.joined"
-           description="A GemFire manager, cache, or other member has joined this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.member.joined"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.member.joined</notification-type>
-    </notification>
-            
-    <notification name="gemfire.distributedsystem.member.left"
-           description="A GemFire manager, cache, or other member has left the distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.member.left"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.member.left</notification-type>
-    </notification>
-
-    <notification name="gemfire.distributedsystem.member.crashed"
-           description="A member of this distributed system has crashed instead of leaving cleanly.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.member.crashed"/>
-        <field    name="severity"       value="4"/><!-- 4: minor, marginal, error -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.member.crashed</notification-type>
-    </notification>
-            
-    <notification name="gemfire.distributedsystem.alert"
-           description="A member of this distributed system has generated an alert.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.alert"/>
-        <field    name="severity"       value="0"/><!-- unknown until runtime -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.alert</notification-type>
-    </notification>
-            
-    <operation   name="waitToBeConnected"
-          description="Wait for the connection to the distributed system to be established"
-               impact="ACTION"
-           returnType="boolean">
-      <parameter name="timeout" 
-          description="Number of milliseconds to wait to be connected"
-                 type="long" />
-    </operation>
-
-    <operation   name="start"
-          description="Start all locators defined for this distributed system."
-               impact="ACTION"
-           returnType="void"/>
-
-    <operation   name="stop"
-          description="Stop all locators defined for this distributed system."
-               impact="ACTION"
-           returnType="void"/>
-
-    <operation   name="manageDistributionLocator"
-          description="Creates a new distribution locator that is ready to configure and start"
-               impact="ACTION_INFO"
-           returnType="javax.management.ObjectName"/>
-
-    <operation   name="manageDistributionLocators"
-          description="Return an array of JMX ObjectNames for all locators known to this distributed system."
-               impact="ACTION_INFO"
-           returnType="[Ljavax.management.ObjectName;"/>
-
-    <operation   name="manageCacheVm"
-          description="Create a new CacheVm MBean (that is, make this distributed system aware of a cache server that has not been started )."
-               impact="ACTION_INFO"
-           returnType="javax.management.ObjectName"/>
-
-    <operation   name="manageCacheVms"
-          description="Return an array of JMX ObjectNames for all cache vms known to this distributed system."
-               impact="ACTION_INFO"
-           returnType="[Ljavax.management.ObjectName;"/>
-
-    <operation   name="manageCacheServer"
-          description="Create a new CacheVm MBean (that is, make this distributed system aware of a cache vm that has not been started ). This action is deprecated as of 5.7 use manageCacheVm instead."
-               impact="ACTION_INFO"
-           returnType="javax.management.ObjectName"/>
-
-    <operation   name="manageCacheServers"
-          description="Return an array of JMX ObjectNames for all cache vms known to this distributed system. This action is deprecated as of 5.7 use manageCacheVm instead."
-               impact="ACTION_INFO"
-           returnType="[Ljavax.management.ObjectName;"/>
-
-    <operation   name="manageSystemMemberApplications"
-          description="Return an array of JMX ObjectNames for all applications that are members of this distributed system."
-               impact="ACTION_INFO"
-           returnType="[Ljavax.management.ObjectName;"/>
-
-    <operation   name="monitorGemFireHealth"
-          description="Return the ObjectName for the GemFireHealth MBean."
-               impact="ACTION_INFO"
-           returnType="javax.management.ObjectName"/>
-
-    <operation   name="displayMergedLogs"
-          description="Combine the tails of all system members' logs into a merged log, with the entries ordered by timestamp."
-               impact="ACTION_INFO"
-           returnType="java.lang.String"/>
-
-    <operation   name="getLicense"
-          description="Display GemFire licensing information."
-               impact="INFO"
-           returnType="java.util.Properties"/>
-
-    <operation   name="getLatestAlert"
-          description="Display the most recent system alert."
-               impact="INFO"
-           returnType="java.lang.String"/>
-           
-    <operation   name="createDistributionLocator"
-          description="Create a DistributionLocator MBean. The parameters specify the locator's host machine, the port on which it listens, the working directory hosting the locator, and product directory used by the locator."
-               impact="ACTION_INFO"
-           returnType="javax.management.ObjectName">
-      <parameter name="host" 
-          description="Host machine for the Locator"
-                 type="java.lang.String" />
-      <parameter name="port" 
-          description="Port for the Locator to listen on"
-                 type="int" />
-      <parameter name="workingDirectory" 
-          description="The working directory hosting the Locator"
-                 type="java.lang.String" />
-      <parameter name="productDirectory" 
-          description="The GemFire product directory used by the Locator"
-                 type="java.lang.String" />
-    </operation>
-    
-    <operation   name="manageSystemMember"
-          description="Return the ObjectName for the SystemMemberMBean representing the specified distributed member or null if the member is not found."
-               impact="ACTION_INFO"
-           returnType="javax.management.ObjectName">
-      <parameter name="distributedMember" 
-          description="The distributed member to manage"
-                 type="org.apache.geode.distributed.DistributedMember" />
-    </operation>
-    
-    <operation   name="getAllStatAlertDefinitions"
-          description="Return an array of all available Stat Alert Definitions objects."
-               impact="INFO"
-           returnType="[Lorg.apache.geode.internal.admin.StatAlertDefinition;">
-    </operation>
-    
-    <operation   name="updateAlertDefinition"
-          description="Update/Add an Admin Stat Alert Definition to the Aggregator. Sends the updated definition to all the Managers/Members."
-               impact="ACTION_INFO"
-           returnType="void">
-      <parameter name="alertDefinition" 
-          description="The Admin Stat Alert Definition to be updated/added to the Aggregator"
-                 type="org.apache.geode.internal.admin.StatAlertDefinition" />
-    </operation>
-    
-    <operation   name="removeAlertDefinition"
-          description="Remove an Admin Stat Alert Definition from the Aggregator and all the Managers/Members."
-               impact="ACTION_INFO"
-           returnType="void">
-      <parameter name="defId" 
-          description="The unique id of the Admin Stat Alert Definition to be removed from the Aggregator"
-                 type="java.lang.Integer" />
-    </operation>
-    
-    <operation   name="isAlertDefinitionCreated"
-          description="Check whether the alert definition is already created."
-               impact="INFO"
-           returnType="boolean">
-      <parameter name="alertDefinition" 
-          description="The Admin Stat Alert Definition to be checked"
-                 type="org.apache.geode.internal.admin.StatAlertDefinition" />
-    </operation>
-    <operation   name="revokePersistentMember"
-          description="Indicate to the distributed system that persistent files have been lost."
-               impact="ACTION_INFO"
-           returnType="void">
-      <parameter name="host" 
-          description="The host of the members to revoke. If null, it will match all hosts"
-                 type="java.lang.String" />
-      <parameter name="directory" 
-          description="The directory on the members to revoke. If null, it will match all directories"
-                 type="java.lang.String" />
-    </operation>
-    <operation   name="shutDownAllMembers"
-          description="Shutting down all members with cache in the distributed system gracefully."
-               impact="ACTION_INFO"
-           returnType="java.util.Set">
-    </operation>
-    <operation   name="shutDownAllMembers"
-          description="Shutting down all members with cache in the distributed system gracefully."
-               impact="ACTION_INFO"
-           returnType="java.util.Set">
-	<parameter name="timeout"
-		description="The amount of time to wait (in milliseconds) for the shutdown all to complete."
-		type="long" />
-    </operation>
-  </mbean>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.SystemMember                             -->
-  <!-- =================================================================== -->
-  <mbean         name="SystemMember"
-          description="GemFire system member"
-                 type="org.apache.geode.admin.SystemMember">
-
-    <attribute   name="id"
-          description="A string that uniquely identifies the application within the distributed system."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="name"
-          description="The application-defined member name."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="host"
-          description="The host machine on which this application is running."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="refreshInterval"
-          description="The interval (in seconds) between auto-refreshes of this application;s configuration attributes, as defined in the gemfire.properties file. To disable the JMX Timer service's auto-refresh feature, set this attribute to zero or less. Effective 6.0, any changes to this parameter wil not affect the current refreshInterval. To change the refreshInterval use AdminDistributedSystem.refreshInterval"
-                 type="int"/>
-
-    <attribute    name="version"
-           description="Display GemFire version information."
-                  type="java.lang.String"
-             writeable="false"/>
-             
-    <attribute    name="hasCache"
-           description="Does the system member host a GemFire Cache?"
-                  type="boolean"
-                    is="false"
-             getMethod="hasCache"
-             writeable="false"/>
-
-    <attribute    name="distributedMember"
-           description="Distributed membership identity."
-                  type="org.apache.geode.distributed.DistributedMember"
-             writeable="false"/>
-    
-    <notification name="gemfire.distributedsystem.cache.created"
-           description="A cache got created on a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.created"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.created</notification-type>
-    </notification>
-
-    <notification name="gemfire.distributedsystem.cache.closed"
-           description="A cache is closed on a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.closed"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.closed</notification-type>
-    </notification>
-    
-    <notification name="gemfire.distributedsystem.cache.region.created"
-           description="A region is created in a cache on a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.region.created"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.region.created</notification-type>
-    </notification>
-    
-    <notification name="gemfire.distributedsystem.cache.region.lost"
-           description="A region was removed from a cache on a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.region.lost"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.region.lost</notification-type>
-    </notification>
-    
-    <notification name="gemfire.distributedsystem.cache.client.joined"
-           description="A cache client established a connection with a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.client.joined"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.client.joined</notification-type>
-    </notification>
-    
-    <notification name="gemfire.distributedsystem.cache.client.left"
-           description="A cache client gracefully closed a connection with a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.client.left"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.client.left</notification-type>
-    </notification>
-    
-    <notification name="gemfire.distributedsystem.cache.client.crashed"
-           description="A cache client crashed and abruptly lost connection with a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.client.crashed"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.client.crashed</notification-type>
-    </notification>
-             
-    <operation    name="getRoles"
-           description="Get the membership roles filled by this member."
-                impact="INFO"
-            returnType="[Ljava.lang.String;">
-    </operation>
-             
-    <operation   name="getLog"
-          description="Display the main log for this system member."
-               impact="INFO"
-           returnType="java.lang.String">
-    </operation>
-
-    <operation   name="getLicense"
-          description="Display GemFire licensing information."
-               impact="INFO"
-           returnType="java.util.Properties">
-    </operation>
-
-    <operation   name="manageCache"
-          description="Create a SystemMemberCache MBean for this application."
-               impact="ACTION_INFO"
-           returnType="javax.management.ObjectName">
-    </operation>
-    
-    <operation   name="manageStats"
-          description="Create a StatisticResource MBean for each statistic resource in this member."
-               impact="ACTION_INFO"
-           returnType="[Ljavax.management.ObjectName;">
-    </operation>
-
-    <operation   name="manageStat"
-          description="Create a StatisticResource MBean for each statistic resource in this member, given the underlying Statistics Type name."
-               impact="ACTION_INFO"
-           returnType="[Ljavax.management.ObjectName;">
-      <parameter name="statisticsTypeName" 
-          description="Name of the underlying Statistics Type eg. DistributionStats"
-                 type="java.lang.String" />           
-    </operation>
-    
-    <operation   name="refreshConfig"
-          description="Refresh configuration attributes for this application, using the gemfire.properties file."
-               impact="ACTION"
-           returnType="void">
-    </operation>
-    
-    <operation   name="getConfiguration"
-          description="Returns the current configuration attributes for this application, using the gemfire.properties file."
-               impact="ACTION"
-           returnType="[Lorg.apache.geode.admin.ConfigurationParameter;">
-    </operation>
-  </mbean>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.StatisticResource                        -->
-  <!-- =================================================================== -->
-  <mbean         name="StatisticResource"
-          description="GemFire statistic resource"
-                 type="org.apache.geode.admin.StatisticResource">
-
-    <attribute   name="name"
-          description="The JMX ObjectName of this statistic resource."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="description"
-          description="Description of this statistic resource."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="type"
-          description="Classification type of this statistic resource."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="owner"
-          description="Name of the source process."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="refreshInterval"
-          description="The interval (in seconds) between auto-refreshes of statistical information. To turn off the JMX Timer service's auto-refresh feature, set this attribute to zero or less. If you're concerned about system performance, leave this set to zero. Effective 6.0, any changes to this parameter wil not affect the current refreshInterval. To change the refreshInterval use AdminDistributedSystem.refreshInterval"
-                 type="int"/>
-
-    <operation   name="refresh"
-          description="Refresh values of statistics."
-               impact="ACTION"
-           returnType="void">
-    </operation>
-    
-    <operation   name="getStatistics"
-          description="Returns a current snapshot of statistics."
-               impact="INFO"
-           returnType="[Lorg.apache.geode.admin.Statistic;">
-    </operation>
-    
-  </mbean>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.DistributionLocator                      -->
-  <!-- =================================================================== -->
-  <mbean         name="DistributionLocator"
-          description="GemFire distribution locator service"
-                 type="org.apache.geode.admin.DistributionLocator">
-
-    <attribute   name="id"
-          description="Id of the distribution locator."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="host"
-          description="The host machine on which this locator is running."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="workingDirectory"
-          description="The current working directory of the locator."
-                 type="java.lang.String"
-            writeable="true"/>
-
-    <attribute   name="productDirectory"
-          description="The location of the GemFire installation used to run this locator."
-                 type="java.lang.String"
-            writeable="true"/>
-
-    <attribute   name="port"
-          description="The port on which this locator is listening: a value in the range 0..65535."
-                 type="int"
-            writeable="true"/>
-
-    <attribute    name="bindAddress"
-           description="The interface address to which the locator binds."
-                  type="java.lang.String"
-             writeable="true"/>
-             
-    <attribute   name="running"
-          description="True if this locator is running."
-                 type="boolean"
-            writeable="false"
-                   is="true"/>
-
-    <operation   name="start"
-          description="Start this distribution locator."
-               impact="ACTION"
-           returnType="void"/>
-
-    <operation   name="waitToStart"
-          description="Wait for the distribution locator to start"
-               impact="ACTION"
-           returnType="boolean">
-      <parameter name="timeout" 
-          description="Number of milliseconds to wait to start"
-                 type="long" />
-    </operation>
-
-    <operation   name="waitToStop"
-          description="Wait for the distribution locator to stop"
-               impact="ACTION"
-           returnType="boolean">
-      <parameter name="timeout" 
-          description="Number of milliseconds to wait to stop"
-                 type="long" />
-    </operation>
-
-    <operation   name="stop"
-          description="Stop this distribution locator."
-               impact="ACTION"
-           returnType="void"/>
-
-    <operation    name="getLog"
-           description="Display the tail of the locator service's log."
-                impact="INFO"
-            returnType="java.lang.String"/>
-            
-    <operation   name="remove"
-          description="Remove this distribution locator."
-               impact="ACTION"
-           returnType="void"/>
-           
-  </mbean>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.SystemMemberCache                        -->
-  <!-- =================================================================== -->
-  <mbean         name="SystemMemberCache"
-          description="GemFire system member cache"
-                 type="org.apache.geode.admin.SystemMemberCache">
-                 
-    <attribute   name="name"
-          description="The name of the Cache"
-                 type="java.lang.String"
-            writeable="false"/>
-    <attribute   name="closed"
-          description="True if this cache has been closed."
-                 type="boolean"
-                 is="true"
-            writeable="false"/>
-    <attribute   name="lockTimeout"
-          description="Seconds that a cache operation will wait to obtain a distributed lock lease."
-                 type="int"
-            writeable="true"/>
-    <attribute   name="lockLease"
-          description="The length, in seconds, of distributed lock leases obtained by this cache."
-                 type="int"
-            writeable="true"/>
-    <attribute   name="searchTimeout"
-          description="Seconds that a cache get operation can spend searching for a value before it times out."
-                 type="int"
-            writeable="true"/>
-    <attribute   name="upTime"
-          description="Seconds that this cache has been open."
-                 type="int"
-            writeable="false"/>
-    <attribute   name="rootRegionNames"
-          description="A set of the names of each root region currently in this cache."
-                 type="java.util.Set"
-            writeable="false"/>
-    <attribute   name="server"
-          description="Is this a cache server?"
-                 type="boolean"
-                   is="true"
-            writeable="true"/>
-
-    <operation   name="getSnapshot"
-          description="Get Member Cache Status"
-               impact="INFO"
-           returnType="org.apache.geode.admin.GemFireMemberStatus">
-    </operation>
-    <operation   name="getRegionSnapshot"
-          description="Get Member Cache's Region Snapshot"
-               impact="INFO"
-           returnType="org.apache.geode.admin.RegionSubRegionSnapshot">
-    </operation>
-    <operation   name="manageRegion"
-          description="Creates a SystemMemberRegion MBean for the region with the specified path."
-               impact="ACTION_INFO"
-           returnType="javax.management.ObjectName">
-      <parameter name="path" 
-          description="Full path of region to create an mbean for."
-                 type="java.lang.String" />
-    </operation>
-    <operation   name="getStatistics"
-          description="Returns a current snapshot of cache statistics."
-               impact="INFO"
-           returnType="[Lorg.apache.geode.admin.Statistic;">
-    </operation>
-    <operation   name="refresh"
-          description="Updates each attribute in this MBean."
-               impact="ACTION"
-           returnType="void">
-    </operation>
-    <operation   name="manageBridgeServer"
-          description="Creates a new, unstarted bridge server for the cache. Deprecated as of 5.7 use manageCacheServer instead."
-               impact="ACTION"
-           returnType="javax.management.ObjectName">
-    </operation>
-    <operation   name="manageBridgeServers"
-          description="Returns the names of the MBeans for the cache's bridge servers. Deprecated as of 5.7 use manageCacheServer instead."
-               impact="ACTION"
-           returnType="[Ljavax.management.ObjectName;">
-    </operation>
-    <operation   name="manageCacheServer"
-          description="Creates a new, unstarted cache server for the cache"
-               impact="ACTION"
-           returnType="javax.management.ObjectName">
-    </operation>
-    <operation   name="manageCacheServers"
-          description="Returns the names of the MBeans for the cache's cache servers"
-               impact="ACTION"
-           returnType="[Ljavax.management.ObjectName;">
-    </operation>
-  </mbean>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.SystemMemberRegion                       -->
-  <!-- =================================================================== -->
-  <mbean         name="SystemMemberRegion"
-          description="View of a GemFire system member cache's region"
-                 type="org.apache.geode.admin.SystemMemberRegion">
-                 
-    <attribute   name="name"
-          description="The name (not the full-path) of this region."
-                 type="java.lang.String"
-            writeable="false"/>
-    <attribute   name="fullPath"
-          description="The full path name of this region"
-                 type="java.lang.String"
-            writeable="false"/>
-    <attribute   name="userAttribute"
-          description="Description of the region's user attribute object."
-                 type="java.lang.String"
-            writeable="false"/>
-    <attribute   name="cacheLoader"
-          description="Description of the region's cache loader."
-                 type="java.lang.String"
-            writeable="false"/>
-    <attribute   name="cacheWriter"
-          description="Description of the region's cache writer."
-                 type="java.lang.String"
-            writeable="false"/>
-    <attribute   name="evictionAttributes"
-          description="Description of the region's eviction attributes."
-                 type="org.apache.geode.cache.EvictionAttributes"
-            writeable="false"/>
-    <attribute   name="cacheListener"
-          description="Description of the region's cache listener. This attribute is deprecated as of 6.0. Use getCacheListeners method instead."
-                 type="java.lang.String"
-            writeable="false"/>
-    <attribute   name="keyConstraint"
-          description="Name of the class that keys in this region are constrained to be"
-                 type="java.lang.String"
-            writeable="false"/>
-    <attribute   name="regionTimeToLiveTimeLimit"
-          description="This region's time to live time limit."
-                 type="int"
-            writeable="false"/>
-    <attribute   name="regionTimeToLiveAction"
-          description="This region's time to live action."
-                 type="java.lang.Object"
-            writeable="false"/>
-    <attribute   name="entryTimeToLiveTimeLimit"
-          description="This region's entry time to live time limit."
-                 type="int"
-            writeable="false"/>
-    <attribute   name="entryTimeToLiveAction"
-          description="This region's entry time to live action."
-                 type="java.lang.Object"
-            writeable="false"/>
-    <attribute   name="regionIdleTimeoutTimeLimit"
-          description="This region's idle timeout time limit."
-                 type="int"
-            writeable="false"/>
-    <attribute   name="regionIdleTimeoutAction"
-          description="This region's idle timeout action."
-                 type="java.lang.Object"
-            writeable="false"/>
-    <attribute   name="entryIdleTimeoutTimeLimit"
-          description="This region's entry idle timeout time limit."
-                 type="int"
-            writeable="false"/>
-    <attribute   name="entryIdleTimeoutAction"
-          description="This region's entry idle timeout action."
-                 type="java.lang.Object"
-            writeable="false"/>
-    <attribute   name="mirrorType"
-          description="This region's mirror type."
-                 type="java.lang.Object"
-            writeable="false"/>
-    <attribute   name="dataPolicy"
-          description="This region's data policy."
-                 type="java.lang.Object"
-            writeable="false"/>
-    <attribute   name="scope"
-          description="This region's scope."
-                 type="java.lang.Object"
-            writeable="false"/>
-    <attribute   name="initialCapacity"
-          description="This region's initial capacity."
-                 type="int"
-            writeable="false"/>
-    <attribute   name="loadFactor"
-          description="This region's load factor."
-                 type="float"
-            writeable="false"/>
-    <attribute   name="concurrencyLevel"
-          description="This region's concurrency level."
-                 type="int"
-            writeable="false"/>
-    <attribute   name="statisticsEnabled"
-          description="True if statistics are enabled on this region."
-                 type="boolean"
-            writeable="false"/>
-    <attribute   name="persistBackup"
-          description="true if the contents of the region are persisted to disk"
-                 type="boolean"
-                   is="false"
-            writeable="false"/>
-    <attribute   name="earlyAck"
-          description="false if ack is sent after processing update; true if sent early"
-                 type="boolean"
-                   is="false"
-            writeable="false"/>
-    <attribute   name="diskWriteAttributes"
-          description="Description of how the region's contents is written to disk "
-                 type="org.apache.geode.cache.DiskWriteAttributes"
-            writeable="false"/>
-    <attribute   name="diskDirs"
-          description="Directories to which the region's contents are written"
-                 type="[Ljava.io.File;"
-            writeable="false"/>
-    <attribute   name="entryCount"
-          description="Number of entries in this region."
-                 type="int"
-            writeable="false"/>
-    <attribute   name="subregionCount"
-          description="Number of subregions in this region."
-                 type="int"
-            writeable="false"/>
-    <attribute   name="lastModifiedTime"
-          description="Last time an entry's value in this region or one of its subregions was modified."
-                 type="long"
-            writeable="false"/>
-    <attribute   name="lastAccessedTime"
-          description="Last time an entry in this region or one of its subregions was accessed."
-                 type="long"
-            writeable="false"/>
-    <attribute   name="hitCount"
-          description="Number of times that a get on this region found a local value."
-                 type="long"
-            writeable="false"/>
-    <attribute   name="missCount"
-          description="Number of times that a get on this region did not find a local value."
-                 type="long"
-            writeable="false"/>
-    <attribute   name="hitRatio"
-          description="Ratio of hits to total get calls."
-                 type="float"
-            writeable="false"/>
-    <attribute   name="subregionNames"
-          description="A set of the names of each subregion of this region."
-                 type="java.util.Set"
-            writeable="false"/>
-    <attribute   name="subregionFullPaths"
-          description="A set of the full paths of each subregion of this region."
-                 type="java.util.Set"
-            writeable="false"/>
-    <attribute   name="membershipAttributes"
-          description="Description of the region's membership attributes."
-                 type="org.apache.geode.cache.MembershipAttributes"
-            writeable="false"/>
-    <attribute   name="subscriptionAttributes"
-          description="Description of the region's subscription attributes."
-                 type="org.apache.geode.cache.SubscriptionAttributes"
-            writeable="false"/>
-    <attribute   name="partitionAttributes"
-          description="Description of the region's partition attributes."
-                 type="org.apache.geode.cache.PartitionAttributes"
-            writeable="false"/>        
-    <attribute   name="concurrencyChecksEnabled"
-          description="True if concurrent modifications are handled on this region."
-                 type="boolean"
-            writeable="false"/>
-
-    <operation   name="refresh"
-          description="Updates each attribute in this MBean."
-               impact="ACTION"
-           returnType="void">
-    </operation>
-    <operation   name="getCacheListeners"
-          description="Descriptions of all CacheListeners on this region as a String array. If there are no cacheListeners defined on the region an empty array is returned."
-               impact="INFO"
-           returnType="[Ljava.lang.String;">
-    </operation>
-  </mbean>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.SystemMemberCacheServer                 -->
-  <!-- =================================================================== -->
-  <mbean         name="SystemMemberCacheServer"
-          description="View of a GemFire system member's cache server"
-                 type="org.apache.geode.admin.SystemMemberCacheServer">
-                 
-    <attribute   name="port"
-          description="The port on which this cache server listens for clients."
-                 type="int"
-            writeable="true"/>
-    <attribute   name="bindAddress"
-          description="The address on which this cache server listens for clients."
-                 type="java.lang.String"
-            writeable="true"/>
-    <attribute   name="hostnameForClients"
-          description="The host name or ip address that will be given to clients who discover this cache server"
-                 type="java.lang.String"
-            writeable="true"/>
-    <attribute   name="notifyBySubscription"
-          description="Whether or not this cache server should notify clients based on key subscription."
-                 type="boolean"
-            writeable="true"/>
-    <attribute   name="socketBufferSize"
-          description="The socket buffer size in bytes for connections made by clients to this server."
-                 type="int"
-            writeable="true"/>
-    <attribute   name="maximumTimeBetweenPings"
-          description="The maximum amount of time, in milliseconds, between pinging a client to determine its health."
-                 type="int"
-            writeable="true"/>
-    <attribute   name="maxConnections"
-          description="The maxium number of client connections allowed by this server."
-                 type="int"
-            writeable="true"/>
-    <attribute   name="maxThreads"
-          description="The maxium number of threads allowed in this server to service client requests."
-                 type="int"
-            writeable="true"/>
-    <attribute   name="maximumMessageCount"
-          description="The maximum number of messages that can be enqueued in a client-queue on this server."
-                 type="int"
-            writeable="true"/>
-    <attribute   name="messageTimeToLive"
-          description="The time, in seconds, after which a message in a client-queue on this server will expire."
-                 type="int"
-            writeable="true"/>
-    <attribute   name="groups"
-          description="The list of server groups that this cache server belongs to."
-                 type="[Ljava.lang.String;"
-            writeable="true"/>
-	<attribute   name="loadPollInterval"
-          description="The period, in milliseconds, to test the load for this cache server using the load probe"
-                 type="long"
-            writeable="true"/>
-	<attribute   name="loadProbe"
-          description="The period, in milliseconds, to test the load for this cache server using the load probe"
-                 type="java.lang.String"
-            writeable="false"/>
-	  
-
-    <attribute   name="running"
-          description="True if cache server is running."
-                 type="boolean"
-                   is="true"
-            writeable="false"/>
-
-    <operation   name="start"
-          description="Starts the cache server."
-               impact="ACTION"
-           returnType="void">
-    </operation>
-    <operation   name="stop"
-          description="Stops the cache server."
-               impact="ACTION"
-           returnType="void">
-    </operation>
-    <operation   name="refresh"
-          description="Updates each attribute in this MBean."
-               impact="ACTION"
-           returnType="void">
-    </operation>
-  </mbean>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.CacheVm                                  -->
-  <!-- =================================================================== -->
-  <mbean         name="CacheVm"
-          description="A dedicated Server VM that contains a GemFire Cache"
-                 type="org.apache.geode.admin.CacheVm">
-                 
-    <attribute   name="id"
-          description="A string that uniquely identifies the cache vm."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="name"
-          description="The JMX ObjectName of this managed resource."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="host"
-          description="The host machine on which the cache vm is running."
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <attribute   name="refreshInterval"
-          description="The interval (in seconds) between auto-refreshes of this application;s configuration attributes, as defined in the gemfire.properties file. To disable the JMX Timer service's auto-refresh feature, set this attribute to zero or less."
-                 type="int"/>
-
-    <attribute    name="version"
-           description="Display GemFire version information."
-                  type="java.lang.String"
-             writeable="false"/>
-             
-    <attribute    name="hasCache"
-           description="Does the cache vm host a GemFire Cache?"
-                  type="boolean"
-                    is="false"
-             getMethod="hasCache"
-             writeable="false"/>
-             
-    <attribute    name="distributedMember"
-           description="Distributed membership identity."
-                  type="org.apache.geode.distributed.DistributedMember"
-             writeable="false"/>             
-
-    <attribute   name="productDirectory"
-          description="The location of the GemFire installation used to run this cache vm."
-                 type="java.lang.String"
-            writeable="true"/>
-
-    <attribute   name="workingDirectory"
-          description="The directory in which the cache vm was launched."
-                 type="java.lang.String"
-            writeable="true"/>
-
-    <attribute   name="running"
-          description="True if this cache vm is running."
-                 type="boolean"
-            writeable="false"
-                   is="true"/>
-
-    <attribute   name="cacheXMLFile"
-          description="The declarative caching file user to configure this cache vm."
-                 type="java.lang.String"
-            writeable="true"/>
-
-    <attribute   name="classPath"
-          description="Location(s) of user classes required by cache vm"
-                 type="java.lang.String"
-            writeable="true"/>
-            
-    <notification name="gemfire.distributedsystem.cache.created"
-           description="A cache got created on a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.created"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.created</notification-type>
-    </notification>
-
-    <notification name="gemfire.distributedsystem.cache.closed"
-           description="A cache is closed on a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.closed"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.closed</notification-type>
-    </notification>
-    
-    <notification name="gemfire.distributedsystem.cache.region.created"
-           description="A region is created in a cache on a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.region.created"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.region.created</notification-type>
-    </notification>
-    
-    <notification name="gemfire.distributedsystem.cache.region.lost"
-           description="A region was removed from a cache on a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.region.lost"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.region.lost</notification-type>
-    </notification>
-    
-    <notification name="gemfire.distributedsystem.cache.client.joined"
-           description="A cache client established a connection with a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.client.joined"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.client.joined</notification-type>
-    </notification>
-    
-    <notification name="gemfire.distributedsystem.cache.client.left"
-           description="A cache client gracefully closed a connection with a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.client.left"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.client.left</notification-type>
-    </notification>
-    
-    <notification name="gemfire.distributedsystem.cache.client.crashed"
-           description="A cache client crashed and abruptly lost connection with a member of this distributed system.">
-      <descriptor>
-        <field    name="name"           value="gemfire.distributedsystem.cache.client.crashed"/>
-        <field    name="severity"       value="6"/><!-- 6: normal, cleared, informative -->
-        <field    name="descriptorType" value="notification"/>
-      </descriptor>
-      <notification-type>gemfire.distributedsystem.cache.client.crashed</notification-type>
-    </notification>
- 
-    <operation    name="getRoles"
-           description="Get the membership roles filled by this member."
-                impact="INFO"
-            returnType="[Ljava.lang.String;">
-    </operation>
-
-    <operation   name="start"
-          description="Start this cache vm."
-               impact="ACTION"
-           returnType="void">
-    </operation>
-
-    <operation   name="waitToStart"
-          description="Wait for the cache vm to start"
-               impact="ACTION"
-           returnType="boolean">
-      <parameter name="timeout" 
-          description="Number of milliseconds to wait to start"
-                 type="long" />
-    </operation>
-
-    <operation   name="waitToStop"
-          description="Wait for the cache vm to stop"
-               impact="ACTION"
-           returnType="boolean">
-      <parameter name="timeout" 
-          description="Number of milliseconds to wait to stop"
-                 type="long" />
-    </operation>
-
-    <operation   name="stop"
-          description="Stop this cache vm."
-               impact="ACTION"
-           returnType="void">
-    </operation>
-
-    <operation   name="getLog"
-          description="Display the log for this cache vm."
-               impact="INFO"
-           returnType="java.lang.String">
-    </operation>
-
-    <operation   name="getLicense"
-          description="Display GemFire licensing information."
-               impact="INFO"
-           returnType="java.util.Properties">
-    </operation>
-
-    <operation   name="manageCache"
-          description="Create a SystemMemberCache MBean for the cache in this cache vm."
-               impact="ACTION_INFO"
-           returnType="javax.management.ObjectName">
-    </operation>
-    
-    <operation   name="manageStats"
-          description="Create a StatisticResource MBean for each statistic resource in this member."
-               impact="ACTION_INFO"
-           returnType="[Ljavax.management.ObjectName;">
-    </operation>
-
-    <operation   name="manageStat"
-          description="Create a StatisticResource MBean for each statistic resource in this member, given the underlying Statistics Type name."
-               impact="ACTION_INFO"
-           returnType="[Ljavax.management.ObjectName;">
-      <parameter name="statisticsTypeName" 
-          description="Name of the underlying Statistics Type eg. DistributionStats"
-                 type="java.lang.String" />           
-    </operation>
-
-    <operation   name="refreshConfig"
-          description="Refresh configuration attributes for this application, using the gemfire.properties file."
-               impact="ACTION"
-           returnType="void">
-    </operation>
-    
-    <operation   name="getConfiguration"
-          description="Returns the current configuration attributes for this application, using the gemfire.properties file."
-               impact="ACTION"
-           returnType="[Lorg.apache.geode.admin.ConfigurationParameter;">
-    </operation>
-    
-  </mbean>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.GemFireHealth                            -->
-  <!-- =================================================================== -->
-  <mbean         name="GemFireHealth"
-          description="Monitors the Health of GemFire"
-                 type="org.apache.geode.admin.GemFireHealth">
-
-    <attribute   name="health"
-          description="The overall health of the distributed system: Good, Okay, or Poor."
-                 type="org.apache.geode.admin.GemFireHealth$Health"
-            writeable="false"/>
-
-    <attribute   name="healthStatus"
-          description="The current status of the overall health of GemFire"
-                 type="java.lang.String"
-            writeable="false"/>
-
-    <operation   name="resetHealth"
-          description="Resets the overall health of the distributed system to Good (optimal)."
-               impact="ACTION_INFO"
-           returnType="void">
-    </operation>
-
-    <operation   name="getDiagnosis"
-          description="Returns a description of any causes of ill health in the distributed system."
-               impact="ACTION_INFO"
-           returnType="java.lang.String">
-    </operation>
-    
-    <operation   name="manageGemFireHealthConfig"
-          description="Registers a new GemFireHealthConfig MBean and returns its ObjectName"
-               impact="ACTION_INFO"
-           returnType="javax.management.ObjectName">
-      <parameter name="host" 
-          description="The host to monitor the health of"
-                 type="java.lang.String" />
-    </operation>
-
-  </mbean>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.DistributedSystemHealthConfig            -->
-  <!-- =================================================================== -->
-  <mbean         name="DistributedSystemHealthConfig"
-          description="Configures how the health of a distributed system is determined"
-                 type="org.apache.geode.admin.DistributedSystemHealthConfig">
-
-    <attribute   name="maxDepartedApplications"
-          description="The maximum number of system members that can unexpectedly leave a healthy distributed system."
-                 type="long"
-            writeable="true"/>
-
-    <operation   name="applyChanges"
-          description="Applies these configuration attributes to the GemFire health monitor."
-               impact="ACTION_INFO"
-           returnType="void">
-    </operation>
-
-  </mbean>
-
-  <!-- =================================================================== -->
-  <!-- org.apache.geode.admin.GemFireHealthConfig                      -->
-  <!-- =================================================================== -->
-  <mbean         name="GemFireHealthConfig"
-          description="Configures how the health of GemFire components is determined"
-                 type="org.apache.geode.admin.GemFireHealthConfig">
-
-    <attribute   name="healthEvaluationInterval"
-          description="The number of seconds to wait between two health assessments of this distributed system."
-                 type="int"
-            writeable="true"/>
-
-    <!--  CacheHealthConfig  -->
-
-    <attribute   name="maxNetSearchTime"
-          description="The maximum time (in milliseconds) that a netSearch operation can take before the cache member is considered to be unhealthy."
-                 type="long"
-            writeable="true"/>
-
-    <attribute   name="maxLoadTime"
-          description="The maximum time (in milliseconds) that a cache load operation can take before the cache member is considered to be unhealthy."
-                 type="long"
-            writeable="true"/>
-
-    <attribute   name="minHitRatio"
-          description="The minimum hit ratio in order for a cache member to be considered healthy."
-                 type="double"
-            writeable="true"/>
-
-    <attribute   name="maxEventQueueSize"
-          description="The maximum number of entries in the event delivery queue of a healthy cache member."
-                 type="long"
-            writeable="true"/>
-
-    <!--  MemberHealthConfig  -->
-
-    <attribute   name="maxVMProcessSize"
-          description="The maximum process size (in megabytes) of a healthy member of the distributed system."
-                 type="long"
-            writeable="true"/>
-
-    <attribute   name="maxMessageQueueSize"
-          description="The maximum number of enqueued incoming or outgoing messages that a healthy member of a distributed system can have."
-                 type="long"
-            writeable="true"/>
-
-    <attribute   name="maxReplyTimeouts"
-          description="The maximum number of message replies that can time out in a healthy member."
-                 type="long"
-            writeable="true"/>
-
-    <!--  Operations  -->
-
-    <operation   name="applyChanges"
-          description="Applies this configuration to the GemFire health monitor."
-               impact="ACTION_INFO"
-           returnType="void">
-    </operation>
-
-  </mbean>
-
-</mbeans-descriptors>
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/admin/AdminTestHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/admin/AdminTestHelper.java b/geode-core/src/test/java/org/apache/geode/admin/AdminTestHelper.java
deleted file mode 100644
index f66fdbd..0000000
--- a/geode-core/src/test/java/org/apache/geode/admin/AdminTestHelper.java
+++ /dev/null
@@ -1,43 +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.admin;
-
-import static org.junit.Assert.*;
-import org.apache.geode.distributed.internal.DistributionManager;
-
-public class AdminTestHelper {
-  private AdminTestHelper() {}
-
-  public static void checkEnableAdministrationOnly(boolean v, boolean expectException) {
-    boolean origIsDedicatedAdminVM = DistributionManager.isDedicatedAdminVM;
-    if (expectException) {
-      try {
-        AdminDistributedSystemFactory.setEnableAdministrationOnly(v);
-        fail("expected IllegalStateException");
-      } catch (IllegalStateException expected) {
-        assertEquals(origIsDedicatedAdminVM, DistributionManager.isDedicatedAdminVM);
-      } finally {
-        DistributionManager.isDedicatedAdminVM = origIsDedicatedAdminVM;
-      }
-    } else {
-      try {
-        AdminDistributedSystemFactory.setEnableAdministrationOnly(v);
-        assertEquals(v, DistributionManager.isDedicatedAdminVM);
-      } finally {
-        DistributionManager.isDedicatedAdminVM = origIsDedicatedAdminVM;
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/admin/AlertLevelJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/admin/AlertLevelJUnitTest.java b/geode-core/src/test/java/org/apache/geode/admin/AlertLevelJUnitTest.java
deleted file mode 100644
index e619071..0000000
--- a/geode-core/src/test/java/org/apache/geode/admin/AlertLevelJUnitTest.java
+++ /dev/null
@@ -1,63 +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.admin;
-
-import static org.apache.geode.internal.Assert.assertTrue;
-import static org.junit.Assert.*;
-
-import java.lang.reflect.Constructor;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import org.apache.geode.test.junit.categories.UnitTest;
-
-/**
- * AlertLevel Tester.
- */
-@Category(UnitTest.class)
-public class AlertLevelJUnitTest {
-
-  /**
-   * Method: equals(Object other)
-   */
-
-  private AlertLevel alertLevel1 = AlertLevel.WARNING;
-  private AlertLevel alertLevel2 = AlertLevel.ERROR;
-  private AlertLevel alertLevel3 = AlertLevel.WARNING;
-
-
-  @Test
-  public void testEquals() throws Exception {
-    // TODO: Test goes here...
-    assertTrue(alertLevel1.equals(alertLevel3));
-    assertFalse(alertLevel1.equals(alertLevel2));
-    assertFalse(alertLevel1.equals(null));
-
-    Constructor<AlertLevel> constructor;
-    constructor = AlertLevel.class.getDeclaredConstructor(int.class, String.class);
-    constructor.setAccessible(true);
-    AlertLevel level = constructor.newInstance(AlertLevel.ERROR.getSeverity(), "ERROR");
-    assertEquals(level.getSeverity(), AlertLevel.ERROR.getSeverity());
-
-
-    AlertLevel level1 =
-        constructor.newInstance(AlertLevel.ERROR.getSeverity(), new String("ERROR"));
-    assertEquals(level1.getName(), alertLevel2.getName());
-    assertTrue(level1.equals(alertLevel2));
-
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/admin/internal/BindDistributedSystemJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/admin/internal/BindDistributedSystemJUnitTest.java b/geode-core/src/test/java/org/apache/geode/admin/internal/BindDistributedSystemJUnitTest.java
deleted file mode 100755
index 0894f11..0000000
--- a/geode-core/src/test/java/org/apache/geode/admin/internal/BindDistributedSystemJUnitTest.java
+++ /dev/null
@@ -1,84 +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.admin.internal;
-
-import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.util.Properties;
-
-import static org.apache.geode.distributed.ConfigurationProperties.BIND_ADDRESS;
-import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR;
-import static org.junit.Assert.assertEquals;
-
-/**
- * Tests {@link org.apache.geode.admin.internal.AdminDistributedSystemImpl}.
- *
- * @created August 30, 2004
- * @since GemFire 3.5
- */
-@SuppressWarnings("deprecation")
-@Category(IntegrationTest.class)
-public class BindDistributedSystemJUnitTest {
-
-  private final static int RETRY_ATTEMPTS = 3;
-  private final static int RETRY_SLEEP = 100;
-
-  private DistributedSystem system;
-
-  @After
-  public void tearDown() {
-    if (this.system != null) {
-      this.system.disconnect();
-    }
-    this.system = null;
-  }
-
-  // public void testBindToAddressNull() throws Exception {
-  // DistributedSystemFactory.bindToAddress(null);
-  // todo...
-  // }
-  //
-  // public void testBindToAddressEmpty() throws Exception {
-  // DistributedSystemFactory.bindToAddress("");
-  // todo...
-  // }
-
-  @Test
-  public void testBindToAddressLoopback() throws Exception {
-    String bindTo = "127.0.0.1";
-    // make sure bindTo is the loopback... needs to be later in test...
-    assertEquals(true, InetAddressUtil.isLoopback(bindTo));
-
-    Properties props = new Properties();
-    props.setProperty(BIND_ADDRESS, bindTo);
-    props.setProperty(START_LOCATOR,
-        "localhost[" + AvailablePortHelper.getRandomAvailableTCPPort() + "]");
-    this.system = org.apache.geode.distributed.DistributedSystem.connect(props);
-
-    assertEquals(true, this.system.isConnected());
-
-    // Because of fix for bug 31409
-    this.system.disconnect();
-
-  }
-
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/admin/internal/CacheHealthEvaluatorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/admin/internal/CacheHealthEvaluatorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/admin/internal/CacheHealthEvaluatorJUnitTest.java
deleted file mode 100644
index 3a70527..0000000
--- a/geode-core/src/test/java/org/apache/geode/admin/internal/CacheHealthEvaluatorJUnitTest.java
+++ /dev/null
@@ -1,199 +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.admin.internal;
-
-import static org.junit.Assert.*;
-
-import org.apache.geode.admin.*;
-import org.apache.geode.cache.*;
-import org.apache.geode.internal.cache.*;
-import org.apache.geode.test.junit.categories.IntegrationTest;
-
-import java.util.*;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
-
-/**
- * Contains simple tests for the {@link CacheHealthEvaluator}
- *
- *
- * @since GemFire 3.5
- */
-@SuppressWarnings("deprecation")
-@Category(IntegrationTest.class)
-public class CacheHealthEvaluatorJUnitTest extends HealthEvaluatorTestCase {
-
-  @Rule
-  public TestName testName = new TestName();
-
-  /**
-   * Tests that we are in {@link GemFireHealth#OKAY_HEALTH okay} health if cache loads take too
-   * long.
-   *
-   * @see CacheHealthEvaluator#checkLoadTime
-   */
-  @Test
-  public void testCheckLoadTime() throws CacheException {
-    Cache cache = CacheFactory.create(this.system);
-    CachePerfStats stats = ((GemFireCacheImpl) cache).getCachePerfStats();
-
-    AttributesFactory factory = new AttributesFactory();
-    factory.setScope(Scope.LOCAL);
-    factory.setCacheLoader(new CacheLoader() {
-      public Object load(LoaderHelper helper) throws CacheLoaderException {
-
-        return "Loaded";
-      }
-
-      public void close() {}
-    });
-
-    RegionAttributes attrs = factory.create();
-    Region region = cache.createRegion(getName(), attrs);
-
-    GemFireHealthConfig config = new GemFireHealthConfigImpl(null);
-    config.setMaxLoadTime(100);
-
-    CacheHealthEvaluator eval =
-        new CacheHealthEvaluator(config, this.system.getDistributionManager());
-    for (int i = 0; i < 10; i++) {
-      region.get("Test1 " + i);
-    }
-    long firstLoadTime = stats.getLoadTime();
-    long firstLoadsCompleted = stats.getLoadsCompleted();
-    assertTrue(firstLoadTime >= 0);
-    assertTrue(firstLoadsCompleted > 0);
-
-    // First time should always be empty
-    List status = new ArrayList();
-    eval.evaluate(status);
-    assertEquals(0, status.size());
-
-    config = new GemFireHealthConfigImpl(null);
-    config.setMaxLoadTime(10);
-    eval = new CacheHealthEvaluator(config, this.system.getDistributionManager());
-    eval.evaluate(status);
-
-    long start = System.currentTimeMillis();
-    for (int i = 0; i < 100; i++) {
-      region.get("Test2 " + i);
-    }
-    assertTrue(System.currentTimeMillis() - start < 1000);
-    long secondLoadTime = stats.getLoadTime();
-    long secondLoadsCompleted = stats.getLoadsCompleted();
-    assertTrue("firstLoadTime=" + firstLoadTime + ", secondLoadTime=" + secondLoadTime,
-        secondLoadTime >= firstLoadTime);
-    assertTrue(secondLoadsCompleted > firstLoadsCompleted);
-
-    // Averge should be less than 10 milliseconds
-    status = new ArrayList();
-    eval.evaluate(status);
-    assertEquals(0, status.size());
-
-    region.getAttributesMutator().setCacheLoader(new CacheLoader() {
-      public Object load(LoaderHelper helper) throws CacheLoaderException {
-
-        try {
-          Thread.sleep(20);
-
-        } catch (InterruptedException ex) {
-          fail("Why was I interrupted?");
-        }
-        return "Loaded";
-      }
-
-      public void close() {}
-
-    });
-
-    for (int i = 0; i < 50; i++) {
-      region.get("Test3 " + i);
-    }
-
-    long thirdLoadTime = stats.getLoadTime();
-    long thirdLoadsCompleted = stats.getLoadsCompleted();
-    assertTrue(thirdLoadTime > secondLoadTime);
-    assertTrue(thirdLoadsCompleted > secondLoadsCompleted);
-
-    status = new ArrayList();
-    eval.evaluate(status);
-    assertEquals(1, status.size());
-
-    AbstractHealthEvaluator.HealthStatus ill = (AbstractHealthEvaluator.HealthStatus) status.get(0);
-    assertEquals(GemFireHealth.OKAY_HEALTH, ill.getHealthCode());
-    String s = "The average duration of a Cache load";
-    assertTrue(ill.getDiagnosis().indexOf(s) != -1);
-  }
-
-  /**
-   * Tests that we are in {@link GemFireHealth#OKAY_HEALTH okay} health if the hit ratio dips below
-   * the threshold.
-   */
-  @Test
-  public void testCheckHitRatio() throws CacheException {
-    Cache cache = CacheFactory.create(this.system);
-    // CachePerfStats stats = ((GemFireCache) cache).getCachePerfStats();
-
-    AttributesFactory factory = new AttributesFactory();
-    factory.setScope(Scope.LOCAL);
-    factory.setCacheLoader(new CacheLoader() {
-      public Object load(LoaderHelper helper) throws CacheLoaderException {
-
-        return "Loaded";
-      }
-
-      public void close() {}
-    });
-
-    RegionAttributes attrs = factory.create();
-    Region region = cache.createRegion(getName(), attrs);
-
-    GemFireHealthConfig config = new GemFireHealthConfigImpl(null);
-    config.setMinHitRatio(0.5);
-
-    CacheHealthEvaluator eval =
-        new CacheHealthEvaluator(config, this.system.getDistributionManager());
-    List status = new ArrayList();
-    eval.evaluate(status);
-    assertEquals(0, status.size());
-
-    region.get("One");
-    region.get("One");
-    region.get("One");
-
-    status = new ArrayList();
-    eval.evaluate(status);
-    assertEquals(0, status.size());
-
-    for (int i = 0; i < 50; i++) {
-      region.get("Miss " + i);
-    }
-
-    status = new ArrayList();
-    eval.evaluate(status);
-
-    AbstractHealthEvaluator.HealthStatus ill = (AbstractHealthEvaluator.HealthStatus) status.get(0);
-    assertEquals(GemFireHealth.OKAY_HEALTH, ill.getHealthCode());
-    String s = "The hit ratio of this Cache";
-    assertTrue(ill.getDiagnosis().indexOf(s) != -1);
-  }
-
-  private String getName() {
-    return getClass().getSimpleName() + "_" + testName.getMethodName();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/test/java/org/apache/geode/admin/internal/DistributedSystemTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/admin/internal/DistributedSystemTestCase.java b/geode-core/src/test/java/org/apache/geode/admin/internal/DistributedSystemTestCase.java
deleted file mode 100755
index 74df5c8..0000000
--- a/geode-core/src/test/java/org/apache/geode/admin/internal/DistributedSystemTestCase.java
+++ /dev/null
@@ -1,64 +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.admin.internal;
-
-import org.apache.geode.distributed.DistributedSystem;
-import org.junit.After;
-import org.junit.Before;
-
-import java.util.Properties;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-/**
- * Provides common setUp and tearDown for testing the Admin API.
- *
- * @since GemFire 3.5
- */
-public abstract class DistributedSystemTestCase {
-
-  /** The DistributedSystem used for this test */
-  protected DistributedSystem system;
-
-  /**
-   * Creates a "loner" <code>DistributedSystem</code> for this test.
-   */
-  @Before
-  public void setUp() throws Exception {
-    this.system = DistributedSystem.connect(defineProperties());
-  }
-
-  /**
-   * Closes the "loner" <code>DistributedSystem</code>
-   */
-  @After
-  public void tearDown() throws Exception {
-    if (this.system != null) {
-      this.system.disconnect();
-    }
-    this.system = null;
-  }
-
-  /**
-   * Defines the <code>Properties</code> used to connect to the distributed system.
-   */
-  protected Properties defineProperties() {
-    Properties props = new Properties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(LOCATORS, "");
-    props.setProperty(CONSERVE_SOCKETS, "true");
-    return props;
-  }
-}