use of com.yahoo.component.AbstractComponent in project vespa by vespa-engine.
the class SearchChainRegistry method setupSearcherRegistry.
private SearcherRegistry setupSearcherRegistry(ComponentRegistry<? extends AbstractComponent> allComponents) {
SearcherRegistry registry = new SearcherRegistry();
for (AbstractComponent component : allComponents.allComponents()) {
if (component instanceof Searcher) {
registry.register((Searcher) component);
}
}
// just freeze this right away
registry.freeze();
return registry;
}
use of com.yahoo.component.AbstractComponent in project vespa by vespa-engine.
the class ApplicationStatusHandler method renderAbstractComponents.
private static JSONArray renderAbstractComponents(List<? extends AbstractComponent> components) {
JSONArray ret = new JSONArray();
for (AbstractComponent c : components) {
JSONObject jc = renderComponent(c, c.getId());
ret.put(jc);
}
return ret;
}
use of com.yahoo.component.AbstractComponent in project vespa by vespa-engine.
the class Deconstructor method deconstruct.
@Override
public void deconstruct(Object component) {
if (component instanceof AbstractComponent) {
AbstractComponent abstractComponent = (AbstractComponent) component;
if (abstractComponent.isDeconstructable()) {
executor.schedule(new DestructComponentTask(abstractComponent), delay.getSeconds(), TimeUnit.SECONDS);
}
} else if (component instanceof Provider) {
// TODO Providers should most likely be deconstructed similarily to AbstractComponent
log.info("Starting deconstruction of provider " + component);
((Provider) component).deconstruct();
log.info("Finished deconstruction of provider " + component);
} else if (component instanceof SharedResource) {
log.info("Releasing container reference to resource " + component);
// No need to delay release, as jdisc does ref-counting
((SharedResource) component).release();
}
}
Aggregations