aboutsummaryrefslogtreecommitdiff
path: root/src/Probe.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Probe.java')
-rw-r--r--src/Probe.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/Probe.java b/src/Probe.java
index 4425dd4..c8021c5 100644
--- a/src/Probe.java
+++ b/src/Probe.java
@@ -7,6 +7,8 @@
* (c) CENA
*
* Changelog:
+ * 1.2.16
+ * - now uses the synchronized wrappers of the Java API for all collections
* 1.2.14
* - uses the "new" for: loop construct of Java5
* - throws RuntimeException instead of System.exit(), allows code reuse
@@ -247,9 +249,8 @@ public class Probe implements IvyApplicationListener, IvyMessageListener, IvyBin
int total=0;
int boundedtotal=0;
for (IvyClient ic: v) {
- for (Enumeration<String> e = ic.getRegexps();e.hasMoreElements();) {
+ for (String r : ic.getRegexps()) {
total++;
- String r = e.nextElement();
if (r.startsWith("^")) boundedtotal++;
println(ic.getApplicationName()+" has subscribed to: "+r);
}
@@ -262,19 +263,16 @@ public class Probe implements IvyApplicationListener, IvyMessageListener, IvyBin
Vector<IvyClient>v=bus.getIvyClientsByName(target);
if (v.size()==0) println("no Ivy client with the name \""+target+"\"");
for (IvyClient ic:v) {
- for (Enumeration<String> e = ic.getRegexps();e.hasMoreElements();) {
+ for (String r : ic.getRegexps()) {
total++;
- String r = e.nextElement();
if (r.startsWith("^")) boundedtotal++;
- println(target+" has subscribed to: "+(String)e.nextElement());
+ println(target+" has subscribed to: "+r);
}
System.out.println("total: "+total+", unbounded:"+(total-boundedtotal));
}
} else if (s.lastIndexOf(".bound")>=0){
println("you have subscribed to:");
- for (Enumeration<String> e = bus.getSelfIvyClient().getRegexps();e.hasMoreElements();) {
- println("\t"+e.nextElement());
- }
+ for (String re : bus.getSelfIvyClient().getRegexps()) println("\t"+re);
} else if (s.lastIndexOf(".bind ")>=0){
String regexp=s.substring(6);
try {
@@ -348,8 +346,6 @@ public class Probe implements IvyApplicationListener, IvyMessageListener, IvyBin
public void connect(IvyClient client) {
println(client.getApplicationName() + " connected " );
- // for (java.util.Enumeration e=client.getRegexps();e.hasMoreElements();)
- // println(client.getApplicationName() + " subscribes to " +e.nextElement() );
}
public void disconnect(IvyClient client) {