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

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

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

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

private static RequestScoper continueRequest(Map<Key<?>, Object> seedMap) {
 Preconditions.checkArgument(
   null != seedMap, "Seed map cannot be null, try passing in Collections.emptyMap() instead.");
 // Snapshot the seed map and add all the instances to our continuing HTTP request.
 final ContinuingHttpServletRequest continuingRequest =
   new ContinuingHttpServletRequest(GuiceFilter.getRequest(Key.get(HttpServletRequest.class)));
 for (Map.Entry<Key<?>, Object> entry : seedMap.entrySet()) {
  Object value = validateAndCanonicalizeValue(entry.getKey(), entry.getValue());
  continuingRequest.setAttribute(entry.getKey().toString(), value);
 }
 return new RequestScoper() {
  @Override
  public CloseableScope open() {
   checkScopingState(
     null == GuiceFilter.localContext.get(),
     "Cannot continue request in the same thread as a HTTP request!");
   return new GuiceFilter.Context(continuingRequest, continuingRequest, null).open();
  }
 };
}
origin: com.mycila.guice.extensions/mycila-guice-servlet

Object value = validateAndCanonicalizeValue(entry.getKey(), entry.getValue());
scopeMap.put(entry.getKey().toString(), value);
origin: mycila/guice

Object value = validateAndCanonicalizeValue(entry.getKey(), entry.getValue());
scopeMap.put(entry.getKey().toString(), value);
origin: org.sonatype.sisu.inject/guice-servlet

private static RequestScoper continueRequest(Map<Key<?>, Object> seedMap) {
 Preconditions.checkArgument(
   null != seedMap, "Seed map cannot be null, try passing in Collections.emptyMap() instead.");
 // Snapshot the seed map and add all the instances to our continuing HTTP request.
 final ContinuingHttpServletRequest continuingRequest =
   new ContinuingHttpServletRequest(GuiceFilter.getRequest(Key.get(HttpServletRequest.class)));
 for (Map.Entry<Key<?>, Object> entry : seedMap.entrySet()) {
  Object value = validateAndCanonicalizeValue(entry.getKey(), entry.getValue());
  continuingRequest.setAttribute(entry.getKey().toString(), value);
 }
 return new RequestScoper() {
  @Override
  public CloseableScope open() {
   checkScopingState(
     null == GuiceFilter.localContext.get(),
     "Cannot continue request in the same thread as a HTTP request!");
   return new GuiceFilter.Context(continuingRequest, continuingRequest, null).open();
  }
 };
}
origin: com.jwebmp.inject.extensions/guice-servlet

private static RequestScoper continueRequest(Map<Key<?>, Object> seedMap) {
 Preconditions.checkArgument(
   null != seedMap, "Seed map cannot be null, try passing in Collections.emptyMap() instead.");
 // Snapshot the seed map and add all the instances to our continuing HTTP request.
 final ContinuingHttpServletRequest continuingRequest =
   new ContinuingHttpServletRequest(GuiceFilter.getRequest(Key.get(HttpServletRequest.class)));
 for (Map.Entry<Key<?>, Object> entry : seedMap.entrySet()) {
  Object value = validateAndCanonicalizeValue(entry.getKey(), entry.getValue());
  continuingRequest.setAttribute(entry.getKey().toString(), value);
 }
 return new RequestScoper() {
  @Override
  public CloseableScope open() {
   checkScopingState(
     null == GuiceFilter.localContext.get(),
     "Cannot continue request in the same thread as a HTTP request!");
   return new GuiceFilter.Context(continuingRequest, continuingRequest, null).open();
  }
 };
}
origin: mycila/guice

  new ContinuingHttpServletRequest(GuiceFilter.getRequest());
for (Map.Entry<Key<?>, Object> entry : seedMap.entrySet()) {
  Object value = validateAndCanonicalizeValue(entry.getKey(), entry.getValue());
  continuingRequest.setAttribute(entry.getKey().toString(), value);
origin: com.mycila.guice.extensions/mycila-guice-servlet

  new ContinuingHttpServletRequest(GuiceFilter.getRequest());
for (Map.Entry<Key<?>, Object> entry : seedMap.entrySet()) {
  Object value = validateAndCanonicalizeValue(entry.getKey(), entry.getValue());
  continuingRequest.setAttribute(entry.getKey().toString(), value);
com.google.inject.servletServletScopesvalidateAndCanonicalizeValue

Javadoc

Validates the key and object, ensuring the value matches the key type, and canonicalizing null objects to the null sentinel.

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
  • 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 plugins for WebStorm
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