public class CloseableReferenceCount
extends java.lang.Object
| Constructor | Description |
|---|---|
CloseableReferenceCount() |
| Modifier and Type | Method | 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 java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelException - If the status is closed.public boolean unreference()
public void unreferenceCheckClosed()
throws java.nio.channels.ClosedChannelException
java.nio.channels.AsynchronousCloseException - If the status is closed.java.nio.channels.ClosedChannelExceptionpublic boolean isOpen()
public int setClosed()
throws java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelException - If someone else closes the object
before we do.public int getReferenceCount()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.