Skip to content

Commit fffe64c

Browse files
Polish
1 parent fc0a719 commit fffe64c

File tree

1 file changed

+54
-57
lines changed

1 file changed

+54
-57
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,54 @@
1-
/*
2-
* Copyright 2013-2021 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
17-
package org.springframework.cloud.sleuth.autoconfig.instrument.batch;
18-
19-
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
20-
import org.springframework.beans.factory.BeanFactory;
21-
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
22-
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
23-
import org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration;
24-
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
25-
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
26-
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
27-
import org.springframework.cloud.sleuth.Tracer;
28-
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
29-
import org.springframework.context.annotation.Bean;
30-
import org.springframework.context.annotation.Configuration;
31-
32-
/**
33-
* {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
34-
* Auto-configuration} that registers instrumentation for Spring Batch.
35-
*
36-
* @author Marcin Grzejszczak
37-
* @since 3.1.0
38-
*/
39-
@Configuration(proxyBeanMethods = false)
40-
@ConditionalOnClass(JobBuilderFactory.class)
41-
@ConditionalOnBean(Tracer.class)
42-
@ConditionalOnProperty(value = "spring.sleuth.batch.enabled", matchIfMissing = true)
43-
@AutoConfigureAfter(BraveAutoConfiguration.class)
44-
@AutoConfigureBefore(BatchAutoConfiguration.class)
45-
public class TraceBatchAutoConfiguration {
46-
47-
@Bean
48-
static TraceJobBuilderFactoryBeanPostProcessor traceJobBuilderFactoryBeanPostProcessor(BeanFactory beanFactory) {
49-
return new TraceJobBuilderFactoryBeanPostProcessor(beanFactory);
50-
}
51-
52-
@Bean
53-
static TraceStepBuilderFactoryBeanPostProcessor traceStepBuilderFactoryBeanPostProcessor(BeanFactory beanFactory) {
54-
return new TraceStepBuilderFactoryBeanPostProcessor(beanFactory);
55-
}
56-
57-
}
1+
/*
2+
* Copyright 2013-2021 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.cloud.sleuth.autoconfig.instrument.batch;
18+
19+
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
20+
import org.springframework.beans.factory.BeanFactory;
21+
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
22+
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
23+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
24+
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
25+
import org.springframework.cloud.sleuth.Tracer;
26+
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
27+
import org.springframework.context.annotation.Bean;
28+
import org.springframework.context.annotation.Configuration;
29+
30+
/**
31+
* {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
32+
* Auto-configuration} that registers instrumentation for Spring Batch.
33+
*
34+
* @author Marcin Grzejszczak
35+
* @since 3.1.0
36+
*/
37+
@Configuration(proxyBeanMethods = false)
38+
@ConditionalOnClass(JobBuilderFactory.class)
39+
@ConditionalOnBean(Tracer.class)
40+
@ConditionalOnProperty(value = "spring.sleuth.batch.enabled", matchIfMissing = true)
41+
@AutoConfigureAfter(BraveAutoConfiguration.class)
42+
public class TraceBatchAutoConfiguration {
43+
44+
@Bean
45+
static TraceJobBuilderFactoryBeanPostProcessor traceJobBuilderFactoryBeanPostProcessor(BeanFactory beanFactory) {
46+
return new TraceJobBuilderFactoryBeanPostProcessor(beanFactory);
47+
}
48+
49+
@Bean
50+
static TraceStepBuilderFactoryBeanPostProcessor traceStepBuilderFactoryBeanPostProcessor(BeanFactory beanFactory) {
51+
return new TraceStepBuilderFactoryBeanPostProcessor(beanFactory);
52+
}
53+
54+
}

0 commit comments

Comments
 (0)