How to call a method from a certain java thread
<p>currently I am working on java client/server chat app and got one question, I'll try to explain as clear as possible</p>

<p>My server part keeps creating threads (new ServerThread) for each user who comes online</p>

<pre><code>while (isRunning) {
    Socket socket = serverSocket.accept();
    DataOutputStream dout = new DataOutputStream(socket.getOutputStream());
    outputStreams.put(socket, dout);
    System.out.println (outputStreams.values());
    new ServerThread(this, socket); 
    window.newConnectionInfo(socket);// informace
}
</code></pre>

<p>I have a getter method in a ServerThread class, which I want to call from the certain ServerThread instance based on socket. But ServerThread class isn't assigned to any variable, so I don't know exactly how to call methods from it. Any solution on that?</p>
