|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.elasticsearch.common.util.concurrent.resource.BlockingAcquirableResource<T>
public class BlockingAcquirableResource<T extends Releasable>
A wrapper around a resource that can be released. Note, release should not be called directly on the resource itself.
Yea, I now, the fact that the resource itself is releasable basically means that users of this class should take care... .
| Constructor Summary | |
|---|---|
BlockingAcquirableResource(T resource)
|
|
| Method Summary | |
|---|---|
boolean |
acquire()
Acquires the resource, returning true if it was acquired. |
void |
forceClose()
Forces the resource to be closed, regardless of the number of acquirers. |
void |
markForClose()
Marks the resource to be closed. |
void |
release()
Releases the resource, will close it if there are no more acquirers. |
T |
resource()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BlockingAcquirableResource(T resource)
| Method Detail |
|---|
public T resource()
resource in interface AcquirableResource<T extends Releasable>public boolean acquire()
acquire in interface AcquirableResource<T extends Releasable>public void release()
release in interface AcquirableResource<T extends Releasable>public void markForClose()
markForClose in interface AcquirableResource<T extends Releasable>public void forceClose()
AcquirableResource
forceClose in interface AcquirableResource<T extends Releasable>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||