Java Doc for NotificationBus.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.NotificationBus

All known Subclasses:   org.jgroups.demos.NotificationBusDemo,
NotificationBus
public class NotificationBus implements Receiver(Code)
This class provides notification sending and handling capability. Producers can send notifications to all registered consumers. Provides hooks to implement shared group state, which allows an application programmer to maintain a local cache which is replicated by all instances. NotificationBus sits on top of a channel, however it creates its channel itself, so the application programmers do not have to provide their own channel.
author:
   Bela Ban

Inner Class :public interface Consumer

Field Summary
 Stringbus_name
    
final  Objectcache_mutex
    
 Channelchannel
    
 Consumerconsumer
    
final  Promiseget_cache_promise
    
 Addresslocal_addr
    
final protected  Loglog
    
final  Vectormembers
    
 Stringprops
    

Constructor Summary
public  NotificationBus()
    
public  NotificationBus(String bus_name)
    
public  NotificationBus(String bus_name, String properties)
    
public  NotificationBus(Channel channel, String bus_name)
    

Method Summary
public  voidblock()
    
 AddressdetermineCoordinator()
    
public  SerializablegetCache()
    
public  SerializablegetCacheFromCoordinator(long timeout, int max_tries)
     Determines the coordinator and asks it for its cache.
public  SerializablegetCacheFromMember(Address mbr, long timeout, int max_tries)
     Determines the coordinator and asks it for its cache.
public  ChannelgetChannel()
     Answers the Channel. Used to operate on the underlying channel directly, e.g.
public  AddressgetLocalAddress()
    
public  VectorgetMembership()
     Returns a reference to the real membership: don't modify.
public  byte[]getState()
    
 voidhandleCacheRequest(Address sender)
    
public  booleanisCoordinator()
    
public  voidnotifyConsumer(Serializable n)
     Don't multicast this to all members, just apply it to local consumers.
public  voidreceive(Message msg)
    
public  voidsendNotification(Serializable n)
    
public  voidsendNotification(Address dest, Serializable n)
    
public  voidsetConsumer(Consumer c)
    
public  voidsetState(byte[] state)
    
public  voidstart()
    
public  voidstop()
    
public  voidsuspect(Address suspected_mbr)
    
public synchronized  voidviewAccepted(View new_view)
    

Field Detail
bus_name
String bus_name(Code)



cache_mutex
final Object cache_mutex(Code)



channel
Channel channel(Code)



consumer
Consumer consumer(Code)



get_cache_promise
final Promise get_cache_promise(Code)



local_addr
Address local_addr(Code)



log
final protected Log log(Code)



members
final Vector members(Code)



props
String props(Code)




Constructor Detail
NotificationBus
public NotificationBus() throws Exception(Code)



NotificationBus
public NotificationBus(String bus_name) throws Exception(Code)



NotificationBus
public NotificationBus(String bus_name, String properties) throws Exception(Code)



NotificationBus
public NotificationBus(Channel channel, String bus_name) throws Exception(Code)




Method Detail
block
public void block()(Code)



determineCoordinator
Address determineCoordinator()(Code)



getCache
public Serializable getCache()(Code)



getCacheFromCoordinator
public Serializable getCacheFromCoordinator(long timeout, int max_tries)(Code)
Determines the coordinator and asks it for its cache. If there is no coordinator (because we are first member), null will be returned. Used only internally by NotificationBus.
Parameters:
  timeout - Max number of msecs until the call returns
Parameters:
  max_tries - Max number of attempts to fetch the cache from the coordinator



getCacheFromMember
public Serializable getCacheFromMember(Address mbr, long timeout, int max_tries)(Code)
Determines the coordinator and asks it for its cache. If there is no coordinator (because we are first member), null will be returned. Used only internally by NotificationBus.
Parameters:
  mbr - The address of the member from which to fetch the state. If null, the current coordinatorwill be asked for the state
Parameters:
  timeout - Max number of msecs until the call returns - if timeout elapsesnull will be returned
Parameters:
  max_tries - Max number of attempts to fetch the cache from the coordinator (will be set to 1 if < 1)



getChannel
public Channel getChannel()(Code)
Answers the Channel. Used to operate on the underlying channel directly, e.g. perform operations that are not provided using only NotificationBus. Should be used sparingly. underlying Channel



getLocalAddress
public Address getLocalAddress()(Code)



getMembership
public Vector getMembership()(Code)
Returns a reference to the real membership: don't modify. If you need to modify, make a copy first ! Vector of Address objects



getState
public byte[] getState()(Code)



handleCacheRequest
void handleCacheRequest(Address sender)(Code)



isCoordinator
public boolean isCoordinator()(Code)



notifyConsumer
public void notifyConsumer(Serializable n)(Code)
Don't multicast this to all members, just apply it to local consumers.



receive
public void receive(Message msg)(Code)



sendNotification
public void sendNotification(Serializable n)(Code)
Pack the argument in a Info, serialize that one into the message buffer and send the message



sendNotification
public void sendNotification(Address dest, Serializable n)(Code)
Pack the argument in a Info, serialize that one into the message buffer and send the message



setConsumer
public void setConsumer(Consumer c)(Code)



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



start
public void start() throws Exception(Code)



stop
public void stop()(Code)



suspect
public void suspect(Address suspected_mbr)(Code)



viewAccepted
public synchronized 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.