[SMX4-1548]add interfaceName|serviceName option for camel-nmr consumer endpoint
git-svn-id: https://svn.apache.org/repos/asf/servicemix/smx4/features/trunk@1525502 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixConsumer.java b/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixConsumer.java
index ccb5848..5622ca1 100644
--- a/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixConsumer.java
+++ b/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixConsumer.java
@@ -59,6 +59,14 @@
getEndpoint().getEndpointName());
result.put(Endpoint.CHANNEL_SYNC_DELIVERY, getEndpoint().isSynchronous());
result.put(Endpoint.RUN_AS_SUBJECT, getEndpoint().isRunAsSubject());
+ String interfaceName = getEndpoint().getInterfaceName();
+ if (interfaceName != null && interfaceName.length() > 0) {
+ result.put(Endpoint.INTERFACE_NAME, interfaceName);
+ }
+ String serviceName = getEndpoint().getServiceName();
+ if (serviceName != null && serviceName.length() > 0) {
+ result.put(Endpoint.SERVICE_NAME, serviceName);
+ }
return result;
}
diff --git a/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixEndpoint.java b/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixEndpoint.java
index ac9efa4..57a667f 100644
--- a/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixEndpoint.java
+++ b/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixEndpoint.java
@@ -37,9 +37,13 @@
public static final String RUN_AS_SUBJECT = "runAsSubject";
private static final String TIMEOUT = "timeout";
private static final String THROW_EXCEPTION_ON_FAILURE = "throwExceptionOnFailure";
+ private static final String INTERFACE_NAME = "interfaceName";
+ private static final String SERVICE_NAME = "serviceName";
private static final Long DEFAULT_TIMEOUT = new Long(0);
private String endpointName;
+ private String interfaceName;
+ private String serviceName;
private boolean synchronous;
private boolean runAsSubject;
private boolean throwExceptionOnFailure = true;
@@ -54,6 +58,8 @@
public void configureProperties(Map<String, Object> options) {
synchronous = Boolean.valueOf((String) options.remove(SYNCHRONOUS));
runAsSubject = Boolean.valueOf((String) options.remove(RUN_AS_SUBJECT));
+ interfaceName = (String)options.remove(INTERFACE_NAME);
+ serviceName = (String)options.remove(SERVICE_NAME);
setThrowExceptionOnFailure(Boolean.valueOf((String) options.remove(THROW_EXCEPTION_ON_FAILURE)));
timeOut = parseLongOption(options, TIMEOUT);
}
@@ -119,4 +125,20 @@
public void setThrowExceptionOnFailure(boolean throwExceptionOnFailure) {
this.throwExceptionOnFailure = throwExceptionOnFailure;
}
+
+ public String getInterfaceName() {
+ return interfaceName;
+ }
+
+ public void setInterfaceName(String interfaceName) {
+ this.interfaceName = interfaceName;
+ }
+
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
}