summaryrefslogtreecommitdiffstats
path: root/EssentialsUpdate/src/f00f/net/irc/martyr/CronManager.java
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-10-12 03:14:07 +0200
committersnowleo <schneeleo@gmail.com>2011-10-12 03:14:26 +0200
commitea192ddd6d5b538e0bd0f6f1721890eb3c25de30 (patch)
tree344d5ad4eec389eedc6a72dbfb1bdfba1047a447 /EssentialsUpdate/src/f00f/net/irc/martyr/CronManager.java
parent1b34ed40736b03f440352f8193f24b6b0525868a (diff)
downloadEssentials-ea192ddd6d5b538e0bd0f6f1721890eb3c25de30.tar
Essentials-ea192ddd6d5b538e0bd0f6f1721890eb3c25de30.tar.gz
Essentials-ea192ddd6d5b538e0bd0f6f1721890eb3c25de30.tar.lz
Essentials-ea192ddd6d5b538e0bd0f6f1721890eb3c25de30.tar.xz
Essentials-ea192ddd6d5b538e0bd0f6f1721890eb3c25de30.zip
EssentialsUpdate WIP
Diffstat (limited to 'EssentialsUpdate/src/f00f/net/irc/martyr/CronManager.java')
-rw-r--r--EssentialsUpdate/src/f00f/net/irc/martyr/CronManager.java80
1 files changed, 80 insertions, 0 deletions
diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/CronManager.java b/EssentialsUpdate/src/f00f/net/irc/martyr/CronManager.java
new file mode 100644
index 000000000..3c5d8b196
--- /dev/null
+++ b/EssentialsUpdate/src/f00f/net/irc/martyr/CronManager.java
@@ -0,0 +1,80 @@
+package f00f.net.irc.martyr;
+
+import java.util.Date;
+import java.util.Timer;
+import java.util.TimerTask;
+
+/**
+ * @since 0.3.2
+ * */
+public class CronManager
+{
+ private Timer timer;
+
+ public CronManager()
+ {
+ timer = new Timer();
+ }
+
+ /**
+ * @param task TimerTask to schedule
+ * @param time When to schedule task
+ */
+ public void schedule(TimerTask task, Date time)
+ {
+ timer.schedule(task, time);
+ }
+
+ /**
+ * @param task TimerTask to schedule
+ * @param firstTime When to run first
+ * @param period How often to run
+ */
+ public void schedule(TimerTask task, Date firstTime, long period)
+ {
+ timer.schedule(task, firstTime, period);
+ }
+
+ /**
+ * @param task TimerTask to schedule
+ * @param delay How long to wait before running
+ */
+ public void schedule(TimerTask task, long delay)
+ {
+ timer.schedule(task, delay);
+ }
+
+ /**
+ * @param task TimerTask to schedule
+ * @param delay How long to wait before running
+ * @param period How often to run
+ */
+ public void schedule(TimerTask task, long delay, long period)
+ {
+ timer.schedule(task, delay, period);
+ }
+
+ /**
+ * @param task TimerTask to schedule
+ * @param firstTime When first to run
+ * @param period How often to run
+ */
+ public void scheduleAtFixedRate(
+ TimerTask task,
+ Date firstTime,
+ long period)
+ {
+ timer.scheduleAtFixedRate(task, firstTime, period);
+ }
+
+ /**
+ * @param task TimerTask to schedule
+ * @param delay When first to run
+ * @param period How often to run
+ */
+ public void scheduleAtFixedRate(TimerTask task, long delay, long period)
+ {
+ timer.scheduleAtFixedRate(task, delay, period);
+ }
+
+}