Package edu.yu.marketmaker.memory
Class HazelcastRepository<K,T extends Identifiable<K>>
java.lang.Object
edu.yu.marketmaker.memory.HazelcastRepository<K,T>
- Type Parameters:
K- the key typeT- the entity type, must implement Identifiable
- All Implemented Interfaces:
Repository<K,T>
public class HazelcastRepository<K,T extends Identifiable<K>>
extends Object
implements Repository<K,T>
Generic Hazelcast-backed implementation of Repository.
Uses a distributed IMap for storage with write-through
persistence to the database via the configured MapStore.
-
Constructor Summary
ConstructorsConstructorDescriptionHazelcastRepository(com.hazelcast.map.IMap<K, T> map) Constructor for HazelcastRepository. -
Method Summary
-
Constructor Details
-
HazelcastRepository
Constructor for HazelcastRepository.- Parameters:
map- that this class will wrap
-
-
Method Details
-
get
Get mapped value- Specified by:
getin interfaceRepository<K,T extends Identifiable<K>> - Parameters:
id- key of the entity- Returns:
-
put
Store entity- Specified by:
putin interfaceRepository<K,T extends Identifiable<K>> - Parameters:
entity- to be stored
-
getAll
Get all mapped values- Specified by:
getAllin interfaceRepository<K,T extends Identifiable<K>> - Returns:
- Collection of all entities
-
delete
Delete entity- Specified by:
deletein interfaceRepository<K,T extends Identifiable<K>> - Parameters:
id- key of the entity
-
getMap
Returns the underlying IMap for advanced operations.- Returns:
- the Hazelcast IMap
-