You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

demo.html 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <H2>Class Evolution</H2>
  2. <P>This is a demonstration of the class evolution mechanism
  3. implemented with Javassist. This mechanism enables a Java program to
  4. reload an existing class file. Although the reloaded class file is
  5. not applied to exiting objects (the old class file is used for those
  6. objects), it is effective in newly created objects.
  7. <P>Since the reloading is transparently executed, no programming
  8. convention is needed. However, there are some limitations on possible
  9. changes of the class definition. For example, the new class definition
  10. must have the same set of methods as the old one. These limitations are
  11. necessary for keeping the type system consistent.
  12. <H3><a href="java.html">Run WebPage.show()</a></H3>
  13. <P>The web server creates a new <code>WebPage</code> object and
  14. calls <code>show()</code> on that object. This method works as
  15. if it is a CGI script or a servlet and you will see the html file
  16. produced by this method on your browser.
  17. <H3><a href="update.html">Change WebPage.class</a></H3>
  18. <P>The web server overwrites class file <code>WebPage.class</code>
  19. on the local disk. Then it signals that <code>WebPage.class</code>
  20. must be reloaded into the JVM. If you run <code>WebPage.show()</code>
  21. again, you will see a different page on your browser.
  22. <H3>Source files</H3>
  23. <P>Web server: <A HREF="DemoServer.java"><code>DemoServer.java</code></A>
  24. <P>WebPage: <A HREF="WebPage.java"><code>WebPage.java</code></A> and
  25. another <A HREF="sample/evolve/WebPage.java"><code>WebPage.java</code></A>
  26. <P>Class loader: <A HREF="DemoLoader.java"><code>DemoLoader.java</code></A>,
  27. <A HREF="Evolution.java"><code>Evolution.java</code></A>, and
  28. <A HREF="VersionManager.java"><code>VersionManager.java</code></A>.