Package org.drasyl.util
Class ReferenceCountUtil
java.lang.Object
org.drasyl.util.ReferenceCountUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Try to callReferenceCounted.release()
if the specified message implementsReferenceCounted
and is not already released.static void
Try to callReferenceCounted.release()
if the specified message implementsReferenceCounted
and is not already released.
-
Method Details
-
release
Try to callReferenceCounted.release()
if the specified message implementsReferenceCounted
and is not already released. If the specified message doesn't implementReferenceCounted
, this method does nothing. -
safeRelease
Try to callReferenceCounted.release()
if the specified message implementsReferenceCounted
and is not already released. If the specified message doesn't implementReferenceCounted
, this method does nothing. Unlikerelease(Object)
this method catches an exception raised byReferenceCounted.release()
and logs it, rather than rethrowing it to the caller. It is usually recommended to userelease(Object)
instead, unless you absolutely need to swallow an exception.
-