}
}
public void waitFor(Object future, long timeout) {
if (!isUsable())
throw new BitronixRuntimeException("concurrent executor is disabled because there is no valid executor implementation");
try {
futureGetMethod.invoke(future, new Object[] { new Long(timeout), timeUnitMilliseconds});
} catch (IllegalAccessException ex) {
throw new BitronixRuntimeException("error calling Future.get()", ex);
} catch (InvocationTargetException ex) {
if (ex.getCause().getClass().getName().endsWith("TimeoutException"))
return; // wait timed out, simply return
throw new BitronixRuntimeException("error calling Future.get()", ex);
}
}