-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathUserService.java
More file actions
33 lines (27 loc) · 844 Bytes
/
UserService.java
File metadata and controls
33 lines (27 loc) · 844 Bytes
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
package io.vertx.example.jpms.serviceproxy;
import io.vertx.codegen.annotations.ProxyGen;
import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.Future;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;
import io.vertx.example.jpms.serviceproxy.impl.SimpleUserService;
import io.vertx.serviceproxy.ServiceProxyBuilder;
/**
* The service interface.
*/
@ProxyGen
@VertxGen
public interface UserService {
static void createService(Vertx vertx) {
vertx
.eventBus()
.consumer("user-service", new UserServiceVertxProxyHandler(vertx, new SimpleUserService(vertx)));
}
static UserService createProxy(Vertx vertx) {
return new ServiceProxyBuilder(vertx)
.setAddress("user-service")
.build(UserService.class);
}
// The service methods
Future<User> getUser(String userID);
}