From 295b46b57f5ac7599f074b20fb1056afefeb6e55 Mon Sep 17 00:00:00 2001 From: salaboy Date: Mon, 4 Jul 2022 11:26:31 +0100 Subject: [PATCH] adding config required for SpringBoot --- docs/documentation/use-samples.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/documentation/use-samples.md b/docs/documentation/use-samples.md index 54947834bf..42fbfacfe8 100644 --- a/docs/documentation/use-samples.md +++ b/docs/documentation/use-samples.md @@ -54,7 +54,7 @@ public class Runner { public static void main(String[] args) { Operator operator = new Operator(DefaultConfigurationService.instance()); - operator.register(new WebServerController()); + operator.register(new WebPageReconciler()); operator.start(); } } @@ -214,6 +214,28 @@ public class Application { } ``` +You will also need a `@Configuration` to make sure that your reconciler is registered: + +```java + +@Configuration +public class Config { + + @Bean + public WebPageReconciler customServiceController() { + return new WebPageReconciler(); + } + + @Bean(initMethod = "start", destroyMethod = "stop") + @SuppressWarnings("rawtypes") + public Operator operator(List controllers) { + Operator operator = new Operator(); + controllers.forEach(operator::register); + return operator; + } +} +``` + #### Spring Boot test support Adding the following dependency would let you mock the operator for the tests where loading the spring container is