}
}
- private void checkReadiness() {
+ /**
+ * Checks whether the deployment is available according to expectations, and
+ * mark it as available.
+ */
+ private synchronized void checkReadiness() {
+ if (isAvailable())
+ return;
if (nodeAvailable && userAdminAvailable && (httpExpected ? httpAvailable : true)) {
String data = KernelUtils.getFrameworkProp(KernelUtils.OSGI_INSTANCE_AREA);
String state = KernelUtils.getFrameworkProp(KernelUtils.OSGI_CONFIGURATION_AREA);
properties.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
LocalRepository localRepository = new LocalRepository(repository, dataModelName);
bc.registerService(Repository.class, localRepository, properties);
- if (log.isDebugEnabled())
- log.debug("Published data model " + dataModelName);
+ if (log.isTraceEnabled())
+ log.trace("Published data model " + dataModelName);
}
@Override
- public Long getAvailableSince() {
+ public synchronized Long getAvailableSince() {
return availableSince;
}
+ public synchronized boolean isAvailable() {
+ return availableSince != null;
+ }
+
private class RepositoryContextStc extends ServiceTracker<RepositoryContext, RepositoryContext> {
public RepositoryContextStc() {