jdk/src/java.management/share/classes/javax/management/timer/TimerAlarmClock.java
changeset 43235 da1786d695b6
parent 25859 3317bb8137f4
equal deleted inserted replaced
43234:cb2a6851b837 43235:da1786d695b6
     1 /*
     1 /*
     2  * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    24  */
    24  */
    25 
    25 
    26 package javax.management.timer;
    26 package javax.management.timer;
    27 
    27 
    28 import java.util.Date;
    28 import java.util.Date;
    29 import java.util.logging.Level;
    29 import java.lang.System.Logger.Level;
    30 import static com.sun.jmx.defaults.JmxProperties.TIMER_LOGGER;
    30 import static com.sun.jmx.defaults.JmxProperties.TIMER_LOGGER;
    31 
    31 
    32 /**
    32 /**
    33  * This class provides a simple implementation of an alarm clock MBean.
    33  * This class provides a simple implementation of an alarm clock MBean.
    34  * The aim of this MBean is to set up an alarm which wakes up the timer every timeout (fixed-delay)
    34  * The aim of this MBean is to set up an alarm which wakes up the timer every timeout (fixed-delay)
    71         try {
    71         try {
    72             //this.sleep(timeout);
    72             //this.sleep(timeout);
    73             TimerAlarmClockNotification notif = new TimerAlarmClockNotification(this);
    73             TimerAlarmClockNotification notif = new TimerAlarmClockNotification(this);
    74             listener.notifyAlarmClock(notif);
    74             listener.notifyAlarmClock(notif);
    75         } catch (Exception e) {
    75         } catch (Exception e) {
    76             TIMER_LOGGER.logp(Level.FINEST, Timer.class.getName(), "run",
    76             TIMER_LOGGER.log(Level.TRACE,
    77                     "Got unexpected exception when sending a notification", e);
    77                     "Got unexpected exception when sending a notification", e);
    78         }
    78         }
    79     }
    79     }
    80 }
    80 }