summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/Searcher.java
blob: 413b3e2814fa9877c03c56c69ae7499ffec72016 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.container.search.searchchain;

import com.yahoo.component.chain.model.ChainedComponentModel;
import com.yahoo.config.model.producer.AbstractConfigProducer;
import com.yahoo.vespa.model.container.component.chain.ChainedComponent;

/**
 * @author gjoranv
 * @author Tony Vaagenes
 */
public class Searcher<T extends ChainedComponentModel> extends ChainedComponent<T> {

    public Searcher(T model) {
        super(model);
    }

    protected SearchChains getSearchChains() {
        AbstractConfigProducer ancestor = getParent();
        while (!(ancestor instanceof SearchChains)) {
            ancestor = ancestor.getParent();
        }
        return (SearchChains)ancestor;
    }

}