本文整理了Java中javax.ws.rs.core.Configuration.getProperties()
方法的一些代码示例,展示了Configuration.getProperties()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getProperties()
方法的具体详情如下:
包路径:javax.ws.rs.core.Configuration
类名称:Configuration
方法名:getProperties
[英]Get the immutable bag of configuration properties.
[中]获取不可变的配置属性包。
代码示例来源:origin: jersey/jersey
private int getMaximumCacheLimit(Configuration configuration) {
int limit = ClientProperties.getValue(configuration.getProperties(),
ClientProperties.DIGESTAUTH_URI_CACHE_SIZELIMIT, MAXIMUM_DIGEST_CACHE_SIZE);
if (limit < 1) {
limit = MAXIMUM_DIGEST_CACHE_SIZE;
}
return limit;
}
代码示例来源:origin: jersey/jersey
private int getMaximumCacheLimit(Configuration configuration) {
int limit = ClientProperties.getValue(configuration.getProperties(),
ClientProperties.DIGESTAUTH_URI_CACHE_SIZELIMIT, MAXIMUM_DIGEST_CACHE_SIZE);
if (limit < 1) {
limit = MAXIMUM_DIGEST_CACHE_SIZE;
}
return limit;
}
代码示例来源:origin: jersey/jersey
NettyConnector(Client client) {
final Object threadPoolSize = client.getConfiguration().getProperties().get(ClientProperties.ASYNC_THREADPOOL_SIZE);
if (threadPoolSize != null && threadPoolSize instanceof Integer && (Integer) threadPoolSize > 0) {
executorService = Executors.newFixedThreadPool((Integer) threadPoolSize);
} else {
executorService = Executors.newCachedThreadPool();
}
this.group = new NioEventLoopGroup();
this.client = client;
}
代码示例来源:origin: org.glassfish.jersey.core/jersey-client
private int getMaximumCacheLimit(Configuration configuration) {
int limit = ClientProperties.getValue(configuration.getProperties(),
ClientProperties.DIGESTAUTH_URI_CACHE_SIZELIMIT, MAXIMUM_DIGEST_CACHE_SIZE);
if (limit < 1) {
limit = MAXIMUM_DIGEST_CACHE_SIZE;
}
return limit;
}
代码示例来源:origin: jersey/jersey
/**
* Get application-wide tracing level threshold.
*
* @param configuration application configuration.
* @return tracing level threshold.
*/
/*package*/
static TracingLogger.Level getTracingThreshold(Configuration configuration) {
final String thresholdText = ServerProperties.getValue(
configuration.getProperties(),
ServerProperties.TRACING_THRESHOLD, String.class);
return (thresholdText == null) ? TracingLogger.DEFAULT_LEVEL : TracingLogger.Level.valueOf(thresholdText);
}
代码示例来源:origin: jersey/jersey
/**
* Get application-wide tracing level threshold.
*
* @param configuration application configuration.
* @return tracing level threshold.
*/
/*package*/
static TracingLogger.Level getTracingThreshold(Configuration configuration) {
final String thresholdText = ServerProperties.getValue(
configuration.getProperties(),
ServerProperties.TRACING_THRESHOLD, String.class);
return (thresholdText == null) ? TracingLogger.DEFAULT_LEVEL : TracingLogger.Level.valueOf(thresholdText);
}
代码示例来源:origin: jersey/jersey
@Override
public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) {
Configuration configuration = bootstrapBag.getConfiguration();
List<AutoDiscoverable> autoDiscoverables = loadImplementations(configuration.getProperties()).stream()
.peek(implClass -> injectionManager.register(Bindings.service(implClass).to(AutoDiscoverable.class)))
.map(injectionManager::createAndInitialize)
.collect(Collectors.toList());
bootstrapBag.setAutoDiscoverables(autoDiscoverables);
}
}
代码示例来源:origin: jersey/jersey
@Override
public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) {
Configuration configuration = bootstrapBag.getConfiguration();
List<AutoDiscoverable> autoDiscoverables = loadImplementations(configuration.getProperties()).stream()
.peek(implClass -> injectionManager.register(Bindings.service(implClass).to(AutoDiscoverable.class)))
.map(injectionManager::createAndInitialize)
.collect(Collectors.toList());
bootstrapBag.setAutoDiscoverables(autoDiscoverables);
}
}
代码示例来源:origin: jersey/jersey
@Override
public boolean configure(final FeatureContext context) {
if (CommonProperties.getValue(context.getConfiguration().getProperties(), context.getConfiguration().getRuntimeType(),
CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, Boolean.FALSE, Boolean.class)) {
return false;
}
// Make sure JSON-P workers have higher priority than other Json providers (in case there is a need to use JSON-P and some
// other provider in an application).
context.register(JsonValueBodyReader.class, Priorities.USER + 1000);
context.register(JsonValueBodyWriter.class, Priorities.USER + 1000);
return true;
}
}
代码示例来源:origin: jersey/jersey
@Override
public void configure(final FeatureContext context) {
if (!context.getConfiguration().isRegistered(MonitoringFeature.class)) {
final Boolean monitoringEnabled = ServerProperties.getValue(context.getConfiguration().getProperties(),
ServerProperties.MONITORING_ENABLED, Boolean.FALSE);
final Boolean statisticsEnabled = ServerProperties.getValue(context.getConfiguration().getProperties(),
ServerProperties.MONITORING_STATISTICS_ENABLED, Boolean.FALSE);
final Boolean mbeansEnabled = ServerProperties.getValue(context.getConfiguration().getProperties(),
ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, Boolean.FALSE);
if (monitoringEnabled || statisticsEnabled || mbeansEnabled) {
context.register(MonitoringFeature.class);
}
}
}
}
代码示例来源:origin: jersey/jersey
@Override
public void configure(final FeatureContext context) {
if (!context.getConfiguration().isRegistered(MonitoringFeature.class)) {
final Boolean monitoringEnabled = ServerProperties.getValue(context.getConfiguration().getProperties(),
ServerProperties.MONITORING_ENABLED, Boolean.FALSE);
final Boolean statisticsEnabled = ServerProperties.getValue(context.getConfiguration().getProperties(),
ServerProperties.MONITORING_STATISTICS_ENABLED, Boolean.FALSE);
final Boolean mbeansEnabled = ServerProperties.getValue(context.getConfiguration().getProperties(),
ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, Boolean.FALSE);
if (monitoringEnabled || statisticsEnabled || mbeansEnabled) {
context.register(MonitoringFeature.class);
}
}
}
}
代码示例来源:origin: jersey/jersey
@Override
public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) {
Configuration configuration = bootstrapBag.getConfiguration();
loadImplementations(configuration.getProperties())
.forEach(implClass -> injectionManager.register(Bindings.service(implClass).to(AutoDiscoverable.class)));
}
}
代码示例来源:origin: jersey/jersey
@Override
public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) {
Configuration configuration = bootstrapBag.getConfiguration();
loadImplementations(configuration.getProperties())
.forEach(implClass -> injectionManager.register(Bindings.service(implClass).to(AutoDiscoverable.class)));
}
}
代码示例来源:origin: jersey/jersey
@Override
public void configure(final FeatureContext context) {
final Configuration config = context.getConfiguration();
if (context.getConfiguration().isRegistered(SseFeature.class)) {
return;
}
if (!PropertiesHelper.getValue(
config.getProperties(), config.getRuntimeType(), SseFeature.DISABLE_SSE, Boolean.FALSE, Boolean.class, null)) {
context.register(SseFeature.class);
}
}
}
代码示例来源:origin: alibaba/fastjson
config.getProperties()
, config.getRuntimeType()
, InternalProperties.JSON_FEATURE, JSON_FEATURE,
代码示例来源:origin: jersey/jersey
@Override
public Connector getConnector(final Client client, final Configuration config) {
final Map<String, Object> properties = config.getProperties();
int computedChunkSize = ClientProperties.getValue(properties,
ClientProperties.CHUNKED_ENCODING_SIZE, chunkSize, Integer.class);
if (computedChunkSize < 0) {
LOGGER.warning(LocalizationMessages.NEGATIVE_CHUNK_SIZE(computedChunkSize, chunkSize));
computedChunkSize = chunkSize;
}
final boolean computedUseFixedLengthStreaming = ClientProperties.getValue(properties,
USE_FIXED_LENGTH_STREAMING, useFixedLengthStreaming, Boolean.class);
final boolean computedUseSetMethodWorkaround = ClientProperties.getValue(properties,
SET_METHOD_WORKAROUND, useSetMethodWorkaround, Boolean.class);
return createHttpUrlConnector(client, connectionFactory, computedChunkSize, computedUseFixedLengthStreaming,
computedUseSetMethodWorkaround);
}
代码示例来源:origin: jersey/jersey
@Override
public Connector getConnector(final Client client, final Configuration config) {
final Map<String, Object> properties = config.getProperties();
int computedChunkSize = ClientProperties.getValue(properties,
ClientProperties.CHUNKED_ENCODING_SIZE, chunkSize, Integer.class);
if (computedChunkSize < 0) {
LOGGER.warning(LocalizationMessages.NEGATIVE_CHUNK_SIZE(computedChunkSize, chunkSize));
computedChunkSize = chunkSize;
}
final boolean computedUseFixedLengthStreaming = ClientProperties.getValue(properties,
USE_FIXED_LENGTH_STREAMING, useFixedLengthStreaming, Boolean.class);
final boolean computedUseSetMethodWorkaround = ClientProperties.getValue(properties,
SET_METHOD_WORKAROUND, useSetMethodWorkaround, Boolean.class);
return createHttpUrlConnector(client, connectionFactory, computedChunkSize, computedUseFixedLengthStreaming,
computedUseSetMethodWorkaround);
}
代码示例来源:origin: jersey/jersey
private Request translateRequest(final ClientRequest clientRequest) {
final URI uri = clientRequest.getUri();
final Request request = client.newRequest(uri);
request.method(clientRequest.getMethod());
request.followRedirects(clientRequest.resolveProperty(ClientProperties.FOLLOW_REDIRECTS, true));
final Object readTimeout = clientRequest.getConfiguration().getProperties().get(ClientProperties.READ_TIMEOUT);
if (readTimeout != null && readTimeout instanceof Integer && (Integer) readTimeout > 0) {
request.timeout((Integer) readTimeout, TimeUnit.MILLISECONDS);
}
return request;
}
代码示例来源:origin: jersey/jersey
@Override
public void configure(FeatureContext context) {
if (!context.getConfiguration().isRegistered(LoggingFeature.class)) {
Map properties = context.getConfiguration().getProperties();
if (commonPropertyConfigured(properties)
|| (context.getConfiguration().getRuntimeType() == RuntimeType.CLIENT && clientConfigured(properties))
|| (context.getConfiguration().getRuntimeType() == RuntimeType.SERVER && serverConfigured(properties))) {
context.register(LoggingFeature.class);
}
}
}
代码示例来源:origin: jersey/jersey
@Override
public void configure(FeatureContext context) {
if (!context.getConfiguration().isRegistered(LoggingFeature.class)) {
Map properties = context.getConfiguration().getProperties();
if (commonPropertyConfigured(properties)
|| (context.getConfiguration().getRuntimeType() == RuntimeType.CLIENT && clientConfigured(properties))
|| (context.getConfiguration().getRuntimeType() == RuntimeType.SERVER && serverConfigured(properties))) {
context.register(LoggingFeature.class);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!