This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-4.4.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.4.x by this push:
new a3cf1fa38ce CAMEL-20820: camel-core - Duplicate JMX MBean operation
for resource endpoints
a3cf1fa38ce is described below
commit a3cf1fa38ceda22f34528c8256ff84a96b1b21cd
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri May 31 11:56:12 2024 +0200
CAMEL-20820: camel-core - Duplicate JMX MBean operation for resource
endpoints
---
.../api/management/mbean/ManagedResourceEndpointMBean.java | 5 ++++-
.../java/org/apache/camel/component/ResourceEndpoint.java | 11 +++--------
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git
a/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedResourceEndpointMBean.java
b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedResourceEndpointMBean.java
index f5dcaa5f60c..bf29112cae8 100644
---
a/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedResourceEndpointMBean.java
+++
b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedResourceEndpointMBean.java
@@ -30,13 +30,16 @@ public interface ManagedResourceEndpointMBean {
@ManagedAttribute(description = "Endpoint service state")
String getState();
+ @ManagedAttribute(description = "Whether the context map is limited to
only include the message body and headers")
+ boolean isAllowContextMapAll();
+
@ManagedAttribute(description = "Whether the content is cached")
boolean isContentCache();
@ManagedAttribute(description = "Whether the content is cached")
void setContentCache(boolean contentCache);
- @ManagedOperation(description = "Clears the content cache")
+ @ManagedOperation(description = "Clears the cached resource, forcing to
re-load the resource on next request")
void clearContentCache();
}
diff --git
a/core/camel-support/src/main/java/org/apache/camel/component/ResourceEndpoint.java
b/core/camel-support/src/main/java/org/apache/camel/component/ResourceEndpoint.java
index 30a24b267d1..f89b29e42c8 100644
---
a/core/camel-support/src/main/java/org/apache/camel/component/ResourceEndpoint.java
+++
b/core/camel-support/src/main/java/org/apache/camel/component/ResourceEndpoint.java
@@ -22,8 +22,6 @@ import java.io.IOException;
import java.io.InputStream;
import org.apache.camel.Component;
-import org.apache.camel.api.management.ManagedAttribute;
-import org.apache.camel.api.management.ManagedOperation;
import org.apache.camel.api.management.ManagedResource;
import org.apache.camel.api.management.mbean.ManagedResourceEndpointMBean;
import org.apache.camel.spi.Metadata;
@@ -112,13 +110,11 @@ public abstract class ResourceEndpoint extends
ProcessorEndpoint implements Mana
}
@Override
- @ManagedAttribute(description = "Whether the resource is cached")
public boolean isContentCache() {
return contentCache;
}
@Override
- @ManagedOperation(description = "Clears the cached resource, forcing to
re-load the resource on next request")
public void clearContentCache() {
log.debug("Clearing resource: {} from the content cache", resourceUri);
buffer = null;
@@ -128,7 +124,9 @@ public abstract class ResourceEndpoint extends
ProcessorEndpoint implements Mana
return buffer == null;
}
- @ManagedAttribute(description = "Whether the context map is limited to
only include the message body and headers")
+ /**
+ * Whether the context map is limited to only include the message body and
headers
+ */
public boolean isAllowContextMapAll() {
return allowContextMapAll;
}
@@ -143,19 +141,16 @@ public abstract class ResourceEndpoint extends
ProcessorEndpoint implements Mana
}
@Override
- @ManagedAttribute(description = "Camel context ID")
public String getCamelId() {
return getCamelContext().getName();
}
@Override
- @ManagedAttribute(description = "Camel ManagementName")
public String getCamelManagementName() {
return getCamelContext().getManagementName();
}
@Override
- @ManagedAttribute(description = "Endpoint service state")
public String getState() {
return getStatus().name();
}