Skip to content

Commit 28b6755

Browse files
committed
rename ThreadScope to RequestScope
1 parent e9d82f9 commit 28b6755

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

jooby/src/main/java/io/jooby/ThreadScope.java renamed to jooby/src/main/java/io/jooby/RequestScope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import java.util.HashMap;
44
import java.util.Map;
55

6-
public class ThreadScope {
6+
public class RequestScope {
77

88
private static final ThreadLocal<Map<Object, Object>> CONTEXT_TL = new ThreadLocal<>();
99

‎modules/jooby-jdbi/src/main/java/io/jooby/internal/jdbi/HandleProvider.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.jooby.internal.jdbi;
22

3-
import io.jooby.ThreadScope;
3+
import io.jooby.RequestScope;
44
import org.jdbi.v3.core.Handle;
55
import org.jdbi.v3.core.Jdbi;
66

@@ -14,7 +14,7 @@ public HandleProvider(Jdbi jdbi) {
1414
}
1515

1616
@Override public Handle get() {
17-
Handle handle = ThreadScope.get(jdbi);
17+
Handle handle = RequestScope.get(jdbi);
1818
if (handle == null) {
1919
handle = jdbi.open();
2020
}

‎modules/jooby-jdbi/src/main/java/io/jooby/jdbi/TransactionalRequest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import io.jooby.Route;
44
import io.jooby.Route.Decorator;
55
import io.jooby.ServiceKey;
6-
import io.jooby.ThreadScope;
6+
import io.jooby.RequestScope;
77
import org.jdbi.v3.core.Handle;
88
import org.jdbi.v3.core.Jdbi;
99

@@ -25,10 +25,10 @@ public TransactionalRequest() {
2525
return ctx -> {
2626
Jdbi jdbi = ctx.require(key);
2727
try(Handle handle = jdbi.open()) {
28-
ThreadScope.bind(jdbi, handle);
28+
RequestScope.bind(jdbi, handle);
2929
return handle.inTransaction(h -> next.apply(ctx));
3030
} finally {
31-
ThreadScope.unbind(jdbi);
31+
RequestScope.unbind(jdbi);
3232
}
3333
};
3434
}

0 commit comments

Comments
 (0)