public JvmOptionsHelper(String[] options) throws InvalidJvmOptionException { if (null == options) { throw new IllegalArgumentException(); } if (options.length == 0) { head = new JvmOptionsElement(""); } else { head = new JvmOptionsElement(options[0]); } JvmOptionsElement current = head; for (int i = 1; i < options.length; i++) { JvmOptionsElement next = new JvmOptionsElement(options[i]); current.setNext(next); current = next; } }
/** * Deletes the option from its set of jvm options and then invokes the next * in the chain. * * @param option * @return Returns true if the option exists in at least one element in the * chain. */ boolean deleteJvmOption(String option) { boolean b1 = jvmOptions.remove(option); boolean b2 = next().deleteJvmOption(option); return (b1 || b2); }
public String toString() { return getJvmOptionsAsStoredInXml(); }
/** * Returns the current set of Jvm options. */ public String[] getJvmOptions() { Set s = new LinkedHashSet(); JvmOptionsElement current = head; while (!JvmOptionsElement.isLast(current)) { ArrayList options = current.getJvmOptions(); if ((options != null) && (options.size() > 0)) { s.addAll(options); } current = current.next(); } return toStringArray(s); }
/** * Returns the current set of Jvm options. */ public String[] getJvmOptionsAsStoredInXml() { Set s = new LinkedHashSet(); JvmOptionsElement current = head; while (!JvmOptionsElement.isLast(current)) { String options = current.getJvmOptionsAsStoredInXml(); if ((options != null) && (options.length() > 0)) { s.add(options); } current = current.next(); } return toStringArray(s); }
JvmOptionsElement last = last(); for (int i = 0; i < options.length; i++) { if (!head.hasOption(options[i])) { JvmOptionsElement x = new JvmOptionsElement(options[i]); last.setNext(x); last = x; } else {
boolean hasOption(String option) { boolean exists = jvmOptions.contains(option); if (!exists) { exists = next.hasOption(option); } return exists; }
private void checkValidOption(String option) throws InvalidJvmOptionException { if ((null == option) || option.equals("")) { throw new InvalidJvmOptionException(strMgr.getString( "jvmOptions.invalid_option", option)); } if (!option.startsWith("-") && !(option.startsWith("\"-") && option.endsWith("\""))) { throw new InvalidJvmOptionException(strMgr.getString( "jvmOptions.no_dash", option)); } //4923404 checkQuotes(option); //4923404 }
/** * Deletes the options from its current set. * * @param options * @return Returns an array of options that <bold>could not</bold> 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. */ public String[] deleteJvmOptions(String[] options) { if (null == options) { throw new IllegalArgumentException(); } final Set donotExist = new HashSet(); for (int i = 0; i < options.length; i++) { if (!head.deleteJvmOption(options[i])) { donotExist.add(options[i]); } } return toStringArray(donotExist); }
checkValidOption(option); jvmOptions.add(option);
/** * Returns the current set of Jvm options. */ public String[] getJvmOptions() { Set s = new LinkedHashSet(); JvmOptionsElement current = head; while (!JvmOptionsElement.isLast(current)) { ArrayList options = current.getJvmOptions(); if ((options != null) && (options.size() > 0)) { s.addAll(options); } current = current.next(); } return toStringArray(s); }
/** * Returns the current set of Jvm options. */ public String[] getJvmOptionsAsStoredInXml() { Set s = new LinkedHashSet(); JvmOptionsElement current = head; while (!JvmOptionsElement.isLast(current)) { String options = current.getJvmOptionsAsStoredInXml(); if ((options != null) && (options.length() > 0)) { s.add(options); } current = current.next(); } return toStringArray(s); }
for (int i = 0; i < options.length; i++) if (!head.hasOption(options[i])) JvmOptionsElement x = new JvmOptionsElement(options[i]); last.setNext(x); last = x;
boolean hasOption(String option) { boolean exists = jvmOptions.contains(option); if (!exists) { exists = next.hasOption(option); } return exists; }
private void checkValidOption(String option) throws InvalidJvmOptionException { if ((null == option) || option.equals("")) { throw new InvalidJvmOptionException(strMgr.getString( "jvmOptions.invalid_option", option)); } if (!option.startsWith("-") && !(option.startsWith("\"-") && option.endsWith("\""))) { throw new InvalidJvmOptionException(strMgr.getString( "jvmOptions.no_dash", option)); } //4923404 checkQuotes(option); //4923404 }
/** * Deletes the options from its current set. * @param options * @return Returns an array of options that <bold>could not</bold> 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. */ public String[] deleteJvmOptions(String[] options) { if (null == options) { throw new IllegalArgumentException(); } //The following tokenizes the options. // options = tokenize(options); final Set donotExist = new HashSet(); for (int i = 0; i < options.length; i++) { if (!head.deleteJvmOption(options[i])) { donotExist.add(options[i]); } } return toStringArray(donotExist); }
checkValidOption(option); jvmOptions.add(option);
/** * Deletes the option from its set of jvm options and then invokes the next * in the chain. * @param option * @return Returns true if the option exists in at least one element in the * chain. */ boolean deleteJvmOption(String option) { boolean b1 = jvmOptions.remove(option); boolean b2 = next().deleteJvmOption(option); return (b1 || b2); }