Package io.opencensus.common
Interface NonThrowingCloseable
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Subinterfaces:
Scope
- All Known Implementing Classes:
CurrentSpanUtils.ScopeInSpan,CurrentTagMapUtils.WithTagMap,NoopScope,NoopScope
@Deprecated public interface NonThrowingCloseable extends java.io.CloseableDeprecated.Scopeis a better match for operations involving the current context.AnCloseablewhich cannot throw a checked exception.This is useful because such a reversion otherwise requires the caller to catch the (impossible) Exception in the try-with-resources.
Example of usage:
try (NonThrowingAutoCloseable ctx = tryEnter()) { ... }- Since:
- 0.5
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.
-