Search in sources :

Example 26 with GroupChannel

use of org.apache.catalina.tribes.group.GroupChannel in project tomcat by apache.

the class TestDataIntegrity method setUp.

@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new MessageDispatchInterceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new MessageDispatchInterceptor());
    listener1 = new Listener();
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] { channel1, channel2 });
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
Also used : ChannelListener(org.apache.catalina.tribes.ChannelListener) MessageDispatchInterceptor(org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor) GroupChannel(org.apache.catalina.tribes.group.GroupChannel) Before(org.junit.Before)

Example 27 with GroupChannel

use of org.apache.catalina.tribes.group.GroupChannel in project tomcat by apache.

the class TestRemoteProcessException method setUp.

@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel2 = new GroupChannel();
    listener1 = new Listener();
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] { channel1, channel2 });
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
Also used : ChannelListener(org.apache.catalina.tribes.ChannelListener) GroupChannel(org.apache.catalina.tribes.group.GroupChannel) Before(org.junit.Before)

Example 28 with GroupChannel

use of org.apache.catalina.tribes.group.GroupChannel in project cas by apereo.

the class CasTomcatServletWebServerFactoryClusterTests method verifyOperation.

@Test
public void verifyOperation() {
    casTomcatEmbeddedServletContainerCustomizer.customize(casServletWebServerFactory);
    val server = casServletWebServerFactory.getWebServer();
    try {
        server.start();
        val tomcatServer = (TomcatWebServer) server;
        val cluster = (SimpleTcpCluster) tomcatServer.getTomcat().getEngine().getCluster();
        val channel = (GroupChannel) cluster.getChannel();
        val membership = channel.getMembershipService();
        assertTrue(membership instanceof McastService);
    } finally {
        server.stop();
    }
}
Also used : lombok.val(lombok.val) TomcatWebServer(org.springframework.boot.web.embedded.tomcat.TomcatWebServer) SimpleTcpCluster(org.apache.catalina.ha.tcp.SimpleTcpCluster) GroupChannel(org.apache.catalina.tribes.group.GroupChannel) McastService(org.apache.catalina.tribes.membership.McastService) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

GroupChannel (org.apache.catalina.tribes.group.GroupChannel)28 Before (org.junit.Before)16 ReceiverBase (org.apache.catalina.tribes.transport.ReceiverBase)9 ChannelListener (org.apache.catalina.tribes.ChannelListener)8 MessageDispatchInterceptor (org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor)8 TcpFailureDetector (org.apache.catalina.tribes.group.interceptors.TcpFailureDetector)6 ThroughputInterceptor (org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor)6 MessageDispatch15Interceptor (org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor)5 McastService (org.apache.catalina.tribes.membership.McastService)5 ClusterSessionListener (org.apache.catalina.ha.session.ClusterSessionListener)4 JvmRouteBinderValve (org.apache.catalina.ha.session.JvmRouteBinderValve)4 SimpleTcpCluster (org.apache.catalina.ha.tcp.SimpleTcpCluster)4 Member (org.apache.catalina.tribes.Member)4 StaticMembershipInterceptor (org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor)4 ReplicationTransmitter (org.apache.catalina.tribes.transport.ReplicationTransmitter)4 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 Properties (java.util.Properties)2 lombok.val (lombok.val)2 DeltaManager (org.apache.catalina.ha.session.DeltaManager)2