This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

unload applet fully

 
Chris Pat
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
Is it possible to fully unload an applet from its destroy fully? I need the second instantiation of the applet to be loaded de novo, as if for the first time, even if just the back button on the browser was click. Can I hook some shutdown hook to fully eliminate the applet from the browser cache, and make it start "virginally" the next activation in the same browser session, without loosing the browser session? tia.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would be the difference between executing the destroy method and "fully eliminating" the applet?
 
Chris Pat
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
What would be the difference between executing the destroy method and "fully eliminating" the applet?


It appears that it is still in the cache. I need to configure it to fully shutdown and restart the jvm, if possible without closing the browser. I know I can unload a SE application by hooking the shutdown hook and realize that is similar to destroy(), however I really want to restart the jvm in the browser.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there is a way to restart the JVM. It generally stays active until the browser is closed. And unless the client-side jar file cache is disabled, it would also reuse the applet jar file.

But why would that be a problem - does the applet use class initializers that do something different on each invocation, or make use of finalizers? If the former, could you move that code to object constructors or the applet's init method?
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!