All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bitronix.tm.twopc.executor.SimpleAsyncExecutor Maven / Gradle / Ivy

There is a newer version: 2.1.4
Show newest version
package bitronix.tm.twopc.executor;

import bitronix.tm.internal.BitronixRuntimeException;

/**
 * This implementation spawns a new thread per request.
 * 

© Bitronix Software

* * @author lorban */ public class SimpleAsyncExecutor implements Executor { public Object submit(Job job) { Thread t = new Thread(job); t.setDaemon(true); t.start(); return t; } public void waitFor(Object future, long timeout) { Thread t = (Thread) future; try { t.join(timeout); } catch (InterruptedException ex) { throw new BitronixRuntimeException("job interrupted", ex); } } public boolean isDone(Object future) { Thread t = (Thread) future; return !t.isAlive(); } public boolean isUsable() { return true; } public void shutdown() { } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy