Class InstrumentationContext


  • public class InstrumentationContext
    extends java.lang.Object
    Instrumentation Context API.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <K,​C>
      ContextStore<K,​C>
      get​(java.lang.Class<K> keyClass, java.lang.Class<C> contextClass)
      Find a ContextStore instance for given key class and context class.
      • Methods inherited from class java.lang.Object

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

      • get

        public static <K,​C> ContextStore<K,​C> get​(java.lang.Class<K> keyClass,
                                                              java.lang.Class<C> contextClass)
        Find a ContextStore instance for given key class and context class.

        Conceptually this can be thought of as a map lookup to fetch a second level map given keyClass.

        In reality, the calls to this method are re-written to something more performant while injecting advice into a method.

        This method must only be called within an Advice class.

        Type Parameters:
        K - key class
        C - context class
        Parameters:
        keyClass - The key class context is attached to.
        contextClass - The context class attached to the user class.
        Returns:
        The instance of context store for given arguments.