当前位置: 首页>>代码示例>>Java>>正文


Java FeaturesAndProperties类代码示例

本文整理汇总了Java中com.sun.jersey.core.util.FeaturesAndProperties的典型用法代码示例。如果您正苦于以下问题:Java FeaturesAndProperties类的具体用法?Java FeaturesAndProperties怎么用?Java FeaturesAndProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FeaturesAndProperties类属于com.sun.jersey.core.util包,在下文中一共展示了FeaturesAndProperties类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureWebAppServlets

import com.sun.jersey.core.util.FeaturesAndProperties; //导入依赖的package包/类
protected void configureWebAppServlets() {
  // Add in the web services filters/serves if app has them.
  // Using Jersey/guice integration module. If user has web services
  // they must have also bound a default one in their webapp code.
  if (this.wsName != null) {
    // There seems to be an issue with the guice/jersey integration
    // where we have to list the stuff we don't want it to serve
    // through the guicecontainer. In this case its everything except
    // the the web services api prefix. We can't just change the filter
    // from /* below - that doesn't work.
    String regex = "(?!/" + this.wsName + ")";
    serveRegex(regex).with(DefaultWrapperServlet.class);

    Map<String, String> params = new HashMap<String, String>();
    params.put(ResourceConfig.FEATURE_IMPLICIT_VIEWABLES, "true");
    params.put(ServletContainer.FEATURE_FILTER_FORWARD_ON_404, "true");
    params.put(FeaturesAndProperties.FEATURE_XMLROOTELEMENT_PROCESSING, "true");
    params.put(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS, GZIPContentEncodingFilter.class.getName());
    params.put(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS, GZIPContentEncodingFilter.class.getName());
    filter("/*").through(getWebAppFilterClass(), params);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:WebApp.java

示例2: configureServlets

import com.sun.jersey.core.util.FeaturesAndProperties; //导入依赖的package包/类
@Override
public void configureServlets() {
  setup();

  serve("/", "/__stop").with(Dispatcher.class);

  for (String path : this.servePathSpecs) {
    serve(path).with(Dispatcher.class);
  }

  // Add in the web services filters/serves if app has them.
  // Using Jersey/guice integration module. If user has web services
  // they must have also bound a default one in their webapp code.
  if (this.wsName != null) {
    // There seems to be an issue with the guice/jersey integration
    // where we have to list the stuff we don't want it to serve
    // through the guicecontainer. In this case its everything except
    // the the web services api prefix. We can't just change the filter
    // from /* below - that doesn't work.
    String regex = "(?!/" + this.wsName + ")";
    serveRegex(regex).with(DefaultWrapperServlet.class);

    Map<String, String> params = new HashMap<String, String>();
    params.put(ResourceConfig.FEATURE_IMPLICIT_VIEWABLES, "true");
    params.put(ServletContainer.FEATURE_FILTER_FORWARD_ON_404, "true");
    params.put(FeaturesAndProperties.FEATURE_XMLROOTELEMENT_PROCESSING, "true");
    params.put(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS, GZIPContentEncodingFilter.class.getName());
    params.put(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS, GZIPContentEncodingFilter.class.getName());
    filter("/*").through(GuiceContainer.class, params);
  }

}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:33,代码来源:WebApp.java

示例3: getJerseyServletParams

import com.sun.jersey.core.util.FeaturesAndProperties; //导入依赖的package包/类
private Dictionary<String, String> getJerseyServletParams() {
        Dictionary<String, String> jerseyServletParams = new Hashtable<String, String>();
        jerseyServletParams.put("javax.ws.rs.Application", CVApplication.class.getName());
        jerseyServletParams.put("org.atmosphere.core.servlet-mapping", CV_SERVLET_ALIAS+"/*");
        jerseyServletParams.put("org.atmosphere.useWebSocket", "true");
        jerseyServletParams.put("org.atmosphere.useNative", "true");
        jerseyServletParams.put("org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults", "true");
        // use the default interceptors without PaddingAtmosphereInterceptor
        // see: https://groups.google.com/forum/#!topic/openhab/Z-DVBXdNiYE
        final String[] interceptors = {
    			"org.atmosphere.interceptor.CacheHeadersInterceptor",
    			"org.atmosphere.interceptor.AndroidAtmosphereInterceptor",
    			"org.atmosphere.interceptor.SSEAtmosphereInterceptor",
    			"org.atmosphere.interceptor.JSONPAtmosphereInterceptor",
    			"org.atmosphere.interceptor.JavaScriptProtocol",
    			"org.atmosphere.interceptor.OnDisconnectInterceptor"
        };
        jerseyServletParams.put("org.atmosphere.cpr.AtmosphereInterceptor", StringUtils.join(interceptors, ","));
        jerseyServletParams.put("org.atmosphere.cpr.broadcasterLifeCyclePolicy", "IDLE_DESTROY");
        jerseyServletParams.put("org.atmosphere.cpr.CometSupport.maxInactiveActivity", "300000");
        
        jerseyServletParams.put("com.sun.jersey.spi.container.ResourceFilter", "org.atmosphere.core.AtmosphereFilter");
//        The BroadcasterCache is set in ResourceStateChangeListener.registerItems(), because otherwise
//        it gets somehow overridden by other registered servlets (e.g. the REST-bundle)
//        the other advantage of this solution is, that the BroadcasterCache class does not need to be exported by this package
//        jerseyServletParams.put("org.atmosphere.cpr.broadcasterCacheClass", "org.openhab.io.cv.internal.cache.CVBroadcasterCache");        
        
        // required because of bug http://java.net/jira/browse/JERSEY-361
        jerseyServletParams.put(FeaturesAndProperties.FEATURE_XMLROOTELEMENT_PROCESSING, "true");

        return jerseyServletParams;
    }
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:33,代码来源:CVApplication.java

示例4: getJerseyServletParams

import com.sun.jersey.core.util.FeaturesAndProperties; //导入依赖的package包/类
private Dictionary<String, String> getJerseyServletParams() {
        Dictionary<String, String> jerseyServletParams = new Hashtable<String, String>();
        jerseyServletParams.put("javax.ws.rs.Application", RESTApplication.class.getName());
        
        jerseyServletParams.put("org.atmosphere.core.servlet-mapping", RESTApplication.REST_SERVLET_ALIAS+"/*");
        jerseyServletParams.put("org.atmosphere.useWebSocket", "true");
        jerseyServletParams.put("org.atmosphere.useNative", "true");
        
        jerseyServletParams.put("org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults", "true");
        // use the default interceptors without PaddingAtmosphereInterceptor
        // see: https://groups.google.com/forum/#!topic/openhab/Z-DVBXdNiYE
        final String[] interceptors = {
    			"org.atmosphere.interceptor.CorsInterceptor",
			"org.atmosphere.interceptor.CacheHeadersInterceptor",
			"org.atmosphere.interceptor.AndroidAtmosphereInterceptor",
			"org.atmosphere.interceptor.SSEAtmosphereInterceptor",
			"org.atmosphere.interceptor.JSONPAtmosphereInterceptor",
			"org.atmosphere.interceptor.JavaScriptProtocol",
			"org.atmosphere.interceptor.OnDisconnectInterceptor"
        };
        jerseyServletParams.put("org.atmosphere.cpr.AtmosphereInterceptor", StringUtils.join(interceptors, ","));
//      The BroadcasterCache is set in ResourceStateChangeListener.registerItems(), because otherwise
//      it gets somehow overridden by other registered servlets (e.g. the CV-bundle)
        //jerseyServletParams.put("org.atmosphere.cpr.broadcasterCacheClass", "org.atmosphere.cache.UUIDBroadcasterCache");
        jerseyServletParams.put("org.atmosphere.cpr.broadcasterLifeCyclePolicy", "IDLE_DESTROY");
        jerseyServletParams.put("org.atmosphere.cpr.CometSupport.maxInactiveActivity", "3000000");
        
        jerseyServletParams.put("org.atmosphere.cpr.broadcaster.maxProcessingThreads", "10"); // Default: unlimited!
        jerseyServletParams.put("org.atmosphere.cpr.broadcaster.maxAsyncWriteThreads", "10"); // Default: 200 on atmos 2.2
        
        jerseyServletParams.put("com.sun.jersey.spi.container.ResourceFilter", "org.atmosphere.core.AtmosphereFilter");
        
        // required because of bug http://java.net/jira/browse/JERSEY-361
        jerseyServletParams.put(FeaturesAndProperties.FEATURE_XMLROOTELEMENT_PROCESSING, "true");

        return jerseyServletParams;
    }
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:38,代码来源:RESTApplication.java

示例5: ProvidesResource

import com.sun.jersey.core.util.FeaturesAndProperties; //导入依赖的package包/类
@Inject
public ProvidesResource(DaggerContainer daggerContainer, WebApplication webApplication, Providers providers,
                        FeaturesAndProperties featuresAndProperties, MessageBodyWorkers messageBodyWorkers,
                        ExceptionMapperContext exceptionMapperContext, ResourceContext resourceContext) {
    assertNotNull(daggerContainer);
    assertNotNull(webApplication);
    assertNotNull(providers);
    assertNotNull(featuresAndProperties);
    assertNotNull(messageBodyWorkers);
    assertNotNull(exceptionMapperContext);
    assertNotNull(resourceContext);
}
 
开发者ID:johnlcox,项目名称:dagger-servlet,代码行数:13,代码来源:JerseyModuleProvidesTest.java

示例6: NewRelicResourceFilterFactory

import com.sun.jersey.core.util.FeaturesAndProperties; //导入依赖的package包/类
@Inject
NewRelicResourceFilterFactory(ResourceTransactionNamer namer, FeaturesAndProperties featuresAndProperties,
    NewRelicWrapper newRelicWrapper) {
    this.namer = namer;
    this.newRelicWrapper = newRelicWrapper;

    Map<String, Object> props = featuresAndProperties.getProperties();
    if (props.containsKey(TRANSACTION_CATEGORY_PROP)) {
        this.category = (String) props.get(TRANSACTION_CATEGORY_PROP);
    } else {
        this.category = null;
    }
}
 
开发者ID:palominolabs,项目名称:jersey-new-relic,代码行数:14,代码来源:NewRelicResourceFilterFactory.java

示例7: provideFeaturesAndProperties

import com.sun.jersey.core.util.FeaturesAndProperties; //导入依赖的package包/类
@Provides
public FeaturesAndProperties provideFeaturesAndProperties(WebApplication webApplication) {
    return webApplication.getFeaturesAndProperties();
}
 
开发者ID:johnlcox,项目名称:dagger-servlet,代码行数:5,代码来源:JerseyModule.java

示例8: featuresAndProperties

import com.sun.jersey.core.util.FeaturesAndProperties; //导入依赖的package包/类
@Provides
public FeaturesAndProperties featuresAndProperties(WebApplication webApplication) {
    return webApplication.getFeaturesAndProperties();
}
 
开发者ID:rridgley1,项目名称:agon,代码行数:5,代码来源:JerseyContainerModule.java


注:本文中的com.sun.jersey.core.util.FeaturesAndProperties类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。