package rocks.inspectit.server.cache.impl; import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import rocks.inspectit.server.cache.IBuffer; /** * Thread that invokes the {@link IBuffer#evict()} method constantly. * * @author Ivan Senic * */ @Component public class BufferEvictor extends BufferWorker { /** * Default constructor. Just calls super class constructor. * * @param buffer * Buffer to work on. */ @Autowired public BufferEvictor(IBuffer<?> buffer) { super(buffer, "buffer-evicting-thread"); } /** * {@inheritDoc} */ @Override public void work() throws InterruptedException { getBuffer().evict(); } /** * {@inheritDoc} */ @Override @PostConstruct public synchronized void start() { super.start(); } }