Interface IObjectLockManager
-
- All Known Implementing Classes:
ObjectLockManager
public interface IObjectLockManagerDefines the object lock manager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StatisticCountergetIgnoreLockStatistic()Get the ignore object lock statisticStatisticCountergetLockStatistic()Get the object lock statisticlonggetNumberOfLockSizeReached()Get the count of how many times the max lock size was reachedStatisticCountergetUnlockStatistic()Get the object unlock statistic<L extends java.io.Serializable>
java.util.List<L>lock(java.util.List<L> theObjectLockList)Locks a list of objects inside the same JVM.voidreleaseResource()Release all object locks and resourcesIObjectLockManagersetObjectLockSize(java.lang.Integer size)Sets the size of the object lockIObjectLockManagersetUnlockTimeout(java.lang.Long timeout)Sets the unlock timeout which defines how long an element can't be blocked again after an unlock<L extends java.io.Serializable>
java.util.List<L>unlock(java.util.List<L> theObjectLockList)Unlock a list of objects inside the same JVM.
-
-
-
Method Detail
-
setObjectLockSize
IObjectLockManager setObjectLockSize(java.lang.Integer size)
Sets the size of the object lock- Parameters:
size- the object lock size (positive number) or null- Returns:
- the instance
-
setUnlockTimeout
IObjectLockManager setUnlockTimeout(java.lang.Long timeout)
Sets the unlock timeout which defines how long an element can't be blocked again after an unlock- Parameters:
timeout- the unlock timeout (positive number) or null- Returns:
- the instance
-
lock
<L extends java.io.Serializable> java.util.List<L> lock(java.util.List<L> theObjectLockList)
Locks a list of objects inside the same JVM.- Type Parameters:
L- the object lock type- Parameters:
theObjectLockList- the list of objects to lock- Returns:
- Returns only the successfully locked objects. It returns in all cases a list but it doesn't throws any exceptions!
-
unlock
<L extends java.io.Serializable> java.util.List<L> unlock(java.util.List<L> theObjectLockList)
Unlock a list of objects inside the same JVM.- Type Parameters:
L- the object lock type- Parameters:
theObjectLockList- the list of objects to unlock- Returns:
- the list of objects to unlock
-
releaseResource
void releaseResource()
Release all object locks and resources
-
getLockStatistic
StatisticCounter getLockStatistic()
Get the object lock statistic- Returns:
- the object lock statistic
-
getUnlockStatistic
StatisticCounter getUnlockStatistic()
Get the object unlock statistic- Returns:
- the object unlock statistic
-
getIgnoreLockStatistic
StatisticCounter getIgnoreLockStatistic()
Get the ignore object lock statistic- Returns:
- the ignore object lock statistic
-
getNumberOfLockSizeReached
long getNumberOfLockSizeReached()
Get the count of how many times the max lock size was reached- Returns:
- the count of how many times the max lock size was reached
-
-