MCPcopy Create free account
hub / github.com/apache/storm / StormTimer

Method StormTimer

storm-client/src/jvm/org/apache/storm/StormTimer.java:39–54  ·  view source on GitHub ↗

Makes a Timer in the form of a StormTimerTask Object. @param name name of the timer @param onKill function to call when timer is killed unexpectedly

(String name, Thread.UncaughtExceptionHandler onKill)

Source from the content-addressed store, hash-verified

37 * @param onKill function to call when timer is killed unexpectedly
38 */
39 public StormTimer(String name, Thread.UncaughtExceptionHandler onKill) {
40 if (onKill == null) {
41 throw new RuntimeException("onKill func is null!");
42 }
43 if (name == null) {
44 this.task.setName("timer");
45 } else {
46 this.task.setName(name);
47 }
48 this.task.setOnKillFunc(onKill);
49 this.task.setActive(true);
50
51 this.task.setDaemon(true);
52 this.task.setPriority(Thread.MAX_PRIORITY);
53 this.task.start();
54 }
55
56 /**
57 * Schedule a function to be executed in the timer.

Callers

nothing calls this directly

Calls 4

setOnKillFuncMethod · 0.80
startMethod · 0.65
setNameMethod · 0.45
setActiveMethod · 0.45

Tested by

no test coverage detected