- java.lang.Object
- 
- jdk.jfr.Configuration
 
- 
 public final class Configuration extends Object A collection of settings and metadata describing the configuration.- Since:
- 9
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Configurationcreate(Reader reader)Reads a configuration from a character stream.static Configurationcreate(Path path)Reads a configuration from a file.static ConfigurationgetConfiguration(String name)Returns a predefined configuration.static List<Configuration>getConfigurations()Returns an immutable list of predefined configurations for this Java Virtual Machine (JVM).StringgetContents()Returns a textual representation of the configuration (for example, the contents of a JFC file).StringgetDescription()Returns a short sentence that describes the configuration (for example"Low overhead configuration safe for continuous use in production environments")StringgetLabel()Returns a human-readable name (for example,"Continuous" or "Profiling"}.StringgetName()Returns an identifying name (for example,"default" or "profile").StringgetProvider()Returns who created the configuration (for example"OpenJDK").Map<String,String>getSettings()Returns the settings that specifies how a recording is configured.
 
- 
- 
- 
Method Detail- 
getSettingspublic Map<String,String> getSettings() Returns the settings that specifies how a recording is configured.Modifying the returned Mapobject doesn't change the configuration.- Returns:
- settings, not null
 
 - 
getNamepublic String getName() Returns an identifying name (for example,"default" or "profile").- Returns:
- the name, or nullif it doesn't exist
 
 - 
getLabelpublic String getLabel() Returns a human-readable name (for example,"Continuous" or "Profiling"}.- Returns:
- the label, or nullif it doesn't exist
 
 - 
getDescriptionpublic String getDescription() Returns a short sentence that describes the configuration (for example"Low overhead configuration safe for continuous use in production environments")- Returns:
- the description, or nullif it doesn't exist
 
 - 
getProviderpublic String getProvider() Returns who created the configuration (for example"OpenJDK").- Returns:
- the provider, or nullif it doesn't exist
 
 - 
getContentspublic String getContents() Returns a textual representation of the configuration (for example, the contents of a JFC file).- Returns:
- contents, or nullif it doesn't exist
- See Also:
- getContents()
 
 - 
createpublic static Configuration create(Path path) throws IOException, ParseException Reads a configuration from a file.- Parameters:
- path- the file that contains the configuration, not- null
- Returns:
- the read Configuration, notnull
- Throws:
- ParseException- if the file can't be parsed
- IOException- if the file can't be read
- SecurityException- if a security manager exists and its- checkReadmethod denies read access to the file.
- See Also:
- File.getPath(),- SecurityManager.checkRead(java.lang.String)
 
 - 
createpublic static Configuration create(Reader reader) throws IOException, ParseException Reads a configuration from a character stream.- Parameters:
- reader- a- Readerthat provides the configuration contents, not- null
- Returns:
- a configuration, not null
- Throws:
- IOException- if an I/O error occurs while trying to read contents from the- Reader
- ParseException- if the file can't be parsed
 
 - 
getConfigurationpublic static Configuration getConfiguration(String name) throws IOException, ParseException Returns a predefined configuration.See getConfigurations()for available configuration names.- Parameters:
- name- the name of the configuration (for example,- "default"or- "profile")
- Returns:
- a configuration, not null
- Throws:
- IOException- if a configuration with the given name does not exist, or if an I/O error occurs while reading the configuration file
- ParseException- if the configuration file can't be parsed
 
 - 
getConfigurationspublic static List<Configuration> getConfigurations() Returns an immutable list of predefined configurations for this Java Virtual Machine (JVM).- Returns:
- the list of predefined configurations, not null
 
 
- 
 
-