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