Polish docs code
See gh-6313
This commit is contained in:
@@ -52,5 +52,5 @@ For Tomcat, the following configuration can be added:
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/actuator/cloudfoundry/customcontextpath/CloudFoundryCustomContextPathConfiguration.java[tag=*]
|
||||
include::{docs-java}/actuator/cloudfoundry/customcontextpath/CloudFoundryCustomContextPathConfiguration.java[]
|
||||
----
|
||||
|
||||
@@ -939,7 +939,7 @@ To replace the default metric tags, define a `MongoConnectionPoolTagsProvider` b
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/actuator/metrics/supported/mongodb/connectionpool/SampleConnectionPoolTagsProviderConfiguration.java[tag=*]
|
||||
include::{docs-java}/actuator/metrics/supported/mongodb/connectionpool/SampleConnectionPoolTagsProviderConfiguration.java[]
|
||||
----
|
||||
|
||||
To disable the auto-configured connection pool metrics, set the following property:
|
||||
@@ -1024,14 +1024,14 @@ To register custom metrics, inject `MeterRegistry` into your component, as shown
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/actuator/metrics/registeringcustom/MetricsMeterRegistryInjection.java[tag=*]
|
||||
include::{docs-java}/actuator/metrics/registeringcustom/MetricsMeterRegistryInjection.java[]
|
||||
----
|
||||
|
||||
If your metrics depend on other beans, it is recommended that you use a `MeterBinder` to register them, as shown in the following example:
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/actuator/metrics/registeringcustom/SampleMeterBinderConfiguration.java[tag=*]
|
||||
include::{docs-java}/actuator/metrics/registeringcustom/SampleMeterBinderConfiguration.java[]
|
||||
----
|
||||
|
||||
Using a `MeterBinder` ensures that the correct dependency relationships are set up and that the bean is available when the metric's value is retrieved.
|
||||
@@ -1049,7 +1049,7 @@ For example, if you want to rename the `mytag.region` tag to `mytag.area` for al
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/actuator/metrics/customizing/MetricsFilterConfiguration.java[tag=*]
|
||||
include::{docs-java}/actuator/metrics/customizing/MetricsFilterConfiguration.java[]
|
||||
----
|
||||
|
||||
NOTE: By default, all `MeterFilter` beans will be automatically bound to the Spring-managed `MeterRegistry`.
|
||||
|
||||
@@ -183,7 +183,7 @@ The following example shows how to use the `ConditionEvaluationReportLoggingList
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/features/developingautoconfiguration/testing/ConditionEvaluationReportTests.java[tag=*]
|
||||
include::{docs-java}/features/developingautoconfiguration/testing/ConditionEvaluationReportTests.java[]
|
||||
----
|
||||
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ For example, to use the `BufferingApplicationStartup`, you could write:
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/features/springapplication/startuptracking/MyApplication.java[tag=*]
|
||||
include::{docs-java}/features/springapplication/startuptracking/MyApplication.java[]
|
||||
----
|
||||
|
||||
The first available implementation, `FlightRecorderApplicationStartup` is provided by Spring Framework.
|
||||
|
||||
@@ -430,7 +430,7 @@ The following example shows how to manually override the database port while the
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/features/sql/r2dbc/CustomizeR2dbcPortConfiguration.java[tag=*]
|
||||
include::{docs-java}/features/sql/r2dbc/MyR2dbcPortConfiguration.java[]
|
||||
----
|
||||
|
||||
The following examples show how to set some PostgreSQL connection options:
|
||||
|
||||
@@ -908,7 +908,7 @@ You can call it with `key=value` strings, as follows:
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/features/testing/utilities/testpropertyvalues/MyEnvironmentTests.java[tag=*]
|
||||
include::{docs-java}/features/testing/utilities/testpropertyvalues/MyEnvironmentTests.java[]
|
||||
----
|
||||
|
||||
|
||||
|
||||
@@ -68,5 +68,5 @@ The following example shows one way to write such an exporter:
|
||||
|
||||
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
include::{docs-java}/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExport.java[tag=*]
|
||||
include::{docs-java}/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExport.java[]
|
||||
----
|
||||
|
||||
@@ -80,7 +80,7 @@ For instance, the following example loads a YAML configuration file from the cla
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/howto/application/customizetheenvironmentorapplicationcontext/MyEnvironmentPostProcessor.java[tag=*]
|
||||
include::{docs-java}/howto/application/customizetheenvironmentorapplicationcontext/MyEnvironmentPostProcessor.java[]
|
||||
----
|
||||
|
||||
TIP: The `Environment` has already been prepared with all the usual property sources that Spring Boot loads by default.
|
||||
|
||||
@@ -43,7 +43,7 @@ The following example shows how to create a data source by using a `DataSourceBu
|
||||
|
||||
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
include::{docs-java}/howto/dataaccess/configurecustomdatasource/BasicDataSourceConfiguration.java[tag=*]
|
||||
include::{docs-java}/howto/dataaccess/configurecustomdatasource/BasicDataSourceConfiguration.java[]
|
||||
----
|
||||
|
||||
To run an app with that `DataSource`, all you need is the connection information.
|
||||
@@ -84,7 +84,7 @@ The following example shows how create a `HikariDataSource` with `DataSourceBuil
|
||||
|
||||
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
include::{docs-java}/howto/dataaccess/configurecustomdatasource/SimpleDataSourceConfiguration.java[tag=*]
|
||||
include::{docs-java}/howto/dataaccess/configurecustomdatasource/SimpleDataSourceConfiguration.java[]
|
||||
----
|
||||
|
||||
You can even go further by leveraging what `DataSourceProperties` does for you -- that is, by providing a default embedded database with a sensible username and password if no URL is provided.
|
||||
@@ -94,7 +94,7 @@ To avoid that, you can redefine a custom `DataSourceProperties` on your custom n
|
||||
|
||||
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
include::{docs-java}/howto/dataaccess/configurecustomdatasource/ConfigurableDataSourceConfiguration.java[tag=*]
|
||||
include::{docs-java}/howto/dataaccess/configurecustomdatasource/ConfigurableDataSourceConfiguration.java[]
|
||||
----
|
||||
|
||||
This setup puts you _in sync_ with what Spring Boot does for you by default, except that a dedicated connection pool is chosen (in code) and its settings are exposed in the `app.datasource.configuration` sub namespace.
|
||||
@@ -131,7 +131,7 @@ In the following example, we provide the _exact_ same feature set as the auto-co
|
||||
|
||||
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
include::{docs-java}/howto/dataaccess/configuretwodatasources/SimpleDataSourcesConfiguration.java[tag=*]
|
||||
include::{docs-java}/howto/dataaccess/configuretwodatasources/SimpleDataSourcesConfiguration.java[]
|
||||
----
|
||||
|
||||
TIP: `firstDataSourceProperties` has to be flagged as `@Primary` so that the database initializer feature uses your copy (if you use the initializer).
|
||||
@@ -161,7 +161,7 @@ You can apply the same concept to the secondary `DataSource` as well, as shown i
|
||||
|
||||
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
include::{docs-java}/howto/dataaccess/configuretwodatasources/CompleteDataSourcesConfiguration.java[tag=*]
|
||||
include::{docs-java}/howto/dataaccess/configuretwodatasources/CompleteDataSourcesConfiguration.java[]
|
||||
----
|
||||
|
||||
The preceding example configures two data sources on custom namespaces with the same logic as Spring Boot would use in auto-configuration.
|
||||
@@ -255,7 +255,7 @@ This implementation provides the same table structure as Hibernate 4: all dots a
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/howto/dataaccess/configurehibernatenamingstrategy/CaseSensitiveSpringPhysicalNamingStrategyConfiguration.java[tag=*]
|
||||
include::{docs-java}/howto/dataaccess/configurehibernatenamingstrategy/CaseSensitiveSpringPhysicalNamingStrategyConfiguration.java[]
|
||||
----
|
||||
|
||||
If you prefer to use Hibernate 5's default instead, set the following property:
|
||||
@@ -289,7 +289,7 @@ Then, add a `HibernatePropertiesCustomizer` bean as shown in the following examp
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/howto/dataaccess/configurehibernatesecondlevelcaching/HibernateSecondLevelCacheConfiguration.java[tag=*]
|
||||
include::{docs-java}/howto/dataaccess/configurehibernatesecondlevelcaching/HibernateSecondLevelCacheConfiguration.java[]
|
||||
----
|
||||
|
||||
This customizer will configure Hibernate to use the same `CacheManager` as the one that the application uses.
|
||||
@@ -322,7 +322,7 @@ You can also reuse `JpaProperties` to bind settings for each `EntityManagerFacto
|
||||
|
||||
[source,java,pending-extract=true,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
include::{docs-java}/howto/dataaccess/usemultipleentitymanagers/CustomEntityManagerFactoryExample.java[tag=*]
|
||||
include::{docs-java}/howto/dataaccess/usemultipleentitymanagers/CustomEntityManagerFactoryConfiguration.java[]
|
||||
----
|
||||
|
||||
The example above creates an `EntityManagerFactory` using a `DataSource` bean named `firstDataSource`.
|
||||
@@ -413,7 +413,7 @@ For example, if you use Hibernate Search with Elasticsearch as its index manager
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/howto/dataaccess/configureacomponentthatisusedbyjpa/ElasticsearchEntityManagerFactoryDependsOnPostProcessor.java[tag=*]
|
||||
include::{docs-java}/howto/dataaccess/configureacomponentthatisusedbyjpa/ElasticsearchEntityManagerFactoryDependsOnPostProcessor.java[]
|
||||
----
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ The following example configures a 60 second connect timeout and adds a `ReadTim
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/howto/httpclients/webclientreactornettycustomization/CustomizeReactorNettyClientConfiguration.java[tag=*]
|
||||
include::{docs-java}/howto/httpclients/webclientreactornettycustomization/MyReactorNettyClientConfiguration.java[]
|
||||
----
|
||||
|
||||
TIP: Note the use of `ReactorResourceFactory` for the connection provider and event loop resources.
|
||||
|
||||
@@ -13,7 +13,7 @@ The `jersey.config.server.response.setStatusOverSendError` property must be set
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/howto/jersey/springsecurity/JerseySetStatusOverSendErrorConfig.java[tag=*]
|
||||
include::{docs-java}/howto/jersey/springsecurity/JerseySetStatusOverSendErrorConfig.java[]
|
||||
----
|
||||
|
||||
|
||||
|
||||
@@ -464,7 +464,7 @@ You can add an `org.apache.catalina.connector.Connector` to the `TomcatServletWe
|
||||
|
||||
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
include::{docs-java}/howto/webserver/enablemultipleconnectorsintomcat/TomcatMultipleConnectorsConfiguration.java[tag=*]
|
||||
include::{docs-java}/howto/webserver/enablemultipleconnectorsintomcat/TomcatMultipleConnectorsConfiguration.java[]
|
||||
----
|
||||
|
||||
|
||||
@@ -484,7 +484,7 @@ To switch to the `LegacyCookieProcessor`, use an `WebServerFactoryCustomizer` be
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{docs-java}/howto/webserver/usetomcatlegacycookieprocessor/LegacyCookieProcessorConfiguration.java[tag=*]
|
||||
include::{docs-java}/howto/webserver/usetomcatlegacycookieprocessor/LegacyCookieProcessorConfiguration.java[]
|
||||
----
|
||||
|
||||
|
||||
@@ -511,7 +511,7 @@ Add an `UndertowBuilderCustomizer` to the `UndertowServletWebServerFactory` and
|
||||
|
||||
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
include::{docs-java}/howto/webserver/enablemultiplelistenersinundertow/UndertowMultipleListenersConfiguration.java[tag=*]
|
||||
include::{docs-java}/howto/webserver/enablemultiplelistenersinundertow/UndertowMultipleListenersConfiguration.java[]
|
||||
----
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user