Skip to content

Commit 946149e

Browse files
committed
slightly improve some javadoc
because I really am this anal
1 parent 83f8b8f commit 946149e

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/context/Context.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ public interface Context extends Executor, Service {
4444
@Override
4545
void execute(Runnable runnable);
4646

47-
interface Key<T> {
48-
49-
}
50-
47+
/**
48+
* An object that identifies something we store in the Vert.x
49+
* local context, usually a {@code Session} or
50+
* {@code StatelessSession}, but in principle anything at all.
51+
*
52+
* @param <T> the type of thing we're storing in the context
53+
*/
54+
interface Key<T> {}
5155
}

hibernate-reactive-core/src/main/java/org/hibernate/reactive/context/impl/BaseKey.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111

1212
/**
1313
* Implementation of {@link Context.Key} suitable for storing
14-
* Session, StatelessSession or other type instances in the
15-
* Vert.x context.
14+
* instances of {@code Session} or {@code StatelessSession},
15+
* or really anything at all, in the Vert.x context.
16+
*
1617
* @param <T> the type of object being stored in the Context.
1718
*/
1819
public final class BaseKey<T> implements Context.Key<T> {

hibernate-reactive-core/src/main/java/org/hibernate/reactive/context/impl/MultitenantKey.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@
1010
import org.hibernate.reactive.context.Context;
1111

1212
/**
13-
* Implementation of {@link Context.Key} suitable for the
14-
* use case with multi-tenancy.
15-
* This wraps the {@link BaseKey} of the same type, allowing
16-
* instance reuse for efficiency.
13+
* Implementation of {@link Context.Key} suitable for use with
14+
* multi-tenancy. In a multi-tenant environment, anything we
15+
* store in the Vert.x context is keyed not only by its type,
16+
* but also by the tenant id.
17+
* <p>
18+
* An instance of this class wraps a {@link BaseKey} of the same
19+
* type, allowing instance reuse for efficiency.
20+
*
1721
* @param <T> the type of object being stored in the Context.
1822
*/
1923
public final class MultitenantKey<T> implements Context.Key<T> {

0 commit comments

Comments
 (0)