java - POJO Property change listener - Ideal way -
I am developing a REST based web application that uses asynchronous third for some data (using websites) The system will call. So the browser -> rest -> my webpages -> other apps -> my webpage-> browser communication between my webpage for other web apps is asynchronous and I can track responses to a request using only some identifiers I am Therefore, I will call & lt; Counter & gt; Request and response & lt; Counter & gt; Response will be , where both the counter will be the same. To map the answer to the request, I am setting a command, counter, flag with a bean. I keep a loop for a while, whether it is setting the flag or not, it keeps on checking. Once I receive a response, set the flag, while the loop leaves and I know that the data is available. Is this the right way? The class is set to be below the bean, Public Zero set AllProperties () {bean.setCommand (commandString); Bean.setCounter (counter); Bean.hasResponse (wrong); } Sni...