Class CommonProperties
- Author:
- Michal Gajdos, Libor Kramolis
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Property which allows (if true) default System properties configuration provider.static final String
Iftrue
then disable feature auto discovery globally on client/server.static final String
Client-specific version ofFEATURE_AUTO_DISCOVERY_DISABLE
.static final String
Server-specific version ofFEATURE_AUTO_DISCOVERY_DISABLE
.static final String
Allows API services loading.static final String
Iftrue
then disable configuration of Json Binding (JSR-367) feature.static final String
Disables configuration of Json Binding (JSR-367) feature forApplication
subclasses whose package names are specified as a value.static final String
Client-specific version ofJSON_BINDING_FEATURE_DISABLE
.static final String
Server-specific version ofJSON_BINDING_FEATURE_DISABLE
.static final String
Comma separated list of jackson modules which shall be excluded from json-jackson processing.static final String
Client-specific version ofJSON_JACKSON_DISABLED_MODULES
.static final String
Server-specific version ofJSON_JACKSON_DISABLED_MODULES
.static final String
Comma separated list of jackson modules which are only enabled (only those modules will be used) for json-jackson processingstatic final String
Client-specific version ofJSON_JACKSON_ENABLED_MODULES
.static final String
Server-specific version ofJSON_JACKSON_ENABLED_MODULES
.static final String
Iftrue
then disable configuration of Json Processing (JSR-353) feature.static final String
Client-specific version ofJSON_PROCESSING_FEATURE_DISABLE
.static final String
Server-specific version ofJSON_PROCESSING_FEATURE_DISABLE
.static final String
Iftrue
then disable META-INF/services lookup globally on client/server.static final String
Client-specific version ofMETAINF_SERVICES_LOOKUP_DISABLE
.static final String
Server-specific version ofMETAINF_SERVICES_LOOKUP_DISABLE
.static final String
Iftrue
then disable configuration of MOXy Json feature.static final String
Client-specific version ofMOXY_JSON_FEATURE_DISABLE
.static final String
Server-specific version ofMOXY_JSON_FEATURE_DISABLE
.static final String
An integer value that defines the buffer size used to buffer the outbound message entity in order to determine its size and set the value of HTTP "Content-Length" header.static final String
Client-specific version ofOUTBOUND_CONTENT_LENGTH_BUFFER
.static final String
Server-specific version ofOUTBOUND_CONTENT_LENGTH_BUFFER
.static final String
Force theParamConverter
to throwIllegalArgumentException
as mandated in javadoc.static final String
Disable some of the default providers from being loaded.static String
Defines theThreadFactory
to be used by internal default Executor Services.static String
Defines whether the virtual threads should be used by Jersey on JDK 21+ when not using an exact number of threads byFixedThreadPool
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Get the value of the specified property.static <T> T
getValue
(Map<String, ?> properties, RuntimeType runtime, String propertyName, T defaultValue) Get the value of the specified property.static <T> T
getValue
(Map<String, ?> properties, RuntimeType runtime, String propertyName, T defaultValue, Class<T> type) Get the value of the specified property.static <T> T
Get the value of the specified property.static <T> T
Get the value of the specified property.
-
Field Details
-
ALLOW_SYSTEM_PROPERTIES_PROVIDER
Property which allows (if true) default System properties configuration provider. If an external properties provider is used, the system properties are not used. Shall be set to turn on the ability to propagate system properties to Jersey configuration.- Since:
- 2.29
- See Also:
-
FEATURE_AUTO_DISCOVERY_DISABLE
Iftrue
then disable feature auto discovery globally on client/server.By default, auto discovery is automatically enabled. The value of this property may be overridden by the client/server variant of this property.
The default value is
false
.The name of the configuration property is "jersey.config.disableAutoDiscovery".
- See Also:
-
FEATURE_AUTO_DISCOVERY_DISABLE_CLIENT
Client-specific version ofFEATURE_AUTO_DISCOVERY_DISABLE
. If present, it overrides the generic one for the client environment.- Since:
- 2.8
- See Also:
-
FEATURE_AUTO_DISCOVERY_DISABLE_SERVER
Server-specific version ofFEATURE_AUTO_DISCOVERY_DISABLE
. If present, it overrides the generic one for the server environment.- Since:
- 2.8
- See Also:
-
JSON_BINDING_FEATURE_DISABLE
Iftrue
then disable configuration of Json Binding (JSR-367) feature.By default, Json Binding is automatically enabled. The value of this property may be overridden by the client/server variant of this property.
The default value is
false
.The name of the configuration property is "jersey.config.disableJsonBinding".
- Since:
- 2.45
- See Also:
-
JSON_BINDING_FEATURE_DISABLE_CLIENT
Client-specific version ofJSON_BINDING_FEATURE_DISABLE
. If present, it overrides the generic one for the client environment.- Since:
- 2.45
- See Also:
-
JSON_BINDING_FEATURE_DISABLE_SERVER
Server-specific version ofJSON_BINDING_FEATURE_DISABLE
. If present, it overrides the generic one for the server environment.- Since:
- 2.45
- See Also:
-
JSON_BINDING_FEATURE_DISABLE_APPLICATION
Disables configuration of Json Binding (JSR-367) feature forApplication
subclasses whose package names are specified as a value. The value is comma-separated string defining prefixes of the application package names.By default, Json Binding is automatically enabled.
The name of the configuration property is "jersey.config.application.disableJsonBinding".
- Since:
- 2.45
- See Also:
-
JSON_PROCESSING_FEATURE_DISABLE
Iftrue
then disable configuration of Json Processing (JSR-353) feature.By default, Json Processing is automatically enabled. The value of this property may be overridden by the client/server variant of this property.
The default value is
false
.The name of the configuration property is "jersey.config.disableJsonProcessing".
- See Also:
-
JSON_PROCESSING_FEATURE_DISABLE_CLIENT
Client-specific version ofJSON_PROCESSING_FEATURE_DISABLE
. If present, it overrides the generic one for the client environment.- Since:
- 2.8
- See Also:
-
JSON_PROCESSING_FEATURE_DISABLE_SERVER
Server-specific version ofJSON_PROCESSING_FEATURE_DISABLE
. If present, it overrides the generic one for the server environment.- Since:
- 2.8
- See Also:
-
METAINF_SERVICES_LOOKUP_DISABLE
Iftrue
then disable META-INF/services lookup globally on client/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.disableMetainfServicesLookup".
- Since:
- 2.1
- See Also:
-
METAINF_SERVICES_LOOKUP_DISABLE_CLIENT
Client-specific version ofMETAINF_SERVICES_LOOKUP_DISABLE
. If present, it overrides the generic one for the client environment.- Since:
- 2.8
- See Also:
-
METAINF_SERVICES_LOOKUP_DISABLE_SERVER
Server-specific version ofMETAINF_SERVICES_LOOKUP_DISABLE
. If present, it overrides the generic one for the server environment.- Since:
- 2.8
- See Also:
-
MOXY_JSON_FEATURE_DISABLE
Iftrue
then disable configuration of MOXy Json feature.By default, MOXy Json is automatically enabled. The value of this property may be overridden by the client/server variant of this property.
The default value is
false
.The name of the configuration property is "jersey.config.disableMoxyJson".
- See Also:
-
MOXY_JSON_FEATURE_DISABLE_CLIENT
Client-specific version ofMOXY_JSON_FEATURE_DISABLE
. If present, it overrides the generic one for the client environment.- Since:
- 2.8
- See Also:
-
MOXY_JSON_FEATURE_DISABLE_SERVER
Server-specific version ofMOXY_JSON_FEATURE_DISABLE
. If present, it overrides the generic one for the server environment.- Since:
- 2.8
- See Also:
-
OUTBOUND_CONTENT_LENGTH_BUFFER
An integer value that defines the buffer size used to buffer the outbound message entity in order to determine its size and set the value of HTTP "Content-Length" header.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.
The value of this property may be overridden by the client/server variant of this property by defining the suffix to this property ".server" or ".client" ("jersey.config.contentLength.buffer".server or "jersey.config.contentLength.buffer".client).The default value is 8192.
The name of the configuration property is "jersey.config.contentLength.buffer".
- See Also:
-
OUTBOUND_CONTENT_LENGTH_BUFFER_CLIENT
Client-specific version ofOUTBOUND_CONTENT_LENGTH_BUFFER
. If present, it overrides the generic one for the client environment.- Since:
- 2.8
- See Also:
-
OUTBOUND_CONTENT_LENGTH_BUFFER_SERVER
Server-specific version ofOUTBOUND_CONTENT_LENGTH_BUFFER
. If present, it overrides the generic one for the server environment.- Since:
- 2.8
- See Also:
-
PROVIDER_DEFAULT_DISABLE
Disable some of the default providers from being loaded. The following providers extend application footprint by XML dependencies, which is too heavy for native image, or by AWT which may possibly be not available by JDK 11 desktop:- jakarta.activation.DataSource
- java.awt.image.RenderedImage
- javax.xml.transform.Source
- javax.xml.transform.dom.DOMSource
- javax.xml.transform.sax.SAXSource
- javax.xml.transform.stream.StreamSource
DATASOURCE, DOMSOURCE, RENDEREDIMAGE, SAXSOURCE, SOURCE, STREAMSOURCE
, or to disable all:ALL
. Multiple options can be disabled by adding multiple comma separated values.- Since:
- 2.30
- See Also:
-
JAXRS_SERVICE_LOADING_ENABLE
Allows API services loading. If absent or true JAXRS services loading is allowed. Services shall implement Feature or DynamicFeature interface and be listed as SPI in user's application.- Since:
- 2.35
- See Also:
-
JSON_JACKSON_ENABLED_MODULES
Comma separated list of jackson modules which are only enabled (only those modules will be used) for json-jackson processing- Since:
- 2.36
- See Also:
-
JSON_JACKSON_ENABLED_MODULES_CLIENT
Client-specific version ofJSON_JACKSON_ENABLED_MODULES
. If present, it overrides the generic one for the client environment.- Since:
- 2.36
- See Also:
-
JSON_JACKSON_ENABLED_MODULES_SERVER
Server-specific version ofJSON_JACKSON_ENABLED_MODULES
. If present, it overrides the generic one for the server environment.- Since:
- 2.36
- See Also:
-
JSON_JACKSON_DISABLED_MODULES
Comma separated list of jackson modules which shall be excluded from json-jackson processing. the JaxbAnnotationModule is always excluded (cannot be configured).- Since:
- 2.36
- See Also:
-
JSON_JACKSON_DISABLED_MODULES_CLIENT
Client-specific version ofJSON_JACKSON_DISABLED_MODULES
. If present, it overrides the generic one for the client environment.- Since:
- 2.36
- See Also:
-
JSON_JACKSON_DISABLED_MODULES_SERVER
Server-specific version ofJSON_JACKSON_DISABLED_MODULES
. If present, it overrides the generic one for the client environment.- Since:
- 2.36
- See Also:
-
PARAM_CONVERTERS_THROW_IAE
Force the
ParamConverter
to throwIllegalArgumentException
as mandated in javadoc. Must be convertible toBoolean
value.Internally the
Exception
is caught by Jersey and usually converted tonull
. Therefore, the default value is set tofalse
to speed-up the conversion.The name of the configuration property is "jersey.config.paramconverters.throw.iae".
- Since:
- 2.40
- See Also:
-
THREAD_FACTORY
Defines the
ThreadFactory
to be used by internal default Executor Services.The default is
Executors.defaultThreadFactory()
on platform threads andThread.ofVirtual().factory()
on virtual threads.- Since:
- 3.1.7
-
USE_VIRTUAL_THREADS
Defines whether the virtual threads should be used by Jersey on JDK 21+ when not using an exact number of threads by
FixedThreadPool
.The default is
false
for this version of Jersey.- Since:
- 3.1.7
-
-
Method Details
-
getValue
Get the value of the specified property. If the property is not set or the actual property value type is not compatible with the specified type, the method will returnnull
.- Parameters:
properties
- Map of properties to get the property value from.propertyName
- Name of the property.type
- Type to retrieve the value as.- Returns:
- Value of the property or
null
. - Since:
- 2.8
-
getValue
Get the value of the specified property. If the property is not set or the real value type is not compatible withdefaultValue
type, the specifieddefaultValue
is returned. Calling this method is equivalent to callingCommonProperties.getValue(properties, key, defaultValue, (Class<T>) defaultValue.getClass())
- Type Parameters:
T
- Type of the property value.- Parameters:
properties
- Map of properties to get the property value from.propertyName
- Name of the property.defaultValue
- Default value if property is not registered- Returns:
- Value of the property or
null
. - Since:
- 2.8
-
getValue
public static <T> T getValue(Map<String, ?> properties, RuntimeType runtime, String propertyName, T defaultValue) Get the value of the specified property. If the property is not set or the real value type is not compatible withdefaultValue
type, the specifieddefaultValue
is returned. Calling this method is equivalent to callingCommonProperties.getValue(properties, runtimeType, key, defaultValue, (Class<T>) defaultValue.getClass())
- Type Parameters:
T
- Type of the property value.- Parameters:
properties
- Map of properties to get the property value from.runtime
- Runtime type which is used to check whether there is a property with the samekey
but post-fixed by runtime type (.server or.client
) which would override thekey
property.propertyName
- Name of the property.defaultValue
- Default value if property is not registered- Returns:
- Value of the property or
null
. - Since:
- 2.8
-
getValue
public static <T> T getValue(Map<String, ?> properties, RuntimeType runtime, String propertyName, T defaultValue, Class<T> type) Get the value of the specified property. If the property is not set or the real value type is not compatible with the specified value type, returnsdefaultValue
.- Type Parameters:
T
- Type of the property value.- Parameters:
properties
- Map of properties to get the property value from.runtime
- Runtime type which is used to check whether there is a property with the samekey
but post-fixed by runtime type (.server or.client
) which would override thekey
property.propertyName
- Name of the property.defaultValue
- Default value if property is not registeredtype
- Type to retrieve the value as.- Returns:
- Value of the property or
null
. - Since:
- 2.8
-
getValue
public static <T> T getValue(Map<String, ?> properties, RuntimeType runtime, String propertyName, Class<T> type) Get the value of the specified property. If the property is not set or the actual property value type is not compatible with the specified type, the method will returnnull
.- Type Parameters:
T
- Type of the property value.- Parameters:
properties
- Map of properties to get the property value from.runtime
- Runtime type which is used to check whether there is a property with the samekey
but post-fixed by runtime type (.server or.client
) which would override thekey
property.propertyName
- Name of the property.type
- Type to retrieve the value as.- Returns:
- Value of the property or
null
. - Since:
- 2.8
-