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

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

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

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

/**
 * Returns an object that "transfers" the request to another thread. This acts as a way of
 * transporting request context data from the current thread to a future thread. The transferred
 * scope is the one active for the thread that calls this method. A later call to {@code open()}
 * activates the transferred the scope, including propagating any objects scoped at that time.
 *
 * <p>As opposed to {@link #continueRequest}, this method propagates all existing scoped objects.
 * The primary use case is in server implementations where you can detach the request processing
 * thread while waiting for data, and reattach to a different thread to finish processing at a
 * later time.
 *
 * <p>Because request-scoped objects are not typically thread-safe, it is important to avoid
 * applying the same request scope concurrently. The returned Scoper will block on open until the
 * current thread has released the request scope.
 *
 * @return an object that when opened will initiate the request scope
 * @throws OutOfScopeException if this method is called from a non-request thread, or if the
 *     request has completed.
 * @since 4.1
 */
public static RequestScoper transferRequest() {
 return (GuiceFilter.localContext.get() != null)
   ? transferHttpRequest()
   : transferNonHttpRequest();
}
origin: com.jwebmp.inject.extensions/guice-servlet

/**
 * Returns an object that "transfers" the request to another thread. This acts as a way of
 * transporting request context data from the current thread to a future thread. The transferred
 * scope is the one active for the thread that calls this method. A later call to {@code open()}
 * activates the transferred the scope, including propagating any objects scoped at that time.
 *
 * <p>As opposed to {@link #continueRequest}, this method propagates all existing scoped objects.
 * The primary use case is in server implementations where you can detach the request processing
 * thread while waiting for data, and reattach to a different thread to finish processing at a
 * later time.
 *
 * <p>Because request-scoped objects are not typically thread-safe, it is important to avoid
 * applying the same request scope concurrently. The returned Scoper will block on open until the
 * current thread has released the request scope.
 *
 * @return an object that when opened will initiate the request scope
 * @throws OutOfScopeException if this method is called from a non-request thread, or if the
 *     request has completed.
 * @since 4.1
 */
public static RequestScoper transferRequest() {
 return (GuiceFilter.localContext.get() != null)
   ? transferHttpRequest()
   : transferNonHttpRequest();
}
origin: org.sonatype.sisu.inject/guice-servlet

/**
 * Returns an object that "transfers" the request to another thread. This acts as a way of
 * transporting request context data from the current thread to a future thread. The transferred
 * scope is the one active for the thread that calls this method. A later call to {@code open()}
 * activates the transferred the scope, including propagating any objects scoped at that time.
 *
 * <p>As opposed to {@link #continueRequest}, this method propagates all existing scoped objects.
 * The primary use case is in server implementations where you can detach the request processing
 * thread while waiting for data, and reattach to a different thread to finish processing at a
 * later time.
 *
 * <p>Because request-scoped objects are not typically thread-safe, it is important to avoid
 * applying the same request scope concurrently. The returned Scoper will block on open until the
 * current thread has released the request scope.
 *
 * @return an object that when opened will initiate the request scope
 * @throws OutOfScopeException if this method is called from a non-request thread, or if the
 *     request has completed.
 * @since 4.1
 */
public static RequestScoper transferRequest() {
 return (GuiceFilter.localContext.get() != null)
   ? transferHttpRequest()
   : transferNonHttpRequest();
}
com.google.inject.servletServletScopestransferNonHttpRequest

Popular methods of ServletScopes

  • scopeRequest
    Scopes the given callable inside a request scope. This is not the same as the HTTP request scope, bu
  • continueRequest
    Wraps the given callable in a contextual callable that "continues" the HTTP request in another threa
  • 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
  • wrap
  • isRequestScoped
    Returns true if binding is request-scoped. If the binding is a com.google.inject.spi.LinkedKeyBindin
  • isSingletonBinding

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • runOnUiThread (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ImageIO (javax.imageio)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Join (org.hibernate.mapping)
  • From CI to AI: The AI layer in your organization
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