org.codehaus.mojo.cobertura.configuration
Class MaxHeapSizeUtil

java.lang.Object
  extended by org.codehaus.mojo.cobertura.configuration.MaxHeapSizeUtil

public class MaxHeapSizeUtil
extends Object

Class for checking and retrieving the maven environment variable for the maximum heap size setting.

Since:
2.3
Author:
Trampas Kirk

Field Summary
static String MAVEN_OPTIONS
          The maven options environment variable.
static String MAX_MEMORY_FLAG
          The max heap size JVM parameter.
 
Method Summary
 boolean envHasMavenMaxMemSetting()
          Returns true if the current environment has the max heap size set in the maven options, otherwise false.
static MaxHeapSizeUtil getInstance()
          Singleton getter.
 String getMavenMaxMemSetting()
          Gets the maximum heap size JVM argument from the maven options environment variable.
 void setEnvSettings(Map<String,String> envSettings)
          Sets the System.getEnv() settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAVEN_OPTIONS

public static final String MAVEN_OPTIONS
The maven options environment variable. Case sensitive.

See Also:
Constant Field Values

MAX_MEMORY_FLAG

public static final String MAX_MEMORY_FLAG
The max heap size JVM parameter. Case sensitive.

See Also:
Constant Field Values
Method Detail

getInstance

public static MaxHeapSizeUtil getInstance()
Singleton getter.

Returns:
the MemSettingUtil instance.

setEnvSettings

public void setEnvSettings(Map<String,String> envSettings)
Sets the System.getEnv() settings.

Parameters:
envSettings - the settings map to use

getMavenMaxMemSetting

public String getMavenMaxMemSetting()
Gets the maximum heap size JVM argument from the maven options environment variable. Returns only the numeric and unit portion. For example, given a maven options setting of "-Xmx64m" this method will return "64m". Returns null if the maven environment variable isn't set, the JVM heap size argument is not present, or the JVM heap size argument is somehow invalid.

Returns:
the maximum heap size JVM argument from the maven options environment variable
See Also:
envHasMavenMaxMemSetting()

envHasMavenMaxMemSetting

public boolean envHasMavenMaxMemSetting()
Returns true if the current environment has the max heap size set in the maven options, otherwise false.

Returns:
true if the current environment has the max heap size set in the maven options, otherwise false.
See Also:
getMavenMaxMemSetting()


Copyright © 2005-2014 Codehaus. All Rights Reserved.