import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.argeo.api.NodeConstants;
import org.argeo.cms.CmsException;
import org.argeo.naming.AttributesDictionary;
import org.argeo.naming.LdifParser;
import org.argeo.naming.LdifWriter;
-import org.argeo.node.NodeConstants;
import org.argeo.osgi.useradmin.UserAdminConf;
import org.eclipse.equinox.http.jetty.JettyConfigurator;
import org.osgi.framework.BundleContext;
// additional repositories
dataModels: for (DataModels.DataModel dataModel : dataModels.getNonAbstractDataModels()) {
- if (NodeConstants.NODE.equals(dataModel.getName()))
+ if (NodeConstants.NODE_REPOSITORY.equals(dataModel.getName()))
continue dataModels;
Dictionary<String, Object> config = InitUtils.getRepositoryConfig(dataModel.getName(),
getProps(NodeConstants.NODE_REPOS_FACTORY_PID, dataModel.getName()));
// activator of the Equinox Jetty bundle.
Dictionary<String, Object> webServerConfig = InitUtils
.getHttpServerConfig(getProps(KernelConstants.JETTY_FACTORY_PID, NodeConstants.DEFAULT));
- if (!webServerConfig.isEmpty()) {
- webServerConfig.put("customizer.class", KernelConstants.CMS_JETTY_CUSTOMIZER_CLASS);
- }
+// if (!webServerConfig.isEmpty()) {
+// webServerConfig.put("customizer.class", KernelConstants.CMS_JETTY_CUSTOMIZER_CLASS);
+//
+// // TODO centralise with Jetty extender
+// Object webSocketEnabled = webServerConfig.get(InternalHttpConstants.WEBSOCKET_ENABLED);
+// if (webSocketEnabled != null && webSocketEnabled.toString().equals("true")) {
+// bc.registerService(ServerEndpointConfig.Configurator.class, new CmsWebSocketConfigurator(), null);
+// webServerConfig.put(InternalHttpConstants.WEBSOCKET_ENABLED, "true");
+// }
+// }
int tryCount = 60;
try {
tryGettyJetty: while (tryCount > 0) {
try {
JettyConfigurator.startServer(KernelConstants.DEFAULT_JETTY_SERVER, webServerConfig);
+ // Explicitly starts Jetty OSGi HTTP bundle, so that it gets triggered if OSGi
+ // configuration is not cleaned
+ FrameworkUtil.getBundle(JettyConfigurator.class).start();
break tryGettyJetty;
} catch (IllegalStateException e) {
// Jetty may not be ready
} catch (Exception e1) {
// silent
}
+ tryCount--;
}
}
} catch (Exception e) {
deployConfigs = new LdifParser().read(in);
}
if (isClean) {
+ if(log.isDebugEnabled())
+ log.debug("Clean state, loading from framework properties...");
setFromFrameworkProperties(isFirstInit);
for (LdapName dn : deployConfigs.keySet()) {
Rdn lastRdn = dn.getRdn(dn.size() - 1);