java - How do you define and inject a bean with annotations in Spring Boot? -
my bean definition looks this:
@enablews @configuration public class webserviceconfig extends wsconfigureradapter { @bean public executorservice executorservice() { return executors.newfixedthreadpool(5); } }
i want use bean in class this:
@endpoint public class soapendpoint { @autowired private executorservice executor; }
is correct? i'm curious because output says injected instance has pool size of 0 instead of 5.
system.out.println(executor);
java.util.concurrent.threadpoolexecutor@1058b8a[running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
Comments
Post a Comment