- private class ThreadSpecificInvocationHandler implements InvocationHandler {
-
- @Override
- public Object invoke(Object aProxy, Method aMethod, Object[] aArgs)
- throws Throwable {
- try {
- return aMethod.invoke(svc.get(), aArgs);
- } catch (InvocationTargetException e) {
- throw e.getCause();
- }
- }
- }
-
- private ThreadLocal<T> svc = new ThreadLocal<T>();