java - Remotely get notifications in order to update a progress monitor -


i have complex application containing server , frontend part.

i trying in frontend part update progress monitor according action takes place in server part. action server part called remotely frontend. having trouble getting notifications real time update monitor.

my code structure looks this:

class frontend_class1{        public void method {           list<string> strings = initializestrings();           progressmonitor.begingtask("", noofsteps);           reponse = frontend_class2.method2(strings);           progressmonitor.worked(1);        }  class frontend_class2{        public responsetype method2(list<string> strings){           serverclassremote remote = new serverclassremote();           response = remote.servermethod(strings);           return response;        }  class server_class{        public servermethod(list<string> strings){           othermethod(strings);        }        public othermethod(list<string> strings){           someothermethod(strings);        }        public someothermethod(list<string> strings){           (string s:strings){               dosomethingwithstring(s);               setstatus(true);           }        }        public setstatus(boolean status){           myvar = status;        }        public boolean getstatus(){           return status;        } 

my intention send notification frontend server side, progress monitor updated 1 each time string done with.

that why included status methods: ask frontend status is, in separate thread running, theoretically, simultaneously other method (servermethod) , resetting status. this:

new thread(new runnable() {             public void run() {                 if (remote.getchanged()) {                     remote.setchanged(false);                 }             }         }).start(); 

but don't run concurrently. how status each time string list finished can update progress monitor?

instead of setting status someothermethod send update report new thread front end. if not have way of sending update yet need have fornt_end run kind of server receive @ least these messages. maybe rmi, should easy enough implement.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -