I want to do a standalone client-server application using multi threading. My client constantly checks for updates from the server. Meanwhile, my server is waiting for updates as well from some utility which uses a timer to determine when to change the update.
Here's how I did it:
I have a Rate object, with a rateStatus attribute, and a statusChanged method. I used the Thread's name to represent the status.
1) I have a Main program, which does starting of the two threads:
2) My ClientJob which gets the Rate Status
3) My ServerJob which just updates the RateStatus after some seconds:
4) and a Bank Util code where the rate in question actually resides.
... it's already OK (I think..) except that my Client thread is not notified everytime I run main. My output is like this:
I want my Client thread to be notified for every status change.. But how come my client thread doesn't recognize the notify because it prints only the last status..
I want my output to be like this:
But it seems that the Client Thread runs after the server thread run..
I hope you can help me with this. Thank you!
SCJP/OCPJP 6 | SCWCD/OCPJWCD 5 | OCMJEA in progress...