can multiple processes access another class exclusively
i have three listener programs running in 3 consoles which listen to different queues.now i have a conection program which i call from my 3 listeners.the problem is that only 1 connection must be made at one time.i tried implementing the connection class as a singleton,but it doesnt work as the 3 listeners operate as 3 diff processes(my understanding).however if i implement all 3 listeners in 1 single program and start 1 program in console then the singleton works fine. so my question is is there a way i can synchronize the connection class from 3 listener programs running seperately in different consoles???
maybe my understanding is wrong.excuse me if it is.