com.sun.enterprise.admin.util
Class JvmOptionsHelper

java.lang.Object
  extended by com.sun.enterprise.admin.util.JvmOptionsHelper

public final class JvmOptionsHelper
extends Object

A helper class to facilitate the add/delete/get jvm options.


Constructor Summary
JvmOptionsHelper(String[] options)
           
 
Method Summary
 String[] addJvmOptions(String[] options)
          Adds the options to its current set.
 String[] deleteJvmOptions(String[] options)
          Deletes the options from its current set.
 String[] getJvmOptions()
          Returns the current set of Jvm options.
 String[] getJvmOptionsAsStoredInXml()
          Returns the current set of Jvm options.
 com.sun.enterprise.admin.util.JvmOptionsElement last()
          Returns the last JvmOptionsElement in the chain of responsibility.
static String[] toStringArray(Collection c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JvmOptionsHelper

public JvmOptionsHelper(String[] options)
                 throws InvalidJvmOptionException
Throws:
InvalidJvmOptionException
Method Detail

addJvmOptions

public String[] addJvmOptions(String[] options)
                       throws InvalidJvmOptionException
Adds the options to its current set. Omits options that already exist. Note :- This method depends on the exact String comparision of the options. Hence an option "a=b c=d" will be added even if individual options already exist.

Parameters:
options -
Returns:
Returns an array of options that could not be added. The array will be atleast of 0 length. An array of length > 0 indicates that some options haven't been added successfully.
Throws:
InvalidJvmOptionException - If any option is invalid. For example, an option that does not start with '-'.
IllegalArgumentException - If options param is null.

last

public com.sun.enterprise.admin.util.JvmOptionsElement last()
Returns the last JvmOptionsElement in the chain of responsibility.


deleteJvmOptions

public String[] deleteJvmOptions(String[] options)
Deletes the options from its current set.

Parameters:
options -
Returns:
Returns an array of options that could not be deleted. The array will be atleast of 0 length. An array of length > 0 indicates that some options haven't been deleted successfully.
Throws:
IllegalArgumentException - If options param is null.

getJvmOptionsAsStoredInXml

public String[] getJvmOptionsAsStoredInXml()
Returns the current set of Jvm options.


getJvmOptions

public String[] getJvmOptions()
Returns the current set of Jvm options.


toStringArray

public static String[] toStringArray(Collection c)


Copyright © 2012. All Rights Reserved.