@@ -0,0 +1,1366 @@
+/*%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at:%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A *%0A */%0Apackage instrumentj.probes.impl;%0A%0Aimport instrumentj.CallStack;%0Aimport instrumentj.StaticProfilerInterface;%0Aimport instrumentj.probes.MethodEntryProbe;%0Aimport instrumentj.probes.MethodExitProbe;%0A%0A/**%0A * @author Stephen Evanchik (evanchsa@gmail.com)%0A *%0A */%0Apublic abstract class StatefulMethodProbe implements MethodEntryProbe, MethodExitProbe %7B%0A%0A%09@Override%0A%09public final void run(Object... args) %7B%0A%09%09final CallStack.Entry stack = StaticProfilerInterface.INSTANCE.getProfiler().peek();%0A%0A%09%09doRun(stack.isExiting(), args);%0A%09%7D%0A%0A    /**%0A     * Implement this method to perform stateful measurements%0A     *%0A     * @param exiting%0A     *            %7B@code true%7D if the method is exiting; %7B@code false%7D otherwise%0A     * @param args%0A     */%0A%09protected abstract void doRun(boolean exiting, Object... args);%0A%7D%0A

Add a Stateful Probe