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


java.lang.Object
   javax.management.NotificationBroadcasterSupport
      javax.management.timer.Timer

Timer
public class Timer extends NotificationBroadcasterSupport implements TimerMBean,MBeanRegistration(Code)
Provides the implementation of the timer MBean. The timer MBean sends out an alarm at a specified time that wakes up all the listeners registered to receive timer notifications.

This class manages a list of dated timer notifications. A method allows users to add/remove as many notifications as required. When a timer notification is emitted by the timer and becomes obsolete, it is automatically removed from the list of timer notifications.
Additional timer notifications can be added into regularly repeating notifications.

Note:

  1. All notifications before the time when the addNotification method is called are ignored, irrespective of the sendPastNotifications flag.
  2. When sending timer notifications, the timer updates the notification sequence number irrespective of the notification type.
  3. The timer service relies on the system date of the host where the Timer class is loaded. Listeners may receive untimely notifications if their host has a different system date. To avoid such problems, synchronize the system date of all host machines where timing is needed.
  4. The default behaviour for periodic notifications is fixed-delay execution, as specified in java.util.Timer . In order to use fixed-rate execution, use the overloaded Timer.addNotification(String,String,Object,Date,long,long,boolean) method.
  5. Notification listeners are potentially all executed in the same thread. Therefore, they should execute rapidly to avoid holding up other listeners or perturbing the regularity of fixed-delay executions. See NotificationBroadcasterSupport .

author:
   Young Yang



Constructor Summary
public  Timer()
    

Method Summary
public synchronized  IntegeraddNotification(String type, String message, Object userData, Date date, long period, long nbOccurences)
     add a notification to the Timer
Parameters:
  type - The notification type string.
Parameters:
  message - The notification¡¯s detailed message string.
Parameters:
  userData - The notification¡¯s user data object.
Parameters:
  date - The date when the notification will occur.
public synchronized  IntegeraddNotification(String type, String message, Object userData, Date date, long period)
    
public synchronized  IntegeraddNotification(String type, String message, Object userData, Date date)
    
public  IntegeraddNotification(String type, String message, Object userData, Date date, long period, long nbOccurences, boolean fixedRate)
    
public synchronized  VectorgetAllNotificationIDs()
    
public  DategetDate(Integer id)
    
public  BooleangetFixedRate(Integer id)
    
public  intgetNbNotifications()
    
public  LonggetNbOccurences(Integer id)
    
public synchronized  VectorgetNotificationIDs(String type)
    
public  MBeanNotificationInfo[]getNotificationInfo()
    
public  StringgetNotificationMessage(Integer id)
    
public  StringgetNotificationType(Integer id)
    
public  ObjectgetNotificationUserData(Integer id)
    
public  LonggetPeriod(Integer id)
    
public  booleangetSendPastNotifications()
    
public  booleanisActive()
    
public  booleanisEmpty()
    
public  voidpostDeregister()
    
public  voidpostRegister(Boolean boolean1)
    
public  voidpreDeregister()
    
public  ObjectNamepreRegister(MBeanServer mbeanserver, ObjectName objectname)
    
public synchronized  voidremoveAllNotifications()
    
public synchronized  voidremoveNotification(Integer id)
    
public synchronized  voidremoveNotifications(String type)
    
public  voidsetSendPastNotifications(boolean flag)
    
public  voidstart()
    
public synchronized  voidstop()
    


Constructor Detail
Timer
public Timer()(Code)




Method Detail
addNotification
public synchronized Integer addNotification(String type, String message, Object userData, Date date, long period, long nbOccurences) throws IllegalArgumentException(Code)
add a notification to the Timer
Parameters:
  type - The notification type string.
Parameters:
  message - The notification¡¯s detailed message string.
Parameters:
  userData - The notification¡¯s user data object.
Parameters:
  date - The date when the notification will occur. The Timer class includesinteger constants for expressing durations in milliseconds, which can then beused to doCreate java.util.Date objects.
Parameters:
  period - The interval in milliseconds between notification occurrences.Repeating notifications are not enabled if this parameter is zero or null.
Parameters:
  nbOccurences - The total number of times that the notification will occur. Ifthe value of this parameter is zero or is not defined (null), and if the period isnot zero or null, then the notification will repeat indefinitely.
throws:
  IllegalArgumentException -



addNotification
public synchronized Integer addNotification(String type, String message, Object userData, Date date, long period) throws IllegalArgumentException(Code)



addNotification
public synchronized Integer addNotification(String type, String message, Object userData, Date date) throws IllegalArgumentException(Code)



addNotification
public Integer addNotification(String type, String message, Object userData, Date date, long period, long nbOccurences, boolean fixedRate) throws IllegalArgumentException(Code)



getAllNotificationIDs
public synchronized Vector getAllNotificationIDs()(Code)



getDate
public Date getDate(Integer id)(Code)



getFixedRate
public Boolean getFixedRate(Integer id)(Code)



getNbNotifications
public int getNbNotifications()(Code)



getNbOccurences
public Long getNbOccurences(Integer id)(Code)



getNotificationIDs
public synchronized Vector getNotificationIDs(String type)(Code)



getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()(Code)



getNotificationMessage
public String getNotificationMessage(Integer id)(Code)



getNotificationType
public String getNotificationType(Integer id)(Code)



getNotificationUserData
public Object getNotificationUserData(Integer id)(Code)



getPeriod
public Long getPeriod(Integer id)(Code)



getSendPastNotifications
public boolean getSendPastNotifications()(Code)



isActive
public boolean isActive()(Code)



isEmpty
public boolean isEmpty()(Code)



postDeregister
public void postDeregister()(Code)



postRegister
public void postRegister(Boolean boolean1)(Code)



preDeregister
public void preDeregister() throws Exception(Code)



preRegister
public ObjectName preRegister(MBeanServer mbeanserver, ObjectName objectname) throws Exception(Code)



removeAllNotifications
public synchronized void removeAllNotifications()(Code)



removeNotification
public synchronized void removeNotification(Integer id) throws InstanceNotFoundException(Code)



removeNotifications
public synchronized void removeNotifications(String type) throws InstanceNotFoundException(Code)



setSendPastNotifications
public void setSendPastNotifications(boolean flag)(Code)



start
public void start()(Code)



stop
public synchronized void stop()(Code)



Methods inherited from javax.management.NotificationBroadcasterSupport
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)(Code)(Java Doc)
public MBeanNotificationInfo[] getNotificationInfo()(Code)(Java Doc)
protected void handleNotification(NotificationListener listener, Notification notif, Object handback)(Code)(Java Doc)
public synchronized void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException(Code)(Java Doc)
public synchronized void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException(Code)(Java Doc)
public void sendNotification(Notification notification)(Code)(Java Doc)

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.