Adapter is still alive after page close?

Hello,

we have a fundamental question about Adapter and Page interaction. It seems that Adapter stays “alive” after page closing. How we can handle it?

We have following situation - we are using a callback interface to display current state of external system. On the callback we are calling a pushlet to refresh the window. It looks like we are still receiving callbacks for already closed pages. That leads of course to exceptions. What is the right way of handling the situation? At the moment we are releasing the callback in Adapter.finalize() method. This seems to be to late.

The questions are

  1. Where is the right place to perform finalization and cleaning of all used instances (assuming that session should be closed if window is closed)?
  2. How to check in a method within Adapter that the window does not exist anymore?

Thank you in advance,
Regards,
Roman

Hello? Anyone? Page closing handling?..
The question is very important for us.

…I will have a look on that by this evening. OK?..

Yes, thank you!
I expect the solution will not be to complicated, isn’t it?
For us is important to close the task till Wednesday.

Thanks once again.

Hi Roman,

just overwrite method…

  • public void destroy() { /* cleanup here */ }

…within your page adapter. Method is called when…

  • User session is terminating (eg Browser window is closed)
  • The sub session is closed (eg User is closing an activity within the workplace)
  • App. driven termination (eg. a call of method “markThisSubsessionForDestroy” or “markThisAdapterForDestroy”)

Within documentation "Details on Session Management
" may be of interest. Hope it helps!

Martin

Thanks, it helped indeed!