Interface ServiceLocator

  • All Known Implementing Classes:
    JeeJoynrServiceLocator

    public interface ServiceLocator
    The container runtime will provide an instance of this which can be injected and then used in order to obtain client proxies for services.
    • Method Detail

      • get

        @Deprecated
        <I> I get​(Class<I> serviceInterface,
                  String domain)
        Deprecated.
        prefer using the builder.
        Obtains a client proxy for the given service interface in the given domain. Calls get(Class, String, MessagingQos, DiscoveryQos) with default values for messaging and discovery quality of service.
        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
        <I> I get​(Class<I> serviceInterface,
                  String domain,
                  long ttl)
        Deprecated.
        prefer using the builder.
        Like get(Class, String), but allows you to specify the maximum time-to-live for messages sent to the service. Calls 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.
        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
        <I> I get​(Class<I> serviceInterface,
                  String domain,
                  MessagingQos messagingQos,
                  DiscoveryQos discoveryQos)
        Deprecated.
        prefer using the builder.
        Like get(Class, String), but allows you to specify the messaging and discovery quality of service information to use.
        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
        <I> I get​(Class<I> serviceInterface,
                  Set<String> domains)
        Deprecated.
        prefer using the builder.
        Obtains a client proxy for multiple services of the given service interface in the given domains. Calls get(Class, Set, MessagingQos, DiscoveryQos) with default values for messaging and discovery quality of service.
        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
        <I> I get​(Class<I> serviceInterface,
                  Set<String> domains,
                  long ttl)
        Deprecated.
        prefer using the builder.
        Like get(Class, Set), but allows you to specify the maximum time-to-live for messages sent to the services. Calls 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.
        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
        <I> I get​(Class<I> serviceInterface,
                  Set<String> domains,
                  MessagingQos messagingQos,
                  DiscoveryQos discoveryQos)
        Deprecated.
        prefer using the builder.
        Like get(Class, Set), but allows you to specify the messaging and discovery quality of service information to use.
        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
        <I> I get​(Class<I> serviceInterface,
                  Set<String> domains,
                  MessagingQos messagingQos,
                  DiscoveryQos discoveryQos,
                  String useCase)
        Deprecated.
        prefer using the builder.
        Like 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 the CallbackHandler bean to use for processing stateless async replies received for requests made from this proxy.
        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 relevant CallbackHandler bean 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

        <I> ServiceLocator.ServiceProxyBuilder<I> builder​(Class<I> serviceInterface,
                                                          String... domains)
        Create a ServiceLocator.ServiceProxyBuilder for the given service interface and domains.
        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.ServiceProxyBuilder which can be used to setup the configuration with which to build the service proxy.
      • getGuidedProxyBuilder

        GuidedProxyBuilder getGuidedProxyBuilder​(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.
        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.