com.sun.jersey.spi.container.WebApplication类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(258)

本文整理了Java中com.sun.jersey.spi.container.WebApplication类的一些代码示例,展示了WebApplication类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebApplication类的具体详情如下:
包路径:com.sun.jersey.spi.container.WebApplication
类名称:WebApplication

WebApplication介绍

[英]A Web application that manages a set of resource classes.

The web application will dispatch HTTP requests to the matching resource method on the matching resource class.
[中]

代码示例

代码示例来源:origin: com.sun.jersey/jersey-server

if (c != null) {
  if (!wa.isInitiated()) {
    wa.initiate(resourceConfig, factory);

代码示例来源:origin: com.sun.jersey/jersey-server

public void onReload() {
    WebApplication oldApplication = application;
    application = application.clone();

    if (application.getFeaturesAndProperties() instanceof ReloadListener)
      ((ReloadListener) application.getFeaturesAndProperties()).onReload();

    oldApplication.destroy();
  }
}

代码示例来源:origin: com.sun.jersey/jersey-server

ExceptionMapper em = wa.getExceptionMapperContext().find(e.getClass());
if (em == null) {
  wa.getResponseListener().onError(
      Thread.currentThread().getId(),
wa.getResponseListener().onMappedException(
    Thread.currentThread().getId(),
    e,

代码示例来源:origin: org.atmosphere/atmosphere-guice

@Provides
public SecurityContext securityContext(WebApplication wa) {
  return wa.getThreadLocalHttpContext().getRequest();
}

代码示例来源:origin: org.atmosphere/atmosphere-guice

@Provides
public ExtendedUriInfo extendedUriInfo(WebApplication wa) {
  return wa.getThreadLocalHttpContext().getUriInfo();
}

代码示例来源:origin: org.sonatype.sisu.siesta/siesta-server

/**
 * @since 1.4
 */
@Provides
public FeaturesAndProperties featuresAndProperties(WebApplication webApplication) {
 return webApplication.getFeaturesAndProperties();
}

代码示例来源:origin: com.sun.jersey.contribs/jersey-guice

@Provides
public MessageBodyWorkers messageBodyWorkers(WebApplication webApplication) {
  return webApplication.getMessageBodyWorkers();
}

代码示例来源:origin: org.sonatype.sisu.siesta/siesta-server

/**
 * @since 1.4
 */
@Provides
public ExceptionMapperContext exceptionMapperContext(WebApplication webApplication) {
 return webApplication.getExceptionMapperContext();
}

代码示例来源:origin: Atmosphere/atmosphere-extensions

@Provides
  public HttpResponseContext responseContext(WebApplication wa) {
    return wa.getThreadLocalHttpContext().getResponse();
  }
}

代码示例来源:origin: com.cedarsoft.rest/jersey

@RequestScoped
@Provides
public HttpContext httpContext( @NotNull WebApplication webApplication ) {
 return webApplication.getThreadLocalHttpContext();
}

代码示例来源:origin: korpling/ANNIS

@Override
 protected void initiate(ResourceConfig rc, WebApplication wa)
 {
  wa.initiate(rc, factory);
 }
};

代码示例来源:origin: org.codehaus.enunciate/enunciate-jersey-rt

public String getCurrentStatusMessage() {
 if (this.wa != null && this.wa.getThreadLocalHttpContext() != null && this.wa.getThreadLocalHttpContext().getResponse() != null) {
  Response res = this.wa.getThreadLocalHttpContext().getResponse().getResponse();
  if (res instanceof StatusMessageResponse) {
   return ((StatusMessageResponse) res).getStatusMessage();
  }
 }
 return null;
}

代码示例来源:origin: com.sun.jersey/jersey-bundle

/**
 * Destroy this Web component.
 * <p/>
 * This will destroy the Web application created by this this Web component.
 */
public void destroy() {
  if (application != null)
    application.destroy();
}

代码示例来源:origin: com.sun.jersey/jersey-server

_application.handleRequest(cRequest, new Writer(exchange));
} catch (RuntimeException e) {
  e.printStackTrace();

代码示例来源:origin: com.sun.jersey.contribs/jersey-simple-server

public void onReload() {
    WebApplication oldApplication = application;
    application = application.clone();
    oldApplication.destroy();
  }
}

代码示例来源:origin: com.sun.jersey/jersey-server

/**
 * Get the message body workers.
 *
 * @return the message body workers.
 */
public MessageBodyWorkers getMessageBodyWorkers() {
  return wa.getMessageBodyWorkers();
}

代码示例来源:origin: com.sun.jersey/jersey-server

@Override
public void trace(String message) {
  if (!isTracingEnabled())
    return;
  if (wa.getFeaturesAndProperties().getFeature(ResourceConfig.FEATURE_TRACE_PER_REQUEST) &&
      !getRequestHeaders().containsKey("X-Jersey-Trace-Accept"))
    return;
  TraceInformation ti = (TraceInformation) getProperties().
      get(TraceInformation.class.getName());
  ti.trace(message);
}

代码示例来源:origin: org.atmosphere/atmosphere-guice

@Provides
public HttpHeaders httpHeaders(WebApplication wa) {
  return wa.getThreadLocalHttpContext().getRequest();
}

代码示例来源:origin: org.atmosphere/atmosphere-guice

@Provides
public UriInfo uriInfo(WebApplication wa) {
  return wa.getThreadLocalHttpContext().getUriInfo();
}

代码示例来源:origin: com.sun.jersey.contribs/jersey-guice

@Provides
public FeaturesAndProperties featuresAndProperties(WebApplication webApplication) {
  return webApplication.getFeaturesAndProperties();
}

相关文章