Kieker 1.5

kieker.monitoring.core.registry
Class Registry<E>

java.lang.Object
  extended by kieker.monitoring.core.registry.Registry<E>
Type Parameters:
E - the type of registered objects
All Implemented Interfaces:
IRegistry<E>

public class Registry<E>
extends Object
implements IRegistry<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/

Author:
Jan Waller

Constructor Summary
Registry()
          Creates a new, empty registry with a default initial capacity (32), load factor (0.75) and concurrencyLevel (8).
 
Method Summary
 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 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

Registry

public Registry()
Creates a new, empty registry with a default initial capacity (32), load factor (0.75) and concurrencyLevel (8).

Method Detail

setRecordReceiver

public final void setRecordReceiver(IMonitoringRecordReceiver recordReceiver)
Description copied from interface: IRegistry
Enables logging of newly registered objects.

Specified by:
setRecordReceiver in interface IRegistry<E>
Parameters:
recordReceiver - the IMonitoringRecordReceiver logged to

get

public int get(E value)
Description copied from interface: IRegistry
Gets a unique id for an object.

Specified by:
get in interface IRegistry<E>
Parameters:
value - the object
Returns:
the unique id

get

public E get(int id)
Description copied from interface: IRegistry
Gets the object associated with the unique id.

Specified by:
get in interface IRegistry<E>
Parameters:
id - the unique id
Returns:
the associated object

getAll

public E[] getAll()
Description copied from interface: IRegistry
Return an array with all registered objects.

Specified by:
getAll in interface IRegistry<E>
Returns:
array of registered objects

getSize

public int getSize()
Description copied from interface: IRegistry
Returns the number of registered objects.

Specified by:
getSize in interface IRegistry<E>
Returns:
number of registered objects

Kieker 1.5

Copyright 2012 the Kieker Project, http://kieker-monitoring.net