summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/src/main/java
diff options
context:
space:
mode:
authorSimon Rettberg2015-07-10 17:25:00 +0200
committerSimon Rettberg2015-07-10 17:25:00 +0200
commitec117f81f1ac0abaee5983444e6389c6bb43927b (patch)
treeba6e19500e5485883097f52b14dbeb3ede499c29 /dozentenmodulserver/src/main/java
parent[client] next/finish wizard buttons woes... (diff)
downloadtutor-module-ec117f81f1ac0abaee5983444e6389c6bb43927b.tar.gz
tutor-module-ec117f81f1ac0abaee5983444e6389c6bb43927b.tar.xz
tutor-module-ec117f81f1ac0abaee5983444e6389c6bb43927b.zip
[*] Move common classes to master-sync-shared
Diffstat (limited to 'dozentenmodulserver/src/main/java')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java4
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/SessionManager.java4
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OperatingSystemList.java4
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java4
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/QuickTimer.java61
5 files changed, 8 insertions, 69 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
index 1484394e..992d5562 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
@@ -17,13 +17,13 @@ import org.openslx.bwlp.sat.thrift.cache.OperatingSystemList;
import org.openslx.bwlp.sat.thrift.cache.OrganizationList;
import org.openslx.bwlp.sat.util.Configuration;
import org.openslx.bwlp.sat.util.Json;
-import org.openslx.bwlp.sat.util.QuickTimer;
-import org.openslx.bwlp.sat.util.QuickTimer.Task;
import org.openslx.bwlp.thrift.iface.ImageSummaryRead;
import org.openslx.bwlp.thrift.iface.NetDirection;
import org.openslx.bwlp.thrift.iface.NetRule;
import org.openslx.bwlp.thrift.iface.UserInfo;
import org.openslx.thrifthelper.ThriftManager;
+import org.openslx.util.QuickTimer;
+import org.openslx.util.QuickTimer.Task;
public class App {
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/SessionManager.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/SessionManager.java
index fe36fff9..1f36adfb 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/SessionManager.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/SessionManager.java
@@ -9,14 +9,14 @@ import java.util.concurrent.TimeUnit;
import org.apache.log4j.Logger;
import org.openslx.bwlp.sat.database.mappers.DbUser;
import org.openslx.bwlp.sat.permissions.User;
-import org.openslx.bwlp.sat.util.QuickTimer;
-import org.openslx.bwlp.sat.util.QuickTimer.Task;
import org.openslx.bwlp.thrift.iface.AuthorizationError;
import org.openslx.bwlp.thrift.iface.Role;
import org.openslx.bwlp.thrift.iface.TAuthorizationException;
import org.openslx.bwlp.thrift.iface.TInvalidTokenException;
import org.openslx.bwlp.thrift.iface.UserInfo;
import org.openslx.thrifthelper.ThriftManager;
+import org.openslx.util.QuickTimer;
+import org.openslx.util.QuickTimer.Task;
/**
* Manages user sessions. Mainly used to map tokens to users.
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OperatingSystemList.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OperatingSystemList.java
index 87898d33..903db0c5 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OperatingSystemList.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OperatingSystemList.java
@@ -6,10 +6,10 @@ import java.util.List;
import org.apache.log4j.Logger;
import org.apache.thrift.TException;
import org.openslx.bwlp.sat.database.mappers.DbOsVirt;
-import org.openslx.bwlp.sat.util.QuickTimer;
-import org.openslx.bwlp.sat.util.QuickTimer.Task;
import org.openslx.bwlp.thrift.iface.OperatingSystem;
import org.openslx.thrifthelper.ThriftManager;
+import org.openslx.util.QuickTimer;
+import org.openslx.util.QuickTimer.Task;
/**
* Holds the list of all known organizations. The list is synchronized with
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java
index 35f3ebcf..4325b152 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/cache/OrganizationList.java
@@ -5,10 +5,10 @@ import java.util.List;
import org.apache.thrift.TException;
import org.openslx.bwlp.sat.database.mappers.DbOrganization;
-import org.openslx.bwlp.sat.util.QuickTimer;
-import org.openslx.bwlp.sat.util.QuickTimer.Task;
import org.openslx.bwlp.thrift.iface.Organization;
import org.openslx.thrifthelper.ThriftManager;
+import org.openslx.util.QuickTimer;
+import org.openslx.util.QuickTimer.Task;
/**
* Holds the list of all known organizations. The list is synchronized with
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/QuickTimer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/QuickTimer.java
deleted file mode 100644
index 14745f97..00000000
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/QuickTimer.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.openslx.bwlp.sat.util;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.apache.log4j.Logger;
-
-/**
- * This is a global, static {@link Timer} you can use anywhere for repeating
- * tasks that will <b>not take a significant amount of time to execute</b>. This
- * means they should not run any complex data base queries (better yet, none at
- * all) or do heavy file I/O, etc..
- * The main reason for this class is to prevent having {@link Timer} threads
- * everywhere in the server for trivial tasks.
- */
-public class QuickTimer {
-
- private static final Logger LOGGER = Logger.getLogger(QuickTimer.class);
-
- private static final Timer timer = new Timer("QuickTimer");
-
- public static void scheduleAtFixedDelay(Task task, long delay, long period) {
- timer.schedule(task, delay, period);
- }
-
- public static void scheduleAtFixedRate(Task task, long delay, long period) {
- timer.scheduleAtFixedRate(task, delay, period);
- }
-
- public static void scheduleOnce(Task task, long delay) {
- timer.schedule(task, delay);
- }
-
- public static void scheduleOnce(Task timerTask) {
- scheduleOnce(timerTask, 1);
- }
-
- /**
- * Cancel this timer. Should only be called when the server is shutting
- * down.
- */
- public static void cancel() {
- timer.cancel();
- }
-
- public static abstract class Task extends TimerTask {
-
- @Override
- public final void run() {
- try {
- fire();
- } catch (Throwable t) {
- LOGGER.warn("A Task threw an exception!", t);
- }
- }
-
- public abstract void fire();
-
- }
-
-}