public class CloseableReferenceCount extends Object
| Constructor and Description |
|---|
CloseableReferenceCount() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.ClosedChannelExceptionpublic boolean isOpen()
public int setClosed()
throws ClosedChannelException
ClosedChannelException - If someone else closes the object
before we do.public int getReferenceCount()
Copyright © 2022 Apache Software Foundation. All rights reserved.