|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.softamis.net.registry.impl.AbstractConsumingRegistry<K,V>
K - type of keys used to identify registry itemsV - type of values stored in the registrypublic abstract class AbstractConsumingRegistry<K extends java.io.Serializable,V extends java.io.Serializable>
Base abstract implementation of ConsumingRegistry. Contains all logic related to working with
items and marking them as dirty, but leaves actual details of requesting and obtining items to
inherited classes.
ProvidingRegistry| Field Summary | |
|---|---|
protected java.util.Set<K> |
fDirtyKeys
Set that contains information about "dirty" keys - ones, that were changed due to synchronization |
protected static org.apache.commons.logging.Log |
fLog
|
protected boolean |
fRequestItemsOnInit
Flag that indicates whether items should be requested right after initialization of registry |
| Constructor Summary | |
|---|---|
protected |
AbstractConsumingRegistry()
|
| Method Summary | |
|---|---|
protected abstract java.util.Set<V> |
doGetItems(K aItemKey)
Performs actual obtaining of items for consumer registry. |
protected abstract void |
doMarkItemInvalid(K aItemKey,
V aItem)
Actual method that performs marking item as invalid |
protected abstract void |
doRequestItems(K aItemKey)
Perform actual request for items for particular key |
java.util.Set<V> |
getItems(K aItemKey)
Returns the set of items stored in the distributed registry under given key. |
boolean |
isDirty(K aItemKey)
Indicates whether there were any changes in distributed registry occurred due to synchronization since the last call of the getItems()
for given key. |
boolean |
isRequestItemsOnInit()
Returns flag that indicates whether items should be requested right after initialization of registry |
void |
markDirty(K aItemKey)
Method allows to mark some key of items as dirty. |
void |
markItemInvalid(K aItemKey,
V aItem)
Provides ability to mark specific item stored in the distributed registry as invalid one. |
void |
requestItems(K aItemKey)
Initiates requesting of items for given key by sending appropriate notifications to ProvidingRegistries |
void |
setRequestItemsOnInit(boolean aRequestItemsOnInit)
Sets flag that indicates whether items should be requested right after initialization of registry |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.softamis.net.registry.ConsumingRegistry |
|---|
addRegistryEventProcessor, close, getKeys, isClosed, removeRegistryEventProcessor |
| Field Detail |
|---|
protected static final org.apache.commons.logging.Log fLog
protected final java.util.Set<K extends java.io.Serializable> fDirtyKeys
isDirty(K)protected boolean fRequestItemsOnInit
| Constructor Detail |
|---|
protected AbstractConsumingRegistry()
| Method Detail |
|---|
public boolean isDirty(K aItemKey)
ConsumingRegistrygetItems()
for given key.
isDirty in interface ConsumingRegistry<K extends java.io.Serializable,V extends java.io.Serializable>aItemKey - key for items
ConsumingRegistry.getItems(K)ConsumingRegistry.getItems(K)public void markDirty(K aItemKey)
aItemKey - key of itempublic void requestItems(K aItemKey)
ConsumingRegistry
requestItems in interface ConsumingRegistry<K extends java.io.Serializable,V extends java.io.Serializable>aItemKey - if null, will request items for all available keysprotected abstract void doRequestItems(K aItemKey)
aItemKey - key for itemspublic java.util.Set<V> getItems(K aItemKey)
ConsumingRegistry
getItems in interface ConsumingRegistry<K extends java.io.Serializable,V extends java.io.Serializable>aItemKey - key of items
protected abstract void doMarkItemInvalid(K aItemKey,
V aItem)
aItemKey - key of itemaItem - particular itemprotected abstract java.util.Set<V> doGetItems(K aItemKey)
aItemKey - key for items
public void markItemInvalid(K aItemKey,
V aItem)
ConsumingRegistryConsumingRegistries in the same
distributed registry, they can be notified of and be handled
properly. It's assumed that this call will not affect
ProvidingRegistries somehow.
- Specified by:
markItemInvalid in interface ConsumingRegistry<K extends java.io.Serializable,V extends java.io.Serializable>
- Parameters:
aItemKey - key of the itemaItem - the item which should be marked invalid
public boolean isRequestItemsOnInit()
public void setRequestItemsOnInit(boolean aRequestItemsOnInit)
aRequestItemsOnInit - true if request should be performed after intialization
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||