Skip to content

Commit 9384c2d

Browse files
committed
Minor refactoring
1 parent b86b0ca commit 9384c2d

3 files changed

Lines changed: 5 additions & 14 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#/in/erail/factory/MethodInstanceFactory
22
$class=in.erail.glue.factory.MethodInstanceFactory
33
$scope=GLOBAL
4+
log=true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#/in/erail/factory/ParameterConstructorInstanceFactory
22
$class=in.erail.glue.factory.ParameterConstructorInstanceFactory
33
$scope=GLOBAL
4+
log=true

src/main/java/io/vertx/core/VertxInstance.java

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,26 @@
33
import io.vertx.reactivex.core.Vertx;
44
import java.util.concurrent.CompletableFuture;
55
import java.util.concurrent.ExecutionException;
6-
import java.util.logging.Level;
7-
import java.util.logging.Logger;
86
import in.erail.glue.annotation.StartService;
97

108
public class VertxInstance {
119

1210
private VertxOptions mVertxOptions;
1311
private boolean mClusterEnable = true;
14-
private CompletableFuture<Vertx> mVertx = null;
12+
private CompletableFuture<Vertx> mVertx = new CompletableFuture<>();
1513

1614
@StartService
1715
public void start() {
18-
1916
if (isClusterEnable()) {
20-
mVertx = new CompletableFuture<>();
2117
Vertx.rxClusteredVertx(getVertxOptions()).subscribe((t) -> mVertx.complete(t));
2218
} else {
23-
mVertx = CompletableFuture.completedFuture(Vertx.vertx(getVertxOptions()));
19+
mVertx.complete(Vertx.vertx(getVertxOptions()));
2420
}
2521

2622
}
2723

28-
public Vertx create() {
29-
30-
try {
24+
public Vertx create() throws InterruptedException, ExecutionException {
3125
return mVertx.get();
32-
} catch (InterruptedException | ExecutionException ex) {
33-
Logger.getLogger(VertxInstance.class.getName()).log(Level.SEVERE, null, ex);
34-
}
35-
36-
return null;
3726
}
3827

3928
public VertxOptions getVertxOptions() {

0 commit comments

Comments
 (0)