Class JeeJoynrServiceLocator
- java.lang.Object
-
- io.joynr.jeeintegration.JeeJoynrServiceLocator
-
- All Implemented Interfaces:
ServiceLocator
public class JeeJoynrServiceLocator extends Object implements ServiceLocator
JEE integration joynr service locator which uses a joynr proxy to provide an implementation for a service interface. The service interface is mapped to its joynr proxy, by expecting aUsedByannotation is attached in the class hierarchy of the service interface. With this annotation, the proxy is found by the JeeJoynrServiceLocator.This class provides some helper methods for common use cases for obtaining a service proxy in the form of the various
getmethods. In order to have access to all features of the joynr proxy builder, such as specifying the stateless async use case or getting aCompletableFuturefor the service proxy, use theServiceLocator.ServiceProxyBuilderwhich can be obtained by callingbuilder(Class, String...)instead.Note that unless you use
ServiceLocator.ServiceProxyBuilder.useFuture(), then the service proxy returned might not initially be connected to the desired provider while arbitration is ongoing. Any calls you make the service proxy in this state will be queued until such a time as the provider becomes available. If you want more fine-grained control over how to handle the provider not being available, becoming available or the arbitration failing, then call theuseFuture()method before calling thebuild()method and add the relevant listeners to the resulting completable future.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classJeeJoynrServiceLocator.JeeJoynrServiceFutureProxyBuilder<T>classJeeJoynrServiceLocator.JeeJoynrServiceProxyBuilder<T>-
Nested classes/interfaces inherited from interface io.joynr.jeeintegration.api.ServiceLocator
ServiceLocator.ServiceProxyBuilder<T>
-
-
Constructor Summary
Constructors Constructor Description JeeJoynrServiceLocator(JoynrIntegrationBean joynrIntegrationBean)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <I> ServiceLocator.ServiceProxyBuilder<I>builder(Class<I> serviceInterface, String... domains)Create aServiceLocator.ServiceProxyBuilderfor the given service interface and domains.<I> Iget(Class<I> serviceInterface, String domain)Deprecated.<I> Iget(Class<I> serviceInterface, String domain, long ttl)Deprecated.<I> Iget(Class<I> serviceInterface, String domain, MessagingQos messagingQos, DiscoveryQos discoveryQos)Deprecated.<I> Iget(Class<I> serviceInterface, Set<String> domains)Deprecated.<I> Iget(Class<I> serviceInterface, Set<String> domains, long ttl)Deprecated.<I> Iget(Class<I> serviceInterface, Set<String> domains, MessagingQos messagingQos, DiscoveryQos discoveryQos)Deprecated.<I> Iget(Class<I> serviceInterface, Set<String> domains, MessagingQos messagingQos, DiscoveryQos discoveryQos, String useCase)Deprecated.GuidedProxyBuildergetGuidedProxyBuilder(Class<?> interfaceClass, Set<String> domains)Returns a guided proxy builder instance to build a proxy object for a selected provider in a given set of domains.
-
-
-
Constructor Detail
-
JeeJoynrServiceLocator
@Inject public JeeJoynrServiceLocator(JoynrIntegrationBean joynrIntegrationBean)
-
-
Method Detail
-
get
@Deprecated public <I> I get(Class<I> serviceInterface, String domain)
Deprecated.Description copied from interface:ServiceLocatorObtains a client proxy for the given service interface in the given domain. CallsServiceLocator.get(Class, String, MessagingQos, DiscoveryQos)with default values for messaging and discovery quality of service.- Specified by:
getin interfaceServiceLocator- Type Parameters:
I- the service type- Parameters:
serviceInterface- the service interface for which to get a client proxy.domain- the domain in which the service implementation must be available.- Returns:
- the client proxy, which can be used to call methods on the service service.
-
get
@Deprecated public <I> I get(Class<I> serviceInterface, String domain, long ttl)
Deprecated.Description copied from interface:ServiceLocatorLikeServiceLocator.get(Class, String), but allows you to specify the maximum time-to-live for messages sent to the service. CallsServiceLocator.get(Class, String, MessagingQos, DiscoveryQos), setting the TTL passed in on the messaging quality of service and providing default values for the discovery quality of service.- Specified by:
getin interfaceServiceLocator- Type Parameters:
I- the service type- Parameters:
serviceInterface- the service interface for which to get a client proxy.domain- the domain in which the service implementation must be available.ttl- the maximum time to live for messages sent via the service. If the time to live expires (the message takes longer to deliver), then an exception is thrown.- Returns:
- the client proxy, which can be used to call methods on the service interface.
-
get
@Deprecated public <I> I get(Class<I> serviceInterface, Set<String> domains)
Deprecated.Description copied from interface:ServiceLocatorObtains a client proxy for multiple services of the given service interface in the given domains. CallsServiceLocator.get(Class, Set, MessagingQos, DiscoveryQos)with default values for messaging and discovery quality of service.- Specified by:
getin interfaceServiceLocator- Type Parameters:
I- the service type- Parameters:
serviceInterface- the BCI interface for which to get a client proxy.domains- the set of domains in which the service implementations must be available.- Returns:
- the client proxy, which can be used to call methods on the BCI service.
-
get
@Deprecated public <I> I get(Class<I> serviceInterface, Set<String> domains, long ttl)
Deprecated.Description copied from interface:ServiceLocatorLikeServiceLocator.get(Class, Set), but allows you to specify the maximum time-to-live for messages sent to the services. CallsServiceLocator.get(Class, Set, MessagingQos, DiscoveryQos), setting the TTL passed in on the messaging quality of service and providing default values for the discovery quality of service.- Specified by:
getin interfaceServiceLocator- Type Parameters:
I- the service type- Parameters:
serviceInterface- the BCI interface for which to get a client proxy.domains- the set of domains in which the service implementations must be available.ttl- the maximum time to live for messages sent via the service. If the time to live expires (the message takes longer to deliver), then an exception is thrown.- Returns:
- the client proxy, which can be used to call methods on the BCI service.
-
get
@Deprecated public <I> I get(Class<I> serviceInterface, String domain, MessagingQos messagingQos, DiscoveryQos discoveryQos)
Deprecated.Description copied from interface:ServiceLocatorLikeServiceLocator.get(Class, String), but allows you to specify the messaging and discovery quality of service information to use.- Specified by:
getin interfaceServiceLocator- Type Parameters:
I- the service type- Parameters:
serviceInterface- the service interface for which to get a client proxy.domain- the domain in which the service implementation must be available.messagingQos- the messaging quality of service information (including the time to live value) to use when communicating to the service.discoveryQos- the discovery quality of service information to use when communicating to the service.- Returns:
- the client proxy, which can be used to call methods on the service service.
-
get
@Deprecated public <I> I get(Class<I> serviceInterface, Set<String> domains, MessagingQos messagingQos, DiscoveryQos discoveryQos)
Deprecated.Description copied from interface:ServiceLocatorLikeServiceLocator.get(Class, Set), but allows you to specify the messaging and discovery quality of service information to use.- Specified by:
getin interfaceServiceLocator- Type Parameters:
I- the service type- Parameters:
serviceInterface- the BCI interface for which to get a client proxy.domains- the set of domains in which the service implementations must be available.messagingQos- the messaging quality of service information (including the time to live value) to use when communicating to the service.discoveryQos- the discovery quality of service information to use when communicating to the service.- Returns:
- the client proxy, which can be used to call methods on the BCI service.
-
get
@Deprecated public <I> I get(Class<I> serviceInterface, Set<String> domains, MessagingQos messagingQos, DiscoveryQos discoveryQos, String useCase)
Deprecated.Description copied from interface:ServiceLocatorLikeServiceLocator.get(Class, Set), but allows you to specify the messaging and discovery quality of service information to use, as well as the stateless async use case in order to identify theCallbackHandlerbean to use for processing stateless async replies received for requests made from this proxy.- Specified by:
getin interfaceServiceLocator- Type Parameters:
I- the service type- Parameters:
serviceInterface- the BCI interface for which to get a client proxy.domains- the set of domains in which the service implementations must be available.messagingQos- the messaging quality of service information (including the time to live value) to use when communicating to the service.discoveryQos- the discovery quality of service information to use when communicating to the service.useCase- the name of the use case for identifying the relevantCallbackHandlerbean to use for processing stateless async replies received for requests made from this proxy.- Returns:
- the client proxy, which can be used to call methods on the BCI service.
-
builder
public <I> ServiceLocator.ServiceProxyBuilder<I> builder(Class<I> serviceInterface, String... domains)
Description copied from interface:ServiceLocatorCreate aServiceLocator.ServiceProxyBuilderfor the given service interface and domains.- Specified by:
builderin interfaceServiceLocator- Type Parameters:
I- the type of the service interface for which a service proxy builder should be created.- Parameters:
serviceInterface- the service interface for which to create the service proxy builder.domains- the list of domains which the proxy will use for looking up the services to communicate with. At least one domain must be provided.- Returns:
- the
ServiceLocator.ServiceProxyBuilderwhich can be used to setup the configuration with which to build the service proxy.
-
getGuidedProxyBuilder
public GuidedProxyBuilder getGuidedProxyBuilder(Class<?> interfaceClass, Set<String> domains)
Description copied from interface:ServiceLocatorReturns a guided proxy builder instance to build a proxy object for a selected provider in a given set of domains.- Specified by:
getGuidedProxyBuilderin interfaceServiceLocator- Parameters:
interfaceClass- Interface the provider offers.domains- the set of domains to be considered when searching the providers.- Returns:
- After configuration, the returned GuidedProxyBuilder can be used to discover providers and build a proxy instance for the selected provider.
-
-