diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-05-29 22:16:50 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-05-29 22:16:50 +0200 |
commit | 7d704feb86c44fca57941d223e8605b55fcf68f0 (patch) | |
tree | 7a33458a46bcc6e211ef3e833441f80762c61a63 /src | |
parent | b65d39ab617d19ac48f44bc41f04a18803ca75e6 (diff) | |
download | quartz-based-queue-7d704feb86c44fca57941d223e8605b55fcf68f0.tar.gz quartz-based-queue-7d704feb86c44fca57941d223e8605b55fcf68f0.tar.bz2 quartz-based-queue-7d704feb86c44fca57941d223e8605b55fcf68f0.tar.xz quartz-based-queue-7d704feb86c44fca57941d223e8605b55fcf68f0.zip |
o Splitting out the parts that implement the "async" features vs the "queue" features.
Diffstat (limited to 'src')
-rwxr-xr-x | src/main/java/io/trygvis/CreateArticleCallable.java | 2 | ||||
-rwxr-xr-x | src/main/java/io/trygvis/Main.java | 2 | ||||
-rwxr-xr-x | src/main/java/io/trygvis/UpdateArticleCallable.java | 2 | ||||
-rwxr-xr-x | src/main/java/io/trygvis/async/AsyncService.java (renamed from src/main/java/io/trygvis/queue/AsyncService.java) | 7 | ||||
-rw-r--r-- | src/main/java/io/trygvis/async/JdbcAsyncService.java (renamed from src/main/java/io/trygvis/queue/JdbcAsyncService.java) | 6 | ||||
-rw-r--r-- | src/main/java/io/trygvis/async/QueueThread.java (renamed from src/main/java/io/trygvis/queue/QueueThread.java) | 5 | ||||
-rw-r--r-- | src/main/java/io/trygvis/async/TaskFailureException.java (renamed from src/main/java/io/trygvis/queue/TaskFailureException.java) | 2 | ||||
-rwxr-xr-x | src/main/java/io/trygvis/queue/Task.java | 2 |
8 files changed, 20 insertions, 8 deletions
diff --git a/src/main/java/io/trygvis/CreateArticleCallable.java b/src/main/java/io/trygvis/CreateArticleCallable.java index 420a5b5..471b59d 100755 --- a/src/main/java/io/trygvis/CreateArticleCallable.java +++ b/src/main/java/io/trygvis/CreateArticleCallable.java @@ -1,7 +1,7 @@ package io.trygvis; import io.trygvis.model.Article; -import io.trygvis.queue.AsyncService; +import io.trygvis.async.AsyncService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; diff --git a/src/main/java/io/trygvis/Main.java b/src/main/java/io/trygvis/Main.java index d22cab2..08b9b75 100755 --- a/src/main/java/io/trygvis/Main.java +++ b/src/main/java/io/trygvis/Main.java @@ -1,6 +1,6 @@ package io.trygvis; -import io.trygvis.queue.AsyncService; +import io.trygvis.async.AsyncService; import io.trygvis.queue.Queue; import io.trygvis.queue.Task; import org.hibernate.dialect.PostgreSQL82Dialect; diff --git a/src/main/java/io/trygvis/UpdateArticleCallable.java b/src/main/java/io/trygvis/UpdateArticleCallable.java index f1ea0e2..a910855 100755 --- a/src/main/java/io/trygvis/UpdateArticleCallable.java +++ b/src/main/java/io/trygvis/UpdateArticleCallable.java @@ -1,6 +1,6 @@ package io.trygvis; -import io.trygvis.queue.AsyncService; +import io.trygvis.async.AsyncService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; diff --git a/src/main/java/io/trygvis/queue/AsyncService.java b/src/main/java/io/trygvis/async/AsyncService.java index c9e5861..e90a0e4 100755 --- a/src/main/java/io/trygvis/queue/AsyncService.java +++ b/src/main/java/io/trygvis/async/AsyncService.java @@ -1,9 +1,14 @@ -package io.trygvis.queue; +package io.trygvis.async; +import io.trygvis.queue.Queue; +import io.trygvis.queue.Task; import org.quartz.SchedulerException; import java.util.List; +/** + * A simple framework for running tasks. + */ public interface AsyncService { /** diff --git a/src/main/java/io/trygvis/queue/JdbcAsyncService.java b/src/main/java/io/trygvis/async/JdbcAsyncService.java index 276541f..4e78a37 100644 --- a/src/main/java/io/trygvis/queue/JdbcAsyncService.java +++ b/src/main/java/io/trygvis/async/JdbcAsyncService.java @@ -1,5 +1,9 @@ -package io.trygvis.queue; +package io.trygvis.async; +import io.trygvis.queue.Queue; +import io.trygvis.queue.QueueDao; +import io.trygvis.queue.Task; +import io.trygvis.queue.TaskDao; import org.quartz.SchedulerException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/io/trygvis/queue/QueueThread.java b/src/main/java/io/trygvis/async/QueueThread.java index a981c7e..69466df 100644 --- a/src/main/java/io/trygvis/queue/QueueThread.java +++ b/src/main/java/io/trygvis/async/QueueThread.java @@ -1,5 +1,8 @@ -package io.trygvis.queue; +package io.trygvis.async; +import io.trygvis.queue.Queue; +import io.trygvis.queue.Task; +import io.trygvis.queue.TaskDao; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.transaction.TransactionException; diff --git a/src/main/java/io/trygvis/queue/TaskFailureException.java b/src/main/java/io/trygvis/async/TaskFailureException.java index d3d8c48..7278e17 100644 --- a/src/main/java/io/trygvis/queue/TaskFailureException.java +++ b/src/main/java/io/trygvis/async/TaskFailureException.java @@ -1,4 +1,4 @@ -package io.trygvis.queue; +package io.trygvis.async; class TaskFailureException extends RuntimeException { public TaskFailureException(Exception e) { diff --git a/src/main/java/io/trygvis/queue/Task.java b/src/main/java/io/trygvis/queue/Task.java index 09d5060..2b1103b 100755 --- a/src/main/java/io/trygvis/queue/Task.java +++ b/src/main/java/io/trygvis/queue/Task.java @@ -21,7 +21,7 @@ public class Task { public final List<String> arguments; - Task(long id, Long parent, String queue, Date scheduled, Date lastRun, int runCount, Date completed, List<String> arguments) { + public Task(long id, Long parent, String queue, Date scheduled, Date lastRun, int runCount, Date completed, List<String> arguments) { this.id = id; this.parent = parent; this.queue = queue; |