Package alt.jiapi.instrumentor

Examples of alt.jiapi.instrumentor.ChainInstrumentor


        StringTokenizer st = new StringTokenizer(chainSpec, "|");
        while (st.hasMoreTokens()) {
            String instrumentorSpec = st.nextToken().trim();

            ChainInstrumentor i = createInstrumentor(instrumentorSpec, symbols);
            if (i == null) {
                throw new JiapiException("ChainBuilder.createInstrumentor(...) returned null");
            }

            chain.add(i);
View Full Code Here


     */
    public ChainInstrumentor createInstrumentor(String instrumentorSpec,
                                           SymbolMap symbols) throws JiapiException, ClassNotFoundException, InstantiationException {
        log.debug("Creating Instrumentor from spec: " + instrumentorSpec);

        ChainInstrumentor instrumentor = null;

        String instrumentorClassName = null;
        String childClassName = null;
        String childHints = null;

View Full Code Here

    private ChainInstrumentor createInstrumentor(Class instrumentorClass, Object child) throws InstantiationException {
        log.debug("Creating Instrumentor: " + instrumentorClass.getName() +
                  ", child: " + child);

        ChainInstrumentor instrumentor = null;

        if (child == null) {
            // Use empty constructor
            try {
                instrumentor = (ChainInstrumentor)instrumentorClass.newInstance();
View Full Code Here

            return;
        }

        try {
//             InstrumentationContext ctx = new InstrumentationContext();
            ChainInstrumentor setDispatcher = new MethodDispatcherInstrumentor();

            GrepInstrumentor grepWriteAccess =
            // Following line fixes bug that we instrument
            // on field accesses that were synthesized by Jiapi itself.
                new GrepInstrumentor(new FieldAccessStrategy("*__jiapi_field*", true, FieldAccessStrategy.WRITE_ACCESS));

            grepWriteAccess.setResolutions(getResolutions());

            ChainInstrumentor afterSet = new TailInstrumentor();
            ChainInstrumentor callFieldSet =
                new MethodCallInstrumentor(new FieldSetHook(this));
           
            InstrumentorChain setChain = new InstrumentorChain();
            setChain.add(setDispatcher);
            setChain.add(grepWriteAccess);
            setChain.add(afterSet);
            setChain.add(callFieldSet);


            ChainInstrumentor getDispatcher = new MethodDispatcherInstrumentor();
            GrepInstrumentor grepReadAccess =
            // Following commented line fixes bug that we instrument
            // on field accesses that were synthesized by Jiapi itself.
                  new GrepInstrumentor(new FieldAccessStrategy("*__jiapi_field*", true, FieldAccessStrategy.READ_ACCESS));

            grepReadAccess.setResolutions(getResolutions());

            ChainInstrumentor beforeRead = new HeadInstrumentor();
            ChainInstrumentor callFieldGet =
                new MethodCallInstrumentor(new FieldGetHook(this));

            InstrumentorChain getChain = new InstrumentorChain();
            getChain.add(getDispatcher);
            getChain.add(grepReadAccess);
View Full Code Here

        try {
//             InstrumentationContext ctx = new InstrumentationContext();

            // For method entry traps :
            ChainInstrumentor entryDispatcher = new MethodDispatcherInstrumentor();
            GrepInstrumentor grepEntry =
                new GrepInstrumentor(new MethodEntryStrategy());

//              Instrumentor head0 = new HeadInstrumentor(); // ---

            grepEntry.setResolutions(getResolutions());

            ChainInstrumentor entryCall
                = new MethodCallInstrumentor(new MethodEntryHook(this));

            InstrumentorChain entryChain = new InstrumentorChain();
            entryChain.add(entryDispatcher);
            entryChain.add(grepEntry);
//              entryChain.add(head0);                       // ---
            entryChain.add(entryCall);


            // For method exit traps :
            ChainInstrumentor exitDispatcher = new MethodDispatcherInstrumentor();
            GrepInstrumentor grepExit
                = new GrepInstrumentor(new MethodReturnStrategy());
           
            grepExit.setResolutions(getResolutions());
           
            ChainInstrumentor head = new HeadInstrumentor();
            ChainInstrumentor exitCall =
                new MethodCallInstrumentor(new MethodExitHook(this));
           
            InstrumentorChain exitChain = new InstrumentorChain();
            exitChain.add(exitDispatcher);
            exitChain.add(grepExit);
View Full Code Here

    public ExceptionEventProducer(InstrumentationDescriptor id, String resolution) {
        super(resolution);

        try {
            InstrumentorChain chain = new InstrumentorChain();
            ChainInstrumentor dispatcher = new MethodDispatcherInstrumentor();
            CatchInstrumentor selectCatchBlocks = new CatchInstrumentor();
            ChainInstrumentor selectHead = new HeadInstrumentor();
            ChainInstrumentor callMethod =
                new MethodCallInstrumentor(new CatchHook(this));

            selectCatchBlocks.setResolutions(getResolutions());

            chain.add(dispatcher);
View Full Code Here

TOP

Related Classes of alt.jiapi.instrumentor.ChainInstrumentor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.