2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * ident "%Z%%M% %I% %E% SMI" 2N/A * Identifies a compiled D program. This identifier is valid only on 2N/A * the {@link LocalConsumer} from which it was obtained. Some {@code 2N/A * Consumer} methods attach additional {@link ProgramInfo} to this 2N/A * Not intended for persistence, since it identifies nothing after its 2N/A * source {@code LocalConsumer} closes. 2N/A * @see Consumer#compile(String program, String[] macroArgs) 2N/A * @see Consumer#compile(java.io.File program, String[] macroArgs) 2N/A * @see Consumer#enable(Program program) 2N/A * @see Consumer#getProgramInfo(Program program) 2N/A * @see Consumer#listProgramProbes(Program program) 2N/A * @see Consumer#listProgramProbeDetail(Program program) 2N/A * @author Tom Erickson 2N/A * Identifies this program among all of a consumer's programs. Set 2N/A // Set by LocalConsumer.compile() 2N/A * Called by native code 2N/A // Called by LocalConsumer.compile() to ensure that only valid 2N/A // instances are made accessible to users. Similarly called by 2N/A // readObject to ensure that only valid instances are deserialized. 2N/A * Gets the full pre-compiled text of the identified program. 2N/A * @return the {@code String} passed to {@link 2N/A * Consumer#compile(String program, String[] macroArgs)}, or the 2N/A * contents of the {@code File} passed to {@link 2N/A * Consumer#compile(java.io.File program, String[] macroArgs)} 2N/A * Gets information about this compiled program provided by {@link 2N/A * Consumer#getProgramInfo(Program program)} or {@link 2N/A * Consumer#enable(Program program)}. 2N/A * @return information about this compiled program, or {@code null} 2N/A * if this {@code Program} has not been passed to {@link 2N/A * Consumer#getProgramInfo(Program program)} or {@link 2N/A * Consumer#enable(Program program)} 2N/A * Sets additional information about this compiled program, 2N/A * including program stability and matching probe count. Several 2N/A * {@code Consumer} methods attach such information to a given 2N/A * {@code Program} argument. The method is {@code public} to 2N/A * support implementations of the {@code Consumer} interface other 2N/A * than {@link LocalConsumer}. Although a {@code Program} can only 2N/A * be obtained from a {@code LocalConsumer}, other {@code Consumer} 2N/A * implemenations may provide a helpful layer of abstraction while 2N/A * using a {@code LocalConsumer} internally to compile DTrace 2N/A * programs. Users of the API are not otherwise expected to call 2N/A * the {@code setInfo()} method directly. 2N/A * @param programInfo optional additional information about this 2N/A * @see Consumer#enable(Program program) 2N/A * @see Consumer#getProgramInfo(Program program) 2N/A // check class invariants 2N/A * Gets the contents of the given file as a string. 2N/A * @return non-null contents of the given file as a string 2N/A * @throws IOException if the method fails to read the contents of 2N/A * Gets a string representation of this {@code Program} instance 2N/A * useful for logging and not intended for display. The exact 2N/A * details of the representation are unspecified and subject to 2N/A * change, but the following format may be regarded as typical: 2N/A * class-name[property1 = value1, property2 = value2] 2N/A * Identifies a compiled D program, specifically one that has been 2N/A * compiled from a file. 2N/A // Set by LocalConsumer.compile() 2N/A // Called by LocalConsumer.compile() to ensure that only valid 2N/A // instances are made accessible to users. Similarly called by 2N/A // readObject to ensure that only valid instances are deserialized. 2N/A * Gets the program file. 2N/A * @return the {@code File} passed to {@link 2N/A * Consumer#compile(java.io.File program, String[] macroArgs)} 2N/A // check class invariants