public class ServiceBinder extends Object
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_CONNECTION_TIMEOUT |
Constructor and Description |
---|
ServiceBinder(Vertx vertx)
Creates a factory.
|
Modifier and Type | Method and Description |
---|---|
ServiceBinder |
addInterceptor(java.util.function.Function<Message<JsonObject>,Future<Message<JsonObject>>> interceptor) |
<T> MessageConsumer<JsonObject> |
register(Class<T> clazz,
T service)
Registers a service on the event bus.
|
<T> MessageConsumer<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 |
setIncludeDebugInfo(boolean includeDebugInfo)
When an exception is thrown by the service or the underlying handler, include
debugging info in the ServiceException, that you can access with
ServiceException.getDebugInfo() |
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(MessageConsumer<JsonObject> consumer)
Unregisters a published service.
|
public static final long DEFAULT_CONNECTION_TIMEOUT
public ServiceBinder(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 setIncludeDebugInfo(boolean includeDebugInfo)
ServiceException.getDebugInfo()
includeDebugInfo
- public ServiceBinder addInterceptor(java.util.function.Function<Message<JsonObject>,Future<Message<JsonObject>>> interceptor)
public <T> MessageConsumer<JsonObject> register(Class<T> clazz, T service)
T
- the type of the service interfaceclazz
- the service class (interface)service
- the service objectpublic <T> MessageConsumer<JsonObject> registerLocal(Class<T> clazz, T service)
T
- the type of the service interfaceclazz
- the service class (interface)service
- the service objectpublic void unregister(MessageConsumer<JsonObject> consumer)
consumer
- the consumer returned by register(Class, Object)
.Copyright © 2022 Eclipse. All rights reserved.