Hi, Jeansonne,
What you may wish to do is review the URL below. It has the description of that method.
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html
You should be aware that when you call that, you are creating an executor, with a single thread. The executor is expecting some workloads to be pushed into it (your yodlee runnables). Although I am not familiar with the use of BVServices (???), it looks like you are calling a RESTful service and that RESTful service is then starting this singleton thread pool. Is that correct?
That being the case, you may wish to add some kind of termination strategy. Assuming it is good practice to start a thread pool inside the server (I may be out of the loop on this one--it is not considered good practice for
EJB servers, but you have a
Servlet runner, here), you could add another method to call the shutdown method. In that case, you might need a singleton holding a statically-defined reference to the returned object.
Further, one parameter for these factory methods is a thread factory.
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadFactory.html
You may be able to specify a thread that is a "Daemon" thread. It may allow Tomcat to kill the threads from the thread pool.
That being said, I would not try and make this happen, if there was an alternative defined by the technology. I would try and find out if your chosen RESTful technology does support asynchronous processing. Jersey has a documented mechanism for doing this, as below. Unfortunately, it requires the client to await the return (it just makes the server processing faster).
https://jersey.java.net/documentation/latest/async.html
Of course, if you are using some other RESTful implementation (such as RESTEasy), you will need to find out how or if that works.
I just recently implemented a RESTful service that does very heavy (several hours) of processing. I do not want my client waiting on that. When I run this, it is submitted via JMS to an MDB. There's your muti-threading, and there is the asynchronous aspect. I am not saying that is necessarily what you need, but it may help.