cgl.narada.service.timer
Class UnixClock

java.lang.Object
  extended by cgl.narada.service.timer.ClockI
      extended by cgl.narada.service.timer.UnixClock

public class UnixClock
extends ClockI

Implementation of ClockI abstract class for Linux and Solaris machines.

Version:
1.0

Field Summary
 
Fields inherited from class cgl.narada.service.timer.ClockI
currentTimeMicros, currentTimeMillis, globalServiceProperties, OSArch, OSName, servicePropertiesFactory
 
Method Summary
static ClockI getClock()
          Returns clock implementation for Linux and Solaris machines.
 long getLocalMicroseconds()
          Returns time in microseconds
 long getLocalMilliseconds()
          Makes a call to native side to get local clock time as milliseconds
 long getTimeMicroseconds()
          Makes a call to native side to get local clock time as microseconds
 long getTimeMilliseconds()
          Returns time in milliseconds
static void main(String[] args)
          Simple test program.
 void sleep(int sleepVal)
          Makes a call to native side to causes thread to sleep for the specified amount in milliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getClock

public static ClockI getClock()
Returns clock implementation for Linux and Solaris machines.

Returns:
ClockI - interface that has been implemented.

getLocalMicroseconds

public long getLocalMicroseconds()
Returns time in microseconds

Returns:
long - local time as microseconds

getLocalMilliseconds

public long getLocalMilliseconds()
Makes a call to native side to get local clock time as milliseconds

Returns:
long - time as milliseconds

sleep

public void sleep(int sleepVal)
Makes a call to native side to causes thread to sleep for the specified amount in milliseconds.

Specified by:
sleep in class ClockI
Parameters:
sleepVal - - sleep time in milliseconds

getTimeMicroseconds

public long getTimeMicroseconds()
Makes a call to native side to get local clock time as microseconds

Specified by:
getTimeMicroseconds in class ClockI
Returns:
long - time as microseconds

getTimeMilliseconds

public long getTimeMilliseconds()
Returns time in milliseconds

Specified by:
getTimeMilliseconds in class ClockI
Returns:
long - time as milliseconds

main

public static void main(String[] args)
Simple test program.

Parameters:
args - - input arguments, no arguments used.


For comments and suggestions please send e-mail to The NaradaBrokering Project