/** * Creates a new docproc service, which is set to be in service. * * @param id the component id of the new service. * @param stack the call stack to use. * @param mgr the document type manager to use. */ public DocprocService(ComponentId id, CallStack stack, DocumentTypeManager mgr) { this(id); setCallStack(stack); setDocumentTypeManager(mgr); setInService(true); }
public DocumentProcessingHandler(ComponentRegistry<DocprocService> docprocServiceRegistry, ComponentRegistry<DocumentProcessor> documentProcessorComponentRegistry, ComponentRegistry<AbstractConcreteDocumentFactory> docFactoryRegistry, DocprocThreadPoolExecutor threadPool, DocumentTypeManager documentTypeManager, ChainsModel chainsModel, SchemaMap schemaMap, Statistics statistics, Metric metric, ContainerDocumentConfig containerDocConfig) { this.docprocServiceRegistry = docprocServiceRegistry; this.docFactoryRegistry = docFactoryRegistry; this.threadPool = threadPool; this.containerDocConfig = containerDocConfig; this.documentTypeManager = documentTypeManager; DocprocService.schemaMap = schemaMap; threadPool.prestartCoreThread(); laterExecutor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false); laterExecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); if (chainsModel != null) { prepareChainRegistry(chainRegistry, chainsModel, documentProcessorComponentRegistry); for (Chain<DocumentProcessor> chain : chainRegistry.allComponents()) { log.config("Setting up call stack for chain " + chain.getId()); DocprocService service = new DocprocService(chain.getId(), convertToCallStack(chain, statistics, metric), documentTypeManager); service.setInService(true); docprocServiceRegistry.register(service.getId(), service); } } }
processingFailed(processing, processing + " failed PERMANENTLY at " + processing.callStack().getLastPopped() + ", disabling processing service.", null); setInService(false); return true; } else {