Package org.tod.meta.steps

Examples of org.tod.meta.steps.MethodCallStep


        }
        return null;
    }

    private static MethodCallStep methodCallTOD(TODSession session, IMethodCallEvent event, boolean forward, boolean live) {
        MethodCallStep s = new MethodCallStep();
        IBehaviorInfo behavior = event.getOperationBehavior();
        IBehaviorInfo calledBehavior = event.getCalledBehavior();
       
        if (calledBehavior == null) {
            calledBehavior = event.getExecutedBehavior();
        }
        // If there is no associated behavior, TOD does not have information
        // for the given class. It is likely out of scope.
        if (behavior == null || calledBehavior == null || calledBehavior.isStaticInit()) {
            return null;
        }
        MethodInfo methodInfo = session.getClassInformationProvider().getMethodInfo(behavior);
        MethodInfo targetMethodInfo = session.getClassInformationProvider().getMethodInfo(calledBehavior);
        if (!session.getFilter().acceptMethod(targetMethodInfo)) {
            return null;
        }
        s.setType(StepType.METHOD_CALL);
        s.setLive(live);
        s.setMethodInfo(methodInfo);
        s.setTargetMethodInfo(targetMethodInfo);
        int line = TypeUtils.calculateLineNumber(event.getOperationBehavior(), event.getOperationBytecodeIndex());
        s.setLineNumber(line); // TODO
        s.setTargetLineNumber(0); // TODO
        s.setForward(forward);
       
        // Set up the parameters.
        Object[] arguments = event.getArguments();
        for (int i = 0; i < arguments.length; i++) {
            Object arg = arguments[i];
            s.addParameter(MirrorFactory.instanceFromTOD(session, arg, calledBehavior.getArgumentTypes()[i].getJvmName()));
        }
       
        return s;
    }
View Full Code Here

TOP

Related Classes of org.tod.meta.steps.MethodCallStep

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.