|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
cgl.narada.service.time.ntptime.NtpTimeService
public class NtpTimeService
This is the thread that computes time according to NTP and adjust the time in NtpTimeserviceImpl class.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected String |
propertiesFile
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Method Summary | |
|---|---|
void |
addNtpInfo(NtpInfo ntpInfo)
Adds NtpInfo object to the queue. |
void |
computeOffset()
Computes the offset from the NtpInfo obtained from servers available in the list. |
static NtpTimeService |
getInstance()
Gets the only instance of NtpTimeService. |
void |
getNtpSamples()
Gets samples from Ntp Servers. |
int |
getNumberOfServers()
gets the number of servers obtained from properties file. |
HashMap |
getServerList()
Gets server list. |
boolean |
initialize()
This method is called inside run before the loop starts. |
static boolean |
isCheckLastUTC()
Returns true if checkLastUTC is true, otherwise returns false. |
boolean |
isRunning()
Returns true if running is true, otherwise returns false. |
void |
loadDefaults()
Reads Ntp server IPs, interval time and other required params from DefaultParams class. |
void |
loadProperties()
Reads Ntp server IPs, interval time and other required params from properties pointer obtained from QosServiceImpl. |
void |
run()
This method calls getNtpSamples() and computeOffset() in a while loop, looping on running variable, which can be set to false by setRunning(false) to break the loop. |
void |
setQosServiceImpl(QosServiceImpl qosServiceImpl)
Sets QosServiceImpl pointer to get a reference to the properties loaded at initialization. |
void |
setRunning(boolean running)
Sets the value of running to the new value. |
void |
terminateService()
|
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, 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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String propertiesFile
| Method Detail |
|---|
public static boolean isCheckLastUTC()
public static NtpTimeService getInstance()
public void getNtpSamples()
public int getNumberOfServers()
public void setQosServiceImpl(QosServiceImpl qosServiceImpl)
qosServiceImpl - QosServiceImplpublic void setRunning(boolean running)
running - - new value of running. Setting this vlaue to false causes
thread to stop runningpublic boolean isRunning()
public HashMap getServerList()
public void addNtpInfo(NtpInfo ntpInfo)
ntpInfo - NtpInfo - NtpInfo object to be added to the queue.public void computeOffset()
public boolean initialize()
public void loadDefaults()
public void loadProperties()
public void run()
run in interface Runnablerun in class Threadpublic void terminateService()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||