|
|
@ -43,9 +43,9 @@ public abstract class ApplicationContextServerWebExchangeMatcher<C>
|
|
|
|
|
|
|
|
|
|
|
|
private final Class<? extends C> contextClass;
|
|
|
|
private final Class<? extends C> contextClass;
|
|
|
|
|
|
|
|
|
|
|
|
private C context;
|
|
|
|
private volatile C context;
|
|
|
|
|
|
|
|
|
|
|
|
private Object contextLock = new Object();
|
|
|
|
private final Object contextLock = new Object();
|
|
|
|
|
|
|
|
|
|
|
|
public ApplicationContextServerWebExchangeMatcher(Class<? extends C> contextClass) {
|
|
|
|
public ApplicationContextServerWebExchangeMatcher(Class<? extends C> contextClass) {
|
|
|
|
Assert.notNull(contextClass, "Context class must not be null");
|
|
|
|
Assert.notNull(contextClass, "Context class must not be null");
|
|
|
@ -68,10 +68,12 @@ public abstract class ApplicationContextServerWebExchangeMatcher<C>
|
|
|
|
protected C getContext(ServerWebExchange exchange) {
|
|
|
|
protected C getContext(ServerWebExchange exchange) {
|
|
|
|
if (this.context == null) {
|
|
|
|
if (this.context == null) {
|
|
|
|
synchronized (this.contextLock) {
|
|
|
|
synchronized (this.contextLock) {
|
|
|
|
|
|
|
|
if (this.context == null) {
|
|
|
|
this.context = createContext(exchange);
|
|
|
|
this.context = createContext(exchange);
|
|
|
|
initialized(this.context);
|
|
|
|
initialized(this.context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return this.context;
|
|
|
|
return this.context;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|