geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject incubator-geode git commit: GEODE-420 Changing TcpClient to not be a static class
Date Wed, 27 Jul 2016 22:49:29 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-420 e8676046c -> 115e5f25d


GEODE-420 Changing TcpClient to not be a static class

TcpClient now holds the SocketCreator that it should use to connect to
locators.  It's currently using the cluster SocketCreator but will be
changed to use the one for the Locator component when it's available.


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

Branch: refs/heads/feature/GEODE-420
Commit: 115e5f25dc4138f90c29452ad8eea987215e2261
Parents: e867604
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Wed Jul 27 15:47:08 2016 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Wed Jul 27 15:47:08 2016 -0700

----------------------------------------------------------------------
 .../internal/DistributionLocatorConfigImpl.java | 10 +--
 .../internal/AutoConnectionSourceImpl.java      |  6 +-
 .../gemfire/distributed/LocatorLauncher.java    | 26 +++++-
 .../distributed/internal/InternalLocator.java   | 37 +-------
 .../membership/gms/locator/GMSLocator.java      |  4 +-
 .../membership/gms/membership/GMSJoinLeave.java | 19 +++--
 .../internal/tcpserver/TcpClient.java           | 90 ++++++++++++++------
 .../gemfire/internal/DistributionLocator.java   |  3 +-
 .../gemstone/gemfire/internal/SystemAdmin.java  |  3 +-
 .../cache/ClusterConfigurationLoader.java       |  8 +-
 .../internal/JmxManagerLocatorRequest.java      |  4 +-
 .../cli/commands/LauncherLifecycleCommands.java |  9 +-
 .../AutoConnectionSourceImplJUnitTest.java      |  6 +-
 .../internal/LocatorLoadBalancingDUnitTest.java |  8 +-
 .../gemfire/distributed/LocatorJUnitTest.java   |  8 +-
 .../TcpServerBackwardCompatDUnitTest.java       |  4 +-
 .../internal/tcpserver/TcpServerJUnitTest.java  | 12 +--
 .../SharedConfigurationDUnitTest.java           |  2 +-
 .../codeAnalysis/sanctionedSerializables.txt    |  1 +
 .../internal/locator/wan/LocatorDiscovery.java  | 10 ++-
 .../wan/LocatorMembershipListenerImpl.java      |  7 +-
 .../cache/wan/AbstractRemoteGatewaySender.java  |  2 +-
 22 files changed, 163 insertions(+), 116 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/admin/internal/DistributionLocatorConfigImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/admin/internal/DistributionLocatorConfigImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/admin/internal/DistributionLocatorConfigImpl.java
index 88d939a..719cd14 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/admin/internal/DistributionLocatorConfigImpl.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/admin/internal/DistributionLocatorConfigImpl.java
@@ -18,7 +18,7 @@ package com.gemstone.gemfire.admin.internal;
 
 import com.gemstone.gemfire.admin.DistributionLocator;
 import com.gemstone.gemfire.admin.DistributionLocatorConfig;
-import com.gemstone.gemfire.distributed.internal.InternalLocator;
+import com.gemstone.gemfire.distributed.internal.tcpserver.*;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 
 import java.net.InetAddress;
@@ -63,19 +63,19 @@ public class DistributionLocatorConfigImpl
    * Contacts a distribution locator on the given host and port and
    * creates a <code>DistributionLocatorConfig</code> for it.
    *
-   * @see InternalLocator#getLocatorInfo
+   * @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 = InternalLocator.getLocatorInfo(bindAddress, port);
+      info = client.getInfo(bindAddress, port);
     }
     else {
-      info = InternalLocator.getLocatorInfo(InetAddressUtil.toInetAddress(host), port);
+      info = client.getInfo(InetAddressUtil.toInetAddress(host), port);
     }
     if (info == null) {
       return null;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceImpl.java
index db34c9f..1d801fb 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceImpl.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceImpl.java
@@ -55,6 +55,7 @@ import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
+import com.gemstone.gemfire.internal.net.*;
 
 /**
  * A connection source which uses locators to find
@@ -66,6 +67,8 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
 
   private static final Logger logger = LogService.getLogger();
   
+  private TcpClient tcpClient;
+  
   protected static final LocatorListRequest LOCATOR_LIST_REQUEST = new LocatorListRequest();
   private static final Comparator<InetSocketAddress> SOCKET_ADDRESS_COMPARATOR = new Comparator<InetSocketAddress>() {
     public int compare(InetSocketAddress o1,InetSocketAddress o2){
@@ -108,6 +111,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
     this.initialLocators = Collections.unmodifiableList(tmpContacts);
     this.connectionTimeout = handshakeTimeout;
     this.serverGroup = serverGroup;
+    this.tcpClient = new TcpClient();
   }
   
   public boolean isBalanced() {
@@ -187,7 +191,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource {
     Object returnObj = null;
     try {
       pool.getStats().incLocatorRequests();
-      returnObj = TcpClient.requestToServer(addr, port, request, connectionTimeout);
+      returnObj = tcpClient.requestToServer(addr, port, request, connectionTimeout);
       ServerLocationResponse response = (ServerLocationResponse)returnObj; 
       pool.getStats().incLocatorResponses();
       if(response != null) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/distributed/LocatorLauncher.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/LocatorLauncher.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/LocatorLauncher.java
index c0ac634..0b1efd3 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/LocatorLauncher.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/LocatorLauncher.java
@@ -19,9 +19,10 @@ package com.gemstone.gemfire.distributed;
 
 import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
 
-import com.gemstone.gemfire.cache.client.internal.locator.LocatorStatusResponse;
+import com.gemstone.gemfire.cache.client.internal.locator.*;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.InternalLocator;
+import com.gemstone.gemfire.distributed.internal.tcpserver.*;
 import com.gemstone.gemfire.internal.DistributionLocator;
 import com.gemstone.gemfire.internal.GemFireVersion;
 import com.gemstone.gemfire.internal.net.SocketCreator;
@@ -241,6 +242,23 @@ public final class LocatorLauncher extends AbstractLauncher<String> {
   }
 
   /**
+   * Returns the status of the locator on the given host & port
+   */
+  public static LocatorStatusResponse statusLocator(int port, InetAddress bindAddress) throws IOException {
+    //final int timeout = (60 * 2 * 1000); // 2 minutes
+    final int timeout = Integer.MAX_VALUE; // 2 minutes
+
+    try {
+      TcpClient client = new TcpClient();
+      return (LocatorStatusResponse) client.requestToServer(bindAddress, port,
+        new LocatorStatusRequest(), timeout, true);
+    }
+    catch (ClassNotFoundException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  /**
    * Gets the reference to the Locator object representing the running GemFire Locator.
    * 
    * @return a reference to the Locator.
@@ -744,7 +762,7 @@ public final class LocatorLauncher extends AbstractLauncher<String> {
 
     while (System.currentTimeMillis() < endTimeInMilliseconds) {
       try {
-        LocatorStatusResponse response = InternalLocator.statusLocator(getPort(), getBindAddress());
+        LocatorStatusResponse response = statusLocator(getPort(), getBindAddress());
         return new LocatorState(this, Status.ONLINE, response);
       }
       catch (Exception ignore) {
@@ -867,7 +885,7 @@ public final class LocatorLauncher extends AbstractLauncher<String> {
 
   private LocatorState statusWithPort() {
     try {
-      LocatorStatusResponse response = InternalLocator.statusLocator(getPort(), getBindAddress());
+      LocatorStatusResponse response = statusLocator(getPort(), getBindAddress());
       return new LocatorState(this, Status.ONLINE, response);
     }
     catch (Exception e) {
@@ -1020,7 +1038,7 @@ public final class LocatorLauncher extends AbstractLauncher<String> {
   @Deprecated
   private LocatorState stopWithPort() {
     try {
-      InternalLocator.stopLocator(getPort(), getBindAddress());
+      new TcpClient().stop(getBindAddress(), getPort());
       return new LocatorState(this, Status.STOPPED);
     }
     catch (ConnectException e) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
index 72ebd86..58f2602 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/InternalLocator.java
@@ -34,7 +34,7 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.locator.PeerLoca
 import com.gemstone.gemfire.distributed.internal.tcpserver.TcpClient;
 import com.gemstone.gemfire.distributed.internal.tcpserver.TcpHandler;
 import com.gemstone.gemfire.distributed.internal.tcpserver.TcpServer;
-import com.gemstone.gemfire.internal.net.SocketCreator;
+import com.gemstone.gemfire.internal.net.*;
 import com.gemstone.gemfire.internal.admin.remote.DistributionLocatorId;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.wan.WANServiceProvider;
@@ -447,39 +447,6 @@ public class InternalLocator extends Locator implements ConnectListener {
     DistributionManager distMgr = (DistributionManager)ids.getDistributionManager();
     return distMgr.getDMType() == DistributionManager.LOCATOR_DM_TYPE;
   }
-  
-  public static LocatorStatusResponse statusLocator(int port, InetAddress bindAddress) throws IOException {
-    //final int timeout = (60 * 2 * 1000); // 2 minutes
-    final int timeout = Integer.MAX_VALUE; // 2 minutes
-
-    try {
-      return (LocatorStatusResponse) TcpClient.requestToServer(bindAddress, port,
-        new LocatorStatusRequest(), timeout, true);
-    }
-    catch (ClassNotFoundException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  /**
-   * Stops the distribution locator that runs on the given port and
-   * bind address.
-   */
-  public static void stopLocator(int port, InetAddress bindAddress) 
-    throws ConnectException {
-    TcpClient.stop(bindAddress, port);
-  }
-
-  /**
-   * Returns information about the locator running on the given host
-   * and port or <code>null</code> if the information cannot be
-   * obtained.  Two <code>String</code>s are returned: the first
-   * string is the working directory of the locator and the second
-   * string is the product directory of the locator.
-   */
-  public static String[] getLocatorInfo(InetAddress host, int port) {
-    return TcpClient.getInfo(host, port);
-  }
 
   ///////////////////////  Constructors  //////////////////////
   
@@ -950,7 +917,7 @@ public class InternalLocator extends Locator implements ConnectListener {
     if (this.server.isAlive()) {
       logger.info(LocalizedMessage.create(LocalizedStrings.InternalLocator_STOPPING__0, this));
       try {
-        stopLocator(getPort(), this.bindAddress);
+        new TcpClient().stop(this.bindAddress, getPort());
       } catch ( ConnectException ignore ) {
         // must not be running
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/locator/GMSLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/locator/GMSLocator.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/locator/GMSLocator.java
index aab9002..5a88779 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/locator/GMSLocator.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/locator/GMSLocator.java
@@ -55,6 +55,7 @@ import com.gemstone.gemfire.distributed.internal.tcpserver.TcpServer;
 import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.internal.VersionedObjectInput;
 import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.internal.net.*;
 
 import static com.gemstone.gemfire.internal.i18n.LocalizedStrings.LOCATOR_UNABLE_TO_RECOVER_VIEW;
 
@@ -320,7 +321,8 @@ public class GMSLocator implements Locator, NetLocator {
   private boolean recover(InetSocketAddress other) {
     try {
       logger.info("Peer locator attempting to recover from " + other);
-      Object response = TcpClient.requestToServer(other.getAddress(), other.getPort(),
+      TcpClient client = new TcpClient();
+      Object response = client.requestToServer(other.getAddress(), other.getPort(),
           new GetViewRequest(), 20000, true);
       if (response != null && (response instanceof GetViewResponse)) {
         this.view = ((GetViewResponse)response).getView();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeave.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeave.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeave.java
index 4b82fa0..2410f36 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeave.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeave.java
@@ -37,6 +37,7 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.messages.*;
 import com.gemstone.gemfire.distributed.internal.tcpserver.TcpClient;
 import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.internal.net.*;
 import com.gemstone.gemfire.security.AuthenticationFailedException;
 import org.apache.logging.log4j.Logger;
 
@@ -460,7 +461,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
    * If this is not the coordinator but the coordinator is known, the message
    * is forwarded to the coordinator.
    *
-   * @param incomingRequest
+   * @param incomingRequest the request to be processed
    */
   private void processJoinRequest(JoinRequestMessage incomingRequest) {
 
@@ -502,7 +503,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
    * to become the new membership coordinator. If this is the coordinator
    * a new view will be triggered.
    *
-   * @param incomingRequest
+   * @param incomingRequest the request to be processed
    */
   private void processLeaveRequest(LeaveRequestMessage incomingRequest) {
 
@@ -563,7 +564,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
    * to become the new membership coordinator. If this is the coordinator
    * a new view will be triggered.
    *
-   * @param incomingRequest
+   * @param incomingRequest the request to process
    */
   private void processRemoveRequest(RemoveMemberMessage incomingRequest) {
     NetView v = currentView;
@@ -935,9 +936,10 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
   private TcpClientWrapper tcpClientWrapper = new TcpClientWrapper();
 
   /***
-   * testing purpose
+   * testing purpose.  Sets the TcpClient that is used by GMSJoinLeave
+   * to communicate with Locators.
    *
-   * @param tcpClientWrapper
+   * @param tcpClientWrapper the wrapper
    */
   void setTcpClientWrapper(TcpClientWrapper tcpClientWrapper) {
     this.tcpClientWrapper = tcpClientWrapper;
@@ -1058,7 +1060,8 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
   protected class TcpClientWrapper {
     protected Object sendCoordinatorFindRequest(InetSocketAddress addr, FindCoordinatorRequest request, int connectTimeout)
         throws ClassNotFoundException, IOException {
-      return TcpClient.requestToServer(
+      TcpClient client = new TcpClient();
+      return client.requestToServer(
           addr.getAddress(), addr.getPort(), request, connectTimeout,
           true);
     }
@@ -1132,7 +1135,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
   /**
    * receives a JoinResponse holding a membership view or rejection message
    *
-   * @param rsp
+   * @param rsp the response message to process
    */
   private void processJoinResponse(JoinResponseMessage rsp) {
     synchronized (joinResponse) {
@@ -1153,7 +1156,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
   /***
    * for testing purpose
    *
-   * @param jrm
+   * @param jrm the join response message to process
    */
   void setJoinResponseMessage(JoinResponseMessage jrm) {
     joinResponse[0] = jrm;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
index f27618f..d4db321 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
@@ -20,9 +20,7 @@ import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.EOFException;
 import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.Socket;
+import java.net.*;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -30,35 +28,51 @@ import org.apache.logging.log4j.Logger;
 
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.cache.UnsupportedVersionException;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.cache.client.internal.locator.*;
 import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.internal.VersionedDataInputStream;
 import com.gemstone.gemfire.internal.VersionedDataOutputStream;
 import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.internal.net.SocketCreatorFactory;
+import com.gemstone.gemfire.internal.net.*;
 
 /**
- * Client for the TcpServer. These methods were refactored out of GossipClient,
- * because they are required for the server regardless of whether we are using the
- * GossipServer or the ServerLocator.
- * <p>
- * TODO - refactor this to support keep-alive connections to the server. requestToServer
- * probably shouldn't a static method.
+ * <p>Client for the TcpServer component of the Locator.
+ * </p>
  * @since GemFire 5.7
  */
 public class TcpClient {
 
   private static final Logger logger = LogService.getLogger();
-  private static final int REQUEST_TIMEOUT = 60 * 2 * 1000;
+  
+  private static final int DEFAULT_REQUEST_TIMEOUT = 60 * 2 * 1000;
+
   private static Map<InetSocketAddress, Short> serverVersions = new HashMap<InetSocketAddress, Short>();
+  
+  private final SocketCreator socketCreator;
+  
+  /**
+   * Constructs a new TcpClient using the default (Locator) SocketCreator.
+   * SocketCreatorFactory should be initialized before invoking this method.
+   */
+  public TcpClient() {
+    this(SocketCreatorFactory.getClusterSSLSocketCreator());
+  }
 
   /**
-   * Stops the TcpServer running on a given host and port
+   * Constructs a new TcpClient
+   * @param socketCreator the SocketCreator to use in communicating with the Locator
    */
-  public static void stop(InetAddress addr, int port) throws java.net.ConnectException {
+  public TcpClient(SocketCreator socketCreator) {
+    this.socketCreator = socketCreator;
+  }
+
+  /**
+   * Stops the Locator running on a given host and port
+   */
+  public void stop(InetAddress addr, int port) throws java.net.ConnectException {
     try {
       ShutdownRequest request = new ShutdownRequest();
-      TcpClient.requestToServer(addr, port, request, REQUEST_TIMEOUT);
+      requestToServer(addr, port, request, DEFAULT_REQUEST_TIMEOUT);
     } catch (java.net.ConnectException ce) {
       // must not be running, rethrow so the caller can handle. 
       // In most cases this Exception should be ignored.
@@ -69,16 +83,16 @@ public class TcpClient {
   }
 
   /**
-   * Contacts the gossip server running on the given host,
+   * Contacts the Locator running on the given host,
    * and port and gets information about it.  Two <code>String</code>s
    * are returned: the first string is the working directory of the
    * locator and the second string is the product directory of the
    * locator.
    */
-  public static String[] getInfo(InetAddress addr, int port) {
+  public String[] getInfo(InetAddress addr, int port) {
     try {
       InfoRequest request = new InfoRequest();
-      InfoResponse response = (InfoResponse) TcpClient.requestToServer(addr, port, request, REQUEST_TIMEOUT);
+      InfoResponse response = (InfoResponse) requestToServer(addr, port, request, DEFAULT_REQUEST_TIMEOUT);
       return response.getInfo();
     } catch (java.net.ConnectException ignore) {
       return null;
@@ -89,11 +103,33 @@ public class TcpClient {
 
   }
 
-  public static Object requestToServer(InetAddress addr, int port, Object request, int timeout) throws IOException, ClassNotFoundException {
+  /**
+   * Send a request to a Locator and expect a reply
+   * 
+   * @param addr The locator's address
+   * @param port The locator's tcp/ip port
+   * @param request The request message
+   * @param timeout Timeout for sending the message and receiving a reply
+   * @return the reply
+   * @throws IOException
+   * @throws ClassNotFoundException
+   */
+  public Object requestToServer(InetAddress addr, int port, Object request, int timeout) throws IOException, ClassNotFoundException {
     return requestToServer(addr, port, request, timeout, true);
   }
 
-  public static Object requestToServer(InetAddress addr, int port, Object request, int timeout, boolean replyExpected)
+  /**
+   * Send a request to a Locator
+   * @param addr The locator's address
+   * @param port The locator's tcp/ip port
+   * @param request The request message
+   * @param timeout Timeout for sending the message and receiving a reply
+   * @param replyExpected Whether to wait for a reply
+   * @return The reply, or null if no reply is expected
+   * @throws IOException
+   * @throws ClassNotFoundException
+   */
+  public Object requestToServer(InetAddress addr, int port, Object request, int timeout, boolean replyExpected)
     throws IOException, ClassNotFoundException {
     InetSocketAddress ipAddr;
     if (addr == null) {
@@ -179,7 +215,7 @@ public class TcpClient {
     }
   }
 
-  public static Short getServerVersion(InetSocketAddress ipAddr, int timeout) throws IOException, ClassNotFoundException {
+  private Short getServerVersion(InetSocketAddress ipAddr, int timeout) throws IOException, ClassNotFoundException {
 
     int gossipVersion = TcpServer.getCurrentGossipVersion();
     Short serverVersion = null;
@@ -238,12 +274,14 @@ public class TcpClient {
     return Short.valueOf(Version.GFE_57.ordinal());
   }
 
-  private TcpClient() {
-    //static class
-  }
-
+  /**
+   * Clear static class information concerning Locators.
+   * This is used in unit tests.  It will force TcpClient to
+   * send version-request messages to locators to reestablish
+   * knowledge of their communication protocols.
+   */
   public static void clearStaticData() {
-    synchronized (serverVersions) {
+    synchronized(serverVersions) {
       serverVersions.clear();
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/internal/DistributionLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/DistributionLocator.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/DistributionLocator.java
index 2549c7a..2fab6b8 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/DistributionLocator.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/DistributionLocator.java
@@ -20,6 +20,7 @@ import com.gemstone.gemfire.SystemFailure;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.InternalLocator;
+import com.gemstone.gemfire.distributed.internal.tcpserver.*;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
@@ -65,7 +66,7 @@ public class DistributionLocator  {
 
   public static void stop(InetAddress addr, int port) {
     try {
-      InternalLocator.stopLocator(port, addr);
+      new TcpClient().stop(addr, port);
     } catch ( ConnectException ignore ) {
       // must not be running
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/internal/SystemAdmin.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/SystemAdmin.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/SystemAdmin.java
index 9b2806c..bc0ff57 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/SystemAdmin.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/SystemAdmin.java
@@ -26,6 +26,7 @@ import com.gemstone.gemfire.cache.persistence.PersistentID;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.*;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
+import com.gemstone.gemfire.distributed.internal.tcpserver.*;
 import com.gemstone.gemfire.internal.StatArchiveReader.ResourceInst;
 import com.gemstone.gemfire.internal.StatArchiveReader.StatValue;
 import com.gemstone.gemfire.internal.admin.remote.TailLogResponse;
@@ -254,7 +255,7 @@ public class SystemAdmin {
 //      File infoFile = ManagerInfo.getLocatorInfoFile(directory);
 
       try {
-        InternalLocator.stopLocator(port, addr);
+        new TcpClient().stop(addr, port);
       } 
       catch ( java.net.ConnectException ce ) {
         if( PureJavaMode.isPure() || OSProcess.exists(pid) ) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ClusterConfigurationLoader.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ClusterConfigurationLoader.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ClusterConfigurationLoader.java
index e362389..be9cfbe 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ClusterConfigurationLoader.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ClusterConfigurationLoader.java
@@ -28,6 +28,7 @@ import com.gemstone.gemfire.internal.admin.remote.DistributionLocatorId;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.lang.StringUtils;
 import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.internal.net.*;
 import com.gemstone.gemfire.internal.process.ClusterConfigurationNotAvailableException;
 import com.gemstone.gemfire.management.internal.configuration.domain.Configuration;
 import com.gemstone.gemfire.management.internal.configuration.messages.ConfigurationRequest;
@@ -162,7 +163,9 @@ public class ClusterConfigurationLoader {
     ConfigurationResponse response = null;
     //Try talking to all the locators in the list
     //to get the shared configuration.
-    
+
+    TcpClient client = new TcpClient();
+
     for (String locatorInfo : locatorList) {
       DistributionLocatorId dlId = new DistributionLocatorId(locatorInfo);
       String ipaddress = dlId.getBindAddress();
@@ -177,8 +180,7 @@ public class ClusterConfigurationLoader {
       int port = dlId.getPort();
         
       try {
-          response = (ConfigurationResponse) TcpClient
-            .requestToServer(locatorInetAddress, port, request, 10000);
+          response = (ConfigurationResponse)client.requestToServer(locatorInetAddress, port, request, 10000);
         } catch (UnknownHostException e) {
           e.printStackTrace();
         } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java
index 861f51d..495f64d 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java
@@ -26,6 +26,7 @@ import java.util.Properties;
 import com.gemstone.gemfire.distributed.internal.tcpserver.TcpClient;
 import com.gemstone.gemfire.internal.DataSerializableFixedID;
 import com.gemstone.gemfire.internal.Version;
+import com.gemstone.gemfire.internal.net.*;
 
 /**
  * Sent to a locator to request it to find (and possibly start)
@@ -87,7 +88,8 @@ public class JmxManagerLocatorRequest implements DataSerializableFixedID {
         distributionConfigProps.putAll(sslConfigProps);
       }
 
-      Object responseFromServer = TcpClient.requestToServer(networkAddress, locatorPort, SINGLETON, msTimeout);
+      TcpClient client = new TcpClient();
+      Object responseFromServer = client.requestToServer(networkAddress, locatorPort, SINGLETON, msTimeout);
 
       return (JmxManagerLocatorResponse) responseFromServer;
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommands.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommands.java
index 61132d6..bc18d16 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommands.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommands.java
@@ -72,7 +72,7 @@ import com.gemstone.gemfire.distributed.internal.tcpserver.TcpClient;
 import com.gemstone.gemfire.internal.DistributionLocator;
 import com.gemstone.gemfire.internal.GemFireVersion;
 import com.gemstone.gemfire.internal.OSProcess;
-import com.gemstone.gemfire.internal.net.SocketCreator;
+import com.gemstone.gemfire.internal.net.*;
 import com.gemstone.gemfire.internal.cache.persistence.PersistentMemberPattern;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.lang.ClassUtils;
@@ -686,13 +686,14 @@ public class LauncherLifecycleCommands extends AbstractCommandsSupport {
     try {
       final InetAddress networkAddress = InetAddress.getByName(locatorHostName);
 
+      TcpClient client = new TcpClient();
       SharedConfigurationStatusResponse statusResponse = (SharedConfigurationStatusResponse)
-          TcpClient.requestToServer(networkAddress, locatorPort, new SharedConfigurationStatusRequest(), 10000, true);
+          client.requestToServer(networkAddress, locatorPort, new SharedConfigurationStatusRequest(), 10000, true);
 
       for (int i = 0; i < NUM_ATTEMPTS_FOR_SHARED_CONFIGURATION_STATUS; i++) {
         if (statusResponse.getStatus().equals(SharedConfigurationStatus.STARTED) || statusResponse.getStatus().equals(SharedConfigurationStatus.NOT_STARTED)) {
-          statusResponse = (SharedConfigurationStatusResponse) TcpClient
-              .requestToServer(networkAddress, locatorPort, new SharedConfigurationStatusRequest(), 10000, true);
+          statusResponse = (SharedConfigurationStatusResponse)
+              client.requestToServer(networkAddress, locatorPort, new SharedConfigurationStatusRequest(), 10000, true);
           try {
             Thread.sleep(5000);
           } catch (InterruptedException e) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceImplJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
index ef23d00..28425e3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceImplJUnitTest.java
@@ -112,7 +112,7 @@ public class AutoConnectionSourceImplJUnitTest {
     try {
       if(server != null && server.isAlive()) {
         try {
-          TcpClient.stop(InetAddress.getLocalHost(), port);
+          new TcpClient().stop(InetAddress.getLocalHost(), port);
         } catch ( ConnectException ignore ) {
           // must not be running
         }
@@ -167,7 +167,7 @@ public class AutoConnectionSourceImplJUnitTest {
       handler.nextLocatorListResponse = new LocatorListResponse(locators,false);
       Thread.sleep(500);
       try {
-        TcpClient.stop(InetAddress.getLocalHost(), port);
+        new TcpClient().stop(InetAddress.getLocalHost(), port);
       } catch ( ConnectException ignore ) {
         // must not be running
       }
@@ -178,7 +178,7 @@ public class AutoConnectionSourceImplJUnitTest {
       assertEquals(server1, source.findServer(null));
     } finally {
       try {
-        TcpClient.stop(InetAddress.getLocalHost(), secondPort);
+        new TcpClient().stop(InetAddress.getLocalHost(), secondPort);
       } catch ( ConnectException ignore ) {
         // must not be running
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorLoadBalancingDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorLoadBalancingDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorLoadBalancingDUnitTest.java
index 1bc2322..4173886 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorLoadBalancingDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorLoadBalancingDUnitTest.java
@@ -142,12 +142,12 @@ public class LocatorLoadBalancingDUnitTest extends LocatorTestBase {
     expected.put(expectedLocation, expectedLoad);
 
     ClientConnectionResponse response;
-    response = (ClientConnectionResponse) TcpClient.requestToServer(InetAddress
+    response = (ClientConnectionResponse) new TcpClient().requestToServer(InetAddress
             .getByName(NetworkUtils.getServerHostName(host)), locatorPort,
         new ClientConnectionRequest(Collections.EMPTY_SET, null), 10000);
     Assert.assertEquals(expectedLocation, response.getServer());
 
-    response = (ClientConnectionResponse) TcpClient.requestToServer(InetAddress
+    response = (ClientConnectionResponse) new TcpClient().requestToServer(InetAddress
             .getByName(NetworkUtils.getServerHostName(host)), locatorPort,
         new ClientConnectionRequest(Collections.EMPTY_SET, null), 10000, true);
     Assert.assertEquals(expectedLocation, response.getServer());
@@ -156,13 +156,13 @@ public class LocatorLoadBalancingDUnitTest extends LocatorTestBase {
     vm0.invoke("check Locator Load", () -> checkLocatorLoad(expected));
 
     QueueConnectionResponse response2;
-    response2 = (QueueConnectionResponse) TcpClient.requestToServer(InetAddress
+    response2 = (QueueConnectionResponse) new TcpClient().requestToServer(InetAddress
             .getByName(NetworkUtils.getServerHostName(host)), locatorPort,
         new QueueConnectionRequest(null, 2,
             Collections.EMPTY_SET, null, false), 10000, true);
     Assert.assertEquals(Collections.singletonList(expectedLocation), response2.getServers());
 
-    response2 = (QueueConnectionResponse) TcpClient
+    response2 = (QueueConnectionResponse) new TcpClient()
         .requestToServer(InetAddress.getByName(NetworkUtils.getServerHostName(host)),
             locatorPort, new QueueConnectionRequest(null, 5, Collections.EMPTY_SET, null,
                 false), 10000, true);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorJUnitTest.java
index af0c30d..cb34c27 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorJUnitTest.java
@@ -23,7 +23,6 @@ import com.gemstone.gemfire.cache.client.internal.locator.QueueConnectionRequest
 import com.gemstone.gemfire.cache.client.internal.locator.QueueConnectionResponse;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.distributed.internal.InternalLocator;
 import com.gemstone.gemfire.distributed.internal.ServerLocation;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messenger.JGroupsMessenger;
 import com.gemstone.gemfire.distributed.internal.tcpserver.TcpClient;
@@ -126,7 +125,8 @@ public class LocatorJUnitTest {
     assertTrue(locator.isPeerLocator());
     assertFalse(locator.isServerLocator());
     int boundPort = (port == 0) ? locator.getPort() : port;
-    String[] info = InternalLocator.getLocatorInfo(InetAddress.getLocalHost(), boundPort);
+    TcpClient client = new TcpClient();
+    String[] info = client.getInfo(InetAddress.getLocalHost(), boundPort);
     assertNotNull(info);
     assertTrue(info.length > 1);
   }
@@ -203,13 +203,13 @@ public class LocatorJUnitTest {
   private void doServerLocation(int realPort) throws Exception {
     {
       ClientConnectionRequest request = new ClientConnectionRequest(Collections.EMPTY_SET, "group1");
-      ClientConnectionResponse response = (ClientConnectionResponse) TcpClient.requestToServer(InetAddress.getLocalHost(), realPort, request, REQUEST_TIMEOUT);
+      ClientConnectionResponse response = (ClientConnectionResponse) new TcpClient().requestToServer(InetAddress.getLocalHost(), realPort, request, REQUEST_TIMEOUT);
       assertEquals(null, response.getServer());
     }
 
     {
       QueueConnectionRequest request = new QueueConnectionRequest(ClientProxyMembershipID.getNewProxyMembership(InternalDistributedSystem.getAnyInstance()), 3, Collections.EMPTY_SET, "group1",true);
-      QueueConnectionResponse response = (QueueConnectionResponse) TcpClient.requestToServer(InetAddress.getLocalHost(), realPort, request, REQUEST_TIMEOUT);
+      QueueConnectionResponse response = (QueueConnectionResponse) new TcpClient().requestToServer(InetAddress.getLocalHost(), realPort, request, REQUEST_TIMEOUT);
       assertEquals(new ArrayList(), response.getServers());
       assertFalse(response.isDurableQueueFound());
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
index 3cb91f7..bfabed9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitTest.java
@@ -153,7 +153,7 @@ public class TcpServerBackwardCompatDUnitTest extends JUnit4DistributedTestCase
               SocketCreator.getLocalHost(), 1234));
           FindCoordinatorResponse response = null;
           
-          response = (FindCoordinatorResponse)TcpClient.requestToServer(SocketCreator.getLocalHost(), port1, req, 5000);
+          response = (FindCoordinatorResponse)new TcpClient().requestToServer(SocketCreator.getLocalHost(), port1, req, 5000);
           assertNotNull(response);
 
         } catch (Exception e) {
@@ -193,7 +193,7 @@ public class TcpServerBackwardCompatDUnitTest extends JUnit4DistributedTestCase
               SocketCreator.getLocalHost(), 1234));
           FindCoordinatorResponse response = null;
           
-          response = (FindCoordinatorResponse)TcpClient.requestToServer(SocketCreator.getLocalHost(), port0, req, 5000);
+          response = (FindCoordinatorResponse)new TcpClient().requestToServer(SocketCreator.getLocalHost(), port0, req, 5000);
           assertNotNull(response);
 
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java
index 425b391..59f5cc22 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java
@@ -64,15 +64,15 @@ public class TcpServerJUnitTest {
     
     TestObject test = new TestObject();
     test.id = 5;
-    TestObject result = (TestObject) TcpClient.requestToServer(localhost, port, test, 60 * 1000 );
+    TestObject result = (TestObject) new TcpClient().requestToServer(localhost, port, test, 60 * 1000 );
     assertEquals(test.id, result.id);
     
-    String[] info = TcpClient.getInfo(localhost, port);
+    String[] info = new TcpClient().getInfo(localhost, port);
     assertNotNull(info);
     assertTrue(info.length > 1);
    
     try { 
-      TcpClient.stop(localhost, port);
+      new TcpClient().stop(localhost, port);
     } catch ( ConnectException ignore ) {
       // must not be running 
     }
@@ -96,7 +96,7 @@ public class TcpServerJUnitTest {
       public void run() {
         Boolean delay = Boolean.valueOf(true);
         try {
-          TcpClient.requestToServer(localhost, port, delay, 60 * 1000 );
+          new TcpClient().requestToServer(localhost, port, delay, 60 * 1000 );
         } catch (IOException e) {
           e.printStackTrace();
         } catch (ClassNotFoundException e) {
@@ -109,7 +109,7 @@ public class TcpServerJUnitTest {
     try {
       Thread.sleep(500);
       assertFalse(done.get());
-      TcpClient.requestToServer(localhost, port, Boolean.valueOf(false), 60 * 1000 );
+      new TcpClient().requestToServer(localhost, port, Boolean.valueOf(false), 60 * 1000 );
       assertFalse(done.get());
 
       latch.countDown();
@@ -120,7 +120,7 @@ public class TcpServerJUnitTest {
       delayedThread.join(60 * 1000);
       assertTrue(!delayedThread.isAlive()); // GemStoneAddition
       try {
-        TcpClient.stop(localhost, port);
+        new TcpClient().stop(localhost, port);
       } catch ( ConnectException ignore ) {
         // must not be running 
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
index eba786a..6c018ed 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/configuration/SharedConfigurationDUnitTest.java
@@ -385,7 +385,7 @@ public class SharedConfigurationDUnitTest extends JUnit4CacheTestCase {
         Set<String> groups = new HashSet<String>();
         groups.add(testGroup);
         ConfigurationRequest configRequest = new ConfigurationRequest(groups);
-        ConfigurationResponse configResponse = (ConfigurationResponse) TcpClient.requestToServer(InetAddress.getByName("localhost"), locator2Port, configRequest, 1000);
+        ConfigurationResponse configResponse = (ConfigurationResponse)new TcpClient().requestToServer(InetAddress.getByName("localhost"), locator2Port, configRequest, 1000);
         assertNotNull(configResponse);
         
         Map<String, Configuration> requestedConfiguration = configResponse.getRequestedConfiguration();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-core/src/test/resources/com/gemstone/gemfire/codeAnalysis/sanctionedSerializables.txt
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/com/gemstone/gemfire/codeAnalysis/sanctionedSerializables.txt b/geode-core/src/test/resources/com/gemstone/gemfire/codeAnalysis/sanctionedSerializables.txt
index 6fc4898..858cdaf 100755
--- a/geode-core/src/test/resources/com/gemstone/gemfire/codeAnalysis/sanctionedSerializables.txt
+++ b/geode-core/src/test/resources/com/gemstone/gemfire/codeAnalysis/sanctionedSerializables.txt
@@ -444,6 +444,7 @@ com/gemstone/gemfire/internal/memcached/ResponseStatus$4,false
 com/gemstone/gemfire/internal/memcached/ResponseStatus$5,false
 com/gemstone/gemfire/internal/memcached/ResponseStatus$6,false
 com/gemstone/gemfire/internal/memcached/commands/ClientError,true,-2426928000696680541
+com/gemstone/gemfire/internal/net/SSLEnabledComponent,false,constant:java/lang/String
 com/gemstone/gemfire/internal/offheap/MemoryBlock$State,false
 com/gemstone/gemfire/internal/offheap/OffHeapStorage$1,false
 com/gemstone/gemfire/internal/offheap/OffHeapStorage$2,false

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-wan/src/main/java/com/gemstone/gemfire/cache/client/internal/locator/wan/LocatorDiscovery.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/com/gemstone/gemfire/cache/client/internal/locator/wan/LocatorDiscovery.java b/geode-wan/src/main/java/com/gemstone/gemfire/cache/client/internal/locator/wan/LocatorDiscovery.java
index bbaed1d..a9de5b3 100644
--- a/geode-wan/src/main/java/com/gemstone/gemfire/cache/client/internal/locator/wan/LocatorDiscovery.java
+++ b/geode-wan/src/main/java/com/gemstone/gemfire/cache/client/internal/locator/wan/LocatorDiscovery.java
@@ -23,6 +23,7 @@ import com.gemstone.gemfire.internal.admin.remote.DistributionLocatorId;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
+import com.gemstone.gemfire.internal.net.*;
 import com.gemstone.gemfire.internal.tcp.ConnectionException;
 import org.apache.logging.log4j.Logger;
 
@@ -47,6 +48,8 @@ public class LocatorDiscovery{
   private LocatorMembershipListener locatorListener;
   
   RemoteLocatorJoinRequest request;
+  
+  TcpClient locatorClient;
 
   public static final int WAN_LOCATOR_CONNECTION_RETRY_ATTEMPT = Integer
       .getInteger("WANLocator.CONNECTION_RETRY_ATTEMPT", 50000).intValue();
@@ -63,6 +66,7 @@ public class LocatorDiscovery{
     this.locatorId = locotor;
     this.request = request; 
     this.locatorListener = locatorListener;
+    this.locatorClient = new TcpClient();
   }
   
   /**
@@ -129,7 +133,7 @@ public class LocatorDiscovery{
     int retryAttempt = 1;
     while (!getDiscoverer().isStopped()) {
       try {
-        RemoteLocatorJoinResponse response = (RemoteLocatorJoinResponse)TcpClient
+        RemoteLocatorJoinResponse response = (RemoteLocatorJoinResponse)locatorClient
             .requestToServer(locatorId.getHost(), locatorId.getPort(), request,
                 WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
         if (response != null) {
@@ -176,7 +180,7 @@ public class LocatorDiscovery{
     while (!getDiscoverer().isStopped()) {
       RemoteLocatorJoinResponse response;
       try {
-        response = (RemoteLocatorJoinResponse)TcpClient
+        response = (RemoteLocatorJoinResponse)locatorClient
             .requestToServer(remoteLocator.getHost(), remoteLocator.getPort(),
                 request, WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
         if (response != null) {
@@ -187,7 +191,7 @@ public class LocatorDiscovery{
               "");
           while (true) {
             Thread.sleep(WAN_LOCATOR_PING_INTERVAL);
-            RemoteLocatorPingResponse pingResponse = (RemoteLocatorPingResponse) TcpClient
+            RemoteLocatorPingResponse pingResponse = (RemoteLocatorPingResponse)locatorClient
                 .requestToServer(remoteLocator.getHost(),
                     remoteLocator.getPort(), pingRequest,
                     WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-wan/src/main/java/com/gemstone/gemfire/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/com/gemstone/gemfire/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java b/geode-wan/src/main/java/com/gemstone/gemfire/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
index 5f4943d..01e01e7 100644
--- a/geode-wan/src/main/java/com/gemstone/gemfire/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
+++ b/geode-wan/src/main/java/com/gemstone/gemfire/cache/client/internal/locator/wan/LocatorMembershipListenerImpl.java
@@ -48,9 +48,12 @@ public class LocatorMembershipListenerImpl implements LocatorMembershipListener
   
   private DistributionConfig config;
   
+  private TcpClient tcpClient;
+  
   private int port;
   
   public LocatorMembershipListenerImpl() {
+    this.tcpClient = new TcpClient();
   }
   
   public void setPort(int port){
@@ -103,7 +106,7 @@ public class LocatorMembershipListenerImpl implements LocatorMembershipListener
           }
           for (DistributionLocatorId value : entry.getValue()) {
             try {
-              TcpClient.requestToServer(value.getHost(), value.getPort(),
+              tcpClient.requestToServer(value.getHost(), value.getPort(),
                   new LocatorJoinMessage(distributedSystemId, locator, localLocatorId, ""), 1000, false);
             }
             catch (Exception e) {
@@ -113,7 +116,7 @@ public class LocatorMembershipListenerImpl implements LocatorMembershipListener
               }
             }
             try {
-              TcpClient.requestToServer(locator.getHost(), locator.getPort(),
+              tcpClient.requestToServer(locator.getHost(), locator.getPort(),
                   new LocatorJoinMessage(entry.getKey(), value, localLocatorId, ""), 1000, false);
             }
             catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/115e5f25/geode-wan/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractRemoteGatewaySender.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractRemoteGatewaySender.java b/geode-wan/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractRemoteGatewaySender.java
index d45d5ef..163a611 100644
--- a/geode-wan/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractRemoteGatewaySender.java
+++ b/geode-wan/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractRemoteGatewaySender.java
@@ -79,7 +79,7 @@ public abstract class AbstractRemoteGatewaySender extends AbstractGatewaySender
       String localLocator = locatorsOnThisVM.nextToken();
       DistributionLocatorId locatorID = new DistributionLocatorId(localLocator);
       try {
-        RemoteLocatorResponse response = (RemoteLocatorResponse) TcpClient
+        RemoteLocatorResponse response = (RemoteLocatorResponse) new TcpClient()
             .requestToServer(locatorID.getHost(), locatorID.getPort(), request,
                 WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
 


Mime
View raw message