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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -