org.apache.catalina.tribes.transport.AbstractSender Java Examples

The following examples show how to use org.apache.catalina.tribes.transport.AbstractSender. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PooledParallelSender.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public DataSender getNewDataSender() {
    try {
        ParallelNioSender sender = new ParallelNioSender();
        AbstractSender.transferProperties(this,sender);
        return sender;
    } catch ( IOException x ) {
        throw new RuntimeException(sm.getString("pooledParallelSender.unable.open"),x);
    }
}
 
Example #2
Source File: TestMulticastPackages.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testSingleDataSendNO_ACK() throws Exception {
    AbstractSender s1 =(AbstractSender) ((ReplicationTransmitter)channel1.getChannelSender()).getTransport();
    AbstractSender s2 =(AbstractSender) ((ReplicationTransmitter)channel2.getChannelSender()).getTransport();
    s1.setTimeout(Long.MAX_VALUE); //for debugging
    s2.setTimeout(Long.MAX_VALUE); //for debugging

    System.err.println("Starting Single package NO_ACK");
    channel1.send(new Member[] {channel2.getLocalMember(false)}, Data.createRandomData(1024),Channel.SEND_OPTIONS_MULTICAST);
    Thread.sleep(500);
    System.err.println("Finished Single package NO_ACK ["+listener1.count+"]");
    Assert.assertEquals("Checking success messages.",1,listener1.count.get());
}
 
Example #3
Source File: TestUdpPackages.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testSingleDataSendNO_ACK() throws Exception {
    AbstractSender s1 =(AbstractSender) ((ReplicationTransmitter)channel1.getChannelSender()).getTransport();
    AbstractSender s2 =(AbstractSender) ((ReplicationTransmitter)channel2.getChannelSender()).getTransport();
    s1.setTimeout(Long.MAX_VALUE); //for debugging
    s2.setTimeout(Long.MAX_VALUE); //for debugging

    System.err.println("Starting Single package NO_ACK");
    channel1.send(new Member[] {channel2.getLocalMember(false)}, Data.createRandomData(1024),Channel.SEND_OPTIONS_UDP);
    Thread.sleep(500);
    System.err.println("Finished Single package NO_ACK ["+listener1.count+"]");
    Assert.assertEquals("Checking success messages.",1,listener1.count.get());
}
 
Example #4
Source File: PooledParallelSender.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Override
public DataSender getNewDataSender() {
    try {
        ParallelNioSender sender = new ParallelNioSender();
        AbstractSender.transferProperties(this,sender);
        return sender;
    } catch ( IOException x ) {
        throw new RuntimeException("Unable to open NIO selector.",x);
    }
}
 
Example #5
Source File: TestMulticastPackages.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Test
public void testSingleDataSendNO_ACK() throws Exception {
    AbstractSender s1 =(AbstractSender) ((ReplicationTransmitter)channel1.getChannelSender()).getTransport();
    AbstractSender s2 =(AbstractSender) ((ReplicationTransmitter)channel2.getChannelSender()).getTransport();
    s1.setTimeout(Long.MAX_VALUE); //for debugging
    s2.setTimeout(Long.MAX_VALUE); //for debugging

    System.err.println("Starting Single package NO_ACK");
    channel1.send(new Member[] {channel2.getLocalMember(false)}, Data.createRandomData(1024),Channel.SEND_OPTIONS_MULTICAST);
    Thread.sleep(500);
    System.err.println("Finished Single package NO_ACK ["+listener1.count+"]");
    assertEquals("Checking success messages.",1,listener1.count.get());
}
 
Example #6
Source File: TestUdpPackages.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Test
public void testSingleDataSendNO_ACK() throws Exception {
    AbstractSender s1 =(AbstractSender) ((ReplicationTransmitter)channel1.getChannelSender()).getTransport();
    AbstractSender s2 =(AbstractSender) ((ReplicationTransmitter)channel2.getChannelSender()).getTransport();
    s1.setTimeout(Long.MAX_VALUE); //for debugging
    s2.setTimeout(Long.MAX_VALUE); //for debugging

    System.err.println("Starting Single package NO_ACK");
    channel1.send(new Member[] {channel2.getLocalMember(false)}, Data.createRandomData(1024),Channel.SEND_OPTIONS_UDP);
    Thread.sleep(500);
    System.err.println("Finished Single package NO_ACK ["+listener1.count+"]");
    assertEquals("Checking success messages.",1,listener1.count.get());
}
 
Example #7
Source File: PooledParallelSender.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Override
public DataSender getNewDataSender() {
    try {
        ParallelNioSender sender = new ParallelNioSender();
        AbstractSender.transferProperties(this,sender);
        return sender;
    } catch ( IOException x ) {
        throw new RuntimeException("Unable to open NIO selector.",x);
    }
}
 
Example #8
Source File: TestMulticastPackages.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Test
public void testSingleDataSendNO_ACK() throws Exception {
    AbstractSender s1 =(AbstractSender) ((ReplicationTransmitter)channel1.getChannelSender()).getTransport();
    AbstractSender s2 =(AbstractSender) ((ReplicationTransmitter)channel2.getChannelSender()).getTransport();
    s1.setTimeout(Long.MAX_VALUE); //for debugging
    s2.setTimeout(Long.MAX_VALUE); //for debugging

    System.err.println("Starting Single package NO_ACK");
    channel1.send(new Member[] {channel2.getLocalMember(false)}, Data.createRandomData(1024),Channel.SEND_OPTIONS_MULTICAST);
    Thread.sleep(500);
    System.err.println("Finished Single package NO_ACK ["+listener1.count+"]");
    assertEquals("Checking success messages.",1,listener1.count.get());
}
 
Example #9
Source File: TestUdpPackages.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Test
public void testSingleDataSendNO_ACK() throws Exception {
    AbstractSender s1 =(AbstractSender) ((ReplicationTransmitter)channel1.getChannelSender()).getTransport();
    AbstractSender s2 =(AbstractSender) ((ReplicationTransmitter)channel2.getChannelSender()).getTransport();
    s1.setTimeout(Long.MAX_VALUE); //for debugging
    s2.setTimeout(Long.MAX_VALUE); //for debugging

    System.err.println("Starting Single package NO_ACK");
    channel1.send(new Member[] {channel2.getLocalMember(false)}, Data.createRandomData(1024),Channel.SEND_OPTIONS_UDP);
    Thread.sleep(500);
    System.err.println("Finished Single package NO_ACK ["+listener1.count+"]");
    assertEquals("Checking success messages.",1,listener1.count.get());
}
 
Example #10
Source File: PooledMultiSender.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
@Override
public DataSender getNewDataSender() {
    MultipointBioSender sender = new MultipointBioSender();
    AbstractSender.transferProperties(this,sender);
    return sender;
}
 
Example #11
Source File: PooledMultiSender.java    From Tomcat7.0.67 with Apache License 2.0 3 votes vote down vote up
/**
 * getNewDataSender
 *
 * @return DataSender
 * TODO Implement this org.apache.catalina.tribes.transport.PooledSender
 *   method
 */
@Override
public DataSender getNewDataSender() {
    MultipointBioSender sender = new MultipointBioSender();
    AbstractSender.transferProperties(this,sender);
    return sender;
}
 
Example #12
Source File: PooledMultiSender.java    From tomcatsrc with Apache License 2.0 3 votes vote down vote up
/**
 * getNewDataSender
 *
 * @return DataSender
 * TODO Implement this org.apache.catalina.tribes.transport.PooledSender
 *   method
 */
@Override
public DataSender getNewDataSender() {
    MultipointBioSender sender = new MultipointBioSender();
    AbstractSender.transferProperties(this,sender);
    return sender;
}