|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.util.CloseableReferenceCount
public class CloseableReferenceCount
A closeable object that maintains a reference count. Once the object is closed, attempting to take a new reference will throw ClosedChannelException.
Constructor Summary | |
---|---|
CloseableReferenceCount()
|
Method Summary | |
---|---|
int |
getReferenceCount()
Get the current reference count. |
boolean |
isOpen()
Return true if the status is currently open. |
void |
reference()
Increment the reference count. |
int |
setClosed()
Mark the status as closed. |
boolean |
unreference()
Decrement the reference count. |
void |
unreferenceCheckClosed()
Decrement the reference count, checking to make sure that the CloseableReferenceCount is not closed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CloseableReferenceCount()
Method Detail |
---|
public void reference() throws ClosedChannelException
ClosedChannelException
- If the status is closed.public boolean unreference()
public void unreferenceCheckClosed() throws ClosedChannelException
AsynchronousCloseException
- If the status is closed.
ClosedChannelException
public boolean isOpen()
public int setClosed() throws ClosedChannelException
ClosedChannelException
- If someone else closes the object
before we do.public int getReferenceCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |