I'm new to OSGI and working on such project that runs on websphere. I have a simple scheduler, I used java.util.concurrent.ScheduledExecutorService like so:
private ScheduledExecutorService scheduler;
...
scheduler = Executors.newScheduledThreadPool(corePoolSize);
since my application is running inside a container(WebSphere) I though it will be better to let the container manage the threads, so I wanted to use:
scheduler = Executors.newScheduledThreadPool(corePoolSize, threadFactory);
were threadFactory will be injected in the blueprint from the container.
I've looked around and could not find an example of how it can be done. So my question is, how can it be done and is it worth the effort at all?