Commit 4ce70f29 authored by Ard Schrijvers's avatar Ard Schrijvers

HSTTWO-4345 [Backport 11.2] Check availability hst services since then hst spring is up

(cherry picked from commit 758a61a8)
parent d5ea367b
/*
* Copyright 2017 Hippo B.V. (http://www.onehippo.com)
* Copyright 2017-2018 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -19,8 +19,6 @@ package org.hippoecm.hst.site.container;
import javax.servlet.ServletContextEvent;
import org.hippoecm.hst.site.HstServices;
import org.onehippo.cms7.services.HippoServiceRegistry;
import org.onehippo.repository.RepositoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.ContextLoaderListener;
......@@ -44,7 +42,7 @@ public class HstDelayedContextLoaderListener extends ContextLoaderListener {
} else {
initThread = new Thread(() -> {
boolean retry = true;
while (retry && HippoServiceRegistry.getService(RepositoryService.class) == null) {
while (retry && !HstServices.isAvailable()) {
log.info("Waiting for the HstServices to become available before initializing the Spring root application context.");
try {
Thread.sleep(1000);
......@@ -54,7 +52,7 @@ public class HstDelayedContextLoaderListener extends ContextLoaderListener {
Thread.currentThread().interrupt();
}
}
if (HippoServiceRegistry.getService(RepositoryService.class) != null) {
if (HstServices.isAvailable()) {
log.info("HstServices is available. Initializing the Spring root application context");
super.contextInitialized(event);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment