The executor services passed in to withCachedThreadPool should be wrapper for submitting Work instances to the WorkManager.
You could run your server socket in a Work instance too - I probably would...
See http://www.ironjacamar.org/doc/userguide/1.1/en-US/html/ch01.html#overview for your outbound/inbound architecture.
Otherwise let us know more details about your setup - but read the above first.
Thanks for your response,
I launch the server in a Work instance but i don't know how wrap Thread of the ThreadPool with the wor instance.
The ThreadPool manage lifecycle of Threads. How to wrap all the states of the life cycle of the thread with the WorkManager.
Do you have an example of an NIO.2 implementation ?
No, do a wrapper class that implements the ExecutorService interface, and take a WorkManager instance in its constructor.
Then the methods uses the WorkManager to execute whatever is passed in.
I would start the ServerSocket in the ResourceAdapter::start() method...
I don't have any NIO.2 examples.