private static void validateInContext(Object tl) { if (s_validateContext && !ManagedContextUtils.isInContext()) { String msg = "Using a managed thread local in a non managed context this WILL cause errors at runtime. TL [" + tl + "]"; log.error(msg, new IllegalStateException(msg)); } }
protected void throwException(Throwable t) throws Exception { ManagedContextUtils.rethrowException(t); if (t instanceof Exception) { throw (Exception)t; } }
boolean reentry = !ManagedContextUtils.setAndCheckOwner(owner); Throwable firstError = null; if (ManagedContextUtils.clearOwner(owner)) ManagedThreadLocal.reset();
boolean reentry = !ManagedContextUtils.setAndCheckOwner(owner); Throwable preError = null; Throwable logicError = null; if (ManagedContextUtils.clearOwner(owner)) ManagedThreadLocal.reset();
@Override public void runWithContext(final Runnable run) { try { callWithContext(new Callable<Object>() { @Override public Object call() throws Exception { run.run(); return null; } }); } catch (Exception e) { /* Only care about non-checked exceptions * as the nature of runnable prevents checked * exceptions from happening */ ManagedContextUtils.rethrowException(e); } }
private static void validateInContext(Object tl) { if (VALIDATE_CONTEXT && !ManagedContextUtils.isInContext()) { String msg = "Using a managed thread local in a non managed context this WILL cause errors at runtime. TL [" + tl + "]"; log.error(msg, new IllegalStateException(msg)); } }
protected void throwException(Throwable t) throws Exception { ManagedContextUtils.rethrowException(t); if (t instanceof Exception) { throw (Exception) t; } }
@Override public void runWithContext(final Runnable run) { try { callWithContext(new Callable<Object>() { @Override public Object call() throws Exception { run.run(); return null; } }); } catch (Exception e) { /* * Only care about non-checked exceptions as the nature of runnable * prevents checked exceptions from happening */ ManagedContextUtils.rethrowException(e); } }