geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [09/14] incubator-geode git commit: jgroups source is now removed from asf branch GEODE-77 and is a downloaded dependency. Able to start/stop a locator and a server via gfsh but there is no HA or authentication in the membership system.
Date Mon, 27 Jul 2015 20:27:53 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d2a942e8/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/package.html
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/package.html b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/package.html
new file mode 100755
index 0000000..54eb2a3
--- /dev/null
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/package.html
@@ -0,0 +1,41 @@
+<HTML>
+<BODY>
+
+<p>The membership and communication services have been abstracted
+via a set of classes and a factory.  This document is an introduction
+to the organization of these classes.</p>
+
+<p>At the lowest level is a <em>NetMember</em>.  A <em>NetMember</em> is a
+low-level system-independent notion of a network member.  At this writing,
+there is only one implementation, <em>GMSMember</em>.
+
+<p><em>NetMember</em> is intended to be implemented in the service
+provider interface but not necessarily exported to the rest of the system.
+In the current design, <em>DistributedMember</em> is the type used to
+identify peers in the network.
+
+<p>The starting point for accessing membership services is via
+<em>MemberFactory</em>.  This class allows one to create a
+<em>NetMember</em> using various arguments or a
+<em>MembershipManager</em>, which handles most membership services.</p>
+
+<p><em>MemberFactory</em> uses pluggable instances that implement
+the service provider interface <em>MemberServices</em>.  At this
+writing, there is only one implementation, <em>GMSMemberFactory</em>.</p>
+
+<p>A <em>MembershipManager</em> is the central focus for membership
+activity.  It includes startup and shutdown methods, requests for the
+current view of members, and a method to send messages.</p>
+
+<p>The current membership view in the system is via <em>NetView</em>,
+which also includes a <em>NetViewId</em>, a sequential identifier
+that abstracts the <em>ViewId</em> notion from JavaGroups.</p>
+
+<p>One of the arguments to the constructor for a <em>MembershipManager</em>
+is a <em>DistributedMembershipListener</em>.  This listener interface
+handles membership events, such as new member arrival, member departure,
+and message receipt.</p>
+
+
+</BODY>
+</HTML>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d2a942e8/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/GFJGBasicAdapter.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/GFJGBasicAdapter.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/GFJGBasicAdapter.java
deleted file mode 100755
index 897d642..0000000
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/GFJGBasicAdapter.java
+++ /dev/null
@@ -1,602 +0,0 @@
-package com.gemstone.gemfire.distributed.internal.membership.jgroup;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInput;
-import java.io.DataInputStream;
-import java.io.DataOutput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.ForcedDisconnectException;
-import com.gemstone.gemfire.GemFireConfigException;
-import com.gemstone.gemfire.InternalGemFireError;
-import com.gemstone.gemfire.SystemConnectException;
-import com.gemstone.gemfire.cache.UnsupportedVersionException;
-import com.gemstone.gemfire.distributed.DistributedMember;
-import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
-import com.gemstone.gemfire.distributed.internal.DistributionManager;
-import com.gemstone.gemfire.distributed.internal.membership.MemberAttributes;
-import com.gemstone.gemfire.distributed.internal.tcpserver.TcpServer;
-import com.gemstone.gemfire.internal.InternalDataSerializer;
-import com.gemstone.gemfire.internal.SocketCreator;
-import com.gemstone.gemfire.internal.Version;
-import com.gemstone.gemfire.internal.VersionedDataInputStream;
-import com.gemstone.gemfire.internal.VersionedDataOutputStream;
-import com.gemstone.gemfire.internal.VersionedObjectInput;
-import com.gemstone.gemfire.internal.VersionedObjectOutput;
-import com.gemstone.gemfire.internal.cache.tier.sockets.HandShake;
-import com.gemstone.gemfire.internal.logging.InternalLogWriter;
-import com.gemstone.gemfire.security.AuthenticationFailedException;
-import com.gemstone.org.jgroups.Address;
-import com.gemstone.org.jgroups.Header;
-import com.gemstone.org.jgroups.Message;
-import com.gemstone.org.jgroups.spi.GFBasicAdapter;
-import com.gemstone.org.jgroups.stack.IpAddress;
-import com.gemstone.org.jgroups.util.ExternalStrings;
-import com.gemstone.org.jgroups.util.GFLogWriter;
-import com.gemstone.org.jgroups.util.GemFireTracer;
-import com.gemstone.org.jgroups.util.SockCreator;
-import com.gemstone.org.jgroups.util.Util;
-
-public class GFJGBasicAdapter implements GFBasicAdapter {
-
-  public static void insertGemFireAttributes(IpAddress addr, Object obj) {
-    MemberAttributes attr = (MemberAttributes)obj;
-    addr.setProcessId(attr.getVmPid());
-    addr.setVmKind(attr.getVmKind());
-    addr.setDirectPort(attr.getPort());
-    addr.setBirthViewId(attr.getVmViewId());
-    addr.setName(attr.getName());
-    addr.setRoles(attr.getGroups());
-    addr.setDurableClientAttributes(attr.getDurableClientAttributes());
-    addr.setSize(-1);
-    addr.setSize(addr.size(Version.CURRENT_ORDINAL));
-  }
-
-  public static void insertDefaultGemFireAttributes(IpAddress addr) {
-    MemberAttributes attr = com.gemstone.gemfire.distributed.internal.membership.MemberAttributes.DEFAULT;
-    insertGemFireAttributes(addr, attr);
-  }
-
-  @Override
-  public void invokeToData(Object obj, DataOutput out) throws IOException {
-    InternalDataSerializer.invokeToData(obj, out);
-  }
-
-  @Override
-  public void writeObject(Object obj, DataOutput out) throws IOException {
-    DataSerializer.writeObject(obj, out);
-  }
-
-  @Override
-  public void invokeFromData(Object obj, DataInput in) throws IOException,
-      ClassNotFoundException {
-    InternalDataSerializer.invokeFromData(obj, in);
-  }
-
-  @Override
-  public <T> T readObject(DataInput in) throws IOException,
-      ClassNotFoundException {
-    try {
-      return DataSerializer.readObject(in);
-    } catch (InternalGemFireError e) {
-      throw new IOException(e.getMessage(), e);
-    }
-  }
-
-  @Override
-  public short getMulticastVersionOrdinal() {
-    return Version.GFE_71.ordinal();
-  }
-
-  @Override
-  public short getSerializationVersionOrdinal(short version) {
-    return Version.fromOrdinalOrCurrent(version).ordinal();
-  }
-
-  @Override
-  public short getCurrentVersionOrdinal() {
-    return Version.CURRENT_ORDINAL;
-  }
-
-  @Override
-  public byte[] serializeWithVersion(Object obj, int destVersionOrdinal) {
-    try {
-      ByteArrayOutputStream out_stream=new ByteArrayOutputStream();
-      //ObjectOutputStream out=new ObjectOutputStream(out_stream);
-      //out.writeObject(obj);
-      DataOutputStream out = new DataOutputStream(out_stream);
-      if (destVersionOrdinal > 0 && destVersionOrdinal != Version.CURRENT_ORDINAL) {
-        out = new VersionedDataOutputStream(out, Version.fromOrdinalOrCurrent((short)destVersionOrdinal));
-      }
-      DataSerializer.writeObject(obj, out); // GemStoneAddition
-      return out_stream.toByteArray();
-    }
-    catch(IOException ex) {
-      // GemStoneAddition - we need the cause to figure out what went wrong
-      IllegalArgumentException ia = new
-          IllegalArgumentException("Error serializing message");
-      ia.initCause(ex);
-      throw ia;
-    }
-  }
-
-  
-  
-  static final byte DEST_SET=1;
-  static final byte SRC_SET=2;
-  static final byte BUF_SET=4;
-  // static final byte HDRS_SET=8; // bela July 15 2005: not needed, we always create headers
-  static final byte IPADDR_DEST=16;
-  static final byte IPADDR_SRC=32;
-  static final byte SRC_HOST_NULL=64;
-  
-  static final byte CACHE_OP = 1; // GemStoneAddition
-  static final byte HIGH_PRIORITY = 8; // GemStoneAddition
-  
-  static boolean DEBUG_SERIALIZATION = false;
-
-
-  
-  @Override
-  public void serializeJGMessage(Message msg, DataOutputStream out) throws IOException {
-    GemFireTracer log = GemFireTracer.getLog(GFJGBasicAdapter.class);
-    //int begIdx = out.size(); // GemStoneAddition
-    byte leading=0;
-
-//    if(dest_addr != null) {
-//        leading+=DEST_SET;
-//        if(dest_addr instanceof IpAddress)
-//            leading+=IPADDR_DEST;
-//    }
-
-    short serVersion = msg.getDestVersionOrdinal();
-    if (0 < serVersion  &&  serVersion < Version.CURRENT_ORDINAL) {
-      out = new VersionedDataOutputStream(out, Version.fromOrdinalNoThrow(serVersion, false));
-    }
-    Version.writeOrdinal(out, serVersion, true);
-    if (DEBUG_SERIALIZATION) {
-      log.info("wrote version " + serVersion);
-    }
-
-    if(msg.getSrc() != null) {
-        leading+=SRC_SET;
-        if(msg.getSrc() instanceof IpAddress) {
-            leading+=IPADDR_SRC;
-            if(((IpAddress)msg.getSrc()).getIpAddress() == null) {
-                leading+=SRC_HOST_NULL;
-            }
-        }
-    }
-    if(msg.getRawBuffer() != null)
-        leading+=BUF_SET;
-
-    // 1. write the leading byte first
-    out.write(leading);
-    if (DEBUG_SERIALIZATION) {
-      log.info("wrote leading byte " + leading);
-    }
-
-    // 2. dest_addr
-//    if(dest_addr != null) {
-//        if(dest_addr instanceof IpAddress)
-//            dest_addr.writeTo(out);
-//        else
-//            Util.writeAddress(dest_addr, out);
-//    }
-
-    // 3. src_addr
-    if(msg.getSrc() != null) {
-        if(msg.getSrc() instanceof IpAddress) {
-           InternalDataSerializer.invokeToData(((IpAddress)msg.getSrc()), out); // GemStoneAddition
-           if (DEBUG_SERIALIZATION) {
-             log.info("wrote Ipaddress " + msg.getSrc());
-           }
-        }
-        else {
-            Util.writeAddress(msg.getSrc(), out);
-            if (DEBUG_SERIALIZATION) {
-              log.info("wrote address using Util " + msg.getSrc());
-            }
-        }
-        //eidx = out.size();
-        //if ( (eidx - sidx) > src_addr.size() ) {
-        //  log.error("address serialized to " + (eidx-sidx) + " bytes but reported size = " + src_addr.size(), new Error());
-        //}
-    }
-
-    // GemStoneAddition - more flags
-    byte gfFlags = 0;
-    if (msg.isCacheOperation)
-      gfFlags += CACHE_OP;
-    if (msg.isHighPriority)
-      gfFlags += HIGH_PRIORITY;
-    out.write(gfFlags);
-    if (DEBUG_SERIALIZATION) {
-      log.info("wrote gfFlags " + gfFlags);
-    }
-    
-    // 4. buf
-    if(msg.getRawBuffer() != null) {
-        int length = msg.getLength();
-        out.writeInt(length);
-        out.write(msg.getRawBuffer(), msg.getOffset(), length);
-        if (DEBUG_SERIALIZATION) {
-          log.info("wrote " + length + " payload bytes");
-        }
-    }
-
-    // 5. headers
-    short size=(short)msg.getHeaders().size();
-    out.writeShort(size);
-    Map.Entry        entry;
-    if (DEBUG_SERIALIZATION) {
-      log.info("writing " + size + " headers");
-    }
-    //long estSize, startPos, endPos; // GemStoneAddition
-    for(Iterator it=msg.getHeaders().entrySet().iterator(); it.hasNext();) {
-        entry=(Map.Entry)it.next();
-        //estSize = ((String)entry.getKey()).length() + 2;
-        //estSize = estSize + 5 + ((Header)entry.getValue()).size();
-        //startPos = out.size();
-        out.writeUTF((String)entry.getKey());
-        ByteArrayOutputStream baos = new ByteArrayOutputStream(50);
-        DataOutputStream hdos;
-        if (0 < serVersion  &&  serVersion < Version.CURRENT_ORDINAL) {
-          hdos = new VersionedDataOutputStream(baos, Version.fromOrdinalNoThrow(serVersion, false));
-        } else {
-          hdos = new DataOutputStream(baos);
-        }
-        
-        msg.writeHeader((Header)entry.getValue(), hdos);
-        hdos.flush();
-        byte[] headerBytes = baos.toByteArray();
-        if (DEBUG_SERIALIZATION) {
-          log.info("writing header " + entry.getKey() + " length=" + headerBytes.length);
-        }
-        out.writeInt(headerBytes.length);
-        out.write(headerBytes);
-        //endPos = out.size();
-        //if ( (endPos-startPos) > estSize ) {
-        //  log.error("bad estimating job in message header: " + entry.getKey(), new Error());
-        //}
-    }
-    //int endIdx = out.size();
-    //if ( (endIdx - begIdx) > size() ) {
-    //  log.error("bad job estimating message size: " + size() + " (est), " + (endIdx-begIdx) + " (actual)", new Error());
-    //}
-  }
-
-  @Override
-  public void deserializeJGMessage(Message msg, DataInputStream in)
-      throws IOException, IllegalAccessException, InstantiationException {
-    int len, leading;
-    String hdr_name;
-    Header hdr = null;
-
-    GemFireTracer log = GemFireTracer.getLog(GFJGBasicAdapter.class);
-
-    // create a versioned stream if a different version
-    // was used to multicast this message
-    short sv = Version.readOrdinal(in);
-    if (DEBUG_SERIALIZATION) {
-      log.info("read version " + sv);
-    }
-    msg.setVersion(sv);
-    
-    if (0 < msg.getVersion()  &&  msg.getVersion() < Version.CURRENT_ORDINAL) {
-      try {
-        in = new VersionedDataInputStream(in, Version.fromOrdinal(msg.getVersion(), false));
-      } catch (UnsupportedVersionException e) {
-        throw new IOException("Unexpected exception during deserialization", e);
-      }
-    }
-
-    // 1. read the leading byte first
-    leading=in.readByte();
-    if (DEBUG_SERIALIZATION) {
-      log.info("read leading byte " + leading);
-    }
-
-    // 2. dest_addr
-//    if((leading & DEST_SET) == DEST_SET) {
-//        if((leading & IPADDR_DEST) == IPADDR_DEST) {
-//            dest_addr=new IpAddress();
-//            dest_addr.readFrom(in);
-//        }
-//        else {
-//            dest_addr=Util.readAddress(in);
-//        }
-//    }
-
-
-    // 3. src_addr
-    if((leading & SRC_SET) == SRC_SET) {
-        if((leading & IPADDR_SRC) == IPADDR_SRC) {
-            IpAddress src_addr=new IpAddress();
-            try {
-              InternalDataSerializer.invokeFromData(((IpAddress)src_addr), in);
-              if (DEBUG_SERIALIZATION) {
-                log.info("read src_addr " + src_addr);
-              }
-            } catch (ClassNotFoundException e) {
-              throw new IOException(e);
-            } // GemStoneAddition
-            msg.setSrc(src_addr);
-            //readFrom(in);
-        }
-        else {
-            msg.setSrc(Util.readAddress(in));
-            if (DEBUG_SERIALIZATION) {
-              log.info("read address using Util " + msg.getSrc());
-            }
-        }
-    }
-    
-    // GemStoneAddition
-    byte gfFlags = in.readByte();
-    if (DEBUG_SERIALIZATION) {
-      log.info("read gfFlags " + gfFlags);
-    }
-    if ( (gfFlags & CACHE_OP) != 0 )
-      msg.isCacheOperation = true;
-    if ( (gfFlags & HIGH_PRIORITY) != 0 )
-      msg.isHighPriority = true;
-
-    // 4. buf
-    if((leading & BUF_SET) == BUF_SET) {
-        len=in.readInt();
-        if (65535 < len  ||  len < 0) {
-          String sender = msg.getSrc() != null?  msg.getSrc().toString() : "(unknown sender)";
-          log.getLogWriter().warning(ExternalStrings.CORRUPTED_MESSAGE_RECEIVED, sender);
-          throw new IOException(ExternalStrings.CORRUPTED_MESSAGE_RECEIVED.toLocalizedString(sender));
-        }
-        if (DEBUG_SERIALIZATION) {
-          log.info("reading " + len + " payload bytes");
-        }
-        try { // GemStoneAddition -- flag this as a problem
-          msg.setBuffer(new byte[len]);
-        }
-        catch (OutOfMemoryError e) {
-          System.err.println(
-              "JGroups#Message: unable to allocate buffer of size " + len
-              + "; gfFlags = " + gfFlags + "; src_addr = " + msg.getSrc());
-          throw e;
-        }
-        in.readFully(msg.getRawBuffer(), 0, len); // GemStoneAddition - use readFully
-        //in.read(buf, 0, len);
-    }
-
-    // 5. headers
-    len=in.readShort();
-    if (msg.getHeaders() == null) {
-      msg.setHeaders(msg.createHeaders(len));
-    }
-    if (DEBUG_SERIALIZATION) {
-      log.info("reading " + len + " headers");
-    }
-    for(int i=0; i < len; i++) {
-        hdr_name=in.readUTF();
-        int hlen = in.readInt();
-        if (DEBUG_SERIALIZATION) {
-          log.info("reading header " + hdr_name + " of length " + hlen);
-        }
-        byte[] headerBytes = new byte[hlen];
-        in.readFully(headerBytes);
-        ByteArrayInputStream bais = new ByteArrayInputStream(headerBytes);
-        DataInputStream dis;
-        if (0 < msg.getVersion()  &&  msg.getVersion() < Version.CURRENT_ORDINAL) {
-          try {
-            dis = new VersionedDataInputStream(bais, Version.fromOrdinal(msg.getVersion(), false));
-          } catch (UnsupportedVersionException e) {
-            throw new IOException("Unexpected exception during deserialization", e);
-          }
-        } else {
-          dis = new DataInputStream(bais);
-        }
-        try {
-          hdr=msg.readHeader(dis);
-          if (DEBUG_SERIALIZATION) {
-            log.info("read " + hdr.toString());
-          }
-          msg.getHeaders().put(hdr_name, hdr);
-        } catch (Exception e) {
-          log = GemFireTracer.getLog(getClass());
-          if (log.isErrorEnabled()) {
-            log.error("Failed to deserialize a header " + hdr_name + " of length " + hlen, e);
-          }
-        }
-    }
-  }
-
-  @Override
-  public ObjectOutput getObjectOutput(DataOutputStream out) throws IOException {
-    ObjectOutput oos=new ObjectOutputStream(out);
-    if (out instanceof VersionedDataOutputStream) {
-      Version v = ((VersionedDataOutputStream)out).getVersion();
-      if (v != null && v != Version.CURRENT) { 
-        oos = new VersionedObjectOutput(oos, v);
-      }
-    }
-    return oos;
-  }
-
-  @Override
-  public ObjectInput getObjectInput(DataInputStream in) throws IOException {
-    ObjectInput ois=new ObjectInputStream(in);
-    if (in instanceof VersionedDataInputStream) {
-      ois = new VersionedObjectInput(ois, ((VersionedDataInputStream)in).getVersion());
-    }
-    return ois;
-  }
-
-  @Override
-  public int getGossipVersionForOrdinal(short serverOrdinal) {
-    return TcpServer.getGossipVersionForOrdinal(serverOrdinal);
-  }
-
-  @Override
-  public boolean isVersionForStreamAtLeast(DataOutput stream, short version) {
-    return InternalDataSerializer.getVersionForDataStream(stream).ordinal() >= version;
-  }
-
-  @Override
-  public boolean isVersionForStreamAtLeast(DataInput stream, short version) {
-    return InternalDataSerializer.getVersionForDataStream(stream).ordinal() >= version;
-  }
-
-  @Override
-  public DataOutputStream getVersionedDataOutputStream(DataOutputStream dos, short version) throws IOException {
-    try {
-      return new VersionedDataOutputStream(dos, Version.fromOrdinal(version, false));
-    } catch (UnsupportedVersionException e) {
-      throw new IOException("Unexpected exception during serialization", e);
-    }
-  }
-  
-  @Override
-  public DataInputStream getVersionedDataInputStream(DataInputStream instream,
-      short version) throws IOException {
-    try {
-      Version mcastVersion = Version.fromOrdinal(version, false);
-      return new VersionedDataInputStream(instream, mcastVersion);
-    } catch (UnsupportedVersionException e) {
-      throw new IOException("Unexpected exception during deserialization", e);
-    }
-  }
-  
-  @Override
-  public byte[] readByteArray(DataInput in) throws IOException {
-    return DataSerializer.readByteArray(in);
-  }
-
-  @Override
-  public void writeByteArray(byte[] array, DataOutput out) throws IOException {
-    DataSerializer.writeByteArray(array, out);
-  }
-
-  @Override
-  public void writeProperties(Properties props, DataOutput oos)
-      throws IOException {
-    DataSerializer.writeProperties(props, oos);
-  }
-
-  @Override
-  public Properties readProperties(DataInput in) throws IOException, ClassNotFoundException {
-    return DataSerializer.readProperties(in);
-  }
-
-  @Override
-  public void checkDisableDNS() {
-    if (!SocketCreator.FORCE_DNS_USE) {
-      IpAddress.resolve_dns = false; // do not resolve host names since DNS lookup can hang if the NIC fails
-      SocketCreator.resolve_dns = false;
-    }
-  }
-
-  @Override
-  public void writeString(String str, DataOutput out) throws IOException {
-    DataSerializer.writeString(str, out);
-  }
-  
-  @Override
-  public String readString(DataInput in) throws IOException {
-    return DataSerializer.readString(in);
-  }
-
-  @Override
-  public void writeStringArray(String[] roles, DataOutput dao) throws IOException {
-    DataSerializer.writeStringArray(roles, dao);
-  }
-  
-  @Override
-  public String[] readStringArray(DataInput in) throws IOException {
-    return DataSerializer.readStringArray(in);
-  }
-  
-  @Override
-  public String getHostName(InetAddress ip_addr) {
-    return SocketCreator.getHostName(ip_addr);
-  }
-  @Override
-  public RuntimeException getGemFireConfigException(String string) {
-    return new GemFireConfigException(string);
-  }
-  
-  @Override
-  public RuntimeException getAuthenticationFailedException(String failReason) {
-    return new AuthenticationFailedException(failReason);
-  }
-
-  @Override
-  public SockCreator getSockCreator() {
-    return SocketCreator.getDefaultInstance();
-  }
-
-  
-  @Override
-  public void setDefaultGemFireAttributes(IpAddress addr) {
-    MemberAttributes attr = com.gemstone.gemfire.distributed.internal.membership.MemberAttributes.DEFAULT;
-    insertGemFireAttributes(addr, attr);
-  }
-
-  @Override
-  public RuntimeException getDisconnectException(String localizedString) {
-    return new DistributedSystemDisconnectedException(localizedString);
-  }
-
-  @Override
-  public Object getForcedDisconnectException(String localizedString) {
-    return new ForcedDisconnectException(localizedString);
-  }
-
-  @Override
-  public RuntimeException getSystemConnectException(String localizedString) {
-    return new SystemConnectException(localizedString);
-  }
-
-  @Override
-  public InetAddress getLocalHost() throws UnknownHostException {
-    return SocketCreator.getLocalHost();
-  }
-
-  @Override
-  public void setGemFireAttributes(IpAddress addr, Object obj) {
-    insertGemFireAttributes(addr, obj);
-  }
-
-  @Override
-  public String getVmKindString(int vmKind) {
-    String vmStr = "";
-    switch (vmKind) {
-    case DistributionManager.NORMAL_DM_TYPE:
-      //vmStr = ":local"; // let this be silent
-      break;
-    case DistributionManager.LOCATOR_DM_TYPE:
-      vmStr = ":locator";
-      break;
-    case DistributionManager.ADMIN_ONLY_DM_TYPE:
-      vmStr = ":admin";
-      break;
-    case DistributionManager.LONER_DM_TYPE:
-      vmStr = ":loner";
-      break;
-    default:
-      //vmStr = ":<unknown:" + vmKind + ">"; // let this be silent for JGroups addresses
-      break;
-    }
-    return vmStr;
-  }
-  
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d2a942e8/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/GFJGPeerAdapter.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/GFJGPeerAdapter.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/GFJGPeerAdapter.java
deleted file mode 100755
index 7fd921b..0000000
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/GFJGPeerAdapter.java
+++ /dev/null
@@ -1,484 +0,0 @@
-package com.gemstone.gemfire.distributed.internal.membership.jgroup;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInput;
-import java.io.DataInputStream;
-import java.io.DataOutput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.SocketAddress;
-import java.net.UnknownHostException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Timer;
-
-import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.ForcedDisconnectException;
-import com.gemstone.gemfire.GemFireConfigException;
-import com.gemstone.gemfire.SystemConnectException;
-import com.gemstone.gemfire.cache.UnsupportedVersionException;
-import com.gemstone.gemfire.distributed.DistributedMember;
-import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
-import com.gemstone.gemfire.distributed.Locator;
-import com.gemstone.gemfire.distributed.internal.DMStats;
-import com.gemstone.gemfire.distributed.internal.DistributionManager;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.distributed.internal.InternalLocator;
-import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
-import com.gemstone.gemfire.distributed.internal.membership.MemberAttributes;
-import com.gemstone.gemfire.distributed.internal.tcpserver.TcpServer;
-import com.gemstone.gemfire.internal.InternalDataSerializer;
-import com.gemstone.gemfire.internal.SocketCreator;
-import com.gemstone.gemfire.internal.Version;
-import com.gemstone.gemfire.internal.VersionedDataInputStream;
-import com.gemstone.gemfire.internal.VersionedDataOutputStream;
-import com.gemstone.gemfire.internal.VersionedObjectInput;
-import com.gemstone.gemfire.internal.VersionedObjectOutput;
-import com.gemstone.gemfire.internal.cache.DirectReplyMessage;
-import com.gemstone.gemfire.internal.cache.tier.sockets.HandShake;
-import com.gemstone.gemfire.internal.logging.InternalLogWriter;
-import com.gemstone.gemfire.internal.logging.log4j.AlertAppender;
-import com.gemstone.gemfire.internal.process.StartupStatus;
-import com.gemstone.gemfire.security.AuthenticationFailedException;
-import com.gemstone.org.jgroups.Address;
-import com.gemstone.org.jgroups.Header;
-import com.gemstone.org.jgroups.Message;
-import com.gemstone.org.jgroups.spi.GFPeerAdapter;
-import com.gemstone.org.jgroups.stack.IpAddress;
-import com.gemstone.org.jgroups.util.ExternalStrings;
-import com.gemstone.org.jgroups.util.GFLogWriter;
-import com.gemstone.org.jgroups.util.GemFireTracer;
-import com.gemstone.org.jgroups.util.SockCreator;
-import com.gemstone.org.jgroups.util.StringId;
-import com.gemstone.org.jgroups.util.Util;
-
-public class GFJGPeerAdapter implements GFPeerAdapter {
-  
-//  protected final GemFireTracer log=GemFireTracer.getLog(GFJGAdapter.class);
-
-  private JGroupMembershipManager jgmm;
-  private DMStats stats;
-  
-  public GFJGPeerAdapter(JGroupMembershipManager mgr, DMStats stats) {
-    this.jgmm = mgr;
-    this.stats = stats;
-  }
-
-  /**
-   * Construct an adapter that can only be used to invoke functions
-   * that do not require a membership manager or DMStats, such
-   * as setMemberAttributes
-   */
-  public GFJGPeerAdapter() {
-  }
-
-  @Override
-  public DatagramSocket getMembershipSocketForUDP() {
-    return jgmm.getMembershipSocketForUDP();
-  }
-
-  @Override
-  public boolean getDisableAutoReconnect() {
-    return jgmm.getDistributionConfig().getDisableAutoReconnect();
-  }
-
-  @Override
-  public boolean isReconnectingDS() {
-    return jgmm.isReconnectingDS();
-  }
-
-  @Override
-  public Timer getConnectionTimeoutTimer() {
-    return jgmm.getTimer();
-  }
-
-  @Override
-  public void setCacheTimeOffset(Address src, long timeOffs, boolean b) {
-    jgmm.setCacheTimeOffset(src, timeOffs, b);
-  }
-
-  @Override
-  public boolean getDisableTcp() {
-    return jgmm.getDistributionConfig().getDisableTcp();
-  }
-
-  @Override
-  public boolean isShunnedMemberNoSync(IpAddress mbr) {
-    return jgmm.isShunnedMemberNoSync(mbr);
-  }
-
-  @Override
-  public int getAckWaitThreshold() {
-    return jgmm.getDistributionConfig().getAckWaitThreshold();
-  }
-
-  @Override
-  public int getAckSevereAlertThreshold() {
-    return jgmm.getDistributionConfig().getAckSevereAlertThreshold();
-  }
-
-  @Override
-  public int getSerialQueueThrottleTime(Address src) {
-    return jgmm.getSerialQueueThrottleTime(src);
-  }
-
-  @Override
-  public void pongReceived(SocketAddress socketAddress) {
-    if (jgmm.getQuorumCheckerImpl() != null) {
-      jgmm.getQuorumCheckerImpl().pongReceived(socketAddress);
-    }
-  }
-
-  @Override
-  public void quorumLost(Set failures, List remaining) {
-    jgmm.quorumLost(failures, remaining);
-  }
-
-  @Override
-  public boolean isShuttingDown(IpAddress addr) {
-    return jgmm.isShuttingDown(addr);
-  }
-
-  @Override
-  public int getMcastPort() {
-    return jgmm.getDistributionConfig().getMcastPort();
-  }
-
-  @Override
-  public void enableNetworkPartitionDetection() {
-    jgmm.enableNetworkPartitionDetection();
-  }
-
-  @Override
-  public long getShunnedMemberTimeout() {
-    return jgmm.getShunnedMemberTimeout();
-  }
-
-  @Override
-  public long getMemberTimeout() {
-    return jgmm.getDistributionConfig().getMemberTimeout();
-  }
-
-  @Override
-  public void verifyCredentials(String authenticator, Properties credentials,
-      Properties securityProperties, GFLogWriter logWriter,
-      GFLogWriter securityLogWriter, Address src) {
-    DistributedMember addr = createDistributedMember(src);
-    if (addr != null) {
-      HandShake.verifyCredentials(authenticator, credentials, securityProperties, 
-          (InternalLogWriter)logWriter, (InternalLogWriter)securityLogWriter, addr);
-    }
-  }
-  
-  @Override
-  public Properties getCredentials(String authInitMethod, Properties secProps,
-      Address mbr, boolean isPeer, GFLogWriter logWriter,
-      GFLogWriter securityLogWriter) {
-    DistributedMember addr = createDistributedMember(mbr);
-    return HandShake.getCredentials(authInitMethod, secProps, addr, isPeer,
-        (InternalLogWriter)logWriter, (InternalLogWriter)securityLogWriter);
-  }
-
-  
-  /**
-   * Creates an {@link InternalDistributedMember} from the given {@link Address}
-   * object assuming the address to be an instance of {@link IpAddress}.
-   * 
-   * @param addr
-   *                the {@link Address} object of the member
-   * @return the {@link DistributedMember} for the given address
-   */
-  private DistributedMember createDistributedMember(Address addr) {
-    if (addr == null) {
-      return null;
-    }
-    IpAddress ipAddr = (IpAddress)addr;
-    DistributedMember member = jgmm.getMemberFromIpAddress(ipAddr, false);
-    if (member == null) {
-      JGroupMember jgm = new JGroupMember(ipAddr);
-      member = new InternalDistributedMember(jgm);
-    }
-    if (member != null && member.equals(jgmm.getLocalMember())) {
-      return null;
-    }
-    return member;
-  }
-
-  /** log startup status that will be displayed in gfsh or other user-interfaces */
-  public void logStartup(StringId msgId, Object...params) {
-    StartupStatus.startup(msgId, params);
-  }
-
-
-  @Override
-  public void beforeChannelClosing(String string, RuntimeException closeException) {
-    AlertAppender.getInstance().shuttingDown();
-    
-    // This test hook is used in LocatorTest
-    if (jgmm.channelTestHook != null) {
-      jgmm.channelTestHook.beforeChannelClosing("before channel closing", closeException);
-    }
-  }
-  
-
-  @Override
-  public void beforeSendingPayload(Object gfmsg) {
-    if(gfmsg instanceof DirectReplyMessage) {
-      ((DirectReplyMessage) gfmsg).registerProcessor();
-    }
-  }
-
-  
-
-  
-  
-  
-  @Override
-  public void incUcastReadBytes(int len) {
-    stats.incUcastReadBytes(len);
-  }
-
-  @Override
-  public void incjChannelUpTime(long l) {
-    stats.incjChannelUpTime(l);
-
-  }
-
-  @Override
-  public void incjgChannelDownTime(long l) {
-    stats.incjgDownTime(l);
-  }
-
-  @Override
-  public void setJgUNICASTreceivedMessagesSize(long rm) {
-    stats.setJgUNICASTreceivedMessagesSize(rm);
-  }
-
-  @Override
-  public void incJgUNICASTdataReceived(long l) {
-    stats.incJgUNICASTdataReceived(l);
-  }
-
-  @Override
-  public void setJgUNICASTsentHighPriorityMessagesSize(long hm) {
-    stats.setJgUNICASTreceivedMessagesSize(hm);
-  }
-
-  @Override
-  public void setJgUNICASTsentMessagesSize(long sm) {
-    stats.setJgUNICASTsentMessagesSize(sm);
-  }
-
-  @Override
-  public void incUcastRetransmits() {
-    stats.incUcastRetransmits();
-  }
-
-  @Override
-  public void incJgFragmentsCreated(int num_frags) {
-    stats.incJgFragmentsCreated(num_frags);
-  }
-
-  @Override
-  public void incJgFragmentationsPerformed() {
-    stats.incJgFragmentationsPerformed();
-  }
-
-  @Override
-  public void incMcastReadBytes(int len) {
-    stats.incMcastReadBytes(len);
-  }
-
-  @Override
-  public long startMcastWrite() {
-    return stats.startMcastWrite();
-  }
-
-  @Override
-  public void endMcastWrite(long start, int length) {
-    stats.endMcastWrite(start, length);
-  }
-
-  @Override
-  public long startUcastWrite() {
-    return stats.startUcastWrite();
-  }
-
-  @Override
-  public void endUcastWrite(long start, int length) {
-    stats.endUcastWrite(start, length);
-  }
-
-  @Override
-  public void incFlowControlResponses() {
-    stats.incFlowControlResponses();
-  }
-
-  @Override
-  public void incJgFCsendBlocks(int i) {
-    stats.incJgFCsendBlocks(i);
-  }
-
-  @Override
-  public long startFlowControlWait() {
-    return stats.startFlowControlWait();
-  }
-
-  @Override
-  public void incJgFCautoRequests(int i) {
-    stats.incJgFCautoRequests(i);
-  }
-
-  @Override
-  public void endFlowControlWait(long blockStartTime) {
-    stats.endFlowControlWait(blockStartTime);
-  }
-  
-
-  @Override
-  public long startFlowControlThrottleWait() {
-    return stats.startFlowControlThrottleWait();
-  }
-
-  @Override
-  public void endFlowControlThrottleWait(long blockStartTime) {
-    stats.endFlowControlThrottleWait(blockStartTime);
-  }
-
-  @Override
-  public void incJgFCreplenish(int i) {
-    stats.incJgFCreplenish(i);
-  }
-
-  @Override
-  public void incJgFCresumes(int i) {
-    stats.incJgFCresumes(i);
-  }
-
-  @Override
-  public void setJgQueuedMessagesSize(int size) {
-    stats.setJgQueuedMessagesSize(size);
-  }
-
-  @Override
-  public void incJgFCsentThrottleRequests(int i) {
-    stats.incJgFCsentThrottleRequests(i);
-  }
-
-  @Override
-  public void incJgFCsentCredits(int i) {
-    stats.incJgFCsentCredits(i);
-  }
-
-  @Override
-  public void incFlowControlRequests() {
-    stats.incFlowControlRequests();
-  }
-
-  @Override
-  public void incjgUpTime(long l) {
-    stats.incjgUpTime(l);
-  }
-
-  @Override
-  public void incBatchSendTime(long gsstart) {
-    stats.incBatchSendTime(gsstart);
-  }
-
-  @Override
-  public void incBatchCopyTime(long start) {
-    stats.incBatchCopyTime(start);
-  }
-
-  @Override
-  public void incBatchFlushTime(long start) {
-    stats.incBatchFlushTime(start);
-  }
-
-  @Override
-  public void incMcastRetransmitRequests() {
-    stats.incMcastRetransmitRequests();
-  }
-
-  @Override
-  public void setJgSTABLEreceivedMessagesSize(long received_msgs_size) {
-    stats.setJgSTABLEreceivedMessagesSize(received_msgs_size);
-  }
-
-  @Override
-  public void setJgSTABLEsentMessagesSize(int size) {
-    stats.setJgSTABLEsentMessagesSize(size);
-  }
-
-  @Override
-  public void incJgNAKACKwaits(int i) {
-    stats.incJgNAKACKwaits(i);
-  }
-
-  @Override
-  public void incMcastRetransmits() {
-    stats.incMcastRetransmits();
-  }
-
-  @Override
-  public void incJgSTABLEmessagesSent(int i) {
-    stats.incJgSTABLEmessagesSent(i);
-  }
-
-  @Override
-  public void incJgSTABLEmessages(int i) {
-    stats.incJgSTABLEmessages(i);
-  }
-
-  @Override
-  public void incJgSTABLEsuspendTime(long l) {
-    stats.incJgSTABLEsuspendTime(l);
-  }
-
-  @Override
-  public void incJgSTABILITYmessages(int i) {
-    stats.incJgSTABILITYmessages(i);
-  }
-  
-  
-  
-  ///////////////////////////////// Serialization methods
-
-  @Override
-  public boolean shutdownHookIsAlive() {
-    Thread shutdownHook = InternalDistributedSystem.shutdownHook;
-    return (shutdownHook != null && shutdownHook.isAlive());
-  }
-  
-  @Override
-  public boolean isAdminOnlyMember() {
-    return (DistributionManager.getDistributionManagerType() == 
-        DistributionManager.ADMIN_ONLY_DM_TYPE || DistributionManager.getDistributionManagerType() == 
-        DistributionManager.LOCATOR_DM_TYPE) // [GemStone]
-        && !Boolean.getBoolean(InternalLocator.FORCE_LOCATOR_DM_TYPE)
-        && !DistributionManager.isCommandLineAdminVM;
-  }
-
-
-  @Override
-  public boolean hasLocator() {
-    return Locator.hasLocator();
-  }
-
-  @Override
-  public boolean isDisconnecting() {
-    InternalDistributedSystem system = InternalDistributedSystem.getAnyInstance();
-    return (system != null && system.isDisconnecting());
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d2a942e8/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/JGroupMember.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/JGroupMember.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/JGroupMember.java
deleted file mode 100755
index e261e3c..0000000
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/JGroupMember.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.distributed.internal.membership.jgroup;
-
-import java.net.InetAddress;
-import java.io.*;
-
-import com.gemstone.gemfire.InternalGemFireError;
-import com.gemstone.gemfire.distributed.DurableClientAttributes;
-import com.gemstone.gemfire.distributed.internal.membership.NetMember;
-import com.gemstone.gemfire.distributed.internal.membership.MemberAttributes;
-import com.gemstone.gemfire.internal.Version;
-import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.org.jgroups.JChannel;
-import com.gemstone.org.jgroups.stack.IpAddress;
-
-/**
- * This is the fundamental representation of a member of a GemFire distributed system.
- * 
- * Unfortunately, this class serves two distinct functions.  First, it is the
- * fundamental element of membership in the GemFire distributed system.  As such,
- * it is used in enumerations and properly responds to hashing and equals() comparisons.
- * 
- * Second, it is used as a cheap way of representing an address.  This is
- * unfortunate, because as a NetMember, it holds two separate port numbers: the
- * "membership" descriptor as well as a direct communication channel.
- * 
- * TODO fix this.
- */
-public class JGroupMember implements NetMember {
-  private transient IpAddress ipAddr;
-  
-  
-  // Used only by Externalization
-  public JGroupMember() {
-  }
-  
-  /** the JGroups address object */
-  public IpAddress getAddress() {
-    return ipAddr;
-  }
-
-  public MemberAttributes getAttributes() {
-    return new MemberAttributes(ipAddr.getDirectPort(), ipAddr.getProcessId(),
-        ipAddr.getVmKind(), ipAddr.getBirthViewId(), ipAddr.getName(), ipAddr.getRoles(),
-        (DurableClientAttributes)ipAddr.getDurableClientAttributes());
-  }
-
-  public void setAttributes(MemberAttributes p_attr) {
-    MemberAttributes attr = p_attr;
-    if (attr == null) {
-      attr = MemberAttributes.INVALID;
-    }
-    GFJGBasicAdapter.insertGemFireAttributes(ipAddr, attr);
-  }
-  
-  /**
-   * This constructor used internally, esp. for views
-   * 
-   * @param base
-   */
-  public JGroupMember(IpAddress base) {
-    ipAddr = base;  
-  }
-  
-  /**
-   * This is the only constructor to refer to a CacheMember other
-   * than the current host.
-   */
-  public JGroupMember(JGroupMember m) {
-    ipAddr = m.ipAddr; // This should be ok, since they shouldn't change
-  }
-
-  /**
-   * Create a CacheMember referring to the current host (as defined by
-   * the given string).
-   * 
-   * @param i the hostname, must be for the current host
-   * @param p the membership listening port
-   */
-  public JGroupMember(String i, int p) {
-    ipAddr = new IpAddress(i, p);
-//    ipAddr.splitBrainEnabled(false);
-//    ipAddr.cantBeCoordinator(false);
-  }
-
-  /**
-   * Create a CacheMember referring to the current host (as defined by
-   * the given string).
-   * 
-   * @param i the hostname, must be for the current host
-   * @param p the membership listening port
-   * @param splitBrainEnabled whether the member has network partition detection enabled
-   * @param canBeCoordinator whether the member can be group coordinator
-   */
-  public JGroupMember(InetAddress i, int p, boolean splitBrainEnabled, boolean canBeCoordinator) {
-    ipAddr = new IpAddress(i, p);
-    ipAddr.splitBrainEnabled(splitBrainEnabled);
-    ipAddr.shouldntBeCoordinator(!canBeCoordinator);
-  }
-
-  /**
-   * Create a CacheMember referring to the current host
-   * 
-   * @param port the membership listening port
-   */
-  public JGroupMember(int port) {
-    ipAddr = new IpAddress(port);
-  }
-
-  public InetAddress getIpAddress() {
-    return ipAddr.getIpAddress();
-  }
-
-  public int getPort() {
-    return ipAddr.getPort();
-  }
-
-  public boolean isMulticastAddress() {
-    return ipAddr.isMulticastAddress();
-  }
-  
-  public boolean splitBrainEnabled() {
-    return ipAddr.splitBrainEnabled();
-  }
-  
-  public boolean canBeCoordinator() {
-    return ipAddr.preferredForCoordinator();
-  }
-
-  /**
-   * Establishes an order between 2 addresses. Assumes other contains non-null IpAddress.
-   * Excludes channel_name from comparison.
-   * @return 0 for equality, value less than 0 if smaller, greater than 0 if greater.
-   */
-  public int compare(NetMember other) {
-    return compareTo(other);
-  }
-
-  /**
-   * implements the java.lang.Comparable interface
-   * @see java.lang.Comparable
-   * @param o - the Object to be compared
-   * @return a negative integer, zero, or a positive integer as this object is less than,
-   *         equal to, or greater than the specified object.
-   * @exception java.lang.ClassCastException - if the specified object's type prevents it
-   *            from being compared to this Object.
-   */
-  public int compareTo(Object o) {
-    if (o == this) {
-      return 0;
-    }
-    // obligatory type check
-    if ((o == null) || !(o instanceof JGroupMember))
-      throw new ClassCastException(LocalizedStrings.JGroupMember_JGROUPMEMBERCOMPARETO_COMPARISON_BETWEEN_DIFFERENT_CLASSES.toLocalizedString());
-    return ipAddr.compareTo(((JGroupMember)o).ipAddr);
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    // GemStone fix for 29125
-    if ((obj == null) || !(obj instanceof JGroupMember)) {
-      return false;
-    }
-    return compareTo(obj) == 0;
-  }
-
-  @Override
-  public int hashCode() {
-    return ipAddr.hashCode();
-  }
-
-  @Override
-  public String toString() {
-    return ipAddr.toString();
-  }
-
-  
-  /**
-   * For Externalizable
-   * 
-   * @see Externalizable
-   */
-  public void writeExternal(ObjectOutput out) throws IOException {
-    if (ipAddr == null)
-      throw new InternalGemFireError(LocalizedStrings.JGroupMember_ATTEMPT_TO_EXTERNALIZE_NULL_IP_ADDRESS.toLocalizedString());
-
-//    ipAddr.writeExternal(out);
-    // do it the way we like
-    byte[] address = ipAddr.getIpAddress().getAddress();
-    
-    out.writeInt(address.length); // IPv6 compatible
-    out.write(address);
-    out.writeInt(ipAddr.getPort());
-    out.write(ipAddr.getFlags());
-    Version.writeOrdinal(out, ipAddr.getVersionOrdinal(), true);
-    byte bytes[] = new MemberAttributes(ipAddr.getDirectPort(), ipAddr.getProcessId(),
-        ipAddr.getVmKind(), ipAddr.getBirthViewId(), ipAddr.getName(), ipAddr.getRoles(),
-        (DurableClientAttributes)ipAddr.getDurableClientAttributes()).toByteArray();
-    if (bytes == null)
-      out.writeInt(0);
-    else {
-      out.writeInt(bytes.length);
-      out.write(bytes);
-    }
-  }
-  
-  /**
-   * For Externalizable
-   * 
-   * @see Externalizable
-   */
-  public void readExternal(ObjectInput in) throws IOException,
-          ClassNotFoundException {
-//    ipAddr = new IpAddress();
-//    ipAddr.readExternal(in);
-    // do it the way we like
-    int len = in.readInt(); // IPv6 compatible
-    byte addr[] = new byte[len];
-    in.readFully(addr);
-    InetAddress ia = InetAddress.getByAddress(addr);
-    int port = in.readInt();
-    byte flags = in.readByte();
-    ipAddr = new IpAddress(ia, port);
-    ipAddr.setFlags(flags);
-    ipAddr.readVersion(flags, in);
-    len = in.readInt();
-    if (len != 0) {
-      byte bytes[] = new byte[len];
-      in.readFully(bytes);
-      GFJGBasicAdapter.insertGemFireAttributes(ipAddr, new MemberAttributes(bytes));
-    }
-  }
-
-  public void setPort(int p) {
-    IpAddress i = new IpAddress(ipAddr.getIpAddress(), p);
-    i.setFlags(ipAddr.getFlags());
-    i.setVmKind(ipAddr.getVmKind());
-    i.setDirectPort(ipAddr.getDirectPort());
-    i.setProcessId(ipAddr.getProcessId());
-    i.setRoles(ipAddr.getRoles());
-    i.setDurableClientAttributes(ipAddr.getDurableClientAttributes());
-    i.setVersionOrdinal(ipAddr.getVersionOrdinal());
-    this.ipAddr = i;
-  }
- }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d2a942e8/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/JGroupMemberFactory.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/JGroupMemberFactory.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/JGroupMemberFactory.java
deleted file mode 100644
index 0265ff1..0000000
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/jgroup/JGroupMemberFactory.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.distributed.internal.membership.jgroup;
-
-import java.net.InetAddress;
-
-import com.gemstone.gemfire.distributed.internal.DMStats;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.distributed.internal.DistributionException;
-import com.gemstone.gemfire.distributed.internal.DistributionManager;
-import com.gemstone.gemfire.distributed.internal.membership.DistributedMembershipListener;
-import com.gemstone.gemfire.distributed.internal.membership.MemberAttributes;
-import com.gemstone.gemfire.distributed.internal.membership.MemberServices;
-import com.gemstone.gemfire.distributed.internal.membership.MembershipManager;
-import com.gemstone.gemfire.distributed.internal.membership.NetMember;
-import com.gemstone.gemfire.internal.OSProcess;
-import com.gemstone.gemfire.internal.admin.remote.RemoteTransportConfig;
-import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.internal.tcp.ConnectionException;
-
-/**
- * Create a new Member based on the given inputs.
- * TODO: need to implement a real factory implementation based on gemfire.properties
- * 
- * @see com.gemstone.gemfire.distributed.internal.membership.NetMember
- * @author D. Jason Penney
- */
-public class JGroupMemberFactory implements MemberServices {
-
-  /**
-   * Return a new NetMember, possibly for a different host
-   * 
-   * @param i the name of the host for the specified NetMember, the current host (hopefully)
-   * if there are any problems.
-   * @param p the membership port
-   * @param splitBrainEnabled whether the member has this feature enabled
-   * @param canBeCoordinator whether the member can be membership coordinator
-   * @param attr the MemberAttributes
-   * @return the new NetMember
-   */
-  public NetMember newNetMember(InetAddress i, int p, boolean splitBrainEnabled,
-      boolean canBeCoordinator, MemberAttributes attr) {
-    JGroupMember result = new JGroupMember(i, p, splitBrainEnabled, canBeCoordinator);
-    result.setAttributes(attr);
-    return result;
-  }
-
-  private MemberAttributes getDefaultAttributes() {
-    // TODO can we get rid of this??
-    if (MemberAttributes.DEFAULT.getVmPid() == -1 ||
-        MemberAttributes.DEFAULT.getVmKind() == -1) {
-      MemberAttributes.setDefaults(
-          -1, 
-          OSProcess.getId(), 
-          -1,
-          DistributionManager.getDistributionManagerType(), 
-          null,
-          null, null);
-    }
-    return MemberAttributes.DEFAULT;
-  }
-  
-  /**
-   * Return a new NetMember representing current host.  This assumes that
-   * the member does not have network partition detection enabled and can
-   * be group coordinator
-   * @param i an InetAddress referring to the current host
-   * @param p the membership port being used
-   * @return the new NetMember
-   */
-  public NetMember newNetMember(InetAddress i, int p) {
-    JGroupMember result = new JGroupMember(i, p, false, true);
-    result.setAttributes(getDefaultAttributes());
-    return result;
-  }
-
-  /**
-   * Return a new NetMember representing current host
-   * 
-   * @param s a String referring to the current host
-   * @param p the membership port being used
-   * @return the new member
-   */
-  public NetMember newNetMember(String s, int p) {
-    JGroupMember result = new JGroupMember(s, p);
-    result.setAttributes(getDefaultAttributes());
-    return result;
-  }
-  
-  /**
-   * Return a new Member
-   * 
-   * Used by externalization only.
-   * 
-   * @return blank member for use with externalization
-   */
-  public NetMember newNetMember() {
-    return new JGroupMember();
-  }
-
-  public MembershipManager newMembershipManager(DistributedMembershipListener listener,
-          DistributionConfig config,
-          RemoteTransportConfig transport,
-          DMStats stats) throws DistributionException
-  {
-    try {
-      return new JGroupMembershipManager().initialize(listener,
-          config, transport, stats);
-    }
-    catch (ConnectionException e) {
-      throw new DistributionException(LocalizedStrings.JGroupMemberFactory_UNABLE_TO_CREATE_MEMBERSHIP_MANAGER.toLocalizedString(), e);
-    }
-  }
-}


Mime
View raw message