Skip to content
Snippets Groups Projects
Commit 1228e69c authored by tonschnoer's avatar tonschnoer
Browse files

add comments, reformat source

parent 6f71228d
Branches
No related tags found
No related merge requests found
package de.kmt.ndr;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import jakarta.annotation.Resource;
......@@ -12,7 +11,6 @@ import jakarta.ejb.Timer;
import jakarta.ejb.TimerConfig;
import jakarta.ejb.TimerService;
@Singleton
@Startup
......@@ -25,17 +23,22 @@ public class Main {
}
// ***********************************************************************************
// triggers every time when timer fires
// ***********************************************************************************
@Timeout
public void scheduler(Timer timer) {
try {
_setUP();
System.out.println("Timer fired.");
}
catch(Exception _ex) {
} catch (Exception _ex) {
}
}
// ***********************************************************************************
// OnStart; configures timer
// ***********************************************************************************
@PostConstruct
public void initialize() {
try {
......@@ -44,12 +47,14 @@ public class Main {
se.hour("*").minute("0/1").second("0/1");
timerService.createCalendarTimer(se, new TimerConfig("Cleanup Service scheduled at ", false));
}
catch(Exception _ex) {
} catch (Exception _ex) {
}
}
// ***********************************************************************************
// OnStop; destroys timer
// ***********************************************************************************
@PreDestroy
public void stop() {
......@@ -59,11 +64,9 @@ public class Main {
timer.cancel();
}
}
catch(Exception _ex) {
} catch (Exception _ex) {
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment