GH-689: Native compilation related changes

Provide mutator/accessor for enhancer filed in FunctionInvocationWrapper
in SimpleFunctionRegistry. This is required by graalvm native compilation in
Spring Cloud Stream applications.

Resolves https://github.com/spring-cloud/spring-cloud-function/issues/689
This commit is contained in:
Soby Chacko
2021-04-22 19:56:01 -04:00
parent 5e824f33aa
commit e16be9c50d

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2019-2020 the original author or authors. * Copyright 2019-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -330,7 +330,6 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
/* /*
* This is primarily to support Stream's ability to access * This is primarily to support Stream's ability to access
* un-converted payload (e.g., to evaluate expression on some attribute of a payload) * un-converted payload (e.g., to evaluate expression on some attribute of a payload)
* It does not have a setter/getter and can only be set via reflection.
* It is not intended to remain here and will be removed as soon as particular elements * It is not intended to remain here and will be removed as soon as particular elements
* of stream will be refactored to address this. * of stream will be refactored to address this.
*/ */
@@ -366,6 +365,14 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
this.skipOutputConversion = skipOutputConversion; this.skipOutputConversion = skipOutputConversion;
} }
public Function<Object, Message> getEnhancer() {
return this.enhancer;
}
public void setEnhancer(Function<Object, Message> enhancer) {
this.enhancer = enhancer;
}
public Object getTarget() { public Object getTarget() {
return target; return target;
} }