Java 类org.apache.catalina.tribes.transport.AbstractSender 实例源码

项目:class-guard    文件:ParallelNioSender.java   
private NioSender[] setupForSend(Member[] destination) throws ChannelException {
    ChannelException cx = null;
    NioSender[] result = new NioSender[destination.length];
    for ( int i=0; i<destination.length; i++ ) {
        NioSender sender = nioSenders.get(destination[i]);
        try {

            if (sender == null) {
                sender = new NioSender();
                AbstractSender.transferProperties(this, sender);
                nioSenders.put(destination[i], sender);
            }
            sender.reset();
            sender.setDestination(destination[i]);
            sender.setSelector(selector);
            sender.setUdpBased(isUdpBased());
            result[i] = sender;
        }catch ( UnknownHostException x ) {
            if (cx == null) cx = new ChannelException("Unable to setup NioSender.", x);
            cx.addFaultyMember(destination[i], x);
        }
    }
    if ( cx != null ) throw cx;
    else return result;
}
项目:class-guard    文件:MultipointBioSender.java   
protected BioSender[] setupForSend(Member[] destination) throws ChannelException {
    ChannelException cx = null;
    BioSender[] result = new BioSender[destination.length];
    for ( int i=0; i<destination.length; i++ ) {
        try {
            BioSender sender = bioSenders.get(destination[i]);
            if (sender == null) {
                sender = new BioSender();
                AbstractSender.transferProperties(this,sender);
                sender.setDestination(destination[i]);
                bioSenders.put(destination[i], sender);
            }
            result[i] = sender;
            if (!result[i].isConnected() ) result[i].connect();
            result[i].keepalive();
        }catch (Exception x ) {
            if ( cx== null ) cx = new ChannelException(x);
            cx.addFaultyMember(destination[i],x);
        }
    }
    if ( cx!=null ) throw cx;
    else return result;
}
项目:apache-tomcat-7.0.57    文件:ParallelNioSender.java   
private NioSender[] setupForSend(Member[] destination) throws ChannelException {
    ChannelException cx = null;
    NioSender[] result = new NioSender[destination.length];
    for ( int i=0; i<destination.length; i++ ) {
        NioSender sender = nioSenders.get(destination[i]);
        try {

            if (sender == null) {
                sender = new NioSender();
                AbstractSender.transferProperties(this, sender);
                nioSenders.put(destination[i], sender);
            }
            sender.reset();
            sender.setDestination(destination[i]);
            sender.setSelector(selector);
            sender.setUdpBased(isUdpBased());
            result[i] = sender;
        }catch ( UnknownHostException x ) {
            if (cx == null) cx = new ChannelException("Unable to setup NioSender.", x);
            cx.addFaultyMember(destination[i], x);
        }
    }
    if ( cx != null ) throw cx;
    else return result;
}
项目:apache-tomcat-7.0.57    文件:MultipointBioSender.java   
protected BioSender[] setupForSend(Member[] destination) throws ChannelException {
    ChannelException cx = null;
    BioSender[] result = new BioSender[destination.length];
    for ( int i=0; i<destination.length; i++ ) {
        try {
            BioSender sender = bioSenders.get(destination[i]);
            if (sender == null) {
                sender = new BioSender();
                AbstractSender.transferProperties(this,sender);
                sender.setDestination(destination[i]);
                bioSenders.put(destination[i], sender);
            }
            result[i] = sender;
            if (!result[i].isConnected() ) result[i].connect();
            result[i].keepalive();
        }catch (Exception x ) {
            if ( cx== null ) cx = new ChannelException(x);
            cx.addFaultyMember(destination[i],x);
        }
    }
    if ( cx!=null ) throw cx;
    else return result;
}
项目:apache-tomcat-7.0.57    文件:ParallelNioSender.java   
private NioSender[] setupForSend(Member[] destination) throws ChannelException {
    ChannelException cx = null;
    NioSender[] result = new NioSender[destination.length];
    for ( int i=0; i<destination.length; i++ ) {
        NioSender sender = nioSenders.get(destination[i]);
        try {

            if (sender == null) {
                sender = new NioSender();
                AbstractSender.transferProperties(this, sender);
                nioSenders.put(destination[i], sender);
            }
            sender.reset();
            sender.setDestination(destination[i]);
            sender.setSelector(selector);
            sender.setUdpBased(isUdpBased());
            result[i] = sender;
        }catch ( UnknownHostException x ) {
            if (cx == null) cx = new ChannelException("Unable to setup NioSender.", x);
            cx.addFaultyMember(destination[i], x);
        }
    }
    if ( cx != null ) throw cx;
    else return result;
}
项目:apache-tomcat-7.0.57    文件:MultipointBioSender.java   
protected BioSender[] setupForSend(Member[] destination) throws ChannelException {
    ChannelException cx = null;
    BioSender[] result = new BioSender[destination.length];
    for ( int i=0; i<destination.length; i++ ) {
        try {
            BioSender sender = bioSenders.get(destination[i]);
            if (sender == null) {
                sender = new BioSender();
                AbstractSender.transferProperties(this,sender);
                sender.setDestination(destination[i]);
                bioSenders.put(destination[i], sender);
            }
            result[i] = sender;
            if (!result[i].isConnected() ) result[i].connect();
            result[i].keepalive();
        }catch (Exception x ) {
            if ( cx== null ) cx = new ChannelException(x);
            cx.addFaultyMember(destination[i],x);
        }
    }
    if ( cx!=null ) throw cx;
    else return result;
}
项目:WBSAirback    文件:ParallelNioSender.java   
private NioSender[] setupForSend(Member[] destination) throws ChannelException {
    ChannelException cx = null;
    NioSender[] result = new NioSender[destination.length];
    for ( int i=0; i<destination.length; i++ ) {
        NioSender sender = nioSenders.get(destination[i]);
        try {

            if (sender == null) {
                sender = new NioSender();
                AbstractSender.transferProperties(this, sender);
                nioSenders.put(destination[i], sender);
            }
            sender.reset();
            sender.setDestination(destination[i]);
            sender.setSelector(selector);
            sender.setUdpBased(isUdpBased());
            result[i] = sender;
        }catch ( UnknownHostException x ) {
            if (cx == null) cx = new ChannelException("Unable to setup NioSender.", x);
            cx.addFaultyMember(destination[i], x);
        }
    }
    if ( cx != null ) throw cx;
    else return result;
}
项目:WBSAirback    文件:MultipointBioSender.java   
protected BioSender[] setupForSend(Member[] destination) throws ChannelException {
    ChannelException cx = null;
    BioSender[] result = new BioSender[destination.length];
    for ( int i=0; i<destination.length; i++ ) {
        try {
            BioSender sender = bioSenders.get(destination[i]);
            if (sender == null) {
                sender = new BioSender();
                AbstractSender.transferProperties(this,sender);
                sender.setDestination(destination[i]);
                bioSenders.put(destination[i], sender);
            }
            result[i] = sender;
            if (!result[i].isConnected() ) result[i].connect();
            result[i].keepalive();
        }catch (Exception x ) {
            if ( cx== null ) cx = new ChannelException(x);
            cx.addFaultyMember(destination[i],x);
        }
    }
    if ( cx!=null ) throw cx;
    else return result;
}
项目:tomcat7    文件:PooledParallelSender.java   
@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);
    }
}
项目:tomcat7    文件:TestMulticastPackages.java   
@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());
}
项目:tomcat7    文件:TestUdpPackages.java   
@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());
}
项目:apache-tomcat-7.0.73-with-comment    文件:PooledParallelSender.java   
@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);
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:TestMulticastPackages.java   
@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());
}
项目:apache-tomcat-7.0.73-with-comment    文件:TestUdpPackages.java   
@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());
}
项目:lazycat    文件:PooledParallelSender.java   
@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);
    }
}
项目:lazycat    文件:PooledMultiSender.java   
/**
 * 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;
}
项目:class-guard    文件:PooledParallelSender.java   
@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);
    }
}
项目:class-guard    文件:TestMulticastPackages.java   
@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());
}
项目:class-guard    文件:TestUdpPackages.java   
@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());
}
项目:apache-tomcat-7.0.57    文件:PooledParallelSender.java   
@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);
    }
}
项目:apache-tomcat-7.0.57    文件:TestMulticastPackages.java   
@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());
}
项目:apache-tomcat-7.0.57    文件:TestUdpPackages.java   
@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());
}
项目:apache-tomcat-7.0.57    文件:TestMulticastPackages.java   
@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());
}
项目:apache-tomcat-7.0.57    文件:TestUdpPackages.java   
@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());
}
项目:apache-tomcat-7.0.57    文件:PooledParallelSender.java   
@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);
    }
}
项目:WBSAirback    文件:PooledParallelSender.java   
@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);
    }
}
项目:WBSAirback    文件:TestMulticastPackages.java   
@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());
}
项目:WBSAirback    文件:TestUdpPackages.java   
@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());
}
项目:tomcat7    文件:PooledMultiSender.java   
/**
 * 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;
}
项目:apache-tomcat-7.0.73-with-comment    文件:PooledMultiSender.java   
/**
 * 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;
}
项目:class-guard    文件:PooledMultiSender.java   
/**
 * 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;
}
项目:apache-tomcat-7.0.57    文件:PooledMultiSender.java   
/**
 * 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;
}
项目:apache-tomcat-7.0.57    文件:PooledMultiSender.java   
/**
 * 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;
}
项目:WBSAirback    文件:PooledMultiSender.java   
/**
 * 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;
}