Tabnine Logo
javax.ws.rs.container
Code IndexAdd Tabnine to your IDE (free)

How to use javax.ws.rs.container

Best Java code snippets using javax.ws.rs.container (Showing top 20 results out of 2,232)

origin: dropwizard/dropwizard

  @Override
  public void filter(ContainerRequestContext requestContext) throws IOException {
    try {
      underlying.filter(requestContext);
    } catch (WebApplicationException err) {
      // Pass through.
    }
  }
}
origin: jersey/jersey

  @Override
  public void invoke(final CompletionCallback callback) {
    callback.onComplete(throwable);
  }
});
origin: jersey/jersey

  @Override
  public void invoke(final ConnectionCallback callback) {
    callback.onDisconnect(disconnected);
  }
});
origin: Graylog2/graylog2-server

  @Override
  public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
    // Add no-cache to XMLHttpRequests, to avoid browsers caching results
    String requestedWith = requestContext.getHeaders().getFirst("X-Requested-With");
    if ("XMLHttpRequest".equals(requestedWith)) {
      responseContext.getHeaders().add("Cache-Control", "no-cache");
    }
  }
}
origin: dropwizard/dropwizard

  @Override
  public void filter(final ContainerRequestContext request,
      final ContainerResponseContext response) throws IOException {

    final Long startTime = (Long) request.getProperty(RUNTIME_PROPERTY);
    if (startTime != null) {
      final float seconds = (currentTimeProvider.get() - startTime) / NANOS_IN_SECOND;
      response.getHeaders().putSingle(RUNTIME_HEADER, String.format(Locale.ROOT, "%.6f", seconds));
    }
  }
}
origin: jersey/jersey

  @Override
  public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
    if (responseContext.hasEntity()) {
      responseContext.setEntity("" + responseContext.getEntity() + "PRE_MATCH_OUT", null, MediaType.TEXT_PLAIN_TYPE);
    }
  }
}
origin: apache/incubator-dubbo

@Override
public void filter(ContainerRequestContext context) throws IOException {
  logHttpHeaders(context.getHeaders());
}
origin: jersey/jersey

@Override
public String getRequestMethod() {
  return context.getMethod();
}
origin: javaee-samples/javaee7-samples

  @Override
  public void handleTimeout(AsyncResponse ar) {
    ar.resume("Operation timed out");
  }
});
origin: jersey/jersey

@Override
public void setAttribute(String name, Object value, int scope) {
  requestContext.setProperty(name, value);
}
origin: jersey/jersey

@Override
public Object getAttribute(String name, int scope) {
  return requestContext.getProperty(name);
}
origin: apache/incubator-dubbo

@Override
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
  logHttpHeaders(responseContext.getStringHeaders());
}
origin: jersey/jersey

@Override
public <T extends ConstraintValidator<?, ?>> T getInstance(final Class<T> key) {
  return resourceContext.getResource(key);
}
origin: jersey/jersey

@Override
public void removeAttribute(String name, int scope) {
  requestContext.removeProperty(name);
}
origin: jersey/jersey

  @Override
  public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
    if (responseContext.hasEntity()) {
      responseContext.setEntity("" + responseContext.getEntity() + "DYN_MATCH_OUT", null, MediaType.TEXT_PLAIN_TYPE);
    }
  }
}
origin: apache/incubator-dubbo

@Override
public void filter(ContainerRequestContext context) throws IOException {
  logHttpHeaders(context.getHeaders());
}
origin: apache/incubator-dubbo

@Override
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
  logHttpHeaders(responseContext.getStringHeaders());
}
origin: jersey/jersey

  @Override
  public void invoke(final CompletionCallback callback) {
    callback.onComplete(throwable);
  }
});
origin: jersey/jersey

  @Override
  public void invoke(final ConnectionCallback callback) {
    callback.onDisconnect(disconnected);
  }
});
origin: jersey/jersey

  @Override
  public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
    if (responseContext.hasEntity()) {
      responseContext.setEntity("" + responseContext.getEntity() + "NAM_MATCH_OUT", null, MediaType.TEXT_PLAIN_TYPE);
    }
  }
}
javax.ws.rs.container

Most used classes

  • ContainerRequestContext
    Container request filter context. A mutable class that provides request-specific information for the
  • ContainerResponseContext
    Container response filter context. A mutable class that provides response-specific information for t
  • PreMatching
  • ResourceInfo
    An injectable class to access the resource class and resource method matched by the current request.
  • AsyncResponse
    An injectable JAX-RS asynchronous response that provides means for asynchronous server side response
  • ResourceContext,
  • ContainerRequestFilter,
  • ContainerResponseFilter,
  • DynamicFeature,
  • TimeoutHandler,
  • CompletionCallback,
  • ConnectionCallback
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