Search in sources :

Example 1 with STABLE

use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.

the class SASLTest method createChannel.

private static JChannel createChannel(String channelName, String mech, String username) throws Exception {
    SASL sasl = new SASL();
    sasl.setMech(mech);
    sasl.setClientCallbackHandler(new MyCallbackHandler(username));
    sasl.setServerCallbackHandler(new MyCallbackHandler(username));
    sasl.setTimeout(5000);
    if (System.getProperty("java.vendor").contains("IBM")) {
        sasl.sasl_props.put("com.ibm.security.sasl.digest.realm", REALM);
    } else {
        sasl.sasl_props.put("com.sun.security.sasl.digest.realm", REALM);
    }
    sasl.setLevel("trace");
    GMS gms = new GMS();
    gms.setJoinTimeout(3000);
    return new JChannel(new Protocol[] { new SHARED_LOOPBACK(), new PING(), new MERGE3(), new NAKACK2(), new UNICAST3(), new STABLE(), sasl, gms }).name(channelName);
}
Also used : NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) STABLE(org.jgroups.protocols.pbcast.STABLE) GMS(org.jgroups.protocols.pbcast.GMS) Protocol(org.jgroups.stack.Protocol)

Example 2 with STABLE

use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.

the class SASL_SimpleAuthorizingCallbackTest method createChannel.

private JChannel createChannel(String channelName, String mech, String principal) throws Exception {
    Properties properties = new Properties();
    properties.put("sasl.local.principal", principal);
    properties.put("sasl.credentials.properties", credentialsFile.getAbsolutePath());
    properties.put("sasl.role", "mycluster");
    properties.put("sasl.roles.properties", rolesFile.getAbsolutePath());
    properties.put("sasl.realm", REALM);
    SASL sasl = new SASL();
    sasl.setMech(mech);
    sasl.setClientCallbackHandler(new SimpleAuthorizingCallbackHandler(properties));
    sasl.setServerCallbackHandler(new SimpleAuthorizingCallbackHandler(properties));
    sasl.setTimeout(5000);
    if (System.getProperty("java.vendor").contains("IBM")) {
        sasl.sasl_props.put("com.ibm.security.sasl.digest.realm", REALM);
    } else {
        sasl.sasl_props.put("com.sun.security.sasl.digest.realm", REALM);
    }
    return new JChannel(new Protocol[] { new SHARED_LOOPBACK(), new PING(), new NAKACK2(), new UNICAST3(), new STABLE(), sasl, new GMS() }).name(channelName);
}
Also used : NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) JChannel(org.jgroups.JChannel) SimpleAuthorizingCallbackHandler(org.jgroups.auth.sasl.SimpleAuthorizingCallbackHandler) STABLE(org.jgroups.protocols.pbcast.STABLE) Properties(java.util.Properties) Protocol(org.jgroups.stack.Protocol) GMS(org.jgroups.protocols.pbcast.GMS)

Example 3 with STABLE

use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.

the class SUPERVISOR_Test method createChannel.

protected JChannel createChannel(String name) throws Exception {
    JChannel ch = new JChannel(new SHARED_LOOPBACK(), new SHARED_LOOPBACK_PING(), new FD(), new NAKACK2().setValue("use_mcast_xmit", false), new UNICAST3(), new STABLE().setValue("max_bytes", 50000), new GMS().setValue("print_local_addr", false), new SUPERVISOR());
    ch.setName(name);
    return ch;
}
Also used : NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) JChannel(org.jgroups.JChannel) SUPERVISOR(org.jgroups.protocols.rules.SUPERVISOR) STABLE(org.jgroups.protocols.pbcast.STABLE) GMS(org.jgroups.protocols.pbcast.GMS)

Example 4 with STABLE

use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.

the class FCTest method setUp.

protected void setUp(Class<? extends Protocol> flow_control_class) throws Exception {
    Protocol flow_control_prot = flow_control_class.newInstance();
    flow_control_prot.setValue("min_credits", 1000).setValue("max_credits", 10000).setValue("max_block_time", 1000);
    ch = new JChannel(new SHARED_LOOPBACK(), new SHARED_LOOPBACK_PING(), new NAKACK2().setValue("use_mcast_xmit", false), new UNICAST3(), new STABLE().setValue("max_bytes", 50000), new GMS().setValue("print_local_addr", false), flow_control_prot, new FRAG2().fragSize(800));
    ch.connect("FCTest");
}
Also used : NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) JChannel(org.jgroups.JChannel) STABLE(org.jgroups.protocols.pbcast.STABLE) Protocol(org.jgroups.stack.Protocol) GMS(org.jgroups.protocols.pbcast.GMS)

Example 5 with STABLE

use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.

the class FragTest method createChannel.

protected static JChannel createChannel(String name, Class<? extends Protocol> clazz) throws Exception {
    Protocol frag_prot = clazz.newInstance();
    frag_prot.setValue("frag_size", FRAG_SIZE);
    return new JChannel(new SHARED_LOOPBACK(), new SHARED_LOOPBACK_PING(), new NAKACK2().setValue("use_mcast_xmit", false), new UNICAST3(), new STABLE().setValue("max_bytes", 50000), new GMS().setValue("print_local_addr", false), new UFC(), new MFC(), frag_prot).name(name);
}
Also used : NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) STABLE(org.jgroups.protocols.pbcast.STABLE) Protocol(org.jgroups.stack.Protocol) GMS(org.jgroups.protocols.pbcast.GMS)

Aggregations

STABLE (org.jgroups.protocols.pbcast.STABLE)34 NAKACK2 (org.jgroups.protocols.pbcast.NAKACK2)29 GMS (org.jgroups.protocols.pbcast.GMS)27 JChannel (org.jgroups.JChannel)15 Protocol (org.jgroups.stack.Protocol)13 UNICAST3 (org.jgroups.protocols.UNICAST3)6 ArrayList (java.util.ArrayList)4 SHARED_LOOPBACK (org.jgroups.protocols.SHARED_LOOPBACK)3 DISCARD (org.jgroups.protocols.DISCARD)2 SHARED_LOOPBACK_PING (org.jgroups.protocols.SHARED_LOOPBACK_PING)2 TCP (org.jgroups.protocols.TCP)2 BeforeMethod (org.testng.annotations.BeforeMethod)2 Test (org.testng.annotations.Test)2 InetAddress (java.net.InetAddress)1 InetSocketAddress (java.net.InetSocketAddress)1 SecureRandom (java.security.SecureRandom)1 List (java.util.List)1 Properties (java.util.Properties)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1