我是否需要定期調用future.get來檢查任務是否被執行?如何查找線程何時完成?
ExecutorService executor = Executors.newSingleThreadExecutor();
@SuppressWarnings("unchecked")
public void start(final file avo) throws IOException
{
Future future = executor.submit(new Callable(){
@Override
public Object call() throws Exception {
Condee conv = new Condee();
return conv.doChange(file);
});
LOG.debug("Finished the execution serverion");
executor.shutdown();
}
你需要更多地關注你的問題。像這樣一個模棱兩可的問題可能會被關閉或刪除。 – gparyani