use of com.yahoo.osgi.provider.model.ComponentModel in project vespa by vespa-engine.
the class ContainerCluster method addMbusServer.
public void addMbusServer(ComponentId chainId) {
ComponentId serviceId = chainId.nestInNamespace(ComponentId.fromString("MbusServer"));
addComponent(new Component<>(new ComponentModel(new BundleInstantiationSpecification(serviceId, ComponentSpecification.fromString(MbusServerProvider.class.getName()), null))));
}
use of com.yahoo.osgi.provider.model.ComponentModel in project vespa by vespa-engine.
the class ContainerCluster method addDefaultRootHandler.
public void addDefaultRootHandler() {
if (hasHandlerWithBinding(ROOT_HANDLER_BINDING))
return;
Handler<AbstractConfigProducer<?>> handler = new Handler<>(new ComponentModel(BundleInstantiationSpecification.getFromStrings(BINDINGS_OVERVIEW_HANDLER_CLASS, null, null), // null bundle, as the handler is in container-disc
null));
handler.addServerBindings(ROOT_HANDLER_BINDING);
addComponent(handler);
}
use of com.yahoo.osgi.provider.model.ComponentModel in project vespa by vespa-engine.
the class DocumentFactoryBuilder method buildDocumentFactories.
public static void buildDocumentFactories(ContainerCluster cluster, Element spec) {
Map<String, String> types = new LinkedHashMap<>();
for (Element e : XML.getChildren(spec, "document")) {
String type = e.getAttribute("type");
String clazz = e.getAttribute("class");
// Empty pkg is forbidden in the documentgen Mojo.
if (clazz.indexOf('.') < 0)
throw new IllegalArgumentException("Malformed class for <document> binding, must be a full class with package: " + clazz);
String pkg = clazz.substring(0, clazz.lastIndexOf('.'));
String concDocFactory = pkg + "." + CONCRETE_DOC_FACTORY_CLASS;
String bundle = e.getAttribute("bundle");
Component<AbstractConfigProducer<?>, ComponentModel> component = new Component<>(new ComponentModel(BundleInstantiationSpecification.getFromStrings(concDocFactory, concDocFactory, bundle)));
if (!cluster.getComponentsMap().containsKey(component.getComponentId()))
cluster.addComponent(component);
types.put(type, concDocFactory);
}
cluster.concreteDocumentTypes().putAll(types);
}
use of com.yahoo.osgi.provider.model.ComponentModel in project vespa by vespa-engine.
the class ContainerCluster method addMetricStateHandler.
public void addMetricStateHandler() {
Handler<AbstractConfigProducer<?>> stateHandler = new Handler<>(new ComponentModel(STATE_HANDLER_CLASS, null, null, null));
stateHandler.addServerBindings("http://*" + StateHandler.STATE_API_ROOT, "https://*" + StateHandler.STATE_API_ROOT, "http://*" + StateHandler.STATE_API_ROOT + "/*", "https://*" + StateHandler.STATE_API_ROOT + "/*");
addComponent(stateHandler);
}
use of com.yahoo.osgi.provider.model.ComponentModel in project vespa by vespa-engine.
the class ContainerCluster method addApplicationStatusHandler.
public void addApplicationStatusHandler() {
Handler<AbstractConfigProducer<?>> statusHandler = new Handler<>(new ComponentModel(BundleInstantiationSpecification.getInternalHandlerSpecificationFromStrings(APPLICATION_STATUS_HANDLER_CLASS, null), null));
statusHandler.addServerBindings("http://*/ApplicationStatus", "https://*/ApplicationStatus");
addComponent(statusHandler);
}
Aggregations