001package com.hammurapi.common.concurrent; 002 003/** 004 * Synchronization interface. 005 * @author Pavel Vlasov 006 * 007 */ 008public interface AsynchronousProcessor { 009 010 /** 011 * Semantics of this method is similar to Thread.join() - this 012 * method blocks if the processor is working active tasks and 013 * unblocks when all work is done. 014 * @throws InterruptedException 015 */ 016 void join() throws InterruptedException; 017 018 /** 019 * Waits for the processor to finish work for specified time. 020 * @param timeout 021 * @return true if all work was finished. 022 * @throws InterruptedException 023 */ 024 boolean join(long timeout) throws InterruptedException; 025}