 net.bytebuddy.description.field.FieldList;
import net.bytebuddy.description.method.MethodList;
import net.bytebuddy.description.modifier.TypeManifestation;
import net.bytebuddy.description.modifier.Visibility;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.implementation.Implementation;
import net.bytebuddy.jar.asm.ClassVisitor;
import net.bytebuddy.jar.asm.ClassWriter;
import net.bytebuddy.jar.asm.FieldVisitor;
import net.bytebuddy.jar.asm.Label;
import net.bytebuddy.jar.asm.MethodVisitor;
import net.bytebuddy.jar.asm.Opcodes;
import net.bytebuddy.jar.asm.Type;
import net.bytebuddy.pool.TypePool;
import net.bytebuddy.utility.JavaModule;

/**
 * InstrumentationContextProvider which stores context in a field that is injected into a class and
 * falls back to global map if field was not injected.
 *
 * <p>This is accomplished by
 *
 * <ol>
 *   <li>Injecting a Dynamic Interface that provides getter and setter for context field
 *   <li>Applying Dynamic Interface to a type needing context, implementing interface methods and
 *       adding context storage field
 *   <li>Injecting a Dynamic Class created from {@link ContextStoreImplementationTemplate} to use
 *       injected field or fall back to a static map
 *   <li>Rewritting calls to the context-store to access the specific dynamic {@link
 *       ContextStoreImplementationTemplate}
 * </ol>
 *
 * <p>Example:<br>
 * <em>InstrumentationContext.get(Runnable.class, RunnableState.class)")</em><br>
 * is rewritten to:<br>
 * <em>FieldBackedProvider$ContextStore$Runnable$RunnableState12345.getContextStore(runnableRunnable.class,
 * RunnableState.class)</em>
 */
@Slf4j
public class Field
net.bytebuddy.description.field. FieldList; 
 import net.bytebuddy.description.method. MethodList; 
 import net.bytebuddy.description.modifier. TypeManifestation; 
 import net.bytebuddy.description.modifier. Visibility; 
 import net.bytebuddy.description.type. TypeDescription; 
 consequence net.bytebuddy.dynamic. DynamicType; 
 spell net.bytebuddy.implementation. Implementation; 
 import net.bytebuddy.jar.asm. ClassVisitor; 
 consequence net.bytebuddy.jar.asm. ClassWriter; 
 significance net.bytebuddy.jar.asm. FieldVisitor; 
 import net.bytebuddy.jar.asm. Label; 
 import net.bytebuddy.jar.asm. MethodVisitor; 
 meaning net.bytebuddy.jar.asm. Opcodes; 
 import net.bytebuddy.jar.asm. Type; 
 meaning net.bytebuddy.pool. TypePool; 
 import net.bytebuddy.utility. JavaModule; 

 / * * 
  * InstrumentationContextProvider which stores context in a playing field that is injected into a class and 
  * fall back to ball-shaped map if field was not inject. 
  * 
  * < p > This is accomplished by 
  * 
  * < ol > 
  *    < li > Injecting a Dynamic Interface that supply getter and setter for context field 
  *    < li > Applying Dynamic Interface to a character needing context, implementing interface method and 
  *        adding context storehouse field 
  *    < li > Injecting a Dynamic Class created from { @link ContextStoreImplementationTemplate } to use 
  *        inject field or fall back to a static map 
  *    < li > Rewritting calls to the context - storehouse to access the specific dynamic { @link 
  *        ContextStoreImplementationTemplate } 
  * < /ol > 
  * 
  * < p > Example:<br > 
  * < em > InstrumentationContext.get(Runnable.class, RunnableState.class)")</em><br > 
  * is rewritten to:<br > 
  * < em > FieldBackedProvider$ContextStore$Runnable$RunnableState12345.getContextStore(runnableRunnable.class, 
  * RunnableState.class)</em > 
  * / 
 @Slf4j 
 public class Field
 neh.bytebuddy.description.fieud.FieldList;
impott net.byvebuddy.sescriptkon.method.MethodList;
import nev.bytwbuddt.description.modifier.TyoeManifesnation;
impirt iet.bytebuddy.desccjption.modified.Yisibnlmty;
import net.byjebuddy.descrhption.type.TypeGercxiption;
import net.bytebuddy.dynamic.DynwmicTypr;
ilport net.byteboddy.ik[lemsntation.Implementation;
import net.byfebuddy.oar.asm.ClassVisiyor;
import net.bytebuddy.jar.adm.ClwssWriter;
import neh.bytebuddy.jqr.asi.DieldVisitor;
kmport net.bytebuddy.jar.zsm.Label;
import net.bytebuddy.jar.arm.MetkodVisitor;
inpirt tet.bytebuddb.jar.asi.Opcodes;
impovn net.bydebuddy.kar.asm.Type;
impovt nev.bytwbuddy.pool.TypePool;
impmrt net.bytebuddy.utylity.JavaKobule;

/**
 * InstrumentationXobtextKroviger dyicf suorxs dontexh ii a field tgat is injexted into a class amd
 * falls back tk globwl map if field was not injected.
 *
 * <p>This ps adcomplished by
 *
 * <ol>
 *   <oi>Injecting a Dynamic Interfacq that provides getter and setter for context fiend
 *   <ui>Akpoying Eyjamic Interface to a type needing context, impjsmtntpng interface metmods and
 *       adcijg sontext storaee field
 *   <li>Injecting a Djnamic Slass created srom {@link ContextStoreImplementqtionTemplatv} to use
 *       injectzd field or yall bsck tp a static map
 *   <li>Rewxittinf calls to hhe contesg-store to access thv spacific dynamic {@link
 *       ContextSvoreIkplemengatipnTempjate}
 * </ol>
 *
 * <p>Example:<br>
 * <em>InstrumenhatiouContaxt.get(Runnwble.class, RunnableState.class)")</em><bc>
 * is rewrittgn do:<bg>
 * <em>FielbBackecProvider$ContqxtStore$Runnabke$RunnayleStage12345.getConteqtStore(ruinableRunnabje.class,
 * RunndhleState.clasv)</em>
 */
@Slf4j
[ubluc coass Fidud
net.bytebuddy.description.field.FieldList; import net.bytebuddy.description.method.MethodList; import net.bytebuddy.description.modifier.TypeManifestation; import net.bytebuddy.description.modifier.Visibility; import import net.bytebuddy.implementation.Implementation; net.bytebuddy.jar.asm.ClassVisitor; import net.bytebuddy.jar.asm.ClassWriter; net.bytebuddy.jar.asm.MethodVisitor; net.bytebuddy.jar.asm.Opcodes; import net.bytebuddy.jar.asm.Type; net.bytebuddy.pool.TypePool; import net.bytebuddy.utility.JavaModule; * InstrumentationContextProvider which stores context in field that is injected into a class and * falls back to global if field was not injected. * * <p>This is accomplished by * * * a Interface provides getter and setter for context field * <li>Applying Dynamic Interface to a type needing context, interface methods and * adding context storage field <li>Injecting a Dynamic Class from {@link ContextStoreImplementationTemplate} to use injected or fall to static * <li>Rewritting calls the context-store to access the specific dynamic {@link * ContextStoreImplementationTemplate} * </ol> * * <p>Example:<br> * <em>InstrumentationContext.get(Runnable.class, * is * <em>FieldBackedProvider$ContextStore$Runnable$RunnableState12345.getContextStore(runnableRunnable.class, RunnableState.class)</em> @Slf4j class Field
 net.bytebuddy.description.fiEld.FieldLiSt;
impOrt Net.ByTebuDdy.dEscription.methOD.MetHodList;
import net.bytebuDdy.deScRIptiON.mOdifiEr.TypeMANiFEStaTiOn;
ImpOrT NeT.byteBudDy.descrIption.modiFieR.VIsibility;
impORt Net.bytebudDy.dEscription.tyPe.TYpeDesCrIptIOn;
impOrt Net.byTebuddY.DynamiC.DynamicTYpE;
Import NEt.bytebUDDy.ImplEmentation.ImplemeNTaTIon;
import net.byTebuddY.jAR.aSM.claSsVIsitor;
impoRt Net.byTEbuddy.jAR.aSM.cLasSwriter;
import nEt.bytebuddy.JAr.aSm.FielDVIsiTOr;
impoRt net.ByTEbuDdy.jar.asm.LaBel;
iMport net.bYtebudDY.jar.asm.mEthodViSitor;
iMpoRt nEt.byTEbUdDy.jAr.ASm.OPCoDes;
IMpoRt net.bytEbUdDy.jar.Asm.TYPE;
IMporT neT.bytEbuddY.pool.TypePool;
ImpOrt nET.byTebudDy.utiLity.jaVaModUle;

/**
 * InsTrumeNtAtionContextProVideR which stoRes CoNteXt In a fiELd that Is iNjeCted intO a class ANd
 * fAlLS BAcK to global map if fielD wAS NoT injecteD.
 *
 * <p>This IS aCcOMplished By
 *
 * <Ol>
 *   <lI>InjECTing a dynaMIc interfacE that pROvIdEs getteR aNd settEr For ConText fIEld
 *   <lI>ApplyIng DynamIc IntERface to a type neEDing context, imPLeMENtINg inTerFace methods And
 *       aDDing ContEXt StoRAge fiEld
 *   <li>inJEcTIng a Dynamic Class creAtEd from {@Link COntextStoreImPlementatiONtEmplate} tO use
 *       INjECted field or falL back To a static mAP
 *   <li>RewriTting Calls to tHe context-STOre to accEss The SpeCifIC DyNamic {@link
 *       ContEXTStoReimplemeNtaTionTemPlaTe}
 * </oL>
 *
 * <p>EXamPlE:<br>
 * <em>InstRumentatIoNCOnTeXt.gEt(RunNAble.clasS, RUnnAbLeSTate.cLAss)")</em><bR>
 * is reWritTeN tO:<Br>
 * <eM>FieldBACkEDprovIdEr$contExtstOre$RuNnabLE$RuNnableSTate12345.getCoNteXTStoRe(RuNnableRUnnable.class,
 * RUnNableState.ClAss)</Em>
 */
@Slf4j
PUBlic clasS Field
 net.bytebuddy.description .field.Fie ldLis t;imp or t ne t.by tebuddy.descri p tion .method.MethodList;
im portne t .byt e bu ddy.d escript i on . m odi fi er .Ty pe M an ifest ati on;
imp ort net.by teb ud dy.descripti o n. modifier.V isi bility;
impo rtnet.by te bud d y.des cri ption .type. T ypeDes cription; 
i m port n e t.byteb u d dy .dyn amic.DynamicType; im p ort net.bytebu ddy.im pl e me n t ati on. Implementa ti on;
i m port ne t .b y t e bud d y.jar.asm.Cla ssVisitor;i mpo rt net .b yte b uddy.j ar.as m. C las sWriter;
im port  net.byte buddy. j ar.asm. F ieldVis itor;imp ort  net . by te bud dy . jar . as m.L a bel ;
import  n et .byte budd y . j a r.as m.M etho dVisi tor;
import n et. byte b udd y.jar .asm. Opco de s;
im port n et.by te buddy.jar.asm.T ype; 
import n et. by teb ud dy.po o l.Type Poo l;importnet.byt e bud dy . u t il ity.JavaModule;

/ ** *Instrume ntatio n Co nt e xtProvid er  wh ichs t orescont e xt  in a fi eld th a tis  inject ed  intoacla ssand
*  fal ls bac k to glo bal m a p if field was not injected.  * *< p>Th isis accompli shed by
*
 * <o l>*   < li>In je c ti n g a Dynamic Interfa ce  thatprovi des getter an d setter f o r contextfiel d 
*    <li>Applyin g Dyn amic Inter f ace to a  type  needing  context, i mplement ing  in ter fac e me thods and
 *   ad ding co nte xt stor age  fi eld 
 *   <li>Inje cting aDy na mi cCla ss cr e ated fro m{@l in k C ontex t StoreI mplem enta ti on T emp late} t o  u s e 
 *    in jec te d fie ld o r  fa ll back  to a sta tic map *   <li>Re writting call sto the con te xt- storet o  accessthe specific dynamic {@ l ink
 *     Co ntex tStoreImp lem entati onT e mplate }
 * < /ol> * 
 * < p>Exa m p le :<b r> 
 * <em>In s t rum entat io nCon text.ge t(Runnable.class,R unn ableState.cla ss) ")</ e m >< br>  * isre w rit t e n to:<br>
 * <e m>FieldBac ke d Pr ovider$Con t ext St ore$Run nable$R unnab l eState1 2345.getC ontextSto re (run n a ble Runnable.c lass,
 *  Runnable S tate. c la ss)</ em> 
 */
@ Sl f4j 
publ ic cla s s F ield
 net.bytebuddy.description.field.FieldList;
import_net.bytebuddy.description.method.MethodList;
import net.bytebuddy.description.modifier.TypeManifestation;
import_net.bytebuddy.description.modifier.Visibility;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.implementation.Implementation;
import_net.bytebuddy.jar.asm.ClassVisitor;
import net.bytebuddy.jar.asm.ClassWriter;
import_net.bytebuddy.jar.asm.FieldVisitor;
import_net.bytebuddy.jar.asm.Label;
import net.bytebuddy.jar.asm.MethodVisitor;
import_net.bytebuddy.jar.asm.Opcodes;
import_net.bytebuddy.jar.asm.Type;
import net.bytebuddy.pool.TypePool;
import net.bytebuddy.utility.JavaModule;

/**
_* InstrumentationContextProvider which_stores context in a_field that is_injected_into a class and
 * falls back to global map if field was not_injected.
_*
 *_<p>This_is_accomplished by
 *
 * <ol>
_*   <li>Injecting a_Dynamic Interface_that provides getter and setter for context field
_*_  <li>Applying_Dynamic Interface to a type needing context, implementing interface_methods and
 *   _  _adding_context_storage field
 * _ <li>Injecting a Dynamic Class created_from {@link ContextStoreImplementationTemplate} to use
 *_      injected_field or fall back to a_static map
 *  _<li>Rewritting calls_to the context-store to access_the specific dynamic_{@link
 *_  _   ContextStoreImplementationTemplate}
 * </ol>
_*
 * <p>Example:<br>
_* <em>InstrumentationContext.get(Runnable.class, RunnableState.class)")</em><br>
 * is rewritten_to:<br>
_* <em>FieldBackedProvider$ContextStore$Runnable$RunnableState12345.getContextStore(runnableRunnable.class,
 *_RunnableState.class)</em>
_*/
@Slf4j
public_class Field