public class FileLockFactory extends Object
T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
Modifier and Type | Method and Description |
---|---|
int |
getDefaultLockTimeout()
Get the maximum time to wait for a lock for.
|
static FileLockFactory |
getInstance()
Get the shared factory instance.
|
FileLock |
getLock(String name)
Create a named lock with the default timeout value.
|
FileLock |
getLock(String name,
Integer timeout)
Create a named lock.
|
void |
setDefaultLockTimeout(int lockTimeout)
Set the maximum time to wait for a lock for.
|
public static FileLockFactory getInstance()
public FileLock getLock(String name, Integer timeout) throws IOException
name
- the lock name (ID).timeout
- the maximum time to wait for the lock.IOException
- when the file the lock is being created on can not be
created.public FileLock getLock(String name) throws IOException
name
- the lock name (ID).IOException
- when the file the lock is being created on can not be
created.public int getDefaultLockTimeout()
public void setDefaultLockTimeout(int lockTimeout)
lockTimeout
- the lock time out in milliseconds.