/** Retransmit this entry */ public void run() { _retransmit(this); }
/** * Create and <b>start</b> the retransmitter * * @param cmd the callback object for retranmissions * @param sched the external scheduler to use to schedule retransmissions * * @throws IllegalArgumentException if <code>cmd</code> is null */ public AckMcastSenderWindow(RetransmitCommand cmd, TimeScheduler sched) { init(cmd, RETRANSMIT_TIMEOUTS, sched, false); }
@Override // GemStoneAddition public void stop() { AckReceiverWindow win; if(sender_win != null) { sender_win.stop(); sender_win=null; } for(Iterator it=receivers.values().iterator(); it.hasNext();) { win=(AckReceiverWindow)it.next(); win.reset(); } receivers.clear(); }
sender_win=new AckMcastSenderWindow(this, timeout); sender_win.ack(hdr.seqno, msg.getSrc()); sender_win.clearStableMessages(); if(trace) log.trace("received ack for #" + hdr.seqno + " from " + msg.getSrc());
/** * Process with address <code>suspected</code> is suspected: remove it * from all receiver sets. This means that no ACKs are expected from this * process anymore. * * @param suspected The suspected process */ public void suspect(Address suspected) { if(log.isInfoEnabled()) log.info(ExternalStrings.AckMcastSenderWindow_SUSPECT_IS__0, suspected); remove(suspected); suspects.add(suspected); if(suspects.size() >= max_suspects) suspects.removeFirst(); }
/** * Setup this object's state * * @param cmd the callback object for retranmissions * @param retransmit_intervals the interval between two consecutive * retransmission attempts * @param sched the external scheduler to use to schedule retransmissions * @param sched_owned if true, the scheduler is owned by this object and * can be started/stopped/destroyed. If false, the scheduler is shared * among multiple objects and start()/stop() should not be called from * within this object * * @throws IllegalArgumentException if <code>cmd</code> is null */ private void init(RetransmitCommand cmd, long[] retransmit_intervals, TimeScheduler sched, boolean sched_owned) { if (cmd == null) { if(log.isErrorEnabled()) log.error(ExternalStrings.AckMcastSenderWindow_COMMAND_IS_NULL_CANNOT_RETRANSMIT_MESSAGES_); throw new IllegalArgumentException("cmd"); } retransmitter_owned = sched_owned; retransmitter = sched; this.retransmit_intervals = retransmit_intervals; this.cmd = cmd; start(); }
if(log.isErrorEnabled()) log.error(_toString(ex));
if(msg.getDest() == null || msg.getDest().isMulticastAddress()) { msg.putHeader(name, new SmackHeader(SmackHeader.MCAST, seqno)); sender_win.add(seqno, msg, (Vector)members.clone()); if(trace) log.trace("sending mcast #" + seqno); seqno++;
/** * @param entry the record associated with the msg to retransmit. It * contains the list of receivers that haven't yet ack reception */ protected/*GemStoneAddition*/ void _retransmit(Entry entry) { Address sender; boolean received; synchronized(entry) { for(Enumeration e = entry.senders.keys(); e.hasMoreElements();) { sender = (Address)e.nextElement(); received = ((Boolean)entry.senders.get(sender)).booleanValue(); if (!received) { if(suspects.contains(sender)) { if(log.isWarnEnabled()) log.warn("removing " + sender + " from retransmit list as it is in the suspect list"); remove(sender); continue; } if(log.isInfoEnabled()) log.info("--> retransmitting msg #" + entry.seqno + " to " + sender); cmd.retransmit(entry.seqno, entry.msg.copy(), sender); } } } }
/** * Create and <b>start</b> the retransmitter * * @param cmd the callback object for retranmissions * @param retransmit_intervals the interval between two consecutive * retransmission attempts * @param sched the external scheduler to use to schedule retransmissions * * @throws IllegalArgumentException if <code>cmd</code> is null */ public AckMcastSenderWindow(RetransmitCommand cmd, long[] retransmit_intervals, TimeScheduler sched) { init(cmd, retransmit_intervals, sched, false); }
void removeMember(Address mbr) { synchronized(members) { if(mbr != null) { Object tmp; View new_view; members.removeElement(mbr); tmp=members.clone(); if(trace) log.trace("removed " + mbr + ", members=" + tmp); new_view=new View(new ViewId(local_addr, vid++), (Vector)tmp); passUp(new Event(Event.VIEW_CHANGE, new_view)); passDown(new Event(Event.VIEW_CHANGE, new_view)); if(sender_win != null) sender_win.remove(mbr); // causes retransmissions to mbr to stop } } }
/** * Create and <b>start</b> the retransmitter * * @param cmd the callback object for retranmissions * @param retransmit_intervals the interval between two consecutive * 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); }