Package io.joynr.jeeintegration
Class JeeJoynrServiceLocator.JeeJoynrServiceFutureProxyBuilder<T>
- java.lang.Object
-
- io.joynr.jeeintegration.JeeJoynrServiceLocator.JeeJoynrServiceFutureProxyBuilder<T>
-
- All Implemented Interfaces:
ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>>
- Enclosing class:
- JeeJoynrServiceLocator
public class JeeJoynrServiceLocator.JeeJoynrServiceFutureProxyBuilder<T> extends Object implements ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<T>build()Create the service proxy using all of the settings previously setup using the 'with*' methods.ServiceLocator.ServiceProxyBuilder<CompletableFuture<CompletableFuture<T>>>useFuture()If you want to have aCompletableFuturereturned which will complete when the proxy has been fully created and initialised successfully, then call this method before callingServiceLocator.ServiceProxyBuilder.build().ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>>withCallback(ProxyBuilder.ProxyCreatedCallback<CompletableFuture<T>> callback)Set the callback to use when creating the proxy.ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>>withDiscoveryQos(DiscoveryQos discoveryQos)Set the discovery quality-of-service to use when looking up the service which the proxy will talk to.ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>>withGbids(String[] gbids)Set the GBIDs to use when looking up the service which the proxy will talk to.ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>>withMessagingQos(MessagingQos messagingQos)Set the messaging quality-of-service to use when sending messages from the resulting proxy.ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>>withTtl(long ttl)Set the time to live for messages being sent from the resulting proxy.ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>>withUseCase(String useCase)Set the stateless async use case name use to find the relevantCallbackHandlerto use for processing stateless async replies resulting from requests sent from this proxy.
-
-
-
Method Detail
-
withTtl
public ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>> withTtl(long ttl)
Description copied from interface:ServiceLocator.ServiceProxyBuilderSet the time to live for messages being sent from the resulting proxy. Subsequent calls toServiceLocator.ServiceProxyBuilder.withMessagingQos(MessagingQos)will override any value you set via this method. If you want to set other messaging QoS values, then you should simply set the TTL on a messaging QoS instance and callServiceLocator.ServiceProxyBuilder.withMessagingQos(MessagingQos).- Specified by:
withTtlin interfaceServiceLocator.ServiceProxyBuilder<T>- Parameters:
ttl- the time to live to use when sending messages from the proxy.- Returns:
- the builder.
-
withMessagingQos
public ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>> withMessagingQos(MessagingQos messagingQos)
Description copied from interface:ServiceLocator.ServiceProxyBuilderSet the messaging quality-of-service to use when sending messages from the resulting proxy.- Specified by:
withMessagingQosin interfaceServiceLocator.ServiceProxyBuilder<T>- Parameters:
messagingQos- the messaging quality-of-service to use.- Returns:
- the builder.
-
withDiscoveryQos
public ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>> withDiscoveryQos(DiscoveryQos discoveryQos)
Description copied from interface:ServiceLocator.ServiceProxyBuilderSet the discovery quality-of-service to use when looking up the service which the proxy will talk to.- Specified by:
withDiscoveryQosin interfaceServiceLocator.ServiceProxyBuilder<T>- Parameters:
discoveryQos- the discovery quality-of-service to use.- Returns:
- the builder.
-
withUseCase
public ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>> withUseCase(String useCase)
Description copied from interface:ServiceLocator.ServiceProxyBuilderSet the stateless async use case name use to find the relevantCallbackHandlerto use for processing stateless async replies resulting from requests sent from this proxy.- Specified by:
withUseCasein interfaceServiceLocator.ServiceProxyBuilder<T>- Parameters:
useCase- stateless async use case name- Returns:
- the builder.
-
withGbids
public ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>> withGbids(String[] gbids)
Description copied from interface:ServiceLocator.ServiceProxyBuilderSet the GBIDs to use when looking up the service which the proxy will talk to.- Specified by:
withGbidsin interfaceServiceLocator.ServiceProxyBuilder<T>- Parameters:
gbids- an array of GBIDs- Returns:
- the builder.
-
withCallback
public ServiceLocator.ServiceProxyBuilder<CompletableFuture<T>> withCallback(ProxyBuilder.ProxyCreatedCallback<CompletableFuture<T>> callback)
Description copied from interface:ServiceLocator.ServiceProxyBuilderSet the callback to use when creating the proxy. The callback can be used to be informed of when the proxy is successfully attached to the provider or in the case that this fails.- Specified by:
withCallbackin interfaceServiceLocator.ServiceProxyBuilder<T>- Parameters:
callback- the callback to use when building the proxy.- Returns:
- the builder.
-
useFuture
public ServiceLocator.ServiceProxyBuilder<CompletableFuture<CompletableFuture<T>>> useFuture()
Description copied from interface:ServiceLocator.ServiceProxyBuilderIf you want to have aCompletableFuturereturned which will complete when the proxy has been fully created and initialised successfully, then call this method before callingServiceLocator.ServiceProxyBuilder.build(). This also allows you to react to any error encountered while attempting to initialise the proxy, such as encountering discovery timeouts if the requested provider isn't available in time. If you want to additionally use acallbackmake sure to set the callback on the builder before calling this method, as it will not be possible any more after the call touseFuture().- Specified by:
useFuturein interfaceServiceLocator.ServiceProxyBuilder<T>- Returns:
- returns a version of the proxy builder which returns a
CompletableFuturefor the proxy rather than the proxy itself.
-
build
public CompletableFuture<T> build()
Description copied from interface:ServiceLocator.ServiceProxyBuilderCreate the service proxy using all of the settings previously setup using the 'with*' methods.- Specified by:
buildin interfaceServiceLocator.ServiceProxyBuilder<T>- Returns:
- the service proxy. Alternatively a
CompletableFuturewhich will yield the service proxy upon successful completion if you previously calledServiceLocator.ServiceProxyBuilder.useFuture().
-
-