Interface NonThrowingCloseable

All Superinterfaces:
AutoCloseable, Closeable
All Known Subinterfaces:
Scope
All Known Implementing Classes:
CurrentSpanUtils.ScopeInSpan, CurrentTagMapUtils.WithTagMap, NoopScope, NoopScope

@Deprecated public interface NonThrowingCloseable extends Closeable
Deprecated.
Scope is a better match for operations involving the current context.
An Closeable which 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

    Modifier and Type
    Method
    Description
    void
    Deprecated.