Package org.jgroups.protocols

Examples of org.jgroups.protocols.TP$ProbeHandler


    }



    private static void modifyDefaultThreadPool(JChannel ch1) {
        TP transport=ch1.getProtocolStack().getTransport();
        ThreadPoolExecutor default_pool=(ThreadPoolExecutor)transport.getDefaultThreadPool();
        if(default_pool != null) {
            default_pool.setCorePoolSize(1);
            default_pool.setMaximumPoolSize(100);
        }
        transport.setThreadPoolQueueEnabled(false);
    }
View Full Code Here


        c2.connect("TransportThreadPoolTest");
       
        Util.blockUntilViewsReceived(5000, 500, c1, c2);
        assert c2.getView().size() == 2 : "view is " + c2.getView() + ", but should have had a size of 2";
       
        TP transport=c1.getProtocolStack().getTransport();
        ExecutorService thread_pool=Executors.newFixedThreadPool(2);
        transport.setDefaultThreadPool(thread_pool);

        transport=c2.getProtocolStack().getTransport();
        thread_pool=Executors.newFixedThreadPool(2);
        transport.setDefaultThreadPool(thread_pool);
       
        c1.send(null, null, "hello world");
        c2.send(null, null, "bela");
        c1.send(null, null, "message 3");
        c2.send(null, null, "message 4");
View Full Code Here

    }

    private static void setLoopback(JChannel ch, boolean b) {
        ProtocolStack stack=ch.getProtocolStack();
        List<Protocol> prots=stack.getProtocols();
        TP transport=(TP)prots.get(prots.size() -1);
        transport.setLoopback(b);
    }
View Full Code Here


    private static void setBundling(JChannel ch, boolean enabled, int max_bytes, long timeout) {
        ProtocolStack stack=ch.getProtocolStack();
        List<Protocol> prots=stack.getProtocols();
        TP transport=(TP)prots.get(prots.size() -1);
        transport.setEnableBundling(enabled);
        if(enabled) {
            transport.setMaxBundleSize(max_bytes);
            transport.setMaxBundleTimeout(timeout);
        }
        transport.setEnableUnicastBundling(false);
        if(enabled) {
            GMS gms=(GMS)stack.findProtocol("GMS");
            gms.setViewAckCollectionTimeout(LATENCY * 2);
            gms.setJoinTimeout(LATENCY * 2);
        }
View Full Code Here

    }


    private static void changeProps(Channel ch) {
        ProtocolStack stack=ch.getProtocolStack();
        TP transport=stack.getTransport();
        transport.setLogDiscardMessages(false);
    }
View Full Code Here

    public void init() throws Exception {
        if(view_ack_collection_timeout <= 0)
            throw new IllegalArgumentException("view_ack_collection_timeout has to be greater than 0");
        prev_members=new BoundedList<Address>(num_prev_mbrs);
        TP transport=getTransport();
        timer=transport.getTimer();
        if(timer == null)
            throw new Exception("timer is null");
        if(impl != null)
            impl.init();
        transport.registerProbeHandler(this);
    }
View Full Code Here

        Util.close(ch);
    }


    public void testSetter() {
        TP transport=ch.getProtocolStack().getTransport();
        int port=transport.getBindPort();
        System.out.println("port = " + port);
        transport.setBindPort(port +20);
        int old_port=port;
        port=transport.getBindPort();
        System.out.println("port = " + port);
        assert old_port + 20 == port;
    }
View Full Code Here

                discard_delivered_msgs=false;
                log.warn("xmit_from_random_member set to true: changed discard_delivered_msgs to false");
            }
        }

        TP transport=getTransport();
        if(transport != null) {
            transport.registerProbeHandler(this);
            if(!transport.supportsMulticasting()) {
                if(use_mcast_xmit) {
                    log.warn("use_mcast_xmit should not be used because the transport (" + transport.getName() +
                            ") does not support IP multicasting; setting use_mcast_xmit to false");
                    use_mcast_xmit=false;
                }
                if(use_mcast_xmit_req) {
                    log.warn("use_mcast_xmit_req should not be used because the transport (" + transport.getName() +
                            ") does not support IP multicasting; setting use_mcast_xmit_req to false");
                    use_mcast_xmit_req=false;
                }
            }
        }
View Full Code Here

        Util.close(c2);
    }

    private static void disableBundling(JChannel ch) {
        ProtocolStack stack=ch.getProtocolStack();
        TP transport=stack.getTransport();
        if(transport != null) {
            transport.setEnableBundling(false);
        }
    }
View Full Code Here

    }


    private static void setOOBPoolSize(JChannel... channels) {
        for(JChannel channel: channels) {
            TP transport=channel.getProtocolStack().getTransport();
            transport.setOOBThreadPoolMinThreads(1);
            transport.setOOBThreadPoolMaxThreads(2);
        }
    }
View Full Code Here

TOP

Related Classes of org.jgroups.protocols.TP$ProbeHandler

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.