public interface ResourceManager<T>
ResourceManager manages an entity instance, datastore connection
corresponding to the entity and its transactional state.
ResourceManager is instantiated and invoked by Session
and Coordinator (especially, in distributed transaction), and applies
datastore operation to the managed entity with the datastore-specific APIs.| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Applies the transactional operation (WAL: Write Ahead Log) to the managed
entity then frees the allocated lock.
|
void |
delete(Object entity)
Deletes the specified entity from the datastore.
|
Object |
entity()
Returns the managed entity instance.
|
<E> E |
get(Class<E> clazz,
Object key)
Gets the entity instance of the specified
Class corresponding to
the specified id. |
void |
prepare()
Allocates lock for the managed entity.
|
void |
put(Object entity)
Puts the specified entity instance into the datastore newly.
|
T |
transaction()
Returns the current transaction.
|
void |
update(Object entity)
Applies the specified entity's update to the datastore.
|
<E> E get(Class<E> clazz, Object key) throws ConcurrentModificationException, IndoubtException
Class corresponding to
the specified id.E - The type of entity.clazz - The Class of entity.key - The key corresponding to the entity you attempt to get.Class corresponding
to the specified key.ConcurrentModificationException - If the entity has been modified
by other transaction.IndoubtException - If the data consistency broken is detected when
the entity is get.void put(Object entity)
entity - An entity instance.void update(Object entity)
entity - An entity instance to be updated.void delete(Object entity)
entity - An entity instance to be updated.void prepare()
Coordinator in Two-phase commit protocol.void commit()
Coordinator in Two-phase commit protocol.Object entity()
T transaction()
null.Copyright © 2009-2014 Eiichiro Uchiumi. All Rights Reserved.