Interface Service.ServiceFactory<I,R>
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
Service.DirectoryService<I>
- All Known Implementing Classes:
ServiceRegistry,TinkerDegreeCentralityFactory,TinkerServiceRegistry,TinkerServiceRegistry.LambdaServiceFactory,TinkerServiceRegistry.TinkerServiceFactory,TinkerTextSearchFactory
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 Summary
Modifier and TypeMethodDescriptiondefault voidclose()Service factories can implement cleanup/shutdown procedures here.createService(boolean isStart, Map params) Create a Service call instance.default MapReturn a description of any service call parameters.getName()Get the name of this service.default Set<TraverserRequirement>getRequirements(Service.Type type) Return anyTraverserRequirements necessary for this service call for the supplied executionService.Type.default Map<Service.Type,Set<TraverserRequirement>> Return anyTraverserRequirements necessary for this service call for each executionService.Typeit supports.Get the execution modes that it supports.
-
Method Details
-
getName
String getName()Get the name of this service. -
getSupportedTypes
Set<Service.Type> getSupportedTypes()Get the execution modes that it supports. -
describeParams
Return a description of any service call parameters. -
getRequirementsByType
Return anyTraverserRequirements necessary for this service call for each executionService.Typeit supports. -
getRequirements
Return anyTraverserRequirements necessary for this service call for the supplied executionService.Type. -
createService
Create a Service call instance.- Parameters:
isStart- true if the call is being used to start a traversalparams- 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:
closein interfaceAutoCloseable
-