KeyType - object type of the keysValueType - object type of the valuespublic class EventingMapBasedStorageService<KeyType,ValueType> extends Object implements StorageService<KeyType,ValueType>, org.springframework.context.ApplicationContextAware
StorageService that publishes event when items are added or removed from the
service.
An EventingMapBasedStorageService.AddEntryEvent is published after an item has been added to the storage service. A EventingMapBasedStorageService.RemoveEntryEvent
is published after an item has been removed from the storage service. These events are published in the root
application context, that is the highest ancestor, of the application context presented to this class.| Modifier and Type | Class and Description |
|---|---|
static class |
EventingMapBasedStorageService.AddEntryEvent<KeyType,ValueType>
An event indicating an item has been added to an storage service.
|
class |
EventingMapBasedStorageService.PartitionEntryIterator
An iterator over the entries of a partition of the storage service.
|
class |
EventingMapBasedStorageService.PartitionIterator
An iterator over the partitions of the storage service.
|
static class |
EventingMapBasedStorageService.RemoveEntryEvent<KeyType,ValueType>
An event indicating an item has been removed from an storage service.
|
| Modifier and Type | Field and Description |
|---|---|
private org.springframework.context.ApplicationContext |
appCtx
Spring application context.
|
private Map<String,Map<KeyType,ValueType>> |
store
Backing map.
|
| Constructor and Description |
|---|
EventingMapBasedStorageService()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String partition,
Object key) |
ValueType |
get(String partition,
Object key) |
Iterator<KeyType> |
getKeys(String partition) |
Iterator<String> |
getPartitions() |
ValueType |
put(String partition,
KeyType key,
ValueType value) |
ValueType |
remove(String partition,
KeyType key) |
void |
setApplicationContext(org.springframework.context.ApplicationContext ctx) |
private org.springframework.context.ApplicationContext appCtx
public EventingMapBasedStorageService()
public boolean contains(String partition, Object key)
contains in interface StorageService<KeyType,ValueType>public ValueType get(String partition, Object key)
get in interface StorageService<KeyType,ValueType>public Iterator<KeyType> getKeys(String partition)
getKeys in interface StorageService<KeyType,ValueType>public Iterator<String> getPartitions()
getPartitions in interface StorageService<KeyType,ValueType>public ValueType put(String partition, KeyType key, ValueType value)
put in interface StorageService<KeyType,ValueType>public ValueType remove(String partition, KeyType key)
remove in interface StorageService<KeyType,ValueType>public void setApplicationContext(org.springframework.context.ApplicationContext ctx)
setApplicationContext in interface org.springframework.context.ApplicationContextAwareCopyright © 1999-2015. All Rights Reserved.