You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2013/09/23 06:13:42 UTC

svn commit: r1525502 - in /servicemix/smx4/features/trunk/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr: ServiceMixConsumer.java ServiceMixEndpoint.java

Author: ffang
Date: Mon Sep 23 04:13:41 2013
New Revision: 1525502

URL: http://svn.apache.org/r1525502
Log:
[SMX4-1548]add interfaceName|serviceName option for camel-nmr consumer endpoint

Modified:
    servicemix/smx4/features/trunk/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixConsumer.java
    servicemix/smx4/features/trunk/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixEndpoint.java

Modified: servicemix/smx4/features/trunk/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixConsumer.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixConsumer.java?rev=1525502&r1=1525501&r2=1525502&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixConsumer.java (original)
+++ servicemix/smx4/features/trunk/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixConsumer.java Mon Sep 23 04:13:41 2013
@@ -59,6 +59,14 @@ public class ServiceMixConsumer extends 
                                                              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;
     }
 

Modified: servicemix/smx4/features/trunk/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixEndpoint.java?rev=1525502&r1=1525501&r2=1525502&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixEndpoint.java (original)
+++ servicemix/smx4/features/trunk/camel/servicemix-camel/src/main/java/org/apache/servicemix/camel/nmr/ServiceMixEndpoint.java Mon Sep 23 04:13:41 2013
@@ -37,9 +37,13 @@ public class ServiceMixEndpoint extends 
     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 class ServiceMixEndpoint extends 
     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 class ServiceMixEndpoint extends 
     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;
+    }
 }