Java Doc for AckMcastSenderWindow.java in  » Net » JGroups-2.4.1-sp3 » org » jgroups » stack » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » JGroups 2.4.1 sp3 » org.jgroups.stack 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jgroups.stack.AckMcastSenderWindow

All known Subclasses:   org.jgroups.protocols.SMACK,
AckMcastSenderWindow
public class AckMcastSenderWindow (Code)
Keeps track of ACKs from receivers for each message. When a new message is sent, it is tagged with a sequence number and the receiver set (set of members to which the message is sent) and added to a hashtable (key = sequence number, val = message + receiver set). Each incoming ACK is noted and when all ACKs for a specific sequence number haven been received, the corresponding entry is removed from the hashtable. A retransmission thread periodically re-sends the message point-to-point to all receivers from which no ACKs have been received yet. A view change or suspect message causes the corresponding non-existing receivers to be removed from the hashtable.

This class may need flow control in order to avoid needless retransmissions because of timeouts.
author:
   Bela Ban June 9 1999
author:
   John Georgiadis May 8 2001
version:
   $Revision: 1.10.6.1 $


Inner Class :public interface RetransmitCommand

Field Summary
final protected static  Loglog
    

Constructor Summary
public  AckMcastSenderWindow(RetransmitCommand cmd, long[] retransmit_intervals, TimeScheduler sched)
    
public  AckMcastSenderWindow(RetransmitCommand cmd, TimeScheduler sched)
    
public  AckMcastSenderWindow(RetransmitCommand cmd, long[] retransmit_intervals)
    
public  AckMcastSenderWindow(RetransmitCommand cmd)
    

Method Summary
public  voidack(long seqno, Address sender)
     An ACK has been received from sender.
public  voidadd(long seqno, Message msg, Vector receivers)
     Adds a new message to the hash table.
public  voidclearStableMessages()
    
public  longgetNumberOfResponsesExpected(long seqno)
    
public  longgetNumberOfResponsesReceived(long seqno)
    
public  VectorgetStableMessages()
     a copy of stable messages, or null (if non available).
public  StringprintDetails(long seqno)
    
public  voidremove(Address obj)
     Remove obj from all receiver sets and wake up retransmission thread.
public  voidreset()
     Remove all pending msgs from the hashtable.
public  longsize()
    
public  voidstart()
     Start the retransmitter.
public  voidstop()
     Stop the rentransmition and clear all pending msgs.

If this retransmitter has been provided an externally managed scheduler, then just clear all msgs and the associated tasks, else stop the scheduler.

public  voidsuspect(Address suspected)
     Process with address suspected is suspected: remove it from all receiver sets.
public  StringtoString()
    
public  voidwaitUntilAllAcksReceived(long timeout)
     Waits until all outstanding messages have been ACKed by all receivers. Takes into account suspicions and view changes.

Field Detail
log
final protected static Log log(Code)




Constructor Detail
AckMcastSenderWindow
public AckMcastSenderWindow(RetransmitCommand cmd, long[] retransmit_intervals, TimeScheduler sched)(Code)
Create and start the retransmitter
Parameters:
  cmd - the callback object for retranmissions
Parameters:
  retransmit_intervals - the interval between two consecutiveretransmission attempts
Parameters:
  sched - the external scheduler to use to schedule retransmissions
throws:
  IllegalArgumentException - if cmd is null



AckMcastSenderWindow
public AckMcastSenderWindow(RetransmitCommand cmd, TimeScheduler sched)(Code)
Create and start the retransmitter
Parameters:
  cmd - the callback object for retranmissions
Parameters:
  sched - the external scheduler to use to schedule retransmissions
throws:
  IllegalArgumentException - if cmd is null



AckMcastSenderWindow
public AckMcastSenderWindow(RetransmitCommand cmd, long[] retransmit_intervals)(Code)
Create and start the retransmitter
Parameters:
  cmd - the callback object for retranmissions
Parameters:
  retransmit_intervals - the interval between two consecutiveretransmission attempts
throws:
  IllegalArgumentException - if cmd is null



AckMcastSenderWindow
public AckMcastSenderWindow(RetransmitCommand cmd)(Code)
Create and start the retransmitter
Parameters:
  cmd - the callback object for retranmissions
throws:
  IllegalArgumentException - if cmd is null




Method Detail
ack
public void ack(long seqno, Address sender)(Code)
An ACK has been received from sender. Tag the sender in the hash table as 'received'. If all ACKs have been received, remove the entry all together.
Parameters:
  seqno - The sequence number of the message for which an ACK hasbeen received.
Parameters:
  sender - The sender which sent the ACK



add
public void add(long seqno, Message msg, Vector receivers)(Code)
Adds a new message to the hash table.
Parameters:
  seqno - The sequence number associated with the message
Parameters:
  msg - The message (should be a copy!)
Parameters:
  receivers - The set of addresses to which the message was sentand from which consequently an ACK is expected



clearStableMessages
public void clearStableMessages()(Code)



getNumberOfResponsesExpected
public long getNumberOfResponsesExpected(long seqno)(Code)
Returns the number of members for a given entry for which acks have to be received



getNumberOfResponsesReceived
public long getNumberOfResponsesReceived(long seqno)(Code)
Returns the number of members for a given entry for which acks have been received



getStableMessages
public Vector getStableMessages()(Code)
a copy of stable messages, or null (if non available). Removesall stable messages afterwards



printDetails
public String printDetails(long seqno)(Code)
Prints all members plus whether an ack has been received from those members for a given seqno



remove
public void remove(Address obj)(Code)
Remove obj from all receiver sets and wake up retransmission thread.
Parameters:
  obj - the sender to remove



reset
public void reset()(Code)
Remove all pending msgs from the hashtable. Cancel all associated tasks in the retransmission scheduler



size
public long size()(Code)
the number of currently pending msgs



start
public void start()(Code)
Start the retransmitter. This has no effect, if the retransmitter was externally provided



stop
public void stop()(Code)
Stop the rentransmition and clear all pending msgs.

If this retransmitter has been provided an externally managed scheduler, then just clear all msgs and the associated tasks, else stop the scheduler. In this case the method blocks until the scheduler's thread is dead. Only the owner of the scheduler should stop it.




suspect
public void suspect(Address suspected)(Code)
Process with address suspected is suspected: remove it from all receiver sets. This means that no ACKs are expected from this process anymore.
Parameters:
  suspected - The suspected process



toString
public String toString()(Code)



waitUntilAllAcksReceived
public void waitUntilAllAcksReceived(long timeout)(Code)
Waits until all outstanding messages have been ACKed by all receivers. Takes into account suspicions and view changes. Returns when there are no entries left in the hashtable. While waiting, no entries can be added to the hashtable (they will be discarded).
Parameters:
  timeout - Miliseconds to wait. 0 means wait indefinitely.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.