Wednesday, September 7, 2011

multithreading in Jetty(not exactly what I mean)

Hi. I'm a newbie in GWT and my JAVA skills aren't to good as well.

In order to learn these technologies I'm trying to implement an e-mail
client.

Time needed to get all messages (say: 200) from mail-server is quite
long (using pop3). My solution looks like that:

User puts access data in configuration box, afterthat client requests
server to download all messages to server-side database .

mailAsync.getMailsSubjectsToDB(accessData ,
toDBcallback);

At the same time client sends another request in order to get already
downloaded messages - client repeats this until all messages from mail-
server are in database (it's being stoped by toDBcallback's
onSuccess() method).

refreshTimer = new Timer(){
@Override
public void run(){
AsyncCallback<ArrayList<EmailItem>> callbackNewMails = new
AsyncCallback<ArrayList<EmailItem>>(){

@Override
public void onFailure(Throwable caught) {
.....
}
@Override
public void onSuccess(ArrayList<EmailItem> result) {
EmailItems.addNewMails(result);
update(result.size());
}
};

mailAsync2.getMailsSubjects(callbackNewMails);
}
}; refreshTimer.scheduleRepeating(2500);


However in practice, these two methods don't run concurrently. First
mailAsync2.getMailsSubjects(callbackNewMails) call is oporeted just
after all messages are loaded into database.

So here's the question: Do I have to use threads in the server-side
code, or is there any other server that's got built-in threads
management?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate