Package org.jgroups.blocks

Examples of org.jgroups.blocks.TCPConnectionMap




    @BeforeMethod
    protected void setUp() throws Exception {
        ct1=new TCPConnectionMap("TCPConnectionMap1",
                                 new DefaultThreadFactory(Util.getGlobalThreadGroup(), "test", true),
                                 null, null, null, null, port1, port1);

        ct1.setUseSendQueues(false);
        ct1.start();
        ct2=new TCPConnectionMap("TCPConnectionMap2",
                                 new DefaultThreadFactory(Util.getGlobalThreadGroup(), "test", true),
                                 null, null, null, null, port2, port2);
        ct2.setUseSendQueues(false);
        ct2.start();
    }
View Full Code Here


                                                                        InetAddress bindAddress,
                                                                        InetAddress externalAddress,
                                                                        int startPort,
                                                                        int endPort,
                                                                        PortsManager pm) throws Exception {
        TCPConnectionMap cTable;
        if(reaperInterval == 0 && connExpireTime == 0) {
            cTable=new TCPConnectionMap(getThreadFactory(),
                                                              this,
                                                              bindAddress,
                                                              externalAddress,
                                                              startPort,
                                                              endPort,
                                                              pm);
        }
        else {
            if(reaperInterval == 0) {
                reaperInterval=5000;
                if(log.isWarnEnabled())
                    log.warn("reaper_interval was 0, set it to " + reaperInterval);
            }
            if(connExpireTime == 0) {
                connExpireTime=1000 * 60 * 5;
                if(log.isWarnEnabled())
                    log.warn("conn_expire_time was 0, set it to " + connExpireTime);
            }
            cTable=new TCPConnectionMap(getThreadFactory(),
                                                              this,
                                                              bindAddress,
                                                              externalAddress,
                                                              startPort,
                                                              endPort,
View Full Code Here

                                                   InetAddress bindAddress,
                                                   InetAddress externalAddress,
                                                   int external_port,
                                                   int startPort,
                                                   int endPort) throws Exception {
        TCPConnectionMap cTable;
        if(reaperInterval == 0 && connExpireTime == 0) {
            cTable=new TCPConnectionMap("jgroups.tcp.srv_sock",
                                        getThreadFactory(),
                                        getSocketFactory(),
                                        this,
                                        bindAddress,
                                        externalAddress,
                                        external_port,
                                        startPort,
                                        endPort);
        }
        else {
            if(reaperInterval == 0) {
                reaperInterval=5000;
                if(log.isWarnEnabled())
                    log.warn("reaper_interval was 0, set it to " + reaperInterval);
            }
            if(connExpireTime == 0) {
                connExpireTime=1000 * 60 * 5;
                if(log.isWarnEnabled())
                    log.warn("conn_expire_time was 0, set it to " + connExpireTime);
            }
            cTable=new TCPConnectionMap("jgroups.tcp.srv_sock",
                                        getThreadFactory(),
                                        getSocketFactory(),
                                        this,
                                        bindAddress,
                                        externalAddress,
                                        external_port,
                                        startPort,
                                        endPort,
                                        reaperInterval,
                                        connExpireTime);
        }

        return cTable.clientBindAddress(client_bind_addr).clientBindPort(client_bind_port)
          .deferClientBinding(defer_client_bind_addr);
    }
View Full Code Here

        String line;
        Address dest;
        byte[]  data;

        if(reaper_interval > 0 || conn_expire_time > 0)
            ct=new TCPConnectionMap("TCPConnectionMap",
                                    new DefaultThreadFactory(Util.getGlobalThreadGroup(), "test", true),
                                    this, null, null, local_port, local_port, reaper_interval, conn_expire_time);
        else
            ct=new TCPConnectionMap("TCPConnectionMap",
                                    new DefaultThreadFactory(Util.getGlobalThreadGroup(), "test", true),
                                    null, this, null, null, local_port, local_port);
        ct.addConnectionMapListener(this);
        ct.start();
        this.dst_host=dst_host;
View Full Code Here

                                                   InetAddress bindAddress,
                                                   InetAddress externalAddress,
                                                   int startPort,
                                                   int endPort
    ) throws Exception {
        TCPConnectionMap cTable;
        if(reaperInterval == 0 && connExpireTime == 0) {
            cTable=new TCPConnectionMap(Global.TCP_SRV_SOCK,
                                        getThreadFactory(),
                                        getSocketFactory(),
                                        this,
                                        bindAddress,
                                        externalAddress,
                                        startPort,
                                        endPort
            );
        }
        else {
            if(reaperInterval == 0) {
                reaperInterval=5000;
                if(log.isWarnEnabled())
                    log.warn("reaper_interval was 0, set it to " + reaperInterval);
            }
            if(connExpireTime == 0) {
                connExpireTime=1000 * 60 * 5;
                if(log.isWarnEnabled())
                    log.warn("conn_expire_time was 0, set it to " + connExpireTime);
            }
            cTable=new TCPConnectionMap(Global.TCP_SRV_SOCK,
                                        getThreadFactory(),
                                        getSocketFactory(),
                                        this,
                                        bindAddress,
                                        externalAddress,
View Full Code Here

                                                                        InetAddress bindAddress,
                                                                        InetAddress externalAddress,
                                                                        int startPort,
                                                                        int endPort
                                                                        ) throws Exception {
        TCPConnectionMap cTable;
        if(reaperInterval == 0 && connExpireTime == 0) {
            cTable=new TCPConnectionMap(getThreadFactory(),
                                                              this,
                                                              bindAddress,
                                                              externalAddress,
                                                              startPort,
                                                              endPort
                                                              );
        }
        else {
            if(reaperInterval == 0) {
                reaperInterval=5000;
                if(log.isWarnEnabled())
                    log.warn("reaper_interval was 0, set it to " + reaperInterval);
            }
            if(connExpireTime == 0) {
                connExpireTime=1000 * 60 * 5;
                if(log.isWarnEnabled())
                    log.warn("conn_expire_time was 0, set it to " + connExpireTime);
            }
            cTable=new TCPConnectionMap(getThreadFactory(),
                                                              this,
                                                              bindAddress,
                                                              externalAddress,
                                                              startPort,
                                                              endPort,
View Full Code Here

                                                     InetAddress bindAddress,
                                                     InetAddress externalAddress,
                                                     int startPort,
                                                     int endPort
    ) throws Exception {
        TCPConnectionMap cTable;
        if(reaperInterval == 0 && connExpireTime == 0) {
            cTable=new TCPConnectionMap(Global.TCP_SRV_SOCK,
                                        getThreadFactory(),
                                        this,
                                        bindAddress,
                                        externalAddress,
                                        startPort,
                                        endPort
            );
        }
        else {
            if(reaperInterval == 0) {
                reaperInterval=5000;
                if(log.isWarnEnabled())
                    log.warn("reaper_interval was 0, set it to " + reaperInterval);
            }
            if(connExpireTime == 0) {
                connExpireTime=1000 * 60 * 5;
                if(log.isWarnEnabled())
                    log.warn("conn_expire_time was 0, set it to " + connExpireTime);
            }
            cTable=new TCPConnectionMap(Global.TCP_SRV_SOCK,
                                        getThreadFactory(),
                                        this,
                                        bindAddress,
                                        externalAddress,
                                        startPort,
View Full Code Here

                                                                        InetAddress bindAddress,
                                                                        InetAddress externalAddress,
                                                                        int startPort,
                                                                        int endPort
                                                                        ) throws Exception {
        TCPConnectionMap cTable;
        if(reaperInterval == 0 && connExpireTime == 0) {
            cTable=new TCPConnectionMap(getThreadFactory(),
                                                              this,
                                                              bindAddress,
                                                              externalAddress,
                                                              startPort,
                                                              endPort
                                                              );
        }
        else {
            if(reaperInterval == 0) {
                reaperInterval=5000;
                if(log.isWarnEnabled())
                    log.warn("reaper_interval was 0, set it to " + reaperInterval);
            }
            if(connExpireTime == 0) {
                connExpireTime=1000 * 60 * 5;
                if(log.isWarnEnabled())
                    log.warn("conn_expire_time was 0, set it to " + connExpireTime);
            }
            cTable=new TCPConnectionMap(getThreadFactory(),
                                                              this,
                                                              bindAddress,
                                                              externalAddress,
                                                              startPort,
                                                              endPort,
View Full Code Here

    TCPConnectionMap ct1, ct2;
    static final int port1=15555, port2=16666;

    @BeforeMethod
    protected void setUp() throws Exception {
        ct1=new TCPConnectionMap("TCPConnectionMap1",
                                 new DefaultThreadFactory("test", true),
                                 null, null, null, null, 0, port1, port1);

        ct1.setUseSendQueues(false);
        ct1.start();
        ct2=new TCPConnectionMap("TCPConnectionMap2",
                                 new DefaultThreadFactory("test2", true),
                                 null, null, null, null, 0, port2, port2);
        ct2.setUseSendQueues(false);
        ct2.start();
    }
View Full Code Here

          : "list A=" + list_a + "\nlist B=" + list_b;
    }


    protected TCPConnectionMap createConnectionMap(InetAddress bind_addr, int port) throws Exception {
        return new TCPConnectionMap("conn", new DefaultThreadFactory("ConnectionMapTest", true, true),
                                    new DefaultSocketFactory(), null, bind_addr, null, 0, port,port);
    }
View Full Code Here

TOP

Related Classes of org.jgroups.blocks.TCPConnectionMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.