|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.db.BasicDBListener com.jalios.jcms.StrongLockManager
public class StrongLockManager
This class manages StrongLock.
Nested Class Summary | |
---|---|
class |
StrongLockManager.CacheEntry
|
Field Summary | |
---|---|
static String |
CACHE_ENABLED_PROP
|
static String |
CACHE_MAX_ENTRIES_PROP
|
static String |
DATA_ID_FIELD
|
static String |
REVISION
|
Method Summary | ||
---|---|---|
boolean |
canRequestLock(Data data,
Member mbr)
Returns true if the given member can request the lock (by mail). |
|
boolean |
checkLockMember(Data data,
Member mbr)
Returns true if the given member has locked the given data or if the data is not locked. |
|
static StrongLockManager |
getInstance()
|
|
|
getLockedDataSet(Class<T> clazz)
Returns all the locked data for the given class. |
|
|
getLockedDataSet(Class<T> clazz,
boolean useCache)
Returns all the locked data for the given class. |
|
String |
getLockInfo(Data data,
Locale locale)
Returns a string which explains who has the lock on the given data (return "" if the data is not locked) |
|
StrongLock |
getStrongLock(Data data)
Returns the StrongLock bound to given data. |
|
StrongLock |
getStrongLock(Data data,
boolean useCache)
Returns the StrongLock bound to given data. |
|
boolean |
isLocked(Data data)
Returns true if the given data is locked. |
|
void |
lock(Data data,
Member mbr)
Lock the given data for the given member. |
|
void |
onPostDelete(DBData data,
org.hibernate.event.PostDeleteEvent event,
boolean firstTime)
|
|
void |
onPostInsert(DBData data,
org.hibernate.event.PostInsertEvent event,
boolean firstTime)
|
|
void |
onPostUpdate(DBData data,
org.hibernate.event.PostUpdateEvent event,
boolean firstTime)
|
|
void |
refreshCacheEntry(Data data)
Invalidate the cache entries for the given publication |
|
void |
resetCache()
Reset the cache. |
|
void |
unlock(Data data)
Unlock the given data, without checking the member. |
|
void |
unlock(Data data,
Member mbr)
Unlock the given data |
|
void |
unlock(Data data,
Member mbr,
boolean force)
Unlock the given data |
Methods inherited from class com.jalios.jcms.db.BasicDBListener |
---|
getAdateFromState, getAuthorIdFromState, getCdateFromState, getEdateFromState, getMdateFromState, getPdateFromState, getPrePstatus, getPrePstatus, getPstatusFromState, hasNoChange, hasNoChange, init, onPreUpdate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
public static final String CACHE_ENABLED_PROP
public static final String CACHE_MAX_ENTRIES_PROP
public static final String DATA_ID_FIELD
Method Detail |
---|
public static StrongLockManager getInstance()
public StrongLock getStrongLock(Data data)
data
- the data
public StrongLock getStrongLock(Data data, boolean useCache)
data
- the datauseCache
- indicate if the cache can be used.
public boolean isLocked(Data data)
data
- the data
public <T extends Data> Set<T> getLockedDataSet(Class<T> clazz)
clazz
- the class
public <T extends Data> Set<T> getLockedDataSet(Class<T> clazz, boolean useCache)
clazz
- the classuseCache
- use the cache if true
public void lock(Data data, Member mbr)
data
- the datambr
- the member who puts the lock.public void unlock(Data data, Member mbr)
data
- the datambr
- the member who releases the lock
(only the member who has locked and the admin
can release the lock).public void unlock(Data data)
data
- the datapublic void unlock(Data data, Member mbr, boolean force)
data
- the datambr
- the member who releases the lockforce
- if false only the member who has locked and the admin can release the lock.public boolean checkLockMember(Data data, Member mbr)
data
- the datambr
- the member
public String getLockInfo(Data data, Locale locale)
data
- the datalocale
- the locale
public boolean canRequestLock(Data data, Member mbr)
data
- the datambr
- the member who request the lock
public void resetCache()
public void refreshCacheEntry(Data data)
data
- the publication idpublic void onPostInsert(DBData data, org.hibernate.event.PostInsertEvent event, boolean firstTime)
onPostInsert
in interface DBListener
onPostInsert
in class BasicDBListener
DBListener.onPostInsert(DBData, PostInsertEvent, boolean)
public void onPostUpdate(DBData data, org.hibernate.event.PostUpdateEvent event, boolean firstTime)
onPostUpdate
in interface DBListener
onPostUpdate
in class BasicDBListener
DBListener.onPostUpdate(DBData, PostUpdateEvent, boolean)
public void onPostDelete(DBData data, org.hibernate.event.PostDeleteEvent event, boolean firstTime)
onPostDelete
in interface DBListener
onPostDelete
in class BasicDBListener
DBListener.onPostDelete(DBData, PostDeleteEvent, boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |