Package com.tagtraum.core
Class VMStartupParameters
- java.lang.Object
-
- com.tagtraum.core.VMStartupParameters
-
public class VMStartupParameters extends Object
VMStartupParameters. Reads or replaces certain VM startup parameters for the next VM start.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description VMStartupParameters()Creates standard instance for beaTunes.VMStartupParameters(int minHeapMB, int maxHeapMB, int maxDirectMB, Preferences preferences, String windowsEnvironmentVariableName, Preferences macJVMOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMemoryConfiguration()StringgetMemoryDirectMax()StringgetMemoryHeapMax()intgetMemoryHeapMaxInMegaBytes()StringgetMemoryHeapMin()intgetMemoryHeapMinInMegaBytes()booleanmatchesPreferences()voidread()Read the memory settings that are set in this running JVM.voidsetMemoryDirectMax(String memoryDirectMax)voidsetMemoryHeapMax(String memoryHeapMax)voidsetMemoryHeapMin(String memoryHeapMin)StringtoString()voidwrite()Export the current values to either a Windows environment variable or macOS preferences.voidwritePreferences()voidwritePreferencesToConfigFile()
-
-
-
Constructor Detail
-
VMStartupParameters
public VMStartupParameters(int minHeapMB, int maxHeapMB, int maxDirectMB, Preferences preferences, String windowsEnvironmentVariableName, Preferences macJVMOptions)- Parameters:
minHeapMB- min heap memory in megabytesmaxHeapMB- max heap memory in megabytesmaxDirectMB- max direct memory in megabytespreferences- preferences to read and write values to/fromwindowsEnvironmentVariableName- environment variable for Windows, e.g.BEATUNES_MEMORY, to write to (may be honored by launcher)macJVMOptions- preferences object to store values in for macOS (may be honored by launcher)
-
VMStartupParameters
public VMStartupParameters()
Creates standard instance for beaTunes.
-
-
Method Detail
-
matchesPreferences
public boolean matchesPreferences() throws IOException- Throws:
IOException
-
writePreferencesToConfigFile
public void writePreferencesToConfigFile() throws IOException- Throws:
IOException
-
writePreferences
public void writePreferences()
-
getMemoryHeapMax
public String getMemoryHeapMax()
-
getMemoryHeapMaxInMegaBytes
public int getMemoryHeapMaxInMegaBytes()
-
setMemoryHeapMax
public void setMemoryHeapMax(String memoryHeapMax)
-
getMemoryHeapMin
public String getMemoryHeapMin()
-
getMemoryHeapMinInMegaBytes
public int getMemoryHeapMinInMegaBytes()
-
setMemoryHeapMin
public void setMemoryHeapMin(String memoryHeapMin)
-
getMemoryDirectMax
public String getMemoryDirectMax()
-
setMemoryDirectMax
public void setMemoryDirectMax(String memoryDirectMax)
-
write
public void write() throws IOExceptionExport the current values to either a Windows environment variable or macOS preferences.- Throws:
IOException- if the export fails
-
read
public void read() throws IOExceptionRead the memory settings that are set in this running JVM.- Throws:
IOException- if we cannot read the current settings
-
getMemoryConfiguration
public String getMemoryConfiguration()
-
-