|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xml.ws.rx.util.TimestampedCollection<K,V>
public class TimestampedCollection<K,V>
TODO javadoc WARNING: This class is a private utility class used by WS-RX implementation. Any usage outside the intedned scope is strongly discouraged. The API exposed by this class may be changed, replaced or removed without any advance notice.
| Method Summary | ||
|---|---|---|
long |
getOldestRegistrationTimestamp()
Returns a timestamp of the oldest registered subject. |
|
boolean |
isEmpty()
Call this function to determine whether the collection is empty or not. |
|
static
|
newInstance()
|
|
V |
register(K correlationId,
V subject)
Registers a subject and maps it to a given correlationId. |
|
boolean |
register(long timestamp,
V subject)
Creates a new subject registration. |
|
boolean |
register(V subject)
Creates a new subject registration. |
|
V |
remove(K correlationId)
Removes a registration from the collection based on a correlationId and returns
the value of the registered subject. |
|
List<V> |
removeAll()
Removes all values from the time-stamped collection and returns them as an ordered FIFO list. |
|
V |
removeOldest()
Removes the oldest registration from the collection and returns the value of the registered subject. |
|
int |
size()
Returns the number of elements in this collection. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <K,V> TimestampedCollection<K,V> newInstance()
public V register(@NotNull
K correlationId,
@NotNull
V subject)
subject and maps it to a given correlationId.
The newly created registration is timestamped which allows for later removal
based on the age of registration using removeOldest() method.
correlationId - correlation identifier to be associated with a given subjectsubject - a primary registration object
subject associated with a given correlationId
or null if there's no such subjectremove(java.lang.Object),
removeOldest()
public boolean register(@NotNull
V subject)
subject registration. The newly created registration
is timestamped which allows for later removal based on the age of registration
using removeOldest() method.
subject - a primary registration subject
true if the registration was successfull, false otherwiseremoveOldest()
public boolean register(long timestamp,
@NotNull
V subject)
subject registration. The newly created registration
is timestamped using a value of the timestamp parameter which allows
for later removal based on the age of registration using removeOldest()
method.
timestamp - a timestamp to be used for the registrationsubject - a primary registration subject
true if the registration was successfull, false otherwiseremoveOldest()
public V remove(@NotNull
K correlationId)
correlationId and returns
the value of the registered subject. This method may return null
correlationId - identifier to be associated with an already registered subject
subject associated with a given correlationId
or null if there's no such subjectregister(java.lang.Object, java.lang.Object)public V removeOldest()
subject.
subject
NoSuchElementException - if the underlying collection is empty.register(java.lang.Object, java.lang.Object),
register(java.lang.Object),
register(long, java.lang.Object)public List<V> removeAll()
public boolean isEmpty()
true if the collection is empty, false otherwisepublic int size()
Integer.MAX_VALUE elements, returns
Integer.MAX_VALUE.
public long getOldestRegistrationTimestamp()
NoSuchElementException - if the underlying collection is empty.removeOldest()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||