Interface Service.ServiceFactory<I,​R>

  • All Superinterfaces:
    AutoCloseable
    All Known Subinterfaces:
    Service.DirectoryService<I>
    All Known Implementing Classes:
    ServiceRegistry
    Enclosing interface:
    Service<I,​R>

    public static interface Service.ServiceFactory<I,​R>
    extends AutoCloseable
    The service factory creates instances of callable services based on the desired execution type. Some services (e.g. full text search) might be run at the start of a traversal or mid-traversal. The service factory will create an instance based on how the service will be executed. This leaves open the possibility for a single named service to support multiple execution modes (streaming vs. chunked vs. all-at-once) and dynamically choose one based on the location in the traversal of the service call and the static parameters supplied (this allow for dynamic chunk size).
    • Method Detail

      • getName

        String getName()
        Get the name of this service.
      • getSupportedTypes

        Set<Service.Type> getSupportedTypes()
        Get the execution modes that it supports.
      • describeParams

        default Map describeParams()
        Return a description of any service call parameters.
      • createService

        Service<I,​R> createService​(boolean isStart,
                                         Map params)
        Create a Service call instance.
        Parameters:
        isStart - true if the call is being used to start a traversal
        params - the static params provided to service call (if any)
        Returns:
        the service call instance
      • close

        default void close()
        Service factories can implement cleanup/shutdown procedures here.
        Specified by:
        close in interface AutoCloseable