Turned on checkstyle
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -22,10 +22,13 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
// @checkstyle:off
|
||||
@SpringBootApplication
|
||||
public class TaskApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(TaskApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
// @checkstyle:on
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -21,6 +21,7 @@ import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.reactivestreams.Publisher;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
@@ -31,8 +32,6 @@ import org.springframework.cloud.task.configuration.EnableTask;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
@@ -48,9 +47,9 @@ public class TaskConfiguration {
|
||||
@Bean
|
||||
public CommandLineRunner commandLineRunner(FunctionCatalog registry) {
|
||||
final Supplier<Publisher<Object>> supplier = registry.lookup(Supplier.class,
|
||||
properties.getSupplier());
|
||||
this.properties.getSupplier());
|
||||
final Function<Publisher<Object>, Publisher<Object>> function = registry
|
||||
.lookup(Function.class, properties.getFunction());
|
||||
.lookup(Function.class, this.properties.getFunction());
|
||||
final Consumer<Publisher<Object>> consumer = consumer(registry);
|
||||
CommandLineRunner runner = new CommandLineRunner() {
|
||||
|
||||
@@ -64,12 +63,13 @@ public class TaskConfiguration {
|
||||
|
||||
private Consumer<Publisher<Object>> consumer(FunctionCatalog registry) {
|
||||
Consumer<Publisher<Object>> consumer = registry.lookup(Consumer.class,
|
||||
properties.getConsumer());
|
||||
this.properties.getConsumer());
|
||||
if (consumer != null) {
|
||||
return consumer;
|
||||
}
|
||||
Function<Publisher<Object>, Publisher<Void>> function = registry.lookup(Function.class,
|
||||
properties.getConsumer());
|
||||
Function<Publisher<Object>, Publisher<Void>> function = registry
|
||||
.lookup(Function.class, this.properties.getConsumer());
|
||||
return flux -> Mono.from(function.apply(flux)).subscribe();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -31,7 +31,7 @@ public class TaskConfigurationProperties {
|
||||
private String consumer;
|
||||
|
||||
public String getSupplier() {
|
||||
return supplier;
|
||||
return this.supplier;
|
||||
}
|
||||
|
||||
public void setSupplier(String supplier) {
|
||||
@@ -39,7 +39,7 @@ public class TaskConfigurationProperties {
|
||||
}
|
||||
|
||||
public String getFunction() {
|
||||
return function;
|
||||
return this.function;
|
||||
}
|
||||
|
||||
public void setFunction(String function) {
|
||||
@@ -47,10 +47,11 @@ public class TaskConfigurationProperties {
|
||||
}
|
||||
|
||||
public String getConsumer() {
|
||||
return consumer;
|
||||
return this.consumer;
|
||||
}
|
||||
|
||||
public void setConsumer(String consumer) {
|
||||
this.consumer = consumer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user