public class GRSRegistry extends Object
GRSRegistry utility class is a statically initialized single instance per JVM that can uniquely register and reference
items registered to it using a unique identifier. The items that can be registered are IBuffer and IBufferStore
instances. In addition to instantiating the registry, during the static initialization, a LifecycleManager is also
initialize and set to monitor the lifecycle properties of the registered items| Modifier and Type | Field and Description |
|---|---|
static GRSRegistry |
Registry
The registry instance used
|
| Modifier and Type | Method and Description |
|---|---|
String |
add(IBuffer buffer)
Registers the provided
IBuffer in the registry and assigns it with a unique id with which it can be referenced |
String |
add(IBufferStore store)
Registers the provided
IBufferStore in the registry and assigns it with a unique id with which it can be referenced |
IBuffer |
getBuffer(String key)
Retrieves the
IBuffer entry that is associated with the provided key |
protected Collection<IBuffer> |
getBufferEntries()
Retrieves the available
IBuffer entries stored in the registry |
IBufferStore |
getStore(String key)
Retrieves the
IBufferStore entry that is associated with the provided key |
protected Collection<IBufferStore> |
getStoreEntries()
Retrieves the available
IBufferStore entries stored in the registry |
void |
remove(String key)
Removes the entry with the specific key from the registry if found and calls
IBuffer.dispose() or IBufferStore.dispose() depending on the nature
of the respective entry |
public static final GRSRegistry Registry
public String add(IBuffer buffer)
IBuffer in the registry and assigns it with a unique id with which it can be referencedpublic String add(IBufferStore store)
IBufferStore in the registry and assigns it with a unique id with which it can be referencedstore - the IBufferStore to registerIBufferStore was assignedpublic IBuffer getBuffer(String key)
IBuffer entry that is associated with the provided keypublic IBufferStore getStore(String key)
IBufferStore entry that is associated with the provided keykey - the key of the entry to retrieveIBufferStore associated with the key or null if no IBufferStore is associated with the keypublic void remove(String key)
IBuffer.dispose() or IBufferStore.dispose() depending on the nature
of the respective entrykey - the key of the entry to remove and disposeprotected Collection<IBuffer> getBufferEntries()
IBuffer entries stored in the registryIBuffer entriesprotected Collection<IBufferStore> getStoreEntries()
IBufferStore entries stored in the registryIBufferStore entriesCopyright © 2014. All Rights Reserved.