summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-10 21:48:39 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-10 21:48:39 +0000
commit92a0cc9733acd10605420a90ed03098fbb7d4423 (patch)
tree2c4c50e3ee4510b28b03823f5aa628b14ced2017 /sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java
parent900d8f5b8d0ffbb2bf264d03d54771ace331a62c (diff)
Allow the customization of receiverAddress
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@921584 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java')
-rw-r--r--sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java b/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java
index a3d33f8235..2e8cf741b6 100644
--- a/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java
+++ b/sca-java-2.x/trunk/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java
@@ -68,6 +68,7 @@ public class ReplicatedEndpointRegistry extends BaseEndpointRegistry implements
private String address = MULTICAST_ADDRESS;
private String bind = null;
private int timeout = 50;
+ private String receiverAddress;
private int receiverPort = 4000;
private int receiverAutoBind = 100;
private List<URI> staticRoutes;
@@ -198,6 +199,7 @@ public class ReplicatedEndpointRegistry extends BaseEndpointRegistry implements
if (mcast != null) {
noMultiCast = Boolean.valueOf(mcast);
}
+ receiverAddress = attributes.get("receiverAddress");
String recvPort = attributes.get("receiverPort");
if (recvPort != null) {
receiverPort = Integer.parseInt(recvPort);
@@ -225,8 +227,11 @@ public class ReplicatedEndpointRegistry extends BaseEndpointRegistry implements
// Configure the receiver ports
ChannelReceiver receiver = channel.getChannelReceiver();
if (receiver instanceof ReceiverBase) {
- ((ReceiverBase)receiver).setAutoBind(receiverAutoBind);
+ if (receiverAddress != null) {
+ ((ReceiverBase)receiver).setAddress(receiverAddress);
+ }
((ReceiverBase)receiver).setPort(receiverPort);
+ ((ReceiverBase)receiver).setAutoBind(receiverAutoBind);
}
/*