Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/tracing/Probe.java
38831 views
/*1* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.tracing;2627/**28* The {@code Probe} interface represents a tracepoint.29*30* A {@code Probe} instance is obtained by calling the31* {@code Provider.getProbe()} method of a provider instance created by32* {@code ProviderFactory.createProvider()}. A {@code Probe} can be used to33* trigger a probe manually (provided the correct arguments are passed to34* it), or to check a probe to see if anything is currently tracing it.35* <p>36* A tracing check can be used to avoid lengthy work that might be37* needed to set up the probe's arguments. However, checking38* whether the probe is enabled generally takes the same amount of time39* as actually triggering the probe. So, you should only check a probe's status40* without triggering it if setting up the arguments is very expensive.41* <p>42* Users do not need to implement this interface: instances are43* created automatically by the system when a {@code Provider)} instance is44* created.45* <p>46* @since 1.747*/4849public interface Probe {50/**51* Checks whether there is an active trace of this probe.52*53* @return true if an active trace is detected.54*/55boolean isEnabled();5657/**58* Determines whether a tracepoint is enabled.59*60* Typically, users do not need to use this method. It is called61* automatically when a Provider's instance method is called. Calls to62* this method expect the arguments to match the declared parameters for63* the method associated with the probe.64*65* @param args the parameters to pass to the method.66* @throws IllegalArgumentException if the provided parameters do not67* match the method declaration for this probe.68*/69void trigger(Object ... args);70}717273