@PostConstruct protected void init() { storeRoot = SnowOwlApplication.INSTANCE.getEnviroment().getDataDirectory().getPath(); }
@PostConstruct protected void init() { LOG.info("Initializing classification service; keeping indexed data for {} recent run(s).", getMaxReasonerRuns()); final File dir = new File(new File(SnowOwlApplication.INSTANCE.getEnviroment().getDataDirectory(), "indexes"), "classification_runs"); indexService = new ClassificationRunIndex(dir); ApplicationContext.getInstance().getServiceChecked(SingleDirectoryIndexManager.class).registerIndex(indexService); try { indexService.trimIndex(getMaxReasonerRuns()); indexService.invalidateClassificationRuns(); } catch (final IOException e) { LOG.error("Failed to run housekeeping tasks for the classification index.", e); } // TODO: common ExecutorService for asynchronous work? executorService = Executors.newCachedThreadPool(); remoteJobSubscription = getNotifications() .ofType(RemoteJobNotification.class) .subscribe(this::onRemoteJobNotification); initialized = true; }
@Override protected void doBeforeActivate() throws Exception { //read extension points first, then create managed items super.doBeforeActivate(); Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); JVMUtil.prepareContainer(IPluginContainer.INSTANCE); TCPUtil.prepareContainer(IPluginContainer.INSTANCE); CDONet4jUtil.prepareContainer(IPluginContainer.INSTANCE); CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); registerCustomProtocols(); LifecycleUtil.activate(IPluginContainer.INSTANCE); final HostAndPort hostAndPort = getRepositoryConfiguration().getHostAndPort(); // open port in server environments if (SnowOwlApplication.INSTANCE.getEnviroment().isServer()) { IAcceptor acceptor = TCPUtil.getAcceptor(IPluginContainer.INSTANCE, hostAndPort.toString()); // Start the TCP transport if (getSnowOwlConfiguration().isGzip()) { IPluginContainer.INSTANCE.addPostProcessor(new TcpGZIPStreamWrapperInjector(CDOProtocolConstants.PROTOCOL_NAME, acceptor)); } LOGGER.info("Listening on {} for connections", hostAndPort); } JVMUtil.getAcceptor(IPluginContainer.INSTANCE, Net4jUtils.NET_4_J_CONNECTOR_NAME); // Start the JVM transport }