public class Deadline extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkTimeout()
Check whether the long running method timeout.
|
static void |
clear()
remove the registered Deadline threadlocal object from current thread.
|
static boolean |
isStarted()
Check whether the timer is started.
|
static void |
registerIfNot(long timeout)
register a Deadline threadlocal object to current thread.
|
static void |
resetTimeout(long timeout)
reset the timeout value of this timer.
|
static void |
startTimer(String method)
start the timer before a method is invoked.
|
static void |
stopTimer()
end the time after a method is done.
|
public static void registerIfNot(long timeout)
timeout - public static void resetTimeout(long timeout)
throws MetaException
timeout - MetaExceptionpublic static boolean isStarted()
throws MetaException
MetaExceptionpublic static void startTimer(String method) throws MetaException
method - MetaExceptionpublic static void stopTimer()
throws MetaException
MetaExceptionpublic static void clear()
public static void checkTimeout()
throws MetaException
DeadlineException - when the method timeoutMetaExceptionCopyright © 2017 The Apache Software Foundation. All rights reserved.