Brooklyn

brooklyn.util.internal
[Groovy] Class TimeExtras

java.lang.Object
  brooklyn.util.internal.TimeExtras

class TimeExtras

Classloading this class will cause multiply/add to be made available on TimeDuration. For example, I could write: 2*TimeUnit.MINUTES+5*TimeUnit.SECONDS. That is why nothing seems to use this class, because the methods it defines are not on this class!

Authors:
alex


Field Summary
static groovy.time.TimeDuration FIVE_MINUTES

static groovy.time.TimeDuration FIVE_SECONDS

static groovy.time.TimeDuration ONE_MINUTE

static groovy.time.TimeDuration ONE_SECOND

static groovy.time.TimeDuration TEN_SECONDS

static groovy.time.TimeDuration THIRTY_SECONDS

static groovy.time.TimeDuration TWO_MINUTES

static Logger log

 
Method Summary
static groovy.time.TimeDuration duration(int value, java.util.concurrent.TimeUnit unit)

creates a duration object

static void init()

static void sleep(groovy.time.TimeDuration duration)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

FIVE_MINUTES

public static final groovy.time.TimeDuration FIVE_MINUTES


FIVE_SECONDS

public static final groovy.time.TimeDuration FIVE_SECONDS


ONE_MINUTE

public static final groovy.time.TimeDuration ONE_MINUTE


ONE_SECOND

public static final groovy.time.TimeDuration ONE_SECOND


TEN_SECONDS

public static final groovy.time.TimeDuration TEN_SECONDS


THIRTY_SECONDS

public static final groovy.time.TimeDuration THIRTY_SECONDS


TWO_MINUTES

public static final groovy.time.TimeDuration TWO_MINUTES


log

public static final Logger log


 
Method Detail

duration

static groovy.time.TimeDuration duration(int value, java.util.concurrent.TimeUnit unit)
creates a duration object

fix for irritating classloading/metaclass order where an int may get constructed too early and not have the multiply syntax available (because grail is invoked?; if e.g. 5*SECONDS throws an error, try duration(5, SECONDS)


init

static void init()


sleep

static void sleep(groovy.time.TimeDuration duration)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.