Java Doc for NotificationBroadcasterSupport.java in  » JMX » jfoxmx » javax » management » 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 » JMX » jfoxmx » javax.management 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.management.NotificationBroadcasterSupport

All known Subclasses:   javax.management.relation.RelationService,  org.huihoo.jfox.service.ComponentSupport,  javax.management.timer.Timer,  javax.management.monitor.Monitor,  example.jmx.notification.SimpleNotification,
NotificationBroadcasterSupport
public class NotificationBroadcasterSupport implements NotificationEmitter(Code)

Provides an implementation of javax.management.NotificationEmitter NotificationEmitter interface. This can be used as the super class of an MBean that sends notifications.

It is not specified whether the notification dispatch model is synchronous or asynchronous. That is, when a thread calls NotificationBroadcasterSupport.sendNotification sendNotification , the NotificationListener.handleNotificationNotificationListener.handleNotification method of each listener may be called within that thread (a synchronous model) or within some other thread (an asynchronous model).

Applications should not depend on notification dispatch being synchronous or being asynchronous. Thus:

  • Applications should not assume a synchronous model. When the NotificationBroadcasterSupport.sendNotification sendNotification method returns, it is not guaranteed that every listener's NotificationListener.handleNotification handleNotification method has been called. It is not guaranteed either that a listener will see notifications in the same order as they were generated. Listeners that depend on order should use the sequence number of notifications to determine their order (see Notification.getSequenceNumber ).
  • Applications should not assume an asynchronous model. If the actions performed by a listener are potentially slow, the listener should arrange for them to be performed in another thread, to avoid holding up other listeners and the caller of NotificationBroadcasterSupport.sendNotification sendNotification .

author:
   Young Yang



Constructor Summary
public  NotificationBroadcasterSupport()
    

Method Summary
public  voidaddNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
     Adds a listener.
Parameters:
  listener - The listener to receive notifications.
Parameters:
  filter - The filter object.
public  MBeanNotificationInfo[]getNotificationInfo()
     Returns a NotificationInfo object contaning the name of the Java class of the notification and the notification types sent.
protected  voidhandleNotification(NotificationListener listener, Notification notif, Object handback)
    

This method is called by NotificationBroadcasterSupport.sendNotificationsendNotification for each listener in order to send the notification to that listener.

public synchronized  voidremoveNotificationListener(NotificationListener listener)
     Removes a listener.
public synchronized  voidremoveNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
    
public  voidsendNotification(Notification notification)
     Sends a notification.


Constructor Detail
NotificationBroadcasterSupport
public NotificationBroadcasterSupport()(Code)




Method Detail
addNotificationListener
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)(Code)
Adds a listener.
Parameters:
  listener - The listener to receive notifications.
Parameters:
  filter - The filter object. If filter is null, no filtering will be performed before handling notifications.
Parameters:
  handback - An opaque object to be sent back to the listener when a notification is emitted. This objectcannot be used by the Notification broadcaster object. It should be resent unchanged with the notificationto the listener.
exception:
  IllegalArgumentException - thrown if the istener is null.
See Also:   NotificationBroadcasterSupport.removeNotificationListener



getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()(Code)
Returns a NotificationInfo object contaning the name of the Java class of the notification and the notification types sent.



handleNotification
protected void handleNotification(NotificationListener listener, Notification notif, Object handback)(Code)

This method is called by NotificationBroadcasterSupport.sendNotificationsendNotification for each listener in order to send the notification to that listener. It can be overridden in subclasses to change the behaviour of notification delivery, for instance to deliver the notification in a separate thread.

It is not guaranteed that this method is called by the same thread as the one that called NotificationBroadcasterSupport.sendNotificationsendNotification .

The default implementation of this method is equivalent to

 listener.handleNotification(notif, handback);
 

Parameters:
  listener - the listener to which the notification is beingdelivered.
Parameters:
  notif - the notification being delivered to the listener.
Parameters:
  handback - the handback object that was supplied when thelistener was added.
since:
   JMX 1.2



removeNotificationListener
public synchronized void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException(Code)
Removes a listener. Note that if the listener has been registered with different handback objects or notification filters, all entries corresponding to the listener will be removed.
Parameters:
  listener - the listener to receive notifications.
throws:
  ListenerNotFoundException -



removeNotificationListener
public synchronized void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException(Code)



sendNotification
public void sendNotification(Notification notification)(Code)
Sends a notification. A listener will be removed if an exception appears when calling the listener's handleNotification method.
Parameters:
  notification -



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.