public interface WindowedWatchdogTimer extends WatchdogTimer
WindowedWatchdogTimer
interface provides methods for controlling a watchdog timer that can be used to
force the device to reboot (or depending on the platform, the Java Virtual Machine to restart).
The windowed watchdog timer must be refreshed within an open time window. If the watchdog is refreshed too soon - during the closed window - or if it is refreshed too late - after the watchdog timeout has expired - the device will be rebooted (or the JVM restarted).
A WindowedWatchdogTimer
instance may represent a virtual windowed watchdog timer. If the device has a single
physical windowed watchdog timer, all of the virtual watchdog timers are mapped onto this one physical watchdog
timer. It gets set with a refresh window starting when the virtual windowed watchdog with the longest closed window
delay is scheduled to end and ending when the virtual windowed watchdog with the earliest timeout is scheduled to
expire. The corresponding watchdog timer device is therefore shared and several applications can concurrently
acquire the same watchdog timer device.
BIG_ENDIAN, LITTLE_ENDIAN, MIXED_ENDIAN
Modifier and Type | Method and Description |
---|---|
long |
getClosedWindowTimeout()
Get the current closed window delay for the watchdog timer.
|
void |
start(long timeout)
Starts the watchdog timer with the specified timeout and with a closed window delay set to
0 . |
void |
start(long closedWindowDelay,
long timeout)
Starts the windowed watchdog timer with the specified closed window delay and timeout.
|
causedLastReboot, getMaxTimeout, getTimeout, refresh, stop
close, getByteOrder, getDescriptor, isOpen, tryLock, unlock
long getClosedWindowTimeout() throws java.io.IOException, ClosedDeviceException
0
is returned. Additionally, the value returned may
differ from the previously set value as it may have been adjusted to account
for the timer resolution or discrete time interval values supported by the underlying
platform or driver.0
if the timer is disabled.java.io.IOException
- if some other I/O error occurs.ClosedDeviceException
- if the device has been closed.start(long, long)
void start(long timeout) throws java.io.IOException, ClosedDeviceException
0
. If the
watchdog timer is not refreshed by a call to refresh
prior to the watchdog timing out, the device will
be rebooted (or the JVM restarted).
The timeout is expressed in milliseconds; if the underlying platform or driver
does not support a millisecond resolution or does not support the requested time interval value
then timeout
will be rounded up to accommodate the supported timer resolution
or respectively aligned to the closest greater supported discrete time interval value. The resulting, actual
timeout can be retrieved by a call to getTimeout
.
Calling this method twice is equivalent to stopping the timer as per a call to stop
and starting
it again with the new specified timeout and with a closed window delay set to 0
.
start
in interface WatchdogTimer
timeout
- the time interval (in milliseconds) until watchdog times out.java.io.IOException
- if some other I/O error occurs.java.lang.IllegalArgumentException
- if timeout
is not greater than 0
or if timeout
is greater than
the maximum supported timeout as returned buy WatchdogTimer.getMaxTimeout()
.ClosedDeviceException
- if the device has been closed.void start(long closedWindowDelay, long timeout) throws java.io.IOException, ClosedDeviceException
refresh
method is called too soon, that is within the closed window delay, or too late, that is not called prior to the
watchdog timing out, the device will be rebooted (or the JVM restarted).
The timeout is expressed in milliseconds; if the underlying platform or driver
does not support a millisecond resolution or does not support the requested time interval value
then timeout
will be rounded up to accommodate the supported timer resolution
or respectively aligned to the closest greater supported discrete time interval value. The resulting, actual
timeout can be retrieved by a call to getTimeout
.
Similarly, the closed window delay is expressed in milliseconds; if the underlying platform or driver
does not support a millisecond resolution or does not support the requested time interval value
then closedWindowDelay
will be rounded down to accommodate the supported timer resolution
or respectively aligned to the closest lower supported discrete time interval value. The resulting, actual
timeout can be retrieved by a call to getClosedWindowTimeout
.
Calling this method twice is equivalent to stopping the timer as per a call to stop
and starting
it again with the new specified closed window delay and timeout.
closedWindowDelay
- the delay (in milliseconds) until the watchdog timer can be refreshed.timeout
- the time interval (in milliseconds) until watchdog times out.java.lang.IllegalArgumentException
- if timeout
is not greater than 0
or if timeout
is greater than
the maximum supported timeout as returned by WatchdogTimer.getMaxTimeout()
; or
if closedWindowDelay
is negative or closedWindowDelay
is greater than or equal to timeout
.java.io.IOException
- if some other I/O error occurs.ClosedDeviceException
- if the device has been closed.Copyright © 2012, 2015, Oracle and/or its affiliates. All rights reserved.
Legal Notices