Hi, i need to implement a ErrorManager . Which is a singleton class . The client programs would register the listners of the expected Errors . I am storing all the listners in Vector . If listner for a particular error is registered it wont be added again . Now the problem is that if i have more than one client who register the same listner and one of then removes the listner then the listner gets removed . Is thre any thing that i can do to prevent that . Please suggest me something .
You should look at the java.util.Observer interface and the java.util.Observable class. In particular, Observable implements much of the logic you need here. I'm not entirely sure that it will completely solve your problem, but I think it would be worth your time looking into it.