Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/tracing/Provider.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* {@code Provider} is a superinterface for user-defined tracing providers.29* <p>30* To define tracepoints, users must extend this interface31* and then use a {@code ProviderFactory} to create an instance of the32* newly-defined interface. Each method in the defined interface represents a33* tracepoint (or probe), which can be triggered by calling the associated34* method on the returned instance.35* <p>36* This interface also contains a {@code getProbe()} method, which can be37* used to get direct handles to the {@code Probe} objects themselves.38* {@code Probe} objects can be triggered manually, or they can be queried to39* check their state.40* <p>41* When an application has finished triggering probes, it should call42* {@code dispose()} to free up any system resources associated with the43* Provider.44* <p>45* All methods declared in a subclass of this interface should have a46* {@code void} return type. Methods can have parameters, and when called the47* values of the arguments will be passed to the tracing implementation.48* If any methods do not have a {@code void} return type, an49* {@code java.lang.IllegalArgumentException} will be thrown when the50* provider is registered.51* @since 1.752*/5354public interface Provider {55/**56* Retrieves a reference to a Probe object, which is used to check status57* or to trigger the probe manually.58*59* If the provided method parameter is not a method of the provider60* interface, or if the provider interface has been disposed, then61* this returns null62*63* @param method a method declared in the provider.64* @return the specified probe represented by that method, or null.65*/66Probe getProbe(java.lang.reflect.Method method);6768/**69* Disposes system resources associated with this provider.70*71* After calling this method, triggering the probes will have no effect.72* Additional calls to this method after the first call are ignored.73*/74void dispose();75}767778