|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.castor.persist.TypeInfo
public final class TypeInfo
Provides lock and cache about all the objects of a specific type. This information includes lifecycle interceptor requesting notification about activities that affect an object.
| Constructor Summary | |
|---|---|
TypeInfo(Cache<OID,CacheEntry> cache)
Constructor for creating class info. |
|
| Method Summary | |
|---|---|
ObjectLock |
acquire(OID oid,
TransactionContext tx,
LockAction lockAction,
int timeout)
Acquire the object lock for transaction. |
ObjectLock |
assure(OID oid,
TransactionContext tx,
boolean write)
Reassure the lock which have been successfully acquired by the transaction. |
void |
closeCache()
Life-cycle method to allow shutdown of cache instances. |
ObjectLock |
delete(OID oid,
TransactionContext tx)
Delete the object lock. |
void |
dumpCache(String name)
Dump all objects in cache and lock to output. |
void |
expireCache()
Expire all objects of this class from the cache. |
boolean |
isCached(OID oid)
Indicates whether an object with the specified identifier is currently cached. |
boolean |
isLocked(OID oid)
Indicates whether an object with the specified OID is currently locked. |
ObjectLock |
release(OID oid,
TransactionContext tx)
Release the object lock. |
ObjectLock |
rename(OID orgoid,
OID newoid,
TransactionContext tx)
Move the locked object from one OID to another OID for transaction. |
ObjectLock |
upgrade(OID oid,
TransactionContext tx,
int timeout)
Upgrade the lock to write lock. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TypeInfo(Cache<OID,CacheEntry> cache)
cache - The LRU which may be used to store and dispose freed ObjectLock.| Method Detail |
|---|
public void closeCache()
public void dumpCache(String name)
name - the class's full namepublic void expireCache()
public ObjectLock acquire(OID oid,
TransactionContext tx,
LockAction lockAction,
int timeout)
throws LockNotGrantedException
ObjectLock.confirm(TransactionContext, boolean)
exactly once.
oid - The OID of the lock.tx - The context of the transaction to acquire lock.lockAction - The initial action to be performed on the lock.timeout - The time limit to acquire the lock.
LockNotGrantedException - Timeout or deadlock or object deleted occurred attempting
to acquire lock on object
public ObjectLock upgrade(OID oid,
TransactionContext tx,
int timeout)
throws LockNotGrantedException
oid - The OID of the lock.tx - The transaction in action.timeout - Time limit.
LockNotGrantedException - Timeout or deadlock or object deleted occured attempting
to acquire lock on object.
public ObjectLock assure(OID oid,
TransactionContext tx,
boolean write)
oid - The OID of the lock.tx - The transaction in action.write - true if we want to upgrade or reassure a
write lock, false for read lock.
public ObjectLock rename(OID orgoid,
OID newoid,
TransactionContext tx)
throws LockNotGrantedException
orgoid - Orginal OID before the object is created.newoid - New OID after the object is created.tx - The TransactionContext of the transaction in action.
LockNotGrantedException - Timeout or deadlock occured attempting to
acquire lock on object
public ObjectLock delete(OID oid,
TransactionContext tx)
oid - The OID of the ObjectLock.tx - The transactionContext of transaction in action.
public ObjectLock release(OID oid,
TransactionContext tx)
oid - The OID of the ObjectLock.tx - The transactionContext of transaction in action.
public boolean isCached(OID oid)
oid - The Object identifier.
public boolean isLocked(OID oid)
oid - Object identifier.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||