use of com.yahoo.jdisc.SharedResource 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