private static BundleInstantiationSpecification getInternalSpecificationFromString(String idSpec, String classSpec) { return new BundleInstantiationSpecification( new ComponentSpecification(idSpec), (classSpec == null || classSpec.isEmpty())? null : new ComponentSpecification(classSpec), new ComponentSpecification(defaultInternalBundle)); }
public ClusterControllerComponent() { super(new ComponentModel(new BundleInstantiationSpecification( new ComponentSpecification("clustercontroller"), new ComponentSpecification("com.yahoo.vespa.clustercontroller.apps.clustercontroller.ClusterController"), new ComponentSpecification("clustercontroller-apps")))); } }
private ComponentSpecification asSourceSpec(String source) { try { return new ComponentSpecification(source); } catch(Exception e) { throw new IllegalArgumentException("The source ref '" + source + "' used for federation is not valid.", e); } }
public ClusterControllerConfigurer(ContentCluster cluster, int index, int nodeCount) { super(new ComponentModel(new BundleInstantiationSpecification( new ComponentSpecification("clustercontroller" + "-" + cluster.getName() + "-configurer"), new ComponentSpecification("com.yahoo.vespa.clustercontroller.apps.clustercontroller.ClusterControllerClusterConfigurer"), new ComponentSpecification("clustercontroller-apps")))); this.cluster = cluster; this.index = index; this.nodeCount = nodeCount; }
private Set<ComponentSpecification> toComponentSpecifications(Collection<String> symbols) { Set<ComponentSpecification> specifications = new LinkedHashSet<>(); for (String symbol : symbols) { specifications.add(new ComponentSpecification(symbol)); } return specifications; } }
private static Set<ComponentSpecification> createComponentSpecifications(List<String> stringSpecs) { Set<ComponentSpecification> specifications = new LinkedHashSet<>(); for (String stringSpec : stringSpecs) { specifications.add(new ComponentSpecification(stringSpec)); } return specifications; }
private static ComponentSpecification getComponentSpecification(Element spec, String attributeName) { return (spec.hasAttribute(attributeName)) ? new ComponentSpecification(spec.getAttribute(attributeName)) : null; }
/** * Return a new instance of the specification with bundle name altered * @param bundleName New name of bundle * @return the new instance of the specification. */ public BundleInstantiationSpecification inBundle(String bundleName) { return new BundleInstantiationSpecification(this.id, this.classId, new ComponentSpecification(bundleName)); }
/** * See getComponent(ComponentSpecification) * @param componentSpecification a component specification string, see {@link com.yahoo.component.Version} * @return the component or null if no component of this name (and version, if specified) is registered here */ public COMPONENT getComponent(String componentSpecification) { return getComponent(new ComponentSpecification(componentSpecification)); }
private static FederationSearcherModel federationSearcherModel() { return new FederationSearcherModel(new ComponentSpecification("federation"), Dependencies.emptyDependencies(), Collections.<TargetSpec>emptyList(), true); }
public static ComponentSpecification getIdRef(Element element) { return new ComponentSpecification(getIdString(element)); }
private static ComponentSpecification idSpecFromPath(String path) { return new ComponentSpecification(RestApi.idFromPath(path), VersionSpecification.emptyVersionSpecification, REST_API_NAMESPACE); }
public IndexingProcessor() { super(new DocumentProcessorModel(new BundleInstantiationSpecification(new ComponentId(DocumentProcessor.INDEXER), new ComponentSpecification(DocumentProcessor.INDEXER), new ComponentSpecification(docprocsBundleSpecification)), new Dependencies(Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<String>emptyList()), new HashMap<>())); }
public ForwardingSearcher(SearchchainForwardConfig config) { if (config.target() == null) { throw new RuntimeException("Configuration value searchchain-forward.target was null."); } try { target = new ComponentSpecification(config.target()); } catch (RuntimeException e) { throw new RuntimeException("Failed constructing the component specification from searchchain-forward.target: " + config.target(), e); } }
public void fillQueryProfileTypes(List<Element> queryProfileTypeElements, QueryProfileTypeRegistry registry) { for (Element element : queryProfileTypeElements) { QueryProfileType type = registry.getComponent(new ComponentSpecification(element.getAttribute("id")).toId()); try { readInheritedTypes(element, type, registry); readFieldDefinitions(element, type, registry); } catch (RuntimeException e) { throw new IllegalArgumentException("Error reading " + type, e); } } }
public ComponentSpecification toSpecification() { if (isAnonymous()) throw new RuntimeException("Can't generate a specification for an anonymous component id."); return new ComponentSpecification(getName(), getVersion().toSpecification(), getNamespace()); }
private static ChainedComponentModel createChainedComponentModel(ChainsConfig.Components component) { return new ChainedComponentModel( new BundleInstantiationSpecification(new ComponentSpecification(component.id()), null, null), createDependencies( component.dependencies().provides(), component.dependencies().before(), component.dependencies().after()), null); }
static ComponentModel providerComponentModel(final ComponentId parentId, String className) { final ComponentSpecification classNameSpec = new ComponentSpecification( className); return new ComponentModel(new BundleInstantiationSpecification( classNameSpec.nestInNamespace(parentId), classNameSpec, null)); }
public ComponentSpecification nestInNamespace(ComponentId namespace) { ComponentId newNameSpace = (getNamespace() == null) ? namespace : getNamespace().nestInNamespace(namespace); return new ComponentSpecification(getName(), getVersionSpecification(), newNameSpace); }
public ComponentSpecification intersect(ComponentSpecification other) { if (!getName().equals(other.getName())) { throw new RuntimeException("The names of the component specifications does not match(" + getName() + "!=" + other.getName() + ")."); } if (!namespaceMatch(other.getNamespace())) { throw new RuntimeException("The namespaces of the component specifications does not match(" + this + ", " + other +")"); } return new ComponentSpecification(getName(), getVersionSpecification().intersect(other.getVersionSpecification()), getNamespace()); }