Class ReferenceCountedResource
java.lang.Object
org.apache.dubbo.common.reference.ReferenceCountedResource
- All Implemented Interfaces:
AutoCloseable
inspired by Netty
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()Useful when used together with try-with-resources patternfinal booleanrelease()Decreases the reference count by 1 and calls} if the reference count reaches 0.invalid @link
{@link this#destroyfinal ReferenceCountedResourceretain()Increments the reference count by 1.
-
Constructor Details
-
ReferenceCountedResource
public ReferenceCountedResource()
-
-
Method Details
-
retain
Increments the reference count by 1. -
release
public final boolean release()Decreases the reference count by 1 and calls} if the reference count reaches 0.invalid @link
{@link this#destroy -
close
public final void close()Useful when used together with try-with-resources pattern- Specified by:
closein interfaceAutoCloseable
-