aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjestin2012-04-26 16:20:17 +0000
committerjestin2012-04-26 16:20:17 +0000
commitc9cd13dd8ec1a636ba3e5f9cdb86e599c75fff6c (patch)
tree53f6af1584404432c73b1ea7d1dbad0d87288503
parentac8c6c0d9bb921166697e9b13009f9ff83ba9716 (diff)
downloadivy-java-c9cd13dd8ec1a636ba3e5f9cdb86e599c75fff6c.zip
ivy-java-c9cd13dd8ec1a636ba3e5f9cdb86e599c75fff6c.tar.gz
ivy-java-c9cd13dd8ec1a636ba3e5f9cdb86e599c75fff6c.tar.bz2
ivy-java-c9cd13dd8ec1a636ba3e5f9cdb86e599c75fff6c.tar.xz
Corrects a small bug on "unbind Msg" based on the regexp string. Fixes an
issue on IvyProbe, mainly, should not affect other types of agents, which shoud rely on the id returned during the bind msg.
-rwxr-xr-xsrc/IvyClient.java9
-rw-r--r--src/SelfIvyClient.java8
2 files changed, 10 insertions, 7 deletions
diff --git a/src/IvyClient.java b/src/IvyClient.java
index 17ce224..80b30b8 100755
--- a/src/IvyClient.java
+++ b/src/IvyClient.java
@@ -183,9 +183,12 @@ public class IvyClient extends Thread {
private void sendSchizo() throws IOException {
traceDebug("sending our service port "+bus.getAppPort());
Map<Integer,String> tosend=bus.getSelfIvyClient().regexpsText;
- sendString(SchizoToken,bus.getAppPort(),bus.getAppName());
- for (Integer ikey : tosend.keySet()) sendRegexp(ikey.intValue(),tosend.get(ikey));
- sendString( EndRegexp,0,"");
+ synchronized (tosend) {
+ sendString(SchizoToken,bus.getAppPort(),bus.getAppName());
+ for (Map.Entry<Integer,String> me : tosend.entrySet())
+ sendRegexp( me.getKey().intValue() , me.getValue() );
+ sendString( EndRegexp,0,"");
+ }
}
public String toString() {
diff --git a/src/SelfIvyClient.java b/src/SelfIvyClient.java
index 3e9ba6a..2cfc016 100644
--- a/src/SelfIvyClient.java
+++ b/src/SelfIvyClient.java
@@ -83,11 +83,11 @@ public class SelfIvyClient extends IvyClient {
// unbinds to the first regexp
protected synchronized boolean unBindMsg(String re) {
synchronized (regexpsText) {
- if (regexpsText.get(re) == null) return false;
- for (Integer k : regexpsText.keySet()) {
- if ( (regexpsText.get(k)).compareTo(re) == 0) {
+ if (!regexpsText.containsValue(re)) return false;
+ for (Map.Entry<Integer,String> me : regexpsText.entrySet()) {
+ if ( me.getValue().equals(re) ) {
try {
- bus.unBindMsg(k.intValue());
+ bus.unBindMsg(me.getKey().intValue());
} catch (IvyException ie) {
return false;
}