-
public interface UserJvmOptionsService
Runtime access to the UserJVMOptions. This class is not typically available in the Java Runtime, you must explicitly include the 'jdk.packager.services' module from the jmod directory of the JDK as part of your application bundle.- Since:
- 9
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static UserJvmOptionsService
getUserJVMDefaults()
Get the instance of UserJvmOptionService to use.Map<String,String>
getUserJVMOptionDefaults()
The "default" set of UserJVMOptions.Map<String,String>
getUserJVMOptions()
The "current" set of UserJVMOptions.void
setUserJVMOptions(Map<String,String> options)
Sets the passed in options as the UserJVMOptions.
-
-
-
Method Detail
-
getUserJVMDefaults
static UserJvmOptionsService getUserJVMDefaults()
Get the instance of UserJvmOptionService to use. Which one to use is configured by the packager and the launcher. Do not directly instantiate any instance of this interface, use this method to get an appropriate instance.- Returns:
- the instance of UserJvmOptionsService for your application.
-
getUserJVMOptions
Map<String,String> getUserJVMOptions()
The "current" set of UserJVMOptions. This will take effect on the next application start, and this may not reflect the current set of UserJVMOptions used to start this application.- Returns:
- A map of the keys and values. Alterations to this map will not change the stored UserJVMOptions
-
setUserJVMOptions
void setUserJVMOptions(Map<String,String> options)
Sets the passed in options as the UserJVMOptions. If the application has specified default values and those keys are not in this map, they will be replaced by the default values. No validation or error checking is performed on these values. It is entirely possible that you may provide a set of UserJVMOptions that may prevent the normal startup of your application and may require manual intervention to resolve.- Parameters:
options
- The UserJVMOptions to set.
-
getUserJVMOptionDefaults
Map<String,String> getUserJVMOptionDefaults()
The "default" set of UserJVMOptions. This returns the default set of keys and values that the application has been configured to use.- Returns:
- the keys and values of the default UserJVMOptions.
- Throws:
UnsupportedOperationException
- if the defaults cannot be calculated.
-
-