本文整理汇总了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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
}
示例7: provideFeaturesAndProperties
import com.sun.jersey.core.util.FeaturesAndProperties; //导入依赖的package包/类
@Provides
public FeaturesAndProperties provideFeaturesAndProperties(WebApplication webApplication) {
return webApplication.getFeaturesAndProperties();
}
示例8: featuresAndProperties
import com.sun.jersey.core.util.FeaturesAndProperties; //导入依赖的package包/类
@Provides
public FeaturesAndProperties featuresAndProperties(WebApplication webApplication) {
return webApplication.getFeaturesAndProperties();
}