Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » UICallback on closed browser revives session?(Advanced UICallback handling)
UICallback on closed browser revives session? [message #668384] Thu, 05 May 2011 13:54 Go to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
Hi!

I am experiencing some problems in UICallback management. I have a "timer", that triggers a method every 2 minutes.
UICallBack.activate(UUID.randomUUID().toString());
Job job = new Job("myJob") {

	@Override
	protected IStatus run(IProgressMonitor monitor) {
		System.out.println("PING");
		getDisplay().asyncExec(new Runnable() {

			@Override
			public void run() {
				System.out.println("PONG");

				/*
				 * do my things on UI
				 */

				schedule(120 * 1000);
			}
		});
		return Status.OK_STATUS;
	}
};
job.schedule(120 * 1000);

Within the dispose(); method I am deactivating the UICallback and canceling the job - so the "PING" never comes again.

But when the user just closes his browser the "PING" is still coming 1 time, without a following "PONG".
In first place I had the re-scheduling before the return-statement of the job. Then the "PING"-ing just never stops (2nd snippet).

My questions are:

(1) Do this never ending "PING"s (2nd snippet) keep the browser-session alive? I read a discussion in the forum which sounds like that. This would mean that the session-timeout would never get a grip and the session would stay forever.

http://www.eclipse.org/forums/index.php?t=msg&th=205041& amp; amp;start=0&S=5378487629550b0954119d989e6ce86d

(2) The 1st snippet just produces one last "PING" after the browser was closed. What happens with the runnable?
I found out that the run-method is never called. But somehow the insertion-process of the runnable seems to "stop" the session.
I tried:

UICallBack.activate(UUID.randomUUID().toString());
Job job = new Job("myJob") {

	@Override
	protected IStatus run(IProgressMonitor monitor) {
		System.out.println("PING");
		getDisplay().asyncExec(null);
		schedule(120 * 1000);
		return Status.OK_STATUS;
	}
};
job.schedule(120 * 1000);
This does not stop the session.
Endless "PING"s can be seen in the console, when the scheduling is done simply before the return-statement.

[Updated on: Fri, 06 May 2011 06:48]

Report message to a moderator

Re: UICallback on closed browser revives session? [message #668544 is a reply to message #668384] Fri, 06 May 2011 07:55 Go to previous message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
I analyzed it by myself. I configured a very short timeout via "Run configurations" and the effect was, that also the job kept running and re-scheduling, when the browser was closed, the session timeout did cut of the session.
So everything seems fine, except the thing that the job keeps running without any sense.

What is still keeping me suspicious are those never ending Runnables. What about them?

My 2nd snippet is a job, that re-schedules itself for shure. Given a closed browser every occuring job produces a async-Runnable thats code is never processed. What happens here?

My 1st snippet contains the re-scheduling within the async-Runnable. So here with a closed browser there is only 1 job occuring after the user closed the browser. This job tries to execute the async-Runnable. This is never processed and no further jobs are scheduled. But again: What happens with them?

Is the worst case that, given a long term session-timeout, my application (2nd snippet) produces endless amounts of still-waiting async-Runnables?

Best regards,
Bassspieler

[Updated on: Fri, 06 May 2011 08:10]

Report message to a moderator

Previous Topic:is rap runtime used plugin class
Next Topic:Progress Indicator
Goto Forum:
  


Current Time: Thu Apr 25 00:28:39 GMT 2024

Powered by FUDForum. Page generated in 0.03848 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top