Java Doc for DistributedQueue.java in  » Net » JGroups-2.4.1-sp3 » org » jgroups » blocks » 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.blocks 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jgroups.blocks.DistributedQueue

All known Subclasses:   org.jgroups.demos.DistributedQueueDemo,
DistributedQueue
public class DistributedQueue implements MessageListener,MembershipListener,Cloneable(Code)
Provides the abstraction of a java.util.LinkedList that is replicated at several locations. Any change to the list (reset, add, remove, etc.) will transparently be propagated to all replicas in the group. All read-only methods will always access the local replica.

Both keys and values added to the list must be serializable, the reason being that they will be sent across the network to all replicas of the group. An instance of this class will contact an existing member of the group to fetch its initial state. Beware to use a total protocol on initialization or elements would not be in same order on all replicas.
author:
   Romuald du Song


Inner Class :public interface Notification

Field Summary
protected  Channelchannel
    
protected  RpcDispatcherdisp
    
protected  Stringgroupname
    
protected  LinkedListinternalQueue
    
protected  Loglogger
    
protected  Vectormembers
    
final protected  Objectmutex
    
protected  Vectornotifs
    
protected  booleanstopped
    

Constructor Summary
public  DistributedQueue(String groupname, ChannelFactory factory, String properties, long state_timeout)
     Creates a DistributedQueue
Parameters:
  groupname - The name of the group to join
Parameters:
  factory - The ChannelFactory which will be used to create a channel
Parameters:
  properties - The property string to be used to define the channel
Parameters:
  state_timeout - The time to wait until state is retrieved in milliseconds.
public  DistributedQueue(JChannel channel)
    
public  DistributedQueue(PullPushAdapter adapter, Serializable id)
     Uses a user-provided PullPushAdapter to create the dispatcher rather than a Channel.

Method Summary
public  void_add(Object value)
    
public  void_addAll(Collection c)
    
public  void_addAtHead(Object value)
    
protected  void_private_reset()
    
public  Object_remove()
    
public  void_reset()
    
public  voidadd(Object value)
    
public  voidaddAll(Collection values)
     Add the speficied collection to the top of the queue.
public  voidaddAtHead(Object value)
    
public  voidaddNotifier(Notification n)
    
public  voidblock()
    
protected  voidcheckResult(RspList rsp, Object retval)
    
public  ChannelgetChannel()
    
public  VectorgetContents()
    
public  AddressgetLocalAddress()
    
public  byte[]getState()
    
final protected  voidinit()
    
final  voidinitSignatures()
    
public static  voidmain(String[] args)
    
public  Objectpeek()
     returns the first object on the queue, without removing it.
public  voidreceive(Message msg)
    
public  Objectremove()
     Try to return the first objet in the queue.It does not wait for an object.
public  Objectremove(long timeout)
    
Parameters:
  timeout - The time to wait until an entry is retrieved in milliseconds.
public  voidremoveNotifier(Notification n)
    
public  voidreset()
    
 voidsendViewChangeNotifications(Vector new_mbrs, Vector old_mbrs)
    
public  voidsetState(byte[] new_state)
    
public  intsize()
    
final public  voidstart(long state_timeout)
    
public  voidstop()
    
public  voidsuspect(Address suspected_mbr)
    
public  StringtoString()
    
public  voidviewAccepted(View new_view)
    

Field Detail
channel
protected Channel channel(Code)



disp
protected RpcDispatcher disp(Code)



groupname
protected String groupname(Code)



internalQueue
protected LinkedList internalQueue(Code)



logger
protected Log logger(Code)



members
protected Vector members(Code)



mutex
final protected Object mutex(Code)



notifs
protected Vector notifs(Code)



stopped
protected boolean stopped(Code)




Constructor Detail
DistributedQueue
public DistributedQueue(String groupname, ChannelFactory factory, String properties, long state_timeout) throws ChannelException(Code)
Creates a DistributedQueue
Parameters:
  groupname - The name of the group to join
Parameters:
  factory - The ChannelFactory which will be used to create a channel
Parameters:
  properties - The property string to be used to define the channel
Parameters:
  state_timeout - The time to wait until state is retrieved in milliseconds. A value of 0 means wait forever.



DistributedQueue
public DistributedQueue(JChannel channel)(Code)



DistributedQueue
public DistributedQueue(PullPushAdapter adapter, Serializable id)(Code)
Uses a user-provided PullPushAdapter to create the dispatcher rather than a Channel. If id is non-null, it will be used to register under that id. This is typically used when another building block is already using PullPushAdapter, and we want to add this building block in addition. The id is the used to discriminate between messages for the various blocks on top of PullPushAdapter. If null, we will assume we are the first block created on PullPushAdapter. The caller needs to call start(), before using the this block. It gives the opportunity for the caller to register as a lessoner for Notifications events.
Parameters:
  adapter - The PullPushAdapter which to use as underlying transport
Parameters:
  id - A serializable object (e.g. an Integer) used to discriminate (multiplex/demultiplex) betweenrequests/responses for different building blocks on top of PullPushAdapter.




Method Detail
_add
public void _add(Object value)(Code)



_addAll
public void _addAll(Collection c)(Code)



_addAtHead
public void _addAtHead(Object value)(Code)



_private_reset
protected void _private_reset()(Code)



_remove
public Object _remove()(Code)



_reset
public void _reset()(Code)



add
public void add(Object value)(Code)
Add the speficied element at the bottom of the queue
Parameters:
  value -



addAll
public void addAll(Collection values)(Code)
Add the speficied collection to the top of the queue. Elements are added in the order that they are returned by the specified collection's iterator.
Parameters:
  values -



addAtHead
public void addAtHead(Object value)(Code)
Add the speficied element at the top of the queue
Parameters:
  value -



addNotifier
public void addNotifier(Notification n)(Code)



block
public void block()(Code)
Block sending and receiving of messages until ViewAccepted is called



checkResult
protected void checkResult(RspList rsp, Object retval)(Code)



getChannel
public Channel getChannel()(Code)



getContents
public Vector getContents()(Code)



getLocalAddress
public Address getLocalAddress()(Code)



getState
public byte[] getState()(Code)



init
final protected void init()(Code)



initSignatures
final void initSignatures()(Code)



main
public static void main(String[] args)(Code)



peek
public Object peek()(Code)
returns the first object on the queue, without removing it. If the queue is empty this object blocks until the first queue object has been added the first object on the queue



receive
public void receive(Message msg)(Code)



remove
public Object remove()(Code)
Try to return the first objet in the queue.It does not wait for an object. the first object in the queue or null if none were found.



remove
public Object remove(long timeout)(Code)

Parameters:
  timeout - The time to wait until an entry is retrieved in milliseconds. A value of 0 means wait forever. the first object in the queue or null if none were found



removeNotifier
public void removeNotifier(Notification n)(Code)



reset
public void reset()(Code)



sendViewChangeNotifications
void sendViewChangeNotifications(Vector new_mbrs, Vector old_mbrs)(Code)



setState
public void setState(byte[] new_state)(Code)



size
public int size()(Code)



start
final public void start(long state_timeout) throws ChannelClosedException, ChannelNotConnectedException(Code)



stop
public void stop()(Code)



suspect
public void suspect(Address suspected_mbr)(Code)
Called when a member is suspected



toString
public String toString()(Code)



viewAccepted
public void viewAccepted(View new_view)(Code)



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.