@@ -36,10 +36,10 @@ public void injectServices(ServiceRegistryImplementor serviceRegistry) {
36
36
37
37
@ Override
38
38
public <T > void put (Key <T > key , T instance ) {
39
- final ContextInternal context = ContextInternal . current ();
39
+ final io . vertx . core . Context context = Vertx . currentContext ();
40
40
if ( context != null ) {
41
41
if ( trace ) LOG .tracef ( "Putting key,value in context: [%1$s, %2$s]" , key , instance );
42
- context .localContextData (). put ( key , instance );
42
+ context .putLocal ( key , instance );
43
43
}
44
44
else {
45
45
if ( trace ) LOG .tracef ( "Context is null for key,value: [%1$s, %2$s]" , key , instance );
@@ -49,10 +49,9 @@ public <T> void put(Key<T> key, T instance) {
49
49
50
50
@ Override
51
51
public <T > T get (Key <T > key ) {
52
- final ContextInternal context = ContextInternal . current ();
52
+ final io . vertx . core . Context context = Vertx . currentContext ();
53
53
if ( context != null ) {
54
- @ SuppressWarnings ("unchecked" )
55
- T local = (T ) context .localContextData ().get ( key );
54
+ T local = context .getLocal ( key );
56
55
if ( trace ) LOG .tracef ( "Getting value %2$s from context for key %1$s" , key , local );
57
56
return local ;
58
57
}
@@ -64,9 +63,9 @@ public <T> T get(Key<T> key) {
64
63
65
64
@ Override
66
65
public void remove (Key <?> key ) {
67
- final ContextInternal context = ContextInternal . current ();
66
+ final io . vertx . core . Context context = Vertx . currentContext ();
68
67
if ( context != null ) {
69
- boolean removed = context .localContextData (). remove ( key ) != null ;
68
+ boolean removed = context .removeLocal ( key );
70
69
if ( trace ) LOG .tracef ( "Key %s removed from context: %s" , key , removed );
71
70
}
72
71
else {
0 commit comments