@@ -67,7 +67,6 @@ public JavaFunctionBroker(ClassLoaderProvider classLoaderProvider) {
67
67
} else {
68
68
this .workerObjectCache = null ;
69
69
}
70
-
71
70
}
72
71
73
72
public void loadMethod (FunctionMethodDescriptor descriptor , Map <String , BindingInfo > bindings )
@@ -112,14 +111,15 @@ private void initializeOneTimeLogics() {
112
111
synchronized (oneTimeLogicInitializationLock ) {
113
112
if (!oneTimeLogicInitialized ) {
114
113
userContextClassLoader = classLoaderProvider .createClassLoader ();
115
- oneTimeLogicInitialized = true ;
116
- initializeFunctionInstanceInjector ();
117
114
118
115
if (JAVA_ENABLE_SDK_TYPES_FLAG ) {
119
116
loadGlobalMiddlewares ();
120
117
} else {
121
118
initializeInvocationChainFactory ();
122
119
}
120
+
121
+ oneTimeLogicInitialized = true ;
122
+ initializeFunctionInstanceInjector ();
123
123
}
124
124
}
125
125
}
@@ -150,10 +150,11 @@ private void initializeInvocationChainFactory() {
150
150
}
151
151
} finally {
152
152
Thread .currentThread ().setContextClassLoader (prevContextClassLoader );
153
- ArrayList <Middleware > middlewares = new ArrayList <>(this .serviceLoadedMiddlewares );
154
- middlewares .add (getFunctionExecutionMiddleWare (userContextClassLoader ));
155
- this .invocationChainFactory = new InvocationChainFactory (middlewares );
156
153
}
154
+
155
+ ArrayList <Middleware > middlewares = new ArrayList <>(this .serviceLoadedMiddlewares );
156
+ middlewares .add (getFunctionExecutionMiddleWare (userContextClassLoader ));
157
+ this .invocationChainFactory = new InvocationChainFactory (middlewares );
157
158
}
158
159
159
160
private void initializeFunctionInstanceInjector () {
@@ -317,6 +318,4 @@ private boolean isTesting(){
317
318
public void setWorkerDirectory (String workerDirectory ) {
318
319
this .workerDirectory = workerDirectory ;
319
320
}
320
-
321
- public List <Middleware > getServiceLoadedMiddlewares () { return this .serviceLoadedMiddlewares ; }
322
321
}
0 commit comments