List of utility methods to do Thread Callable
T | call(Callable call try { return callable.call(); } catch (Exception e) { throw new RuntimeException(e); |
T | call(final Callable call try { return c == null ? null : c.call(); } catch (final Exception e) { throw toRuntimeException(e); |
Callable
| callableListCreator() callable List Creator return new Callable<List<T>>() { @Override public List<T> call() { return new ArrayList<T>(); }; |
boolean | callConditionAndReturnResult(Callable call Condition And Return Result try { return condition.call(); } catch (Exception exception) { throw new RuntimeException(exception); |
Object | callInLoader(Callable body, ClassLoader loader) call In Loader ClassLoader originalCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(loader); return body.call(); } finally { Thread.currentThread().setContextClassLoader(originalCl); |
T | callInLocale(Locale locale, Callable call In Locale Locale realLocale = Locale.getDefault(); try { Locale.setDefault(locale); return task.call(); } finally { Locale.setDefault(realLocale); |
T | callWithSystemProperty(String name, String value, Callable call With System Property String oldValue = System.getProperty(name); try { System.setProperty(name, value); return callee.call(); } finally { System.setProperty(name, oldValue); |
Callable | copyFromList(final List list, final double[][] data, final int cols) copy From List Callable c = new Callable() { public Object call() throws Exception { int s = list.size(); double[] rowData = null; int row = -1; int col = 0; for (int i = 0; i < s; i++) { if (i % cols == 0) { ... |
Callable | copyInto(final List list, final double[] data) copy Into Callable c = new Callable() { public Object call() throws Exception { for (int i = 0; i < data.length; i++) { list.add(data[i]); return list; }; ... |
void | executeLocally(Callable execute Locally try { task.call(); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException(ex); |