Package org.jgroups.util
Class Responses
- java.lang.Object
-
- org.jgroups.util.Responses
-
- All Implemented Interfaces:
java.lang.Iterable<PingData>
public class Responses extends java.lang.Object implements java.lang.Iterable<PingData>
Manages responses for the discovery protocol. Moved fromDiscovery
into this standalone class. Responses are only added but never removed.- Since:
- 3.5
- Author:
- Bela Ban
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Responses.PingDataIterator
-
Field Summary
Fields Modifier and Type Field Description protected boolean
break_on_coord_rsp
protected CondVar
cond
protected boolean
done
protected int
index
protected java.util.concurrent.locks.Lock
lock
protected int
num_expected_rsps
protected PingData[]
ping_rsps
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Responses
_done()
protected void
add(PingData data)
Responses
add(Responses rsps, Address local_addr)
Responses
addResponse(PingData rsp, boolean overwrite)
Responses
clear()
boolean
containsResponseFrom(Address mbr)
Responses
done()
protected int
find(PingData data)
PingData
findResponseFrom(Address mbr)
boolean
isCoord(Address addr)
boolean
isDone()
boolean
isEmpty()
java.util.Iterator<PingData>
iterator()
protected static int
newLength(int length)
protected int[]
numResponses()
java.lang.String
print()
protected void
resize(int new_size)
int
size()
protected java.util.List<PingData>
toList()
java.lang.String
toString()
boolean
waitFor(long timeout)
-
-
-
Field Detail
-
ping_rsps
protected PingData[] ping_rsps
-
index
protected int index
-
lock
protected final java.util.concurrent.locks.Lock lock
-
cond
protected final CondVar cond
-
num_expected_rsps
protected final int num_expected_rsps
-
break_on_coord_rsp
protected final boolean break_on_coord_rsp
-
done
protected boolean done
-
-
Method Detail
-
isDone
public boolean isDone()
-
done
public Responses done()
-
clear
public Responses clear()
-
containsResponseFrom
public boolean containsResponseFrom(Address mbr)
-
isCoord
public boolean isCoord(Address addr)
-
waitFor
public boolean waitFor(long timeout)
-
iterator
public java.util.Iterator<PingData> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<PingData>
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
print
public java.lang.String print()
-
_done
protected Responses _done()
-
numResponses
protected int[] numResponses()
-
toList
protected java.util.List<PingData> toList()
-
resize
protected void resize(int new_size)
-
add
protected void add(PingData data)
-
find
protected int find(PingData data)
-
newLength
protected static int newLength(int length)
-
-