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.
|
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.