Interface IClusterLockingService
public interface IClusterLockingService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final String
static final int
Deprecated.static final int
Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionacquireLock
(IURI uri, long validTime, long waitTime) Acquires distributed lock for the given thing.acquireLock
(IURI uri, long validTime, long waitTime, boolean newChange) Deprecated.Returns instance of any existing lock for the specified thingboolean
void
releaseLock
(IClusterLock lock) Releases previously acquired lockvoid
removeFromTLS
(IClusterLock lock) void
setLightweightLocking
(boolean value) Sets lightweight locking use.
-
Field Details
-
LOCKING_SERVICE_NAME
- See Also:
-
LOCK_MAX_WAIT_TIME
static final int LOCK_MAX_WAIT_TIME -
LOCK_MAX_TIME
static final int LOCK_MAX_TIME -
TASK_LOCK_MAX_WAIT_TIME
Deprecated. -
TASK_LOCK_MAX_TIME
Deprecated.
-
-
Method Details
-
acquireLock
Acquires distributed lock for the given thing. Lock is owned by source object. Lock will be valid specified time. If there is an active lock on the given thing this API call may wait for current lock to expire to be released up to specified waitTime.- Parameters:
uri
- of the thing to be lockedvalidTime
- time in millis the lock will be valid. 0 - indefinitewaitTime
- waiting time to acquire a lock. 0 - immediately exit if lock can not be obtained)- Returns:
- acquired lock instance or null if unable to acquire a lock
- Throws:
PortalException
-
acquireLock
@Deprecated IClusterLock acquireLock(IURI uri, long validTime, long waitTime, boolean newChange) throws PortalException Deprecated.- Parameters:
uri
-validTime
-waitTime
-newChange
-- Returns:
- Throws:
PortalException
-
removeFromTLS
- Parameters:
lock
-
-
releaseLock
Releases previously acquired lock- Parameters:
lock
- to be released- Throws:
PortalException
-
getLock
Returns instance of any existing lock for the specified thing- Parameters:
uri
- uri of the thing to return lock for- Returns:
- active lock instance or null if not does not exist
- Throws:
PortalException
-
isLightweightLocking
boolean isLightweightLocking()- Returns:
- whether lock service uses lightweight locking. Can be safely used only inside single JVM, not across the cluster
-
setLightweightLocking
void setLightweightLocking(boolean value) Sets lightweight locking use. Can be safely used only inside single JVM, not across the cluster- Parameters:
value
-
-