Search in sources :

Example 1 with ComponentModel

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))));
}
Also used : MbusServerProvider(com.yahoo.container.jdisc.messagebus.MbusServerProvider) ComponentModel(com.yahoo.osgi.provider.model.ComponentModel) BundleInstantiationSpecification(com.yahoo.container.bundle.BundleInstantiationSpecification) ComponentId(com.yahoo.component.ComponentId)

Example 2 with ComponentModel

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);
}
Also used : AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) ComponentModel(com.yahoo.osgi.provider.model.ComponentModel) BindingsOverviewHandler(com.yahoo.container.usability.BindingsOverviewHandler) ProcessingHandler(com.yahoo.vespa.model.container.component.chain.ProcessingHandler) Handler(com.yahoo.vespa.model.container.component.Handler) JerseyHandler(com.yahoo.vespa.model.container.jersey.JerseyHandler) StateHandler(com.yahoo.container.jdisc.state.StateHandler)

Example 3 with ComponentModel

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);
}
Also used : AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) Element(org.w3c.dom.Element) ComponentModel(com.yahoo.osgi.provider.model.ComponentModel) Component(com.yahoo.vespa.model.container.component.Component) LinkedHashMap(java.util.LinkedHashMap)

Example 4 with ComponentModel

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);
}
Also used : AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) ComponentModel(com.yahoo.osgi.provider.model.ComponentModel) BindingsOverviewHandler(com.yahoo.container.usability.BindingsOverviewHandler) ProcessingHandler(com.yahoo.vespa.model.container.component.chain.ProcessingHandler) Handler(com.yahoo.vespa.model.container.component.Handler) JerseyHandler(com.yahoo.vespa.model.container.jersey.JerseyHandler) StateHandler(com.yahoo.container.jdisc.state.StateHandler)

Example 5 with ComponentModel

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);
}
Also used : AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) ComponentModel(com.yahoo.osgi.provider.model.ComponentModel) BindingsOverviewHandler(com.yahoo.container.usability.BindingsOverviewHandler) ProcessingHandler(com.yahoo.vespa.model.container.component.chain.ProcessingHandler) Handler(com.yahoo.vespa.model.container.component.Handler) JerseyHandler(com.yahoo.vespa.model.container.jersey.JerseyHandler) StateHandler(com.yahoo.container.jdisc.state.StateHandler)

Aggregations

ComponentModel (com.yahoo.osgi.provider.model.ComponentModel)6 AbstractConfigProducer (com.yahoo.config.model.producer.AbstractConfigProducer)4 StateHandler (com.yahoo.container.jdisc.state.StateHandler)3 BindingsOverviewHandler (com.yahoo.container.usability.BindingsOverviewHandler)3 Handler (com.yahoo.vespa.model.container.component.Handler)3 ProcessingHandler (com.yahoo.vespa.model.container.component.chain.ProcessingHandler)3 JerseyHandler (com.yahoo.vespa.model.container.jersey.JerseyHandler)3 ComponentId (com.yahoo.component.ComponentId)1 ComponentSpecification.fromString (com.yahoo.component.ComponentSpecification.fromString)1 BundleInstantiationSpecification (com.yahoo.container.bundle.BundleInstantiationSpecification)1 MbusServerProvider (com.yahoo.container.jdisc.messagebus.MbusServerProvider)1 Component (com.yahoo.vespa.model.container.component.Component)1 SimpleComponent (com.yahoo.vespa.model.container.component.SimpleComponent)1 LinkedHashMap (java.util.LinkedHashMap)1 Element (org.w3c.dom.Element)1