Skip to content

Commit

Permalink
Remove yet more ContextManagers references.
Browse files Browse the repository at this point in the history
Signed-off-by: Sjoerd Talsma <[email protected]>
  • Loading branch information
sjoerdtalsma committed Nov 30, 2024
1 parent 48be034 commit 0d05ae9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
* ensuring that all context values are set in that other thread.
*
* <p>
* A snapshot can be obtained from the {@code ContextManagers} utility class for interaction with all registered
* {@link ContextManager} implementations.
* A snapshot can be obtained from {@linkplain #capture()} method.
*
* <p>
* This library contains several utility classes named {@code ContextAware...} or {...WithContext} that will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private ContextSnapshotImpl() {
}
if (managers.isEmpty() && SNAPSHOT_LOGGER.isLoggable(Level.FINER)) {
final Thread currentThread = Thread.currentThread();
SNAPSHOT_LOGGER.finer(this + " was created but no ContextManagers were found! Thread="
SNAPSHOT_LOGGER.finer(this + " was created but no context managers were found! Thread="
+ currentThread.getName() + ", ContextClassLoader=" + currentThread.getContextClassLoader());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,6 @@
* </ul>
* </ul>
*
* <h2>{@linkplain nl.talsmasoftware.context.core.ContextManagers ContextManagers}</h2>
* <p>
* Utility class to interact with all detected {@linkplain nl.talsmasoftware.context.api.ContextManager ContextManager}
* implementations at once, combining all
* their {@linkplain nl.talsmasoftware.context.api.ContextManager#getActiveContextValue() active context values}
* into a single {@linkplain nl.talsmasoftware.context.api.ContextSnapshot context snapshot} that can be reactivated
* in another thread.
* <p>
* Although this utility class is public and it is allowed to interact with it,
* it is advised to use one of the <em>ContextAware..</em> or <em>..WithContext</em> classes instead.<br>
* They make it much easier to close the reactivated snapshot again in a proper manner.
*
* @author Sjoerd Talsma
*/
package nl.talsmasoftware.context.core;
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
*
* <p>
* There is no need to instantiate the context manager yourself.
* Including it on the classpath will allow the {@code ContextManagers} class to detect it automatically.
* Including it on the classpath will allow the API to automatically include it in
* {@linkplain nl.talsmasoftware.context.api.ContextSnapshot context snapshots}.
*/
public class OpenTelemetryContextManager implements ContextManager<io.opentelemetry.context.Context> {
private static final OpenTelemetryContextManager INSTANCE = new OpenTelemetryContextManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ private static String readVersion() {
}

private static boolean mustTrace(Class<?> type) {
return ContextSnapshot.class.isAssignableFrom(type)
|| "nl.talsmasoftware.context.core.ContextManagers".equals(type.getName());
return ContextSnapshot.class.isAssignableFrom(type);
}
}

0 comments on commit 0d05ae9

Please sign in to comment.