JavaScript ClassLoader and Hotspot

If you are familiar with Java debugging, you must know there is a technology called “Hotspot“. One feature of Hotspot is to replace old classes bytecodes with a new ones that are generated by dynamic compilers. This feature helps developers a lot in debugging. That is to say, when a developer load a very complex application in debugging mode, he want to modify the sources a little, he can just do it, the compiler will compile those related classes and notify classloader to load those affected classes bytecodes. And the modified codes are on effects. It saves lots of time by avoiding closing, reopening and waiting big applications again and again. This is very convenient when comparing to those static compiled applications written by C or C++ languages.

OK, now comes to JavaScript classloader and Hotspot technologies. JavaScript classloader technology are already proved by Java2Script. You can load JavaScript classes on demands, and using SCRIPT in asynchronous mode or XMLHttpRequest (XHR) in synchronous or asynchronous modes. And these days, Java2Script is also implementing JavaScript’s Hotspot technology (Not released publicly at the time of this writing, but you can check Java2Script out from SVN repository right now using its 3.3 compiler branch.). Such JavaScript Hotspot technology is not complicate, because JavaScript is already a very robust and convenient language to do so. All Java2Script implementation is to clean those classes’ declaration inside JavaScript class inheritance system simulator. And then reload the *.js using Java2Script’s classloader. In the implementation, classloader does not change class or object’s prototype when a reloaded class is redefined, it’s possible to keep all classes relationships without breaking those already instantiated instances.

To trigger Java2Script class simulator to Hotspot swapping, there is a thread trying to load an updating JavaScript classes list from Java2Script compiler in Eclipse. Its work is simple, just trying to load<session>.js. And the server listening on default port 1725 is started by Java2Script compiler, called “Java2Script Inner Hotspot Server (J2SIHS)”. When a compiling occurs, compiler will notify this server that a class is updated, and the server will add the information to the list. Once a JavaScript request arrives, it will send out the list according to the request session id. And when the JavaScript client thread gets the updated classes list, it will try to unload related classes and reload them. That is the rough procedure of Java2Script Hotspot technology.

By using Hotspot, I think it is much more convenient for me to develop JavaScript RIA in Java codes than before, especially in developing SWT applications.

This entry was posted in Architecture. Bookmark the permalink.

29 Responses to JavaScript ClassLoader and Hotspot

  1. Aw, this was a very nice post. Finding the time and actual effort to create a good article… but what can I say… I hesitate a lot and never seem to get nearly anything done.

  2. Еволюц?я розум?ння кл?н?чно? рол? у пац?ент?в з АГ.

  3. nike klader says:

    ?html 01 Jun 2014 02:18 43K webhits 201406.

  4. Hogan Skor says:

    ?br: Sites semelhantes, como nsassuncao.

  5. ?программы и игры Оргтехника и канцтовары Автомобильные товары Туристические товары Спортивные товары КУПИТЬ РаспродажаНизкие цены и бесплатная доставка по Америке.

  6. mbt sverige says:

    The good news is that most LASIK complications resolve relatively quickly after surgery.

  7. nike dam says:

    To Pacy, campers could do nothing wrong, and what we did wrong, he forgave us with white haired endearment.

  8. Из 13 потерпевших в суд явились только девять.

  9. 😀 Humor: *CRAZY*Subject: Re: yek tarfand jaleb nimbuzz Fri Sep 06, 2013 12:11 pm ChiO Copy kOniM.

  10. 服务宗旨:现金支付、价格合理、信守承诺、安全快捷 、高效、并严格为客户保密.

  11. billigt mbt says:

    Doing so lets you come through by riding straight ahead at the same speed you’ve been riding.

  12. s basketball team to a key road victory over Case.

  13. nike rea says:

    log 12 Jun 2014 05:19 43k access_140613.

  14. V??i Ng?i thì ta có thê? mang theo vài tép to?i bên mình khi ?i ????ng xa ?ê? tránh bi? ke? x??u ha?i 27.

  15. rea nike says:

    Some frames are heavy, though you can buy lightweight frames.

  16. nike 60 skor says:

    ?Is Being Overweight a Problem for LASIK.

  17. Salt is brittle, but, unlike wheat, also very hard.

  18. Около 50 человек в “ЛНР” пополнят незаконное вооруженное формирование “Призрак”, возглавляемое Алексеем Мозговым.

  19. Barry says:

    You will be satisfied using error information, in the event
    you try to achieve the school website anytime soon. and contains a bunch of provides under his strip|contains a ton of provides
    under his strip and is 27 It simply will be the movie that offers the regard they
    contains been employed by his complete career and deserves to Ryan Reynolds.

  20. I must thank you for the efforts you’ve put in penning this site.

    I’m hoping to view the same high-grade content from you
    in the future as well. In fact, your creative writing
    abilities has inspired me to get my own, personal site now 😉

  21. site says:

    There are books, home study courses, workshops and other means of information, to gain the knowledge required to become the alpha leader.

    At the moment, it is assumed that Google are working on creating the ‘full’ version of this to launch sometime in the near future.
    When advertising in an ezine, you place your advert in ezine
    that of the same or similar niche with what you are offering
    in your site.

    excellent submit, very informative. I wonder why the opposite experts of this sector do not
    understand this. You must continue your writing. I’m confident, you have a huge readers’ base already!

  22. 9ASSET.COM is a Thailand property or real estate sell, buy, and rent website, with user friendly functions and variety categories of property or real estate information whom are looking for sale, buy, rent, and lease.

  23. tent cards says:

    Seriously?? What if I find the odor of tomatoes gross and my neighbors commonly cook tomato-based Italian food? Or what about smelly curry? I can’t stand curry but I’m not about to bug people about them cooking stuff like I should’ve fined some other neighbors for having babies and left newborn/child stink in the Marijuana, as a skunk You don’t smoke pot I get Obviously you It’s more like calling weed "It’s skunky" is slang for good

  24. If heaven is going to be full of people like Hardie, well, the Almighty can have them to himself.

  25. I look forward to new updates and will share this site .

Leave a Reply

Your email address will not be published. Required fields are marked *