1
|
package eu.dnetlib.services.async;
|
2
|
|
3
|
import java.util.Map;
|
4
|
|
5
|
import eu.dnetlib.exceptions.DnetGenericRuntimeException;
|
6
|
|
7
|
public abstract class AsyncRunnable implements Runnable {
|
8
|
|
9
|
abstract public Map<String, String> prepare() throws AsyncMethodException;
|
10
|
|
11
|
abstract public void execute() throws AsyncMethodException;
|
12
|
|
13
|
@Override
|
14
|
public final void run() {
|
15
|
try {
|
16
|
execute();
|
17
|
} catch (final AsyncMethodException e) {
|
18
|
throw new DnetGenericRuntimeException("Error executing async method", e);
|
19
|
}
|
20
|
}
|
21
|
|
22
|
}
|