File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
simple/simple-common/src/main/java/org/simpleframework/common/thread Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,18 @@ public class ConcurrentScheduler implements Scheduler {
35
35
*/
36
36
private final SchedulerQueue queue ;
37
37
38
+ /**
39
+ * Constructor for the <code>ConcurrentScheduler</code> object.
40
+ * This will create a scheduler with a fixed number of threads to
41
+ * use before execution. Depending on the types of task that are
42
+ * to be executed this should be increased for accuracy.
43
+ *
44
+ * @param type this is the type of the worker threads
45
+ */
46
+ public ConcurrentScheduler (Class <? extends Runnable > type ) {
47
+ this (type , 10 );
48
+ }
49
+
38
50
/**
39
51
* Constructor for the <code>ConcurrentScheduler</code> object.
40
52
* This will create a scheduler with a fixed number of threads to
@@ -44,7 +56,7 @@ public class ConcurrentScheduler implements Scheduler {
44
56
* @param type this is the type of the worker threads
45
57
* @param size this is the number of threads for the scheduler
46
58
*/
47
- public ConcurrentScheduler (Class type , int size ) {
59
+ public ConcurrentScheduler (Class <? extends Runnable > type , int size ) {
48
60
this .queue = new SchedulerQueue (type , size );
49
61
}
50
62
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ class SchedulerQueue {
53
53
* @param type this is the type of task to execute
54
54
* @param size this is the number of threads for the scheduler
55
55
*/
56
- public SchedulerQueue (Class type , int size ) {
56
+ public SchedulerQueue (Class <? extends Runnable > type , int size ) {
57
57
this .factory = new DaemonFactory (type );
58
58
this .executor = new ScheduledThreadPoolExecutor (size , factory );
59
59
}
You can’t perform that action at this time.
0 commit comments