public class ResourceTable
extends java.lang.Object
Constructor and Description |
---|
ResourceTable()
Create a resource table.
|
ResourceTable(int initialSize)
Create a resource table of a specified size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acquire(java.lang.String[] resourceNames,
int timeout)
Try to acquire a set of named locks.
|
void |
release(java.lang.String[] resourceNames)
Release a set of previously acquired locks.
|
public ResourceTable()
public ResourceTable(int initialSize)
initialSize
- a hint as to the initial capacity to make the tablepublic boolean acquire(java.lang.String[] resourceNames, int timeout) throws java.lang.InterruptedException
resourceNames
- a list of names identifying locks to be acquired.timeout
- a maximum time, in milliseconds to ait for the locks to become available.java.lang.InterruptedException
- is the method was interrupted while
waiting for the locks to become available.public void release(java.lang.String[] resourceNames)
resourceNames
- the names of the locks to be releasedCopyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.