-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set Thread context classloder for entire middleware chain (#717)
* Set Thread context classloder for entire middleware chain * clean up code * clean up
- Loading branch information
Showing
5 changed files
with
28 additions
and
77 deletions.
There are no files selected for viewing
28 changes: 0 additions & 28 deletions
28
...main/java/com/microsoft/azure/functions/worker/broker/EnhancedJavaMethodExecutorImpl.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 16 additions & 5 deletions
21
src/main/java/com/microsoft/azure/functions/worker/broker/JavaMethodExecutor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
package com.microsoft.azure.functions.worker.broker; | ||
|
||
|
||
import java.util.*; | ||
import com.microsoft.azure.functions.worker.binding.*; | ||
|
||
|
||
/** | ||
* Used to executor of arbitrary Java method in any JAR using reflection. | ||
* Thread-Safety: Multiple thread. | ||
*/ | ||
public interface JavaMethodExecutor { | ||
void execute(ExecutionContextDataSource executionContextDataSource) throws Exception; | ||
public class JavaMethodExecutor { | ||
|
||
private static final JavaMethodExecutor INSTANCE = new JavaMethodExecutor(); | ||
|
||
public static JavaMethodExecutor getInstance(){ | ||
return INSTANCE; | ||
} | ||
|
||
private JavaMethodExecutor() {} | ||
|
||
public void execute(ExecutionContextDataSource executionContextDataSource) throws Exception { | ||
Object retValue = ParameterResolver.resolveArguments(executionContextDataSource) | ||
.orElseThrow(() -> new NoSuchMethodException("Cannot locate the method signature with the given input")) | ||
.invoke(executionContextDataSource::getFunctionInstance); | ||
executionContextDataSource.updateReturnValue(retValue); | ||
} | ||
} |
25 changes: 0 additions & 25 deletions
25
src/main/java/com/microsoft/azure/functions/worker/broker/JavaMethodExecutorImpl.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
src/main/java/com/microsoft/azure/functions/worker/broker/JavaMethodExecutors.java
This file was deleted.
Oops, something went wrong.