Context - the context type.Result - the result type.public final class ServiceRepository<Context,Result> extends java.lang.Object implements net.infumia.frame.Cloned<ServiceRepository<Context,Result>>
| Constructor and Description |
|---|
ServiceRepository(ServicePipeline pipeline,
io.leangen.geantyref.TypeToken<? extends Service<Context,Result>> serviceType,
Service<Context,Result> defaultImplementation)
Constructs a new
ServiceRepository with a default implementation. |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(Implementation<Context,Result> operation)
Applies an implementation operation to this repository.
|
ServiceRepository<Context,Result> |
cloned() |
java.util.concurrent.CompletableFuture<Result> |
completeAsync(Context context)
Executes the services in this repository asynchronously with the given context.
|
java.util.concurrent.CompletableFuture<Result> |
completeDirect(Context context)
Executes the services in this repository directly (synchronously) with the given context.
|
public ServiceRepository(ServicePipeline pipeline, io.leangen.geantyref.TypeToken<? extends Service<Context,Result>> serviceType, Service<Context,Result> defaultImplementation)
ServiceRepository with a default implementation.pipeline - the service pipeline.serviceType - the type token of the service.defaultImplementation - the default service implementation.public ServiceRepository<Context,Result> cloned()
cloned in interface net.infumia.frame.Cloned<ServiceRepository<Context,Result>>public void apply(Implementation<Context,Result> operation)
operation - the operation to apply.public java.util.concurrent.CompletableFuture<Result> completeDirect(Context context)
context - the context to execute with.CompletableFuture that will be completed with the result.