Package org.jgroups.util

Examples of org.jgroups.util.TimeScheduler$IntTask


    static final double       PERCENTAGE_OFF=1.3; // how much can expected xmit_timeout and real timeout differ to still be okay ?
    final Map<Long,Entry>     msgs=new ConcurrentHashMap<Long,Entry>(); // keys=seqnos (Long), values=Entries

    @DataProvider(name="provider")
    Object[][] provider() {
        final TimeScheduler timer=new DefaultTimeScheduler(10);
        return new Object[][] {
                {timer,
                 new AckSenderWindow(new MyRetransmitCommand(), new StaticInterval(xmit_timeouts), timer)}
        };
    }
View Full Code Here


    public void testShutdownOfTimer() throws Exception {
        a=createSharedChannel(SINGLETON_1);
        b=createSharedChannel(SINGLETON_1);
        a.connect("x");
        b.connect("y");
        TimeScheduler timer1=a.getProtocolStack().getTransport().getTimer();
        TimeScheduler timer2=b.getProtocolStack().getTransport().getTimer();

        assert timer1 == timer2;

        assert !timer1.isShutdown();
        assert !timer2.isShutdown();

        Util.sleep(500);
        b.close();

        assert !timer2.isShutdown();
        assert !timer1.isShutdown();

        a.close(); // now, reference counting reaches 0, so the timer thread pool is stopped
        assert timer2.isShutdown();
        assert timer1.isShutdown();
    }
View Full Code Here

    }


    public void setUp() throws Exception {
        super.setUp();
        timer=new TimeScheduler();
    }
View Full Code Here

     * retransmission attempts
     *
     * @throws IllegalArgumentException if <code>cmd</code> is null
     */
    public AckMcastSenderWindow(RetransmitCommand cmd, long[] retransmit_intervals) {
  init(cmd, retransmit_intervals, new TimeScheduler(SUSPEND_TIMEOUT), true);
    }
View Full Code Here

     * Create a new Retransmitter associated with the given sender address
     * @param sender the address from which retransmissions are expected or to which retransmissions are sent
     * @param cmd the retransmission callback reference
     */
    public Retransmitter(Address sender, RetransmitCommand cmd) {
        init(sender, cmd, new TimeScheduler(SUSPEND_TIMEOUT), true);
    }
View Full Code Here

     * i. Set the gossip task scheduler
     * ii. Reset the layer's state.
     * iii. Start the gossiping task
     */
    public void start() throws Exception {
        TimeScheduler timer;

        super.start();
        timer=stack != null ? stack.timer : null;
        if(timer == null)
            throw new Exception("STABLE.start(): timer is null");
View Full Code Here

     * @deprecated Use {@link org.jgroups.protocols.TP#getTimer()} to fetch the timer and call getCorePoolSize() directly
     * @return
     */
    public int getTimerThreads() {
        TP transport=getTransport();
        TimeScheduler timer;
        if(transport != null) {
            timer=transport.getTimer();
            if(timer != null)
                return timer.getCorePoolSize();
        }
        return -1;
    }
View Full Code Here

     * transport and then invoke the method on it
     * @return
     */
    public String dumpTimerQueue() {
        TP transport=getTransport();
        TimeScheduler timer;
        if(transport != null) {
            timer=transport.getTimer();
            if(timer != null)
                return timer.dumpTaskQueue();
        }
        return "";
    }
View Full Code Here

     * @param retransmit_intervals the interval between two consecutive
     *                             retransmission attempts
     * @throws IllegalArgumentException if <code>cmd</code> is null
     */
    public AckMcastSenderWindow(RetransmitCommand cmd, Interval retransmit_intervals) {
        init(cmd, retransmit_intervals, new TimeScheduler(), true);
    }
View Full Code Here

            catch(InterruptedException e) {
            }
        }
        this.timer=timer;
        if(this.timer == null)
            this.timer=new TimeScheduler();
    }
View Full Code Here

TOP

Related Classes of org.jgroups.util.TimeScheduler$IntTask

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.