diff options
author | jestin | 2002-12-30 13:07:11 +0000 |
---|---|---|
committer | jestin | 2002-12-30 13:07:11 +0000 |
commit | acaedb9d66cfab0329c49a9120938143b7c15487 (patch) | |
tree | f4f76b8f1f92cf31bb0783a9a1a7eba44758b8cb /src | |
parent | e126ac84a2d2415328989d0e084faeda42e303c8 (diff) | |
download | ivy-java-acaedb9d66cfab0329c49a9120938143b7c15487.zip ivy-java-acaedb9d66cfab0329c49a9120938143b7c15487.tar.gz ivy-java-acaedb9d66cfab0329c49a9120938143b7c15487.tar.bz2 ivy-java-acaedb9d66cfab0329c49a9120938143b7c15487.tar.xz |
use of the old Vector API and old System.getProperties in order to allow the
classes to be compiled with a 1.1.7A jdk
Diffstat (limited to 'src')
-rwxr-xr-x | src/Ivy.java | 19 | ||||
-rwxr-xr-x | src/IvyApplicationAdapter.java | 4 | ||||
-rwxr-xr-x | src/IvyClient.java | 2 | ||||
-rw-r--r-- | src/IvyDaemon.java | 8 | ||||
-rw-r--r-- | src/Probe.java | 15 |
5 files changed, 32 insertions, 16 deletions
diff --git a/src/Ivy.java b/src/Ivy.java index 5c11066..b3f8bfb 100755 --- a/src/Ivy.java +++ b/src/Ivy.java @@ -22,6 +22,9 @@ import java.util.*; *</pre> * * CHANGELOG: + * 1.2.2: + * - added the String domains(String d) function, in order to display the + * domain list * 1.2.1: * - bus.start(null) now starts on DEFAULT_DOMAIN * - added the getDomains in order to correctly display the domain list @@ -332,7 +335,7 @@ public class Ivy implements Runnable { public Vector getIvyClients() { Vector v=new Vector(); for (Enumeration e=clients.elements();e.hasMoreElements();) { - v.add(e.nextElement()); + v.addElement(e.nextElement()); } return v; } @@ -378,10 +381,10 @@ public class Ivy implements Runnable { if (length!=0) while (true) { index=s.indexOf(separator,last); if (index==-1) { - v.add(s.substring(last,length)); + v.addElement(s.substring(last,length)); break; } else if (index<s.length()) { - v.add(s.substring(last,index)); + v.addElement(s.substring(last,index)); last=index+1; } else { break; @@ -463,6 +466,16 @@ public class Ivy implements Runnable { return s; } + public String domains(String toparse) { + String s="broadcasting on "; + Ivy.Domain[] d = parseDomains(toparse); + for (int index=0;index<d.length;index++) { + s+=d[index].getDomainaddr()+":"+d[index].getPort()+" "; + } + return s; + } + + class Domain { private String domainaddr; private int port; diff --git a/src/IvyApplicationAdapter.java b/src/IvyApplicationAdapter.java index a07020f..376ee9a 100755 --- a/src/IvyApplicationAdapter.java +++ b/src/IvyApplicationAdapter.java @@ -1,6 +1,3 @@ -package fr.dgac.ivy; - - /** * this class is a dummy ApplicationListener * @@ -17,6 +14,7 @@ package fr.dgac.ivy; * changelog: * 1.0.12: fixed a missing id in the parameters */ +package fr.dgac.ivy; public abstract class IvyApplicationAdapter implements IvyApplicationListener { public void connect( IvyClient client ) { } diff --git a/src/IvyClient.java b/src/IvyClient.java index 1556930..ba30d74 100755 --- a/src/IvyClient.java +++ b/src/IvyClient.java @@ -358,7 +358,7 @@ public class IvyClient implements Runnable { while (to<b.length) { while ( (to<b.length) && (b[to]!=3) ) to++; if (to<b.length) { - v.add(s.substring(from,to)); + v.addElement(s.substring(from,to)); to++; from=to; } diff --git a/src/IvyDaemon.java b/src/IvyDaemon.java index 13b6f0c..72c83ec 100644 --- a/src/IvyDaemon.java +++ b/src/IvyDaemon.java @@ -4,9 +4,9 @@ * @author <a href="http://www.tls.cena.fr/products/ivy/">http://www.tls.cena.fr/products/ivy/</a> */ package fr.dgac.ivy ; - import java.io.*; import java.net.*; +import java.util.Properties ; import gnu.getopt.Getopt; /** @@ -19,6 +19,8 @@ import gnu.getopt.Getopt; * @author <a href="http://www.tls.cena.fr/products/ivy/">http://www.tls.cena.fr/products/ivy/</a> * * changelog: + * 1.2.2 + * changes the setProperty to a backward compatible construct * 1.0.12 * - class goes public access ! */ @@ -39,7 +41,9 @@ public class IvyDaemon implements Runnable { domain=opt.getOptarg(); break; case 'd': - System.setProperty("IVY_DEBUG","yes"); + Properties sysProp = System.getProperties(); + sysProp.put("IVY_DEBUG","yes"); + //System.setProperty("IVY_DEBUG","yes"); break; case 'p': String s=""; diff --git a/src/Probe.java b/src/Probe.java index 0b8a73e..d560298 100644 --- a/src/Probe.java +++ b/src/Probe.java @@ -10,6 +10,10 @@ import gnu.getopt.Getopt; * * * Changelog: + * 1.2.2 + * - changes setProperty to a backward-compatible construct + * - now uses the bus.domains(String domain) in order to display the domain + * list * 1.2.1 * - new -t switch to print the date for each ivy message * - now displays the correct domain list @@ -51,7 +55,9 @@ class Probe implements IvyApplicationListener, IvyMessageListener, Runnable { timestamp=true; break; case 'd': - System.setProperty("IVY_DEBUG","yes"); + Properties sysProp = System.getProperties(); + sysProp.put("IVY_DEBUG","yes"); + //System.setProperty("IVY_DEBUG","yes"); break; case 'h': default: @@ -64,12 +70,7 @@ class Probe implements IvyApplicationListener, IvyMessageListener, Runnable { System.out.println("you want to subscribe to " + args[i]); bus.bindMsg(args[i],p); } - String s = "broadcasting on "; - Ivy.Domain[] d = bus.parseDomains(domain); - for (int index=0;index<d.length;index++) { - s+=d[index].getDomainaddr()+":"+d[index].getPort()+" "; - } - System.out.println(s); + System.out.println(bus.domains(domain)); bus.start(domain); p.start(bus); } |