From e16be9c50d7ae6fdf58c25d8997d4304e9de4869 Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Thu, 22 Apr 2021 19:56:01 -0400 Subject: [PATCH] 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 --- .../context/catalog/SimpleFunctionRegistry.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/SimpleFunctionRegistry.java b/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/SimpleFunctionRegistry.java index b436782dc..f2492aa74 100644 --- a/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/SimpleFunctionRegistry.java +++ b/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/SimpleFunctionRegistry.java @@ -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"); * 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 * 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 * of stream will be refactored to address this. */ @@ -366,6 +365,14 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect this.skipOutputConversion = skipOutputConversion; } + public Function getEnhancer() { + return this.enhancer; + } + + public void setEnhancer(Function enhancer) { + this.enhancer = enhancer; + } + public Object getTarget() { return target; }