public void prepare()

in oap-server/server-tools/profile-exporter/tool-profile-snapshot-server-mock/src/main/java/org/apache/skywalking/oap/server/tool/profile/core/MockCoreModuleProvider.java [119:227]


    public void prepare() throws ServiceNotProvidedException, ModuleStartException {
        this.registerServiceImplementation(
                NamingControl.class,
                new NamingControl(50, 50, 150, new EndpointNameGrouping())
        );

        MockStreamAnnotationListener streamAnnotationListener = new MockStreamAnnotationListener(getManager());
        annotationScan.registerListener(streamAnnotationListener);

        AnnotationScan scopeScan = new AnnotationScan();
        scopeScan.registerListener(new DefaultScopeDefine.Listener());
        try {
            scopeScan.scan();
        } catch (Exception e) {
            throw new ModuleStartException(e.getMessage(), e);
        }

        this.registerServiceImplementation(MeterSystem.class, new MeterSystem(getManager()));

        CoreModuleConfig moduleConfig = new CoreModuleConfig();
        this.registerServiceImplementation(ConfigService.class, new ConfigService(moduleConfig, this));
        this.registerServiceImplementation(ServerStatusService.class, new ServerStatusService(getManager(), moduleConfig));
        moduleConfig.setEnableHierarchy(false);
        this.registerServiceImplementation(HierarchyDefinitionService.class, new HierarchyDefinitionService(moduleConfig));
        this.registerServiceImplementation(HierarchyService.class, new HierarchyService(getManager(), moduleConfig));
        this.registerServiceImplementation(
                DownSamplingConfigService.class, new DownSamplingConfigService(Collections.emptyList()));

        this.registerServiceImplementation(GRPCHandlerRegister.class, new MockGRPCHandlerRegister());
        this.registerServiceImplementation(HTTPHandlerRegister.class, new MockHTTPHandlerRegister());

        this.registerServiceImplementation(
                IComponentLibraryCatalogService.class, new MockComponentLibraryCatalogService());

        this.registerServiceImplementation(SourceReceiver.class, new MockSourceReceiver());

        MockWorkerInstancesService instancesService = new MockWorkerInstancesService();
        this.registerServiceImplementation(IWorkerInstanceGetter.class, instancesService);
        this.registerServiceImplementation(IWorkerInstanceSetter.class, instancesService);

        this.registerServiceImplementation(RemoteSenderService.class, new RemoteSenderService(getManager()));
        this.registerServiceImplementation(ModelCreator.class, storageModels);
        this.registerServiceImplementation(IModelManager.class, storageModels);
        this.registerServiceImplementation(ModelManipulator.class, storageModels);

        this.registerServiceImplementation(
                NetworkAddressAliasCache.class, new NetworkAddressAliasCache(moduleConfig));

        this.registerServiceImplementation(TopologyQueryService.class, new TopologyQueryService(getManager(), storageModels));
        this.registerServiceImplementation(MetricsMetadataQueryService.class, new MetricsMetadataQueryService());
        this.registerServiceImplementation(MetricsQueryService.class, new MetricsQueryService(getManager()));
        this.registerServiceImplementation(TraceQueryService.class, new TraceQueryService(getManager()));
        this.registerServiceImplementation(BrowserLogQueryService.class, new BrowserLogQueryService(getManager()));
        this.registerServiceImplementation(LogQueryService.class, new LogQueryService(getManager()));
        this.registerServiceImplementation(MetadataQueryService.class, new MetadataQueryService(getManager(), moduleConfig));
        this.registerServiceImplementation(AggregationQueryService.class, new AggregationQueryService(getManager()));
        this.registerServiceImplementation(AlarmQueryService.class, new AlarmQueryService(getManager()));
        this.registerServiceImplementation(TopNRecordsQueryService.class, new TopNRecordsQueryService(getManager()));

        // add profile service implementations
        this.registerServiceImplementation(
                ProfileTaskMutationService.class, new ProfileTaskMutationService(getManager()));
        this.registerServiceImplementation(
                ProfileTaskQueryService.class, new ProfileTaskQueryService(getManager(), moduleConfig));
        this.registerServiceImplementation(ProfileTaskCache.class, new ProfileTaskCache(getManager(), moduleConfig));

        this.registerServiceImplementation(CommandService.class, new CommandService(getManager()));

        this.registerServiceImplementation(RemoteClientManager.class, new MockRemoteClientManager(getManager(), 0));

        // add oal engine loader service implementations
        this.registerServiceImplementation(OALEngineLoaderService.class, new OALEngineLoaderService(getManager()));

        // Management
        this.registerServiceImplementation(UITemplateManagementService.class, new UITemplateManagementService(getManager()));
        this.registerServiceImplementation(
            UIMenuManagementService.class, new UIMenuManagementService(getManager(), moduleConfig));

        this.registerServiceImplementation(EventQueryService.class, new EventQueryService(getManager()));
        this.registerServiceImplementation(RecordQueryService.class, new RecordQueryService(getManager()));
        this.registerServiceImplementation(HierarchyQueryService.class, new HierarchyQueryService(getManager(), moduleConfig));
        this.registerServiceImplementation(
            TTLStatusQuery.class, new TTLStatusQuery(
                getManager(),
                moduleConfig.getMetricsDataTTL(),
                moduleConfig.getRecordDataTTL()
            )
        );
        this.registerServiceImplementation(
            TagAutoCompleteQueryService.class, new TagAutoCompleteQueryService(getManager(), moduleConfig));
        this.registerServiceImplementation(
            AsyncProfilerMutationService.class, new AsyncProfilerMutationService(getManager()));
        this.registerServiceImplementation(
            AsyncProfilerQueryService.class, new AsyncProfilerQueryService(getManager()));
        this.registerServiceImplementation(
            AsyncProfilerTaskCache.class, new AsyncProfilerTaskCache(getManager(), moduleConfig));
        this.registerServiceImplementation(
            EBPFProfilingMutationService.class, new EBPFProfilingMutationService(getManager()));
        this.registerServiceImplementation(
            EBPFProfilingQueryService.class,
            new EBPFProfilingQueryService(getManager(), moduleConfig, this.storageModels)
        );
        this.registerServiceImplementation(
            ContinuousProfilingMutationService.class, new ContinuousProfilingMutationService(getManager()));
        this.registerServiceImplementation(
            ContinuousProfilingQueryService.class, new ContinuousProfilingQueryService(getManager()));
        this.registerServiceImplementation(EndpointNameGroupService.class, new EndpointNameGrouping());

    }