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
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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
Service factories can implement cleanup/shutdown procedures here.Service<I,R>
createService(boolean isStart, Map params)
Create a Service call instance.default Map
describeParams()
Return a description of any service call parameters.String
getName()
Get the name of this service.default Set<TraverserRequirement>
getRequirements(Service.Type type)
Return anyTraverserRequirement
s necessary for this service call for the supplied executionService.Type
.default Map<Service.Type,Set<TraverserRequirement>>
getRequirementsByType()
Return anyTraverserRequirement
s necessary for this service call for each executionService.Type
it supports.Set<Service.Type>
getSupportedTypes()
Get the execution modes that it supports.
-
-
-
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.
-
getRequirementsByType
default Map<Service.Type,Set<TraverserRequirement>> getRequirementsByType()
Return anyTraverserRequirement
s necessary for this service call for each executionService.Type
it supports.
-
getRequirements
default Set<TraverserRequirement> getRequirements(Service.Type type)
Return anyTraverserRequirement
s necessary for this service call for the supplied executionService.Type
.
-
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 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:
close
in interfaceAutoCloseable
-
-