use of org.eclipse.dataspaceconnector.transfer.core.inline.DataOperatorRegistryImpl in project DataSpaceConnector by eclipse-dataspaceconnector.
the class CoreTransferExtension method initialize.
@Override
public void initialize(ServiceExtensionContext context) {
var monitor = context.getMonitor();
var telemetry = context.getTelemetry();
var typeManager = context.getTypeManager();
registerTypes(typeManager);
var dataFlowManager = new DataFlowManagerImpl();
context.registerService(DataFlowManager.class, dataFlowManager);
var manifestGenerator = new ResourceManifestGeneratorImpl();
context.registerService(ResourceManifestGenerator.class, manifestGenerator);
var statusCheckerRegistry = new StatusCheckerRegistryImpl();
context.registerService(StatusCheckerRegistry.class, statusCheckerRegistry);
var dataOperatorRegistry = new DataOperatorRegistryImpl();
context.registerService(DataOperatorRegistry.class, dataOperatorRegistry);
var provisionManager = new ProvisionManagerImpl(monitor);
context.registerService(ProvisionManager.class, provisionManager);
var waitStrategy = context.hasService(TransferWaitStrategy.class) ? context.getService(TransferWaitStrategy.class) : new ExponentialWaitStrategy(DEFAULT_ITERATION_WAIT);
var endpointDataReferenceReceiverRegistry = new EndpointDataReferenceReceiverRegistryImpl();
context.registerService(EndpointDataReferenceReceiverRegistry.class, endpointDataReferenceReceiverRegistry);
// Register a default EndpointDataReferenceTransformer that can be overridden in extensions.
var endpointDataReferenceTransformerRegistry = new EndpointDataReferenceTransformerRegistryImpl();
context.registerService(EndpointDataReferenceTransformerRegistry.class, endpointDataReferenceTransformerRegistry);
var commandQueue = new BoundedCommandQueue<TransferProcessCommand>(10);
var observable = new TransferProcessObservableImpl();
context.registerService(TransferProcessObservable.class, observable);
var retryLimit = context.getSetting(TRANSFER_SEND_RETRY_LIMIT, 7);
var retryBaseDelay = context.getSetting(TRANSFER_SEND_RETRY_BASE_DELAY_MS, 100L);
var sendRetryManager = new TransferProcessSendRetryManager(monitor, () -> new ExponentialWaitStrategy(retryBaseDelay), retryLimit);
processManager = TransferProcessManagerImpl.Builder.newInstance().waitStrategy(waitStrategy).manifestGenerator(manifestGenerator).dataFlowManager(dataFlowManager).provisionManager(provisionManager).dispatcherRegistry(dispatcherRegistry).statusCheckerRegistry(statusCheckerRegistry).monitor(monitor).telemetry(telemetry).executorInstrumentation(context.getService(ExecutorInstrumentation.class)).vault(vault).typeManager(typeManager).commandQueue(commandQueue).commandRunner(new CommandRunner<>(registry, monitor)).observable(observable).transferProcessStore(transferProcessStore).policyArchive(policyArchive).batchSize(context.getSetting(TRANSFER_STATE_MACHINE_BATCH_SIZE, 5)).sendRetryManager(sendRetryManager).addressResolver(addressResolver).build();
context.registerService(TransferProcessManager.class, processManager);
registry.register(new AddProvisionedResourceCommandHandler(processManager));
registry.register(new DeprovisionCompleteCommandHandler(processManager));
}
Aggregations