I am engaging the following problems:
Thanks BTW: sorry for confusing every one, it is a small project that only involve 5-10 classes.
There's definately nothing wrong with it. All higher level abstractions are based on sockets one way or another. Unless your project is sufficiently large there is no need to pull a series other frameworks/toolkit to perform the same job. Threads are cheap (and can even benefit from a multicore architecture), although using SelectableChannels
as @aioobe suggested is not a bad idea either.
When your projects require it, you can always learn about other inter-process communication methods (message passing, remote method invocaton etc., and its about 100 implementations) then.
You might however want to limit the number of threads you server use simultaneously. This can easily be achieved by claiming e.g., a semaphore of a size equal to the number of threads you want to serve. Another interesting thing to consider is using java thread pools to better reuse your resources.