This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 127a9943c48 (chores) resume-api: use constants for referring to the 
bean names
127a9943c48 is described below

commit 127a9943c48d2c9313a40482f59f1da387932ac4
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Tue Jun 28 10:23:10 2022 +0200

    (chores) resume-api: use constants for referring to the bean names
---
 .../src/main/java/org/apache/camel/resume/cache/ResumeCache.java        | 1 +
 .../src/main/java/org/apache/camel/support/resume/AdapterHelper.java    | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/core/camel-api/src/main/java/org/apache/camel/resume/cache/ResumeCache.java 
b/core/camel-api/src/main/java/org/apache/camel/resume/cache/ResumeCache.java
index a3d31fecc74..043f45bc72d 100644
--- 
a/core/camel-api/src/main/java/org/apache/camel/resume/cache/ResumeCache.java
+++ 
b/core/camel-api/src/main/java/org/apache/camel/resume/cache/ResumeCache.java
@@ -28,6 +28,7 @@ import org.apache.camel.resume.ResumeStrategy;
  * @param <K> the type of the key
  */
 public interface ResumeCache<K> {
+    String DEFAULT_NAME = "resumeCache";
 
     /**
      * If the specified key is not present, compute its value from the mapping 
function (like Java's standard Map one)
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/resume/AdapterHelper.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/resume/AdapterHelper.java
index 86b066a4667..23e6ff5fb60 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/resume/AdapterHelper.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/resume/AdapterHelper.java
@@ -55,7 +55,7 @@ public final class AdapterHelper {
         if (adapterInstance instanceof ResumeAdapter) {
             ResumeAdapter resumeAdapter = (ResumeAdapter) adapterInstance;
 
-            Object obj = context.getRegistry().lookupByName("resumeCache");
+            Object obj = 
context.getRegistry().lookupByName(ResumeCache.DEFAULT_NAME);
             if (resumeAdapter instanceof Cacheable && obj instanceof 
ResumeCache) {
                 ((Cacheable) resumeAdapter).setCache((ResumeCache<?>) obj);
             } else {

Reply via email to