Source:
public void run() { if (log.isInfoEnabled()) { log.info("Cartridge agent started"); } validateRequiredSystemProperties(); subscribeToTopicsAndRegisterListeners(); registerTopologyEventListeners(); registerTenantEventListeners(); while (!CartridgeAgentConfiguration.getInstance().isInitialized()) { try { log.debug("Waiting for Cartridge Agent to be initialized..."); Thread.sleep(1000); } catch (InterruptedException ignore) { } } extensionHandler.onInstanceStartedEvent(); CartridgeAgentEventPublisher.publishInstanceStartedEvent(); try { extensionHandler.startServerExtension(); } catch (Exception e) { if (log.isErrorEnabled()) { log.error("Error processing start servers event", e); } } CartridgeAgentUtils.waitUntilPortsActive(CartridgeAgentConfiguration.getInstance().getListenAddress(), CartridgeAgentConfiguration.getInstance().getPorts()); String repoUrl = CartridgeAgentConfiguration.getInstance().getRepoUrl(); if ("null".equals(repoUrl) || StringUtils.isBlank(repoUrl)) { if (log.isInfoEnabled()) { log.info("No artifact repository found"); } extensionHandler.onInstanceActivatedEvent(); CartridgeAgentEventPublisher.publishInstanceActivatedEvent(); } else { } String persistenceMappingsPayload = CartridgeAgentConfiguration.getInstance().getPersistenceMappings(); if (persistenceMappingsPayload != null) { extensionHandler.volumeMountExtension(persistenceMappingsPayload); } LogPublisherManager logPublisherManager = new LogPublisherManager(); publishLogs(logPublisherManager); while (!terminated) { try { Thread.sleep(1000); } catch (InterruptedException ignore) { } } logPublisherManager.stop(); }

Target:
public void run() { if (log.isInfoEnabled()) { log.info("Cartridge agent started"); } validateRequiredSystemProperties(); subscribeToTopicsAndRegisterListeners(); registerTopologyEventListeners(); registerTenantEventListeners(); while (!CartridgeAgentConfiguration.getInstance().isInitialized()) { try { if (log.isInfoEnabled()) { log.info("Waiting for Cartridge Agent to be initialized..."); } Thread.sleep(1000); } catch (InterruptedException ignore) { } } extensionHandler.onInstanceStartedEvent(); CartridgeAgentEventPublisher.publishInstanceStartedEvent(); try { extensionHandler.startServerExtension(); } catch (Exception e) { if (log.isErrorEnabled()) { log.error("Error processing start servers event", e); } } CartridgeAgentUtils.waitUntilPortsActive(CartridgeAgentConfiguration.getInstance().getListenAddress(), CartridgeAgentConfiguration.getInstance().getPorts()); String repoUrl = CartridgeAgentConfiguration.getInstance().getRepoUrl(); if ("null".equals(repoUrl) || StringUtils.isBlank(repoUrl)) { if (log.isInfoEnabled()) { log.info("No artifact repository found"); } extensionHandler.onInstanceActivatedEvent(); CartridgeAgentEventPublisher.publishInstanceActivatedEvent(); } else { } String persistenceMappingsPayload = CartridgeAgentConfiguration.getInstance().getPersistenceMappings(); if (persistenceMappingsPayload != null) { extensionHandler.volumeMountExtension(persistenceMappingsPayload); } LogPublisherManager logPublisherManager = new LogPublisherManager(); publishLogs(logPublisherManager); while (!terminated) { try { Thread.sleep(1000); } catch (InterruptedException ignore) { } } logPublisherManager.stop(); }