javax.management.timer
Class Timer

java.lang.Object
  |
  +--javax.management.NotificationBroadcasterSupport
        |
        +--javax.management.timer.Timer
All Implemented Interfaces:
MBeanRegistration, NotificationBroadcaster, TimerMBean

public class Timer
extends NotificationBroadcasterSupport
implements TimerMBean, MBeanRegistration

Version:
$Revision: 1.7 $
Author:
Simone Bordet

Field Summary
static long ONE_DAY
           
static long ONE_HOUR
           
static long ONE_MINUTE
           
static long ONE_SECOND
           
static long ONE_WEEK
           
 
Constructor Summary
Timer()
           
 
Method Summary
 java.lang.Integer addNotification(java.lang.String type, java.lang.String message, java.lang.Object userData, java.util.Date date)
           
 java.lang.Integer addNotification(java.lang.String type, java.lang.String message, java.lang.Object userData, java.util.Date date, long period)
           
 java.lang.Integer addNotification(java.lang.String type, java.lang.String message, java.lang.Object userData, java.util.Date date, long period, long occurrences)
           
 java.util.Vector getAllNotificationIDs()
           
 java.util.Date getDate(java.lang.Integer id)
           
 int getNbNotifications()
           
 java.lang.Long getNbOccurences(java.lang.Integer id)
           
 java.util.Vector getNotificationIDs(java.lang.String type)
           
 java.lang.String getNotificationMessage(java.lang.Integer id)
           
 java.lang.String getNotificationType(java.lang.Integer id)
           
 java.lang.Object getNotificationUserData(java.lang.Integer id)
           
 java.lang.Long getPeriod(java.lang.Integer id)
           
 boolean getSendPastNotifications()
           
 boolean isActive()
           
 boolean isEmpty()
           
 void postDeregister()
          Called upon after the MBean has been de-registered.
 void postRegister(java.lang.Boolean registrationDone)
          Called upon after a registration ( successful or not ).
 void preDeregister()
          Called upon before an MBean will be de-registered by the MBeanServer.
 ObjectName preRegister(MBeanServer server, ObjectName name)
          Allows the MBean to perform any operations before being registered to the MBeanServer.
 void removeAllNotifications()
           
 void removeNotification(java.lang.Integer id)
           
 void removeNotifications(java.lang.String type)
           
 void sendNotification(Notification n)
           
 void setSendPastNotifications(boolean value)
           
 void start()
           
 void stop()
           
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, removeNotificationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONE_SECOND

public static final long ONE_SECOND
See Also:
Constant Field Values

ONE_MINUTE

public static final long ONE_MINUTE
See Also:
Constant Field Values

ONE_HOUR

public static final long ONE_HOUR
See Also:
Constant Field Values

ONE_DAY

public static final long ONE_DAY
See Also:
Constant Field Values

ONE_WEEK

public static final long ONE_WEEK
See Also:
Constant Field Values
Constructor Detail

Timer

public Timer()
Method Detail

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws java.lang.Exception
Description copied from interface: MBeanRegistration
Allows the MBean to perform any operations before being registered to the MBeanServer.

Any exception will cause the MBean not being registered.

Specified by:
preRegister in interface MBeanRegistration
Parameters:
server - The MBeanServer on which the MBean will be registered.
name - The ObjectName of the MBean.
Returns:
ObjectName The name of the registered MBean
Throws:
java.lang.Exception - Exception of the operation. Note that this is caught by the MBeanServer and re-thrown as an MBeanRegistrationException.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Description copied from interface: MBeanRegistration
Called upon after a registration ( successful or not ).

Specified by:
postRegister in interface MBeanRegistration
Parameters:
registrationDone - Evaluates to true of the registrations is successful, false otherwise.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Description copied from interface: MBeanRegistration
Called upon before an MBean will be de-registered by the MBeanServer.

Specified by:
preDeregister in interface MBeanRegistration
Throws:
java.lang.Exception - Would be caught by the MBeanServer and rethrown as an MBeanRegistrationException.

postDeregister

public void postDeregister()
Description copied from interface: MBeanRegistration
Called upon after the MBean has been de-registered.

Specified by:
postDeregister in interface MBeanRegistration

start

public void start()
Specified by:
start in interface TimerMBean

stop

public void stop()
Specified by:
stop in interface TimerMBean

isActive

public boolean isActive()
Specified by:
isActive in interface TimerMBean

addNotification

public java.lang.Integer addNotification(java.lang.String type,
                                         java.lang.String message,
                                         java.lang.Object userData,
                                         java.util.Date date)
                                  throws java.lang.IllegalArgumentException
Specified by:
addNotification in interface TimerMBean
java.lang.IllegalArgumentException

addNotification

public java.lang.Integer addNotification(java.lang.String type,
                                         java.lang.String message,
                                         java.lang.Object userData,
                                         java.util.Date date,
                                         long period)
                                  throws java.lang.IllegalArgumentException
Specified by:
addNotification in interface TimerMBean
java.lang.IllegalArgumentException

addNotification

public java.lang.Integer addNotification(java.lang.String type,
                                         java.lang.String message,
                                         java.lang.Object userData,
                                         java.util.Date date,
                                         long period,
                                         long occurrences)
                                  throws java.lang.IllegalArgumentException
Specified by:
addNotification in interface TimerMBean
java.lang.IllegalArgumentException

removeNotification

public void removeNotification(java.lang.Integer id)
                        throws InstanceNotFoundException
Specified by:
removeNotification in interface TimerMBean
InstanceNotFoundException

removeNotifications

public void removeNotifications(java.lang.String type)
                         throws InstanceNotFoundException
Specified by:
removeNotifications in interface TimerMBean
InstanceNotFoundException

removeAllNotifications

public void removeAllNotifications()
Specified by:
removeAllNotifications in interface TimerMBean

getAllNotificationIDs

public java.util.Vector getAllNotificationIDs()
Specified by:
getAllNotificationIDs in interface TimerMBean

getNotificationIDs

public java.util.Vector getNotificationIDs(java.lang.String type)
Specified by:
getNotificationIDs in interface TimerMBean

getSendPastNotifications

public boolean getSendPastNotifications()
Specified by:
getSendPastNotifications in interface TimerMBean

setSendPastNotifications

public void setSendPastNotifications(boolean value)
Specified by:
setSendPastNotifications in interface TimerMBean

getNbNotifications

public int getNbNotifications()
Specified by:
getNbNotifications in interface TimerMBean

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface TimerMBean

getNotificationType

public java.lang.String getNotificationType(java.lang.Integer id)
Specified by:
getNotificationType in interface TimerMBean

getNotificationMessage

public java.lang.String getNotificationMessage(java.lang.Integer id)
Specified by:
getNotificationMessage in interface TimerMBean

getNotificationUserData

public java.lang.Object getNotificationUserData(java.lang.Integer id)
Specified by:
getNotificationUserData in interface TimerMBean

getDate

public java.util.Date getDate(java.lang.Integer id)
Specified by:
getDate in interface TimerMBean

getPeriod

public java.lang.Long getPeriod(java.lang.Integer id)
Specified by:
getPeriod in interface TimerMBean

getNbOccurences

public java.lang.Long getNbOccurences(java.lang.Integer id)
Specified by:
getNbOccurences in interface TimerMBean

sendNotification

public void sendNotification(Notification n)
Overrides:
sendNotification in class NotificationBroadcasterSupport


Copyright © 2001-2002 MX4J Team. All Rights Reserved.