Tabnine Logo
ServletScopes.continueRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
continueRequest
method
in
com.google.inject.servlet.ServletScopes

Best Java code snippets using com.google.inject.servlet.ServletScopes.continueRequest (Showing top 5 results out of 315)

origin: com.google.inject.extensions/guice-servlet

return wrap(callable, continueRequest(seedMap));
origin: com.google.inject.extensions/guice-servlet

 @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);
 }
}
origin: org.sonatype.nexus.plugins/nexus-extdirect-plugin

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());
}
origin: com.jwebmp.inject.extensions/guice-servlet

return wrap(callable, continueRequest(seedMap));
origin: org.sonatype.sisu.inject/guice-servlet

return wrap(callable, continueRequest(seedMap));
com.google.inject.servletServletScopescontinueRequest

Javadoc

Wraps the given callable in a contextual callable that "continues" the HTTP request in another thread. This acts as a way of transporting request context data from the request processing thread to to worker threads. There are some limitations:
  • Derived objects (i.e. anything marked @RequestScoped will not be transported.
  • State changes to the HttpServletRequest after this method is called will not be seen in the continued thread.
  • Only the HttpServletRequest, ServletContext and request parameter map are available in the continued thread. The response and session are not available.

Popular methods of ServletScopes

  • scopeRequest
    Scopes the given callable inside a request scope. This is not the same as the HTTP request scope, bu
  • transferRequest
    Wraps the given callable in a contextual callable that "transfers" the request to another thread. Th
  • validateAndCanonicalizeValue
    Validates the key and object, ensuring the value matches the key type, and canonicalizing null objec
  • transferHttpRequest
  • transferNonHttpRequest
  • wrap
  • isRequestScoped
    Returns true if binding is request-scoped. If the binding is a com.google.inject.spi.LinkedKeyBindin
  • isSingletonBinding

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now