|
Kieker 1.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object kieker.common.util.registry.Registry<E>
E
- the type of registered objectspublic final class Registry<E>
A simple registry to assign unique ids to objects. The basic strategy is to subdivide the table among Segments, each of which itself is a concurrently readable hash table. Based upon ConcurrentHashMap. Written by Doug Lea with assistance from members of JCP JSR-166 Expert Group and released to the public domain, as explained at http://creativecommons.org/publicdomain/zero/1.0/
Constructor Summary | |
---|---|
Registry()
Creates a new, empty registry with a default initial capacity (32), load factor (0.75) and concurrencyLevel (8). |
Method Summary | |
---|---|
void |
clear()
Clears the whole registry. |
int |
get(E value)
Gets a unique id for an object. |
E |
get(int id)
Gets the object associated with the unique id. |
E[] |
getAll()
Return an array with all registered objects. |
int |
getSize()
Returns the number of registered objects. |
void |
remove(E value)
Removes the given element from the registry. |
void |
setRecordReceiver(IMonitoringRecordReceiver recordReceiver)
Enables logging of newly registered objects. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Registry()
Method Detail |
---|
public final void setRecordReceiver(IMonitoringRecordReceiver recordReceiver)
setRecordReceiver
in interface IRegistry<E>
recordReceiver
- the IMonitoringRecordReceiver logged topublic final int get(E value)
get
in interface IRegistry<E>
value
- the object
public final E get(int id)
get
in interface IRegistry<E>
id
- the unique id
public final E[] getAll()
getAll
in interface IRegistry<E>
public final int getSize()
IRegistry
getSize
in interface IRegistry<E>
public final void remove(E value)
value
- The element to remove.public final void clear()
|
Kieker 1.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |