public class ServiceBinder extends Object
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_CONNECTION_TIMEOUT |
Constructor and Description |
---|
ServiceBinder(io.vertx.core.Vertx vertx)
Creates a factory.
|
Modifier and Type | Method and Description |
---|---|
ServiceBinder |
addInterceptor(Function<io.vertx.core.eventbus.Message<io.vertx.core.json.JsonObject>,io.vertx.core.Future<io.vertx.core.eventbus.Message<io.vertx.core.json.JsonObject>>> interceptor) |
<T> io.vertx.core.eventbus.MessageConsumer<io.vertx.core.json.JsonObject> |
register(Class<T> clazz,
T service)
Registers a service on the event bus.
|
<T> io.vertx.core.eventbus.MessageConsumer<io.vertx.core.json.JsonObject> |
registerLocal(Class<T> clazz,
T service)
Registers a local service on the event bus.
|
ServiceBinder |
setAddress(String address)
Set the address to use on the subsequent proxy creations or service registrations.
|
ServiceBinder |
setTimeoutSeconds(long timeoutSeconds)
Set the default timeout in seconds while waiting for a reply.
|
ServiceBinder |
setTopLevel(boolean topLevel)
Set if the services to create are a top level services.
|
void |
unregister(io.vertx.core.eventbus.MessageConsumer<io.vertx.core.json.JsonObject> consumer)
Unregisters a published service.
|
public static final long DEFAULT_CONNECTION_TIMEOUT
public ServiceBinder(io.vertx.core.Vertx vertx)
vertx
- a non null instance of vertx.public ServiceBinder setAddress(String address)
address
- an eventbus addresspublic ServiceBinder setTopLevel(boolean topLevel)
topLevel
- true for top level (default: true)public ServiceBinder setTimeoutSeconds(long timeoutSeconds)
timeoutSeconds
- the default timeout (default: 5 minutes)public ServiceBinder addInterceptor(Function<io.vertx.core.eventbus.Message<io.vertx.core.json.JsonObject>,io.vertx.core.Future<io.vertx.core.eventbus.Message<io.vertx.core.json.JsonObject>>> interceptor)
public <T> io.vertx.core.eventbus.MessageConsumer<io.vertx.core.json.JsonObject> register(Class<T> clazz, T service)
T
- the type of the service interfaceclazz
- the service class (interface)service
- the service objectpublic <T> io.vertx.core.eventbus.MessageConsumer<io.vertx.core.json.JsonObject> registerLocal(Class<T> clazz, T service)
T
- the type of the service interfaceclazz
- the service class (interface)service
- the service objectpublic void unregister(io.vertx.core.eventbus.MessageConsumer<io.vertx.core.json.JsonObject> consumer)
consumer
- the consumer returned by register(Class, Object)
.Copyright © 2021 Eclipse. All rights reserved.