Class CurrentRequestVersion


  • public final class CurrentRequestVersion
    extends java.lang.Object
    A thread-scoped value that holds the "current Version" for the request.

    This is not intended as a general mechanism for passing data. Rather it is here to support those cases where someplace deep in a library we need to know about the context of the request that initially triggered the current request.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Version get()
      Gets the current Version Will return null if no current version has been set.
      static void remove()
      Clears the ThreadLocal used to store the version.
      static void set​(Version version)
      Sets the current Version.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • get

        public static Version get()
        Gets the current Version Will return null if no current version has been set.
      • set

        public static void set​(Version version)
        Sets the current Version. Use remove() as soon as the version is no longer required in order to purge the ThreadLocal used for storing it.
      • remove

        public static void remove()
        Clears the ThreadLocal used to store the version.