With that number of threads/requests you'll almost certainly need a thread pool.
I don't think there is some "official" JBoss API exposed for this kind of stuff, but you could use as starting points:
This is a re-usable simple thread pool implementation. It is used, for example, by:
which is the embedded JNDI naming server running within JBoss.
You'll need a basic undestanding of loading your own services in JBoss as MBeans, so read the 2nd chapter of the JBoss Documentation.
Usually, there is a lot of useful information in the wiki, as well, eg:
Thanx for the thread pool thing.... Little help with connection to the port part and integration of the service as a JBoss service would be highly appreciated ...
With 5000 simultaneous connections/threads, I guess you'll kill every os! This is why java NIO selector was introduced - you'll have a small thread pool (10) to handle the connections.
We will be implementing this as a clustered app ... i think that should be capable of that kind of load(5000 connections) ... any ideas ?
You need to clarify the reasons you want your application to be clustered. Clustering for high availability usually reduces performance due to state replication among cluster nodes. What you need is probably load balancing, but again you need to decide if there is any shared state. In many cases the whole thing depends on the access protocol (http, rmi, other?) and your use cases...
You may also want to have a look at the JBoss remoting framework.
For thread pool i suggest you to try
pool = Executors.newCachedThreadPool();
pool = Executors.newFixedThreadPool(poolSize);
You have to implement class Handler implements Runnable
serverSocket = new ServerSocket(port);
For network communication i also suggest you Jgroups 2