public class Pool<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Pool.Element<T> |
Modifier and Type | Field and Description |
---|---|
protected Supplier<T> |
creator |
protected Lock[] |
locks |
protected T[] |
pool |
Constructor and Description |
---|
Pool(int capacity,
Supplier<T> creator) |
Modifier and Type | Method and Description |
---|---|
Pool.Element<T> |
get()
Gets the next available resource for which the lock can be acquired and returns it and its associated
lock, which needs to be released when the caller is done using the resource.
|
T[] |
getElements() |
int |
getNumLocked() |
static void |
main(String[] args) |
String |
toString() |
public T[] getElements()
public int getNumLocked()
public Pool.Element<T> get()
public static void main(String[] args)
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.