-
Notifications
You must be signed in to change notification settings - Fork 5
/
WorkerVerticle.java
36 lines (28 loc) · 901 Bytes
/
WorkerVerticle.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package org.genericsystem.watch.gui;
import org.genericsystem.common.Root;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;
/**
* This class extends {@link AbstractVerticle} in order to provide a worker verticle. One must override the default {@link #start()} or {@link #start(io.vertx.core.Future)} methods.
*
* @author Pierrik Lassalas
*/
public class WorkerVerticle extends AbstractVerticle {
private Root root;
public WorkerVerticle() {
this(null);
}
public WorkerVerticle(Root root) {
this.root = root;
}
@Override
public void start(Future<Void> startFuture) throws Exception {
System.out.println("Worker thread: " + Thread.currentThread().getName());
start();
startFuture.complete();
}
@Override
public void start() throws Exception {
throw new IllegalStateException("You need to implement the start() method of the worker verticle.");
}
}