Methods Summary |
---|
public java.lang.String[] | addJvmOptions(java.lang.String[] options)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.
if (null == options)
{
throw new IllegalArgumentException();
}
final Set alreadyExist = new HashSet();
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
{
alreadyExist.add(options[i]);
}
}
return toStringArray(alreadyExist);
|
public java.lang.String[] | deleteJvmOptions(java.lang.String[] options)Deletes the options from its current set.
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);
|
public java.lang.String[] | getJvmOptions()Returns the current set of Jvm options.
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);
|
public java.lang.String[] | getJvmOptionsAsStoredInXml()Returns the current set of Jvm options.
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);
|
public com.sun.enterprise.admin.util.JvmOptionsElement | last()Returns the last JvmOptionsElement in the chain of responsibility.
JvmOptionsElement current = head;
while (current.hasNext())
{
current = current.next();
}
return current;
|
public static java.lang.String[] | toStringArray(java.util.Collection c)
final String[] s = new String[c.size()];
final Iterator it = c.iterator();
int i = 0;
while (it.hasNext())
{
s[i] = (String)it.next();
i++;
}
return s;
|
private static java.lang.String[] | tokenize(java.lang.String[] options)
Set s = new LinkedHashSet();
//4923404
for (int i = 0; i < options.length; i++)
{
QuotedStringTokenizer strTok = new QuotedStringTokenizer(
options[i], " \t");
while (strTok.hasMoreTokens())
{
s.add(strTok.nextToken());
}
}
//4923404
return toStringArray(s);
|