Class ServiceProxyBuilder

java.lang.Object
io.vertx.serviceproxy.ServiceProxyBuilder

public class ServiceProxyBuilder extends Object
A builder for Service Proxies which state can be reused during the builder lifecycle.
Author:
Paulo Lopes
  • Constructor Details

    • ServiceProxyBuilder

      public ServiceProxyBuilder(Vertx vertx)
      Creates a builder.
      Parameters:
      vertx - a non null instance of vertx.
  • Method Details

    • setAddress

      public ServiceProxyBuilder setAddress(String address)
      Set the address to use on the subsequent proxy creations or service registrations.
      Parameters:
      address - an eventbus address
      Returns:
      self
    • setToken

      public ServiceProxyBuilder setToken(String token)
      Set a JWT token to be used on proxy calls.
      Parameters:
      token - a JWT token
      Returns:
      self
    • setOptions

      public ServiceProxyBuilder setOptions(DeliveryOptions options)
      Set delivery options to be used during a proxy call.
      Parameters:
      options - delivery options
      Returns:
      self
    • build

      public <T> T build(Class<T> clazz)
      Creates a proxy to a service on the event bus.
      Type Parameters:
      T - the type of the service interface
      Parameters:
      clazz - the service class (interface)
      Returns:
      a proxy to the service