Skip to content

Commit

Permalink
Fix some typos, dead links and formatting issues (#519)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcono1234 <[email protected]>
  • Loading branch information
Marcono1234 authored Nov 18, 2024
1 parent d8f77d5 commit 21327df
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 39 deletions.
6 changes: 3 additions & 3 deletions context-propagation-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ Add the following dependency to your classpath:

## Applicability

By far the easiest use of the context propagation libary is using the
By far the easiest use of the context propagation library is using the
[`ContextAwareExecutorService`][ContextAwareExecutorService].

If that is not a possibility, the following java functional interface wrappers
in this java 8 module may be of help to you:

## Functional interfaces

The easiest use of the context propagation libary is using the
The easiest use of the context propagation library is using the
[`ContextAwareExecutorService`][ContextAwareExecutorService].

If that is not a possibility, you can use the following java functional interface wrappers
Expand Down Expand Up @@ -80,7 +80,7 @@ test cases that demonstrate the behaviour of this complex class.
### Caveats

Please be aware that:
1. in almost all circumstances it's preferrable
1. in almost all circumstances it's preferable
to choose `ContextAwareExecutorService` over `ContextAwareCompletableFuture`.
2. neither the standard `CompletableFuture` nor this context-aware version
will attempt to cancel or interrupt an ongoing process when cancelled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static ContextSnapshot createContextSnapshot() {
final ContextSnapshotImpl result = new ContextSnapshotImpl(managers, values);
if (managers.isEmpty() && LOGGER.isLoggable(Level.FINER)) {
LOGGER.finer(result + " was created but no ContextManagers were found! "
+ " Thead=" + Thread.currentThread()
+ " Thread=" + Thread.currentThread()
+ ", ContextClassLoader=" + Thread.currentThread().getContextClassLoader());
}
Timers.timed(System.nanoTime() - start, ContextManagers.class, "createContextSnapshot", null);
Expand Down
24 changes: 12 additions & 12 deletions managers/context-manager-locale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ allowing a configured `Locale` to be propagated.
## How to use this module

1. Add it to your classpath.
```xml
<dependency>
<groupId>nl.talsmasoftware.context</groupId>
<artifactId>locale-context</artifactId>
<version>[see Maven badge above]</version>
</dependency>
```
```xml
<dependency>
<groupId>nl.talsmasoftware.context</groupId>
<artifactId>locale-context</artifactId>
<version>[see Maven badge above]</version>
</dependency>
```
2. Make sure to use the `ContextAwareExecutorService` as your threadpool.
3. Set the current Locale for some block of code:
```java
Expand All @@ -28,11 +28,11 @@ allowing a configured `Locale` to be propagated.
}
```
4. Use the LocaleContext anywhere in your application:
```java
private void someMethod() {
Locale locale = LocaleContextManager.getCurrentLocaleOrDefault();
}
```
```java
private void someMethod() {
Locale locale = LocaleContextManager.getCurrentLocaleOrDefault();
}
```


[maven-img]: https://img.shields.io/maven-central/v/nl.talsmasoftware.context/locale-context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static Locale getOrDefault() {
* Sets the current locale on the current thread until {@linkplain Context#close()} is called.
*
* @param locale The locale to become the current locale.
* @return The context to restore the previous locale with upon {@code close()}.
* @return The context to restore the previous locale upon {@code close()}.
*/
public static Context<Locale> set(Locale locale) {
return new LocaleContext(locale);
Expand Down
2 changes: 1 addition & 1 deletion managers/context-manager-opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ default OpenTelemetry Context storage.

Obtaining the current context value is delegated to
`io.opentelemetry.context.Context.current()`.
Intializing a new context value is delegated to
Initializing a new context value is delegated to
`io.opentelemetry.context.Context.makeCurrent()`.

Adding the `context-manager-opentelemetry` jar to the classpath
Expand Down
14 changes: 7 additions & 7 deletions managers/context-manager-servletrequest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ if the `ServletRequestContextFilter` was applied to the inbound request.
## How to use this library

1. Add it to your classpath.
```xml
<dependency>
<groupId>nl.talsmasoftware.context</groupId>
<artifactId>servletrequest-propagation</artifactId>
<version>[see Maven badge above]</version>
</dependency>
```
```xml
<dependency>
<groupId>nl.talsmasoftware.context</groupId>
<artifactId>servletrequest-propagation</artifactId>
<version>[see Maven badge above]</version>
</dependency>
```

2. Include the `ServletRequestContextFilter` in your application.

Expand Down
28 changes: 14 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
> This is the development branch for the v2 version of this library.
> All breaking changes to the library must go in this branch.
> - Java version bumped to Java8 mimimum
> - Java version bumped to Java8 minimum
> - `ContextManager.getActiveContext()` replaced by `getActiveContextValue()`.
> - `ContextManager.clear()` will require an implementation.
> - All `@Deprecated(forRemoval=true)` is to be removed.
Expand All @@ -36,7 +36,7 @@ cleanup after execution finishes:

Abstraction containing a value in the context of a _thread_.
The most common implementation in Java is a ThreadLocal value.
The library provies an `AbstractThreadLocalContext` base class
The library provides an `AbstractThreadLocalContext` base class
that features nesting values and predictable behaviour for out-of-order closing.

For each context type, there can only be one _active_ context per thread at any time.
Expand Down Expand Up @@ -107,7 +107,7 @@ out of the box by this context-propagation library:
## Custom contexts

Adding your own `Context` type is possible
by [creating your own context manager](context-propagation/README.md#creating-your-own-context-manager).
by [creating your own context manager](context-propagation-api/README.md#creating-your-own-context-manager).

## Building jars with dependencies

Expand All @@ -117,7 +117,7 @@ provider configuration files under `META-INF/services` are either preserved or
merged. Otherwise Java's `ServiceLoader` will not be able to find the context
implementations of this library.

In case your are using the Maven Shade Plugin, you can use the
In case you are using the Maven Shade Plugin, you can use the
[`ServicesResourceTransformer`](https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#ServicesResourceTransformer)
for this task.

Expand All @@ -134,7 +134,7 @@ On a development machine, you can get timing for each snapshot by turning on log
for `nl.talsmasoftware.context.core.Timers` at `FINEST` or `TRACE` level
(depending on your logger of choice).
Please **do not** turn this on in production as the logging overhead will most likely
have a noticable impact on your application.
have a noticeable impact on your application.

### Metrics reporting

Expand Down Expand Up @@ -165,15 +165,15 @@ configure various timers in the global default metric registry of your applicati
[javadoc]: https://www.javadoc.io/doc/nl.talsmasoftware.context/context-propagation-root


[servletrequest propagation]: servletrequest-propagation
[slf4j mdc propagation]: slf4j-propagation
[log4j2 thread context propagation]: log4j2-propagation
[locale context]: locale-context
[spring security context]: spring-security-context
[opentracing span propagation]: opentracing-span-propagation
[context propagation metrics]: context-propagation-metrics
[context propagation micrometer]: context-propagation-micrometer
[servletrequest propagation]: managers/context-manager-servletrequest
[slf4j mdc propagation]: managers/context-manager-slf4j
[log4j2 thread context propagation]: managers/context-manager-log4j2
[locale context]: managers/context-manager-locale
[spring security context]: managers/context-manager-spring-security
[opentracing span propagation]: managers/context-manager-opentracing
[context propagation metrics]: timers/context-timer-metrics
[context propagation micrometer]: timers/context-timer-micrometer
[micrometer]: https://micrometer.io

[ContextAwareExecutorService]: https://javadoc.io/doc/nl.talsmasoftware.context/context-propagation/latest/nl/talsmasoftware/context/executors/ContextAwareExecutorService.html
[ContextAwareCompletableFuture]: context-propagation-java8#contextawarecompletablefuture
[ContextAwareCompletableFuture]: context-propagation-core/README.md#contextawarecompletablefuture

0 comments on commit 21327df

Please sign in to comment.