A membership implementation using simple multicast. This is the representation of a multicast member. Carries the host, and port of the this or other cluster nodes.
| 32 | * the host, and port of the this or other cluster nodes. |
| 33 | */ |
| 34 | public class MemberImpl implements Member, java.io.Externalizable { |
| 35 | |
| 36 | /** |
| 37 | * The start marker for tribes member data. |
| 38 | */ |
| 39 | public static final byte[] TRIBES_MBR_BEGIN = new byte[] { 84, 82, 73, 66, 69, 83, 45, 66, 1, 0 }; |
| 40 | /** |
| 41 | * The end marker for tribes member data. |
| 42 | */ |
| 43 | public static final byte[] TRIBES_MBR_END = new byte[] { 84, 82, 73, 66, 69, 83, 45, 69, 1, 0 }; |
| 44 | /** |
| 45 | * The string manager for this class. |
| 46 | */ |
| 47 | protected static final StringManager sm = StringManager.getManager(Constants.Package); |
| 48 | |
| 49 | /** |
| 50 | * The listen host for this member. |
| 51 | */ |
| 52 | protected volatile byte[] host = new byte[0]; |
| 53 | /** |
| 54 | * The hostname string representation. |
| 55 | */ |
| 56 | protected transient volatile String hostname; |
| 57 | /** |
| 58 | * The tcp listen port for this member |
| 59 | */ |
| 60 | protected volatile int port; |
| 61 | /** |
| 62 | * The udp listen port for this member |
| 63 | */ |
| 64 | protected volatile int udpPort = -1; |
| 65 | |
| 66 | /** |
| 67 | * The tcp/SSL listen port for this member |
| 68 | */ |
| 69 | protected volatile int securePort = -1; |
| 70 | |
| 71 | /** |
| 72 | * Counter for how many broadcast messages have been sent from this member |
| 73 | */ |
| 74 | protected AtomicInteger msgCount = new AtomicInteger(0); |
| 75 | |
| 76 | /** |
| 77 | * The number of milliseconds since this member was created, is kept track of using the start time |
| 78 | */ |
| 79 | protected volatile long memberAliveTime = 0; |
| 80 | |
| 81 | /** |
| 82 | * For the local member only |
| 83 | */ |
| 84 | protected transient long serviceStartTime; |
| 85 | |
| 86 | /** |
| 87 | * To avoid serialization over and over again, once the local dataPkg has been set, we use that to transmit data |
| 88 | */ |
| 89 | protected transient byte[] dataPkg = null; |
| 90 | |
| 91 | /** |
nothing calls this directly
no test coverage detected