public final class ServerProperties extends Object
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION_NAME
String property that defines the application name. |
static String |
BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK
A Bean Validation (JSR-349) support customization property.
|
static String |
BV_FEATURE_DISABLE
If
true then disable Bean Validation support. |
static String |
BV_SEND_ERROR_IN_RESPONSE
A Bean Validation (JSR-349) support customization property.
|
static String |
FEATURE_AUTO_DISCOVERY_DISABLE
If
true then disable auto discovery on server. |
static String |
HTTP_METHOD_OVERRIDE
Defines configuration of HTTP method overriding.
|
static String |
JSON_PROCESSING_FEATURE_DISABLE
If
true then disable configuration of Json Processing (JSR-353) feature on server. |
static String |
LANGUAGE_MAPPINGS
Defines mapping of URI extensions to languages.
|
static String |
LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED
If
true then Jersey will not attempt to resolve relative URIs in the Location http header against the
request URI. |
static String |
LOCATION_HEADER_RELATIVE_URI_RESOLUTION_RFC7231
If
true then Jersey will resolve relative URIs in the Location http header against the
request URI according to RFC7231 (new HTTP Specification). |
static String |
MEDIA_TYPE_MAPPINGS
Defines mapping of URI extensions to media types.
|
static String |
METAINF_SERVICES_LOOKUP_DISABLE
If
true then disable META-INF/services lookup on server. |
static String |
MONITORING_ENABLED
If
true then application monitoring will be enabled. |
static String |
MONITORING_STATISTICS_ENABLED
If
true then calculation of monitoring statistics will be enabled. |
static String |
MONITORING_STATISTICS_MBEANS_ENABLED
If
true then Jersey will expose MBeans with monitoring statistics. |
static String |
MONITORING_STATISTICS_REFRESH_INTERVAL
Interval (in
ms ) indicating how often will be monitoring statistics refreshed and
onStatistics
method called. |
static String |
MOXY_JSON_FEATURE_DISABLE
If
true then disable configuration of MOXy Json feature on server. |
static String |
OUTBOUND_CONTENT_LENGTH_BUFFER
An integer value that defines the buffer size used to buffer server-side response entity in order to
determine its size and set the value of HTTP "Content-Length" header.
|
static String |
PROCESSING_RESPONSE_ERRORS_ENABLED
If property value is
true then the errors raised during response processing are tried to handled using available
response error mappers . |
static String |
PROVIDER_CLASSNAMES
Defines one or more class names that implement application-specific resources
and providers.
|
static String |
PROVIDER_CLASSPATH
Defines class-path that contains application-specific resources and
providers.
|
static String |
PROVIDER_PACKAGES
Defines one or more packages that contain application-specific resources and
providers.
|
static String |
PROVIDER_SCANNING_RECURSIVE
Sets the recursion strategy for package scanning.
|
static String |
REDUCE_CONTEXT_PATH_SLASHES_ENABLED
If set to
true then a container will ignore multiple slashes between a port and a context path and will resolve it
as URI with only one slash. |
static String |
RESOURCE_VALIDATION_DISABLE
If
true then the extensive validation of application resource model is disabled. |
static String |
RESOURCE_VALIDATION_IGNORE_ERRORS
If
true then validation of application resource models does not fail even in case of a fatal
validation errors. |
static String |
RESPONSE_SET_STATUS_OVER_SEND_ERROR
Whenever response status is
4xx or 5xx it is possible to choose between sendError or
setStatus on container specific Response implementation. |
static String |
SUBRESOURCE_LOCATOR_CACHE_AGE
An integer value that defines the maximum age (in seconds) for cached for sub-resource locator models.
|
static String |
SUBRESOURCE_LOCATOR_CACHE_JERSEY_RESOURCE_ENABLED
If
true then Jersey will cache Jersey resources in addition to
caching sub-resource locator classes and instances (which are cached by default). |
static String |
SUBRESOURCE_LOCATOR_CACHE_SIZE
An integer value that defines the size of cache for sub-resource locator models.
|
static int |
SUBRESOURCE_LOCATOR_DEFAULT_CACHE_SIZE
The default sub-resource locator cache size (64).
|
static String |
TRACING
Enable tracing support.
|
static String |
TRACING_THRESHOLD
Set level o tracing information.
|
static String |
WADL_FEATURE_DISABLE
If
true then disable WADL generation. |
static String |
WADL_GENERATOR_CONFIG
If set the wadl generator configuration that provides a
WadlGenerator . |
Modifier and Type | Method and Description |
---|---|
static <T> T |
getValue(Map<String,?> properties,
RuntimeType runtimeType,
String key,
T defaultValue,
Class<T> type)
Get the value of the specified property.
|
static <T> T |
getValue(Map<String,?> properties,
String key,
Class<T> type)
Get the value of the specified property.
|
static <T> T |
getValue(Map<String,?> properties,
String key,
T defaultValue)
Get the value of the specified property.
|
static <T> T |
getValue(Map<String,?> properties,
String key,
T defaultValue,
Class<T> type)
Get the value of the specified property.
|
public static final String PROVIDER_PACKAGES
@Path
) and
providers (annotated with @Provider
).
The property value MUST be an instance of String
or String[]
array. Each String
instance represents one or more package names
that MUST be separated only by characters declared in common delimiters:
" ,;\n"
.
A default value is not set.
The name of the configuration property is "jersey.config.server.provider.packages".
public static final String PROVIDER_SCANNING_RECURSIVE
true
indicates
that the list of provided package names
should be scanned
recursively including any nested packages. Value of false
indicates that only
packages in the list should be scanned. In such case any nested packages will be ignored.
The property value MUST be an instance of Boolean
type or a String
convertible
to Boolean
type.
A default value is true
.
The name of the configuration property is "jersey.config.server.provider.scanning.recursive".
PROVIDER_PACKAGES
,
Constant Field Valuespublic static final String PROVIDER_CLASSPATH
@Path
)
and providers (annotated with @Provider
).
Each path element MUST be an absolute or relative directory, or a Jar file.
The contents of a directory, including Java class files, jars files
and sub-directories are scanned (recursively).
The property value MUST be an instance of String
or String[]
array. Each String
instance represents one or more paths
that MUST be separated only by characters declared in common delimiters:
" ,;\n"
.
A default value is not set.
The name of the configuration property is "jersey.config.server.provider.classpath".
public static final String PROVIDER_CLASSNAMES
@Path
) or providers (annotated with
@Provider
).
The property value MUST be an instance of String
or String[]
array. Each String
instance represents one or more class names
that MUST be separated only by characters declared in common delimiters:
" ,;\n"
.
A default value is not set.
The name of the configuration property is "jersey.config.server.provider.classnames".
public static final String MEDIA_TYPE_MAPPINGS
UriConnegFilter
. See it's javadoc for more
information on media type mappings.
The property value MUST be an instance of String
, String[]
or Map<String, MediaType>
.
Each String
instance represents one or more uri-extension-to-media-type map entries separated by
a comma (","). Each map entry is a key-value pair separated by a colon (":").
Here is an example of an acceptable String value mapping txt extension to text/plain and xml extension to application/xml:
txt : text/plain, xml : application/xml
A default value is not set.
The name of the configuration property is "jersey.config.server.mediaTypeMappings".
public static final String LANGUAGE_MAPPINGS
UriConnegFilter
. See it's javadoc for more
information on language mappings.
The property value MUST be an instance of String
, String[]
or Map<String, String>
.
Each String
instance represents one or more uri-extension-to-language map entries separated by
a comma (","). Each map entry is a key-value pair separated by a colon (":").
Here is an example of an acceptable String value mapping english extension to "en" value of Content-Language header
and french extension to "fr" Content-Language header value:
english : en, french : fr
A default value is not set.
The name of the configuration property is "jersey.config.server.languageMappings".
public static final String HTTP_METHOD_OVERRIDE
HttpMethodOverrideFilter
to determine
where it should look for method override information (e.g. request header or query parameters).
HttpMethodOverrideFilter.Source
enum lists the allowed property
values.
The property value must be an instance of String
, String[]
,
Source
or
Source[]
.
Each String
instance represents one or more class names separated by characters declared in
common delimiters: " ,;\n"
.
The default value is "HEADER, QUERY"
.
The name of the configuration property is "jersey.config.server.httpMethodOverride".
public static final String WADL_GENERATOR_CONFIG
WadlGenerator
.
If this property is not set the default wadl generator will be used for generating wadl.
The type of this property must be a subclass or an instance of a subclass of
WadlGeneratorConfig
.
The name of the configuration property is "jersey.config.server.wadl.generatorConfig".
public static final String WADL_FEATURE_DISABLE
true
then disable WADL generation.
By default WADL generation is automatically enabled, if JAXB is present in the classpath.
The default value is false
.
The name of the configuration property is "jersey.config.server.wadl.disableWadl".
public static final String BV_FEATURE_DISABLE
true
then disable Bean Validation support.
By default Bean Validation (JSR-349) is automatically enabled, if org.glassfish.jersey.ext::jersey-bean-validation
Jersey module is present in the classpath.
The default value is false
.
The name of the configuration property is "jersey.config.beanValidation.disable.server".
public static final String BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK
true
the check whether the overriding / implementing methods are annotated with
ValidateOnExecution
as well as one of their predecessor (in hierarchy)
is disabled.
By default this checks is automatically enabled, unless the Bean Validation support is disabled explicitly (see
BV_FEATURE_DISABLE
).
The default value is false
.
The name of the configuration property is "jersey.config.beanValidation.disable.validateOnExecutableCheck.server".
ValidateOnExecution
,
Constant Field Valuespublic static final String BV_SEND_ERROR_IN_RESPONSE
true
and Bean Validation support has not been explicitly disabled (see
BV_FEATURE_DISABLE
), the validation error information will be sent in the entity of the
returned Response
.
The default value is false
. This means that in case of an error response caused by a Bean Validation
error, only a status code is sent in the server Response
by default.
The name of the configuration property is "jersey.config.beanValidation.enableOutputValidationErrorEntity.server".
public static final String REDUCE_CONTEXT_PATH_SLASHES_ENABLED
true
then a container will ignore multiple slashes between a port and a context path and will resolve it
as URI with only one slash.
The default value is false
. This means that in case of multiple slashes a container will match with the address
with the same number of slashes before a context path.
The property influences only Grizzly Container from containers which are supported by Jersey. Other containers have limited or disabled usage of a context path.
The name of the configuration property is "jersey.config.server.reduceContextPathSlashes.enabled".
public static final String FEATURE_AUTO_DISCOVERY_DISABLE
true
then disable auto discovery on server.
By default auto discovery is automatically enabled if global property
"jersey.config.disableAutoDiscovery" is not disabled. If set then the server
property value overrides the global property value.
The default value is false
.
The name of the configuration property is "jersey.config.server.disableAutoDiscovery".
This constant is an alias for CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE_SERVER
public static final String OUTBOUND_CONTENT_LENGTH_BUFFER
If the entity size exceeds the configured buffer size, the buffering would be cancelled and the entity size would not be determined. Value less or equal to zero disable the buffering of the entity at all.
This property can be used on the server side to override the outbound message buffer size value - default or the global custom value set using the "jersey.config.contentLength.buffer" global property.The default value is 8192.
The name of the configuration property is "jersey.config.server.contentLength.buffer".
This constant is an alias for CommonProperties.OUTBOUND_CONTENT_LENGTH_BUFFER_SERVER
public static final String JSON_PROCESSING_FEATURE_DISABLE
true
then disable configuration of Json Processing (JSR-353) feature on server.
By default Json Processing is automatically enabled if global property
"jersey.config.disableJsonProcessing" is not disabled. If set then the server
property value overrides the global property value.
The default value is false
.
The name of the configuration property is "jersey.config.server.disableJsonProcessing".
This constant is an alias for CommonProperties.JSON_PROCESSING_FEATURE_DISABLE_SERVER
public static final String METAINF_SERVICES_LOOKUP_DISABLE
true
then disable META-INF/services lookup on server.
By default Jersey looks up SPI implementations described by META-INF/services/* files.
Then you can register appropriate provider classes by Application
.
The default value is false
.
The name of the configuration property is "jersey.config.server.disableMetainfServicesLookup".
This constant is an alias for CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE_SERVER
CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE
,
Constant Field Valuespublic static final String MOXY_JSON_FEATURE_DISABLE
true
then disable configuration of MOXy Json feature on server.
By default MOXy Json is automatically enabled if global property
"jersey.config.disableMoxyJson" is not disabled. If set then the server
property value overrides the global property value.
The default value is false
.
The name of the configuration property is "jersey.config.server.disableMoxyJson".
This constant is an alias for CommonProperties.MOXY_JSON_FEATURE_DISABLE_SERVER
public static final String RESOURCE_VALIDATION_DISABLE
true
then the extensive validation of application resource model is disabled.
This impacts both the validation of root resources during deployment as well as validation of any sub resources
returned from sub-resource locators.
This option is typically used for performance purpose. Note however that in case the application resource models are
not valid, setting the property to true
can cause invalid behaviour and hard to diagnose issues at runtime.
By default the resource validation is run on models which are created either from the supplied resource class or instance
as well as on any directly provided resource
models.
The default value is false
.
The name of the configuration property is "jersey.config.server.resource.validation.disable".
public static final String RESOURCE_VALIDATION_IGNORE_ERRORS
true
then validation of application resource models does not fail even in case of a fatal
validation errors. All resource model validation issues are still output to the log, unless the resource
model validation is completely disabled (see RESOURCE_VALIDATION_DISABLE
).
This impacts both the validation of root resources during deployment as well as validation of any sub resources
returned from sub-resource locators. The option is typically used during development and testing.
The default value is false
.
The name of the configuration property is "jersey.config.server.resource.validation.ignoreErrors".
RESOURCE_VALIDATION_DISABLE
,
Constant Field Valuespublic static final String MONITORING_ENABLED
true
then application monitoring will be enabled.
This will enable the possibility
of injecting ApplicationInfo
into resource and providers.
The default value is false
.
The name of the configuration property is "jersey.config.server.monitoring.enabled".
public static final String MONITORING_STATISTICS_ENABLED
true
then calculation of monitoring statistics will be enabled.
This will enable the possibility
of injecting MonitoringStatistics
into resource and providers
and also the registered listeners
implementing MonitoringStatisticsListener
will be called
when statistics are available.
Monitoring statistics extends basic monitoring feature. Therefore when enabled,
the monitoring gets automatically enabled too (the same result as setting the property
MONITORING_ENABLED
true
).
Enabling statistics has negative performance impact and therefore should
be enabled only when needed.
The default value is false
.
The name of the configuration property is "jersey.config.server.monitoring.statistics.enabled".
public static final String MONITORING_STATISTICS_MBEANS_ENABLED
true
then Jersey will expose MBeans with monitoring statistics.
Exposed JMX MBeans are based
on MonitoringStatistics
and therefore when they are enabled,
also the calculation of monitoring statistics needs to be enabled. Therefore if this property is true
the calculation of monitoring statistics is automatically enabled (the same result as setting the property
MONITORING_STATISTICS_ENABLED
to true
).
Enabling statistics MBeans has negative
performance impact and therefore should be enabled only when needed.
The default value is false
.
The name of the configuration property is "jersey.config.server.monitoring.statistics.mbeans.enabled".
public static final String MONITORING_STATISTICS_REFRESH_INTERVAL
ms
) indicating how often will be monitoring statistics refreshed and
onStatistics
method called.
The default value is 500
.
The name of the configuration property is "jersey.config.server.monitoring.statistics.refresh.interval".
public static final String APPLICATION_NAME
String
property that defines the application name.
The name is an arbitrary user defined name
which is used to distinguish between Jersey applications in the case that more applications
are deployed on the same runtime (container). The name can be used for example for purposes
of monitoring by JMX when name identifies to which application deployed MBeans belong to.
The name should be unique in the runtime.
The property is ignored
if the application name is set programmatically by
ResourceConfig.getApplicationName()
.
There is no default value.
The name of the configuration property is "jersey.config.server.application.name".
public static final String TRACING
X-Jersey-Tracing-nnn
).
The feature should not be switched on on production environment.
Allowed values:
OFF
- tracing support is disabled.ON_DEMAND
- tracing support is in 'stand by' mode, it is enabled on demand by existence of request HTTP headerALL
- tracing support is enabled for every request.String
. The default value is "OFF"
.
The name of the configuration property is "jersey.config.server.tracing.type".
public static final String TRACING_THRESHOLD
X-Jersey-Tracing-Threshold
.
Allowed values:
SUMMARY
TRACE
VERBOSE
String
. The default value is "TRACE"
.
The name of the configuration property is "jersey.config.server.tracing.threshold".
TRACING
,
Constant Field Valuespublic static final String RESPONSE_SET_STATUS_OVER_SEND_ERROR
4xx
or 5xx
it is possible to choose between sendError
or
setStatus
on container specific Response
implementation. E.g. on servlet container Jersey
can call HttpServletResponse.setStatus(...)
or HttpServletResponse.sendError(...)
.
Calling sendError(...)
method usually resets entity, response headers and provide error page for
specified status code (e.g. servlet error-page
configuration).
However if you want to post-process response (e.g. by servlet filter) the only
way to do it is calling setStatus(...)
on container Response object.
If property value is true
the method Response.setStatus(...)
is used over default
Response.sendError(...)
.
Type of the property value is boolean
. The default value is false
.
The name of the configuration property is "jersey.config.server.response.setStatusOverSendError".
public static final String PROCESSING_RESPONSE_ERRORS_ENABLED
true
then the errors raised during response processing are tried to handled using available
response error mappers
.
Type of the property value is boolean
. The default value is false
.
The name of the configuration property is "jersey.config.server.exception.processResponseErrors".
public static final String SUBRESOURCE_LOCATOR_CACHE_SIZE
The default value is 64.
The name of the configuration property is "jersey.config.server.subresource.cache.size".
SUBRESOURCE_LOCATOR_DEFAULT_CACHE_SIZE
,
SUBRESOURCE_LOCATOR_CACHE_AGE
,
Constant Field Valuespublic static final int SUBRESOURCE_LOCATOR_DEFAULT_CACHE_SIZE
SUBRESOURCE_LOCATOR_CACHE_SIZE
,
Constant Field Valuespublic static final String SUBRESOURCE_LOCATOR_CACHE_AGE
Entry aging is not enabled by default.
The name of the configuration property is "jersey.config.server.subresource.cache.age".
SUBRESOURCE_LOCATOR_CACHE_SIZE
,
Constant Field Valuespublic static final String SUBRESOURCE_LOCATOR_CACHE_JERSEY_RESOURCE_ENABLED
true
then Jersey will cache Jersey resources
in addition to
caching sub-resource locator classes and instances (which are cached by default).
To make sure the caching is effective in this case you need to return same Jersey Resource instances for same input
parameters from resource method. This means that generating new Jersey Resource instances for same input parameters would
not have any performance effect and it would only fill-up the cache.
The default value is false
.
The name of the configuration property is "jersey.config.server.subresource.cache.jersey.resource.enabled".
public static final String LOCATION_HEADER_RELATIVE_URI_RESOLUTION_RFC7231
true
then Jersey will resolve relative URIs in the Location
http header against the
request URI according to RFC7231 (new HTTP Specification).
This behaviour violates the JAX-RS 2.0 specification (which dates older than RFC7231).
If LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED
is set to true
, value of this property is not taken
into account.
The default value is false
(JAX-RS 2.0 compliant).
The name of the configuration property is "jersey.config.server.headers.location.relative.resolution.rfc7231".
public static final String LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED
true
then Jersey will not attempt to resolve relative URIs in the Location
http header against the
request URI.
The default value is false
.
The name of the configuration property is "jersey.config.server.headers.location.relative.resolution.disabled".
public static <T> T getValue(Map<String,?> properties, String key, Class<T> type)
null
.T
- Type of the property value.properties
- Map of properties to get the property value from.key
- Name of the property.type
- Type to retrieve the value as.null
.public static <T> T getValue(Map<String,?> properties, String key, T defaultValue)
defaultValue
type,
the specified defaultValue
is returned. Calling this method is equivalent to calling
ServerProperties.getValue(properties, key, defaultValue, (Class<T>) defaultValue.getClass())
.T
- Type of the property value.properties
- Map of properties to get the property value from.key
- Name of the property.defaultValue
- Default value if property is not registerednull
.public static <T> T getValue(Map<String,?> properties, String key, T defaultValue, Class<T> type)
defaultValue
.T
- Type of the property value.properties
- Map of properties to get the property value from.key
- Name of the property.defaultValue
- Default value if property is not registeredtype
- Type to retrieve the value as.null
.public static <T> T getValue(Map<String,?> properties, RuntimeType runtimeType, String key, T defaultValue, Class<T> type)
defaultValue
.T
- Type of the property value.properties
- Map of properties to get the property value from.runtimeType
- Runtime type which is used to check whether there is a property with the same
key
but post-fixed by runtime type (.server
or .client
) which would override the key
property.key
- Name of the property.defaultValue
- Default value if property is not registeredtype
- Type to retrieve the value as.null
.Copyright © 2007-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.