<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [ <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"> ]> <!-- Created with Sodipodi ("http://www.sodipodi.com/") --> <svg id="svg548" sodipodi:version="0.32" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" width="210mm" height="297mm" sodipodi:docbase="/home/mcr70/projects/jiapi/docs" sodipodi:docname="/home/mcr70/projects/jiapi/docs/instrumentation.svg"> <defs id="defs550" /> <sodipodi:namedview id="base" /> <g id="g593" transform="translate(-38.75000,-178.7500)"> <rect style="font-size:12;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.56764pt;" id="rect555" width="163.750000" height="62.500026" x="302.500000" y="297.362057" /> <text style="font-size:12;font-weight:normal;stroke-width:1pt;font-family:helvetica;" x="317.500000" y="312.362183" id="text556"> <tspan id="tspan557"> InstrumentationDescriptor</tspan> </text> <text style="font-size:12;font-weight:normal;stroke-width:1pt;font-family:helvetica;" x="336.250000" y="324.862152" id="text559"> <tspan id="tspan560"> include: ...</tspan> <tspan sodipodi:role="line" id="tspan562" x="336.250000" y="336.862152"> exclude: ...</tspan> <tspan sodipodi:role="line" id="tspan591" x="336.250000" y="348.862152"> addInstrumentor()</tspan> </text> </g> <g id="g610" transform="translate(115.0000,86.24997)"> <g id="g574"> <rect style="font-size:12;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.51993pt;" id="rect551" width="152.499998" height="86.249996" x="47.500000" y="132.362133" /> <text style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" x="60.000000" y="149.862183" id="text552"> <tspan id="tspan553"> InstrumentationContext</tspan> </text> </g> <text style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" x="85.000000" y="162.362183" id="text605"> <tspan id="tspan606"> addDescriptor()</tspan> <tspan sodipodi:role="line" id="tspan608" x="85.0000000" y="174.362183"> instrument()</tspan> </text> </g> <text style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" x="461.250000" y="103.612091" id="text621"> <tspan id="tspan622"> Intrumentation process:</tspan> <tspan sodipodi:role="line" id="tspan624" x="461.250000" y="115.612091"> 1) Create InstrumentingClassLoader</tspan> <tspan sodipodi:role="line" id="tspan661" x="461.250000" y="127.612091"> Associate InstrumentationContext with it.</tspan> <tspan sodipodi:role="line" id="tspan657" x="461.250000" y="139.612091"> </tspan> <tspan sodipodi:role="line" id="tspan659" x="461.250000" y="151.612091"> 2) add some descriptors to ctx, that define</tspan> <tspan sodipodi:role="line" id="tspan626" x="461.250000" y="163.612091"> what is to be instrumented and how</tspan> <tspan sodipodi:role="line" id="tspan628" x="461.250000" y="175.612091"> </tspan> <tspan sodipodi:role="line" id="tspan630" x="461.250000" y="187.612091"> 3) call ClassLoader.loadClass()</tspan> <tspan sodipodi:role="line" id="tspan665" x="461.250000" y="199.612091"> This will try to load class, and call </tspan> <tspan sodipodi:role="line" id="tspan667" x="461.250000" y="211.612091"> ctx.instrument()</tspan> <tspan sodipodi:role="line" id="tspan632" x="461.250000" y="223.612091"> This will loop through all the decriptors</tspan> <tspan sodipodi:role="line" id="tspan634" x="461.250000" y="235.612091"> in order, and make a decision whether or </tspan> <tspan sodipodi:role="line" id="tspan636" x="461.250000" y="247.612091"> not a class is to be instrumented. If so,</tspan> <tspan sodipodi:role="line" id="tspan638" x="461.250000" y="259.612091"> instrument class with Instrumentor associated </tspan> <tspan sodipodi:role="line" id="tspan640" x="461.250000" y="271.612091"> with descriptor</tspan> </text> <g id="g649" transform="translate(-30.00000,2.499969)"> <rect style="font-size:12;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.849409pt;" id="rect642" width="167.500000" height="63.750000" x="71.250000" y="89.862122" /> <text style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" x="83.7500000" y="106.112152" id="text643"> <tspan id="tspan644"> InstrumentingClassLoader</tspan> </text> <text style="fill:black;stroke:none;font-family:helvetica;font-style:normal;font-weight:normal;font-size:12px;fill-opacity:1;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;" x="108.750000" y="119.862183" id="text646"> <tspan id="tspan647"> setContext()</tspan> </text> </g> <path style="fill:none;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;" d="M 153.75 154.862 L 201.25 218.612 " id="path663" /> <path style="fill:none;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;" d="M 270 216.112 L 297.5 181.112 " id="path664" /> </svg>