| | |
| | | import java.util.List; |
| | | import java.util.concurrent.CountDownLatch; |
| | | |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yssh.dao.BaseMapper; |
| | | import com.yssh.service.IAsyncService; |
| | | |
| | | |
| | | @Service |
| | | public class AsyncServiceImpl implements IAsyncService { |
| | | |
| | | protected final Log logger = LogFactory.getLog(this.getClass()); |
| | | |
| | | |
| | | @Override |
| | | public <T> void executeAsync(String tableName, List<T> lists, BaseMapper mapper, CountDownLatch countDownLatch) { |
| | | try{ |
| | |
| | | countDownLatch.countDown();// 很关键, 无论上面程序是否异常必须执行countDown,否则await无法释放 |
| | | } |
| | | } |
| | | |
| | | } |