upgrade-080-090.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <html>
  2. <head>
  3. <title>Acegi Security - Upgrading from version 0.8.0 to 1.0.0</title>
  4. </head>
  5. <body>
  6. <h1>Upgrading from 0.8.0 to 1.0.0</h1>
  7. <p>
  8. The following should help most casual users of the project update their
  9. applications:
  10. <ul>
  11. <li>The most significant change in 0.9.0 is that <code>ContextHolder</code> and all of its
  12. related classes have been removed. This significant change was made for the sake of consistency
  13. with the core Spring project's approach of a single <code>ThreadLocal</code> per use case,
  14. instead of a shared <code>ThreadLocal</code> for multiple use cases as the previous
  15. <code>ContextHolder</code> allowed. <b>This is an important change in 0.9.0.</b> Many applications
  16. will need to modify their code (and possibly web views) if they directly interact with the old
  17. <code>ContextHolder</code>. The replacement security <code>ThreadLocal</code> is called
  18. <a href="../multiproject/acegi-security/xref/net/sf/acegisecurity/context/SecurityContextHolder.html">
  19. SecurityContextHolder</a> and provides a single getter/setter for a
  20. <a href="../multiproject/acegi-security/xref/net/sf/acegisecurity/context/SecurityContextHolder.html">SecurityContext</a>.
  21. <code>SecurityContextHolder</code> guarantees to never return a <cod>null</code> <code>SecurityContext</code>.
  22. <code>SecurityContext</code> provides single getter/setter for <code>Authentication</code>.<BR><BR>
  23. To migrate, simply modify all your code that previously worked with <code>ContextHolder</code>,
  24. <code>SecureContext</code> and <code>Context</code> to directly call <code>SecurityContextHolder</code>
  25. and work with the <code>SecurityContext</code> (instead of the now removed <code>Context</code>
  26. and <code>SecureContext</code> interfaces).<br><br>
  27. We apologise for the inconvenience, but on a more positive note this means you receive strict
  28. type checking, you no longer need to mess around with casting to and from <code>Context</code>
  29. implementations, your applications no longer need to perform checking of <code>null</code> and
  30. unexpected <code>Context</code> implementation types, and the new <code>SecurityContextHolder</code>
  31. is an <code>InheritableThreadLocal</code> - which should make life easier in rich client
  32. environments.<br><br></li>
  33. <li>AbstractProcessingFilter has changed its getter/setter approach used for customised
  34. authentication exception directions. See the <a href="../multiproject/acegi-security/xref/net/sf/acegisecurity/ui/AbstractProcessingFilter.html">
  35. AbstractProcessingFilter JavaDocs</a> to learn more.<br><br></li>
  36. <li>AnonymousProcessingFilter now has a removeAfterRequest property, which defaults to true. This
  37. will cause the anonymous authentication token to be set to null at the end of each request, thus
  38. avoiding the expense of creating a HttpSession in HttpSessionContextIntegrationFilter. You may
  39. set this property to false if you would like the anoymous authentication token to be preserved,
  40. which would be an unusual requirement.<br><br></li>
  41. </ul>
  42. </body>
  43. </html>