|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.opends.server.api.DirectoryThread
org.opends.server.util.TimeThread
@PublicAPI(stability=UNCOMMITTED, mayInstantiate=false, mayExtend=false, mayInvoke=true) public final class TimeThread
This class defines a thread that will wake up periodically, get the current time, and store various representations of it. Note that only limited debugging will be performed in this class due to the frequency with which it will be called.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
---|---|
static java.util.Calendar |
getCalendar()
Retrieves a Calendar containing the time at the last update. |
static java.util.Date |
getDate()
Retrieves a Date containing the time at the last update. |
static java.lang.String |
getGeneralizedTime()
Retrieves a string containing a normalized representation of the current time in a generalized time format. |
static java.lang.String |
getGMTTime()
Retrieves a string containing the current time in GMT. |
static int |
getHourAndMinute()
Retrieves an integer containing the time in HHmm format at the last update. |
static java.lang.String |
getLocalTime()
Retrieves a string containing the current time in the local time zone. |
static long |
getNanoTime()
Retrieves the time in nanoseconds from the most precise available system timer. |
static long |
getTime()
Retrieves the time in milliseconds since the epoch at the last update. |
static java.lang.String |
getUserDefinedTime(java.lang.String formatString)
Retrieves the current time formatted using the given format string. |
static void |
removeUserDefinedFormatter(java.lang.String formatString)
Removes the user-defined time formatter from this time thread so that it will no longer be maintained. |
void |
run()
Operates in a loop, getting the current time and then sleeping briefly before checking again. |
Methods inherited from class org.opends.server.api.DirectoryThread |
---|
getAssociatedTask, getCreationStackTrace, getDebugProperties, getParentThread, setAssociatedTask |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public static java.util.Calendar getCalendar()
Calendar
containing the time at the last update.
Calendar
containing the time at the last update.public static java.util.Date getDate()
Date
containing the time at the last update.
Date
containing the time at the last update.public static long getTime()
public static long getNanoTime()
public static java.lang.String getGeneralizedTime()
public static java.lang.String getLocalTime()
public static java.lang.String getGMTTime()
public static int getHourAndMinute()
public static java.lang.String getUserDefinedTime(java.lang.String formatString) throws java.lang.IllegalArgumentException
formatString
- The string that defines the format of the time string
to retrieve.
java.lang.IllegalArgumentException
- If the provided format string is
invalid.public static void removeUserDefinedFormatter(java.lang.String formatString)
formatString
- The format string for the date formatter to remove.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |