return wrap(callable, continueRequest(seedMap));
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { assertNull(someObject); // Seed with someobject. someObject = new SomeObject(); Callable<String> task = ServletScopes.continueRequest( callable, ImmutableMap.<Key<?>, Object>of(Key.get(SomeObject.class), someObject)); executorService.submit(task); } }
public ExtDirectJsonRequestProcessorThread() { Subject subject = SecurityUtils.getSubject(); checkState(subject != null, "Subject is not set"); // create the thread state by this moment as this is created in the master (web container) thread threadState = new SubjectThreadState(subject); processRequest = ServletScopes.continueRequest(new Callable<String>() { @Override public String call() { threadState.bind(); UserIdMdcHelper.set(); try { return ExtDirectJsonRequestProcessorThread.super.processRequest(); } finally { UserIdMdcHelper.unset(); threadState.restore(); } } }, Collections.<Key<?>, Object>emptyMap()); }
return wrap(callable, continueRequest(seedMap));
return wrap(callable, continueRequest(seedMap));