@@ -32,15 +32,11 @@ public void injectServices(ServiceRegistryImplementor serviceRegistry) {
32
32
vertxInstance = serviceRegistry .getService ( VertxInstance .class );
33
33
}
34
34
35
- static ContextInternal currentContext () {
36
- return (ContextInternal ) Vertx .currentContext ();
37
- }
38
-
39
35
@ Override
40
36
public <T > void put (Key <T > key , T instance ) {
41
- final ContextInternal context = currentContext ();
37
+ final io . vertx . core . Context context = Vertx . currentContext ();
42
38
if ( context != null ) {
43
- context .localContextData (). put ( key , instance );
39
+ context .put ( key , instance );
44
40
}
45
41
else {
46
42
throw LOG .notVertxContextActive ();
@@ -50,9 +46,9 @@ public <T> void put(Key<T> key, T instance) {
50
46
@ Override
51
47
@ SuppressWarnings ("unchecked" )
52
48
public <T > T get (Key <T > key ) {
53
- final ContextInternal context = currentContext ();
49
+ final io . vertx . core . Context context = Vertx . currentContext ();
54
50
if ( context != null ) {
55
- return (T ) context .localContextData (). get ( key );
51
+ return (T ) context .get ( key );
56
52
}
57
53
else {
58
54
return null ;
@@ -61,9 +57,9 @@ public <T> T get(Key<T> key) {
61
57
62
58
@ Override
63
59
public void remove (Key <?> key ) {
64
- final ContextInternal context = currentContext ();
60
+ final io . vertx . core . Context context = Vertx . currentContext ();
65
61
if ( context != null ) {
66
- context .localContextData (). remove ( key );
62
+ context .remove ( key );
67
63
}
68
64
}
69
65
0 commit comments