class MyMonitoringIntroductionAdvice extends DelegatingIntroductionInterceptor implements MyMonitoringCapable {

    private boolean active = false;

    public void setActive(boolean active) {
        this.active = active;
    }

    @Override
    public void toggleMonitoring() {
        setActive(true);
    }

    // 当被监控的方法被调用时，如果监控处于激活状态，则输出日志
    @Override
    protected Object doProceed(MethodInvocation mi) throws Throwable {<FILL_FUNCTION_BODY>}
}

        if (this.active) {
            System.out.println("开启监控...");
            long startTime = System.currentTimeMillis();
            Object result = super.doProceed(mi);
            long endTime = System.currentTimeMillis();
            System.out.println(mi.getClass().getName() + "." + mi.getMethod().getName() + " 耗费时间：" + (endTime - startTime) + " 毫秒");
            System.out.println("结束监控...");
            return result;
        }
        return super.doProceed(mi);
    
<methods>public void <init>(java.lang.Object) ,public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation) throws java.lang.Throwable<variables>private java.lang.Object delegate