Package ro.sync.exml.plugin.lock
Interface LockHandler
-
- All Known Implementing Classes:
LockHandlerBase
,LockHandlerWithContext
@API(type=EXTENDABLE, src=PUBLIC) public interface LockHandler
Manage locking and unlocking.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
unlock(java.net.URL resource)
Unlock a specific resourcevoid
updateLock(java.net.URL resource, int timeoutSeconds)
Lock a specific resource if it has never been locked before or refresh the lock.
-
-
-
Method Detail
-
unlock
void unlock(java.net.URL resource) throws LockException
Unlock a specific resource- Parameters:
resource
- The URL to unlock- Throws:
LockException
- When could not unlock properly.
-
updateLock
void updateLock(java.net.URL resource, int timeoutSeconds) throws LockException
Lock a specific resource if it has never been locked before or refresh the lock. This will get called at the beginning to lock the resource and after that periodically.- Parameters:
resource
- The URL to lock.timeoutSeconds
- The timeout in seconds to set for the lock (so that the lock expires after the timeout passes). The refresh on the lock is called about every (timeout/2) seconds.- Throws:
LockException
- When could not lock properly.
-
-