@Override protected ZoieContext initialValue() { return new ZoieContext(); } };
@Override protected ZoieContext childValue(ZoieContext parentValue) { return parentValue.clone(); }
/** * Get the current thread's ZoieContext to keep in the wrapper runnable so that * when the runnable is executed, the context can be set to be the same as the * invoking thread. * @param runnable */ public ZoieRunnable(Runnable runnable) { innerRunnable = runnable; ctx = ZoieContext.getContext(); }
@SuppressWarnings("unchecked") public E get() { return (E) ZoieContext.getContext().getReaderContext(_reader).get(_key); } }
@Override protected void afterExecute(Runnable r, Throwable t) { ZoieContext.getContext().clear(); super.afterExecute(((ZoieRunnable) r).innerRunnable, t); }
@Override protected void beforeExecute(Thread t, Runnable r) { if (! (r instanceof ZoieRunnable)) throw new RuntimeException("Not a properly submitted zoie job"); ZoieContext.setContext(((ZoieRunnable)r).ctx); super.beforeExecute(t, ((ZoieRunnable)r).innerRunnable); }
@SuppressWarnings("unchecked") public E get() { return (E) ZoieContext.getContext().getReaderContext(_reader).get(_key); } }
@Override protected void afterExecute(Runnable r, Throwable t) { ZoieContext.getContext().clear(); super.afterExecute(((ZoieRunnable)r).innerRunnable, t); }
@Override protected void beforeExecute(Thread t, Runnable r) { if (!(r instanceof ZoieRunnable)) throw new RuntimeException( "Not a properly submitted zoie job"); ZoieContext.setContext(((ZoieRunnable) r).ctx); super.beforeExecute(t, ((ZoieRunnable) r).innerRunnable); }
@SuppressWarnings("unchecked") public E get() { return (E) ZoieContext.getContext().getReaderContext(_reader).get(_key); } }
@Override protected void afterExecute(Runnable r, Throwable t) { ZoieContext.getContext().clear(); super.afterExecute(((ZoieRunnable) r).innerRunnable, t); }
@Override protected ZoieContext childValue(ZoieContext parentValue) { return parentValue.clone(); }
@Override protected ZoieContext initialValue() { return new ZoieContext(); } };
/** * Get the current thread's ZoieContext to keep in the wrapper runnable so that * when the runnable is executed, the context can be set to be the same as the * invoking thread. * @param runnable */ public ZoieRunnable(Runnable runnable) { innerRunnable = runnable; ctx = ZoieContext.getContext(); } public ZoieContext getContext()
@Override protected void beforeExecute(Thread t, Runnable r) { if (!(r instanceof ZoieRunnable)) throw new RuntimeException( "Not a properly submitted zoie job"); ZoieContext.setContext(((ZoieRunnable) r).ctx); super.beforeExecute(t, ((ZoieRunnable) r).innerRunnable); }
public void set(E value) { ZoieContext.getContext().getReaderContext(_reader).set(_key, value); }
protected ZoieContext childValue(ZoieContext parentValue) { return parentValue.clone(); }
@Override protected ZoieContext initialValue() { return new ZoieContext(); } };
/** * Get the current thread's ZoieContext to keep in the wrapper runnable so that * when the runnable is executed, the context can be set to be the same as the * invoking thread. * @param runnable */ public ZoieRunnable(Runnable runnable) { innerRunnable = runnable; ctx = ZoieContext.getContext(); }
public void set(E value) { ZoieContext.getContext().getReaderContext(_reader).set(_key, value); }