You could configure the session bean so that it is in a pool with a strict maximum size of 1.
That way you will never get more than one client calling the session bean.
If you look at the 'Free Docos' to the right you should get access to the administrators and developers guide which describes configuring the container.
Thanks. Can this be done for one particular session bean and not the others?
Yes this can be done for just one session bean.
In your JBoss.xml you define the new container configuration probably by extending an existing config. For the bean concerned you specify that it should use the new config instead of the existing config.
Thanks. Can you synchronize within a class that the session bean uses? For example, the session bean calls class B. Is it possible to do the synch within the class B and not inside the session bean?
You should probably wrap the class with it's own session bean if that is what you are trying to achieve.
reading the words "session bean", "synchronized", "socket" and "singleton" in one posting is scaring me a bit ;-)
Since the singleton (and therefore the synchronisation) depends on the deployment (a singleton is a singleton for a specific ClassLoader) i won't rely on this.
I recommend using a real singleton with synchronisation by implementing a MBean which does the socket things. The session bean calls the MBean and you don't have to deal with "a single instance session bean"