org.jgroups.tests.bla10 Maven / Gradle / Ivy
Go to download
This artifact provides a single jar that contains all classes required to use remote Jakarta Enterprise Beans and Jakarta Messaging, including
all dependencies. It is intended for use by those not using maven, maven users should just import the Jakarta Enterprise Beans and
Jakarta Messaging BOM's instead (shaded JAR's cause lots of problems with maven, as it is very easy to inadvertently end up
with different versions on classes on the class path).
package org.jgroups.tests;
import org.jgroups.JChannel;
import org.jgroups.util.Util;
/**
* @author Bela Ban
* @since x.y
*/
public class bla10 {
protected JChannel a, b, c;
protected static final String cfg="/home/bela/dan/tcp-dan.xml";
protected void start() throws Exception {
a=new JChannel(cfg).name("A");
a.connect("test");
for(int i=1; i <= 1000; i++) {
System.out.printf("attempt %d:\n", i);
try {
b=new JChannel(cfg).name("B");
c=new JChannel(cfg).name("C");
b.connect("test");
c.connect("test");
Util.waitUntilAllChannelsHaveSameSize(10000, 1000, a,b,c);
}
catch(Throwable t) {
System.out.printf("connect() failed: %s", t);
}
finally {
Util.close(b,c);
}
}
Util.close(c,b,a);
}
public static void main(String[] args) throws Exception {
new bla10().start();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy