[Solved] EventListener for Vectors?
I am currently working on a school project in which I am to create a working application of my choice. I've decided to create a chat-client/chat-server suite.
The setup is very easy: I run a chat-server on my computer at home, which handles all communication between the clients, as well as all specific commands (such as whois/pm's) and so on.
Now, my issue is as follows: My server creates a new serverThread for every accepted connection and places it into a Vector. The thread is then self-sufficient, so that if the socket is closed it'll automatically null itself and exit. However, this means that I have no possibility of tracking changes to the vector, and by extent no way of keeping track of connecting/disconnecting clients, which means I have no way of telling when to broadcast the users to the clients.
So, in short: Is there any event which is fired upon a variable change, and which I can apply to my vector? I can't find any inherited ones in the java documentation, but I'm sure there's some way to do it. Other solutions which give me the same functionality (easily managed variable and tracking) are obviously also acceptable.
With hopes of help,