//
// }.open();
- checkReadiness();
+ new Thread(() -> {
+ while (!checkReadiness()) {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ }
+ }
+ }, "Check readiness").start();
+
+ // checkReadiness();
setInstance(this);
}
* Checks whether the deployment is available according to expectations, and
* mark it as available.
*/
- private void checkReadiness() {
+ private boolean checkReadiness() {
if (isAvailable())
- return;
- if (cmsDeployment != null && userAdmin != null) {
+ return true;
+ if (cmsDeployment == null)
+ return false;
+
+ if (((CmsDeploymentImpl) cmsDeployment).allExpectedServicesAvailable() && userAdmin != null) {
String data = KernelUtils.getFrameworkProp(KernelUtils.OSGI_INSTANCE_AREA);
String state = KernelUtils.getFrameworkProp(KernelUtils.OSGI_CONFIGURATION_AREA);
availableSince = System.currentTimeMillis();
if (log.isTraceEnabled())
log.trace("Kernel initialization took " + initDuration + "ms");
tributeToFreeSoftware(initDuration);
+
+ return true;
} else {
- throw new IllegalStateException("Deployment is not available");
+ return false;
+ // throw new IllegalStateException("Deployment is not available");
}
}
return getInstance();
}
-// /** Required by USER login module. */
-// public synchronized static UserAdmin getUserAdmin() {
-// return getInstance().userAdmin;
-// }
-
/** Required by SPNEGO login module. */
- @Deprecated
public synchronized static GSSCredential getAcceptorCredentials() {
- // FIXME find a cleaner way
+ // TODO find a cleaner way
return ((CmsUserAdmin) getInstance().userAdmin).getAcceptorCredentials();
}