changeset 1920:9a93570b7b06

2009-05-22 Omair Majid <omajid@redhat.com> * netx/net/sourceforge/jnlp/JNLPFile.java (parse): Fix comment to reflect that the element can be either 'java' or 'j2se'. * netx/net/sourceforge/jnlp/JREDesc.java: Fix comment to reflect a 'java' element. New private variable vmArgs to keep track of 'java-vm-args'. (JREDesc): Modify to take in an additional parameter vmArgs and store it in vmArgs. (getVMArgs): New function. Return the value of 'java-vm-args' attribute. * netx/net/sourceforge/jnlp/Parser.java: Fix comments to reflect either a 'java' or 'j2se' element. (getResourceDesc): Treat 'java' element identically to 'j2se' element. (getJRE): Read in the value of the 'java-vm-args' attribute.
author Omair Majid <omajid@redhat.com>
date Fri, 22 May 2009 10:13:16 -0400
parents 9a952e506f16
children fa12c4801f74
files ChangeLog netx/net/sourceforge/jnlp/JNLPFile.java netx/net/sourceforge/jnlp/JREDesc.java netx/net/sourceforge/jnlp/Parser.java
diffstat 4 files changed, 36 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jul 30 04:51:32 2009 -0400
+++ b/ChangeLog	Fri May 22 10:13:16 2009 -0400
@@ -1,3 +1,17 @@
+2009-05-22  Omair Majid  <omajid@redhat.com>
+
+	* netx/net/sourceforge/jnlp/JNLPFile.java (parse): Fix comment to reflect 
+	that the element can be either 'java' or 'j2se'.
+	* netx/net/sourceforge/jnlp/JREDesc.java: Fix comment to reflect a 'java'
+	element. New private variable vmArgs to keep track of 'java-vm-args'.
+	(JREDesc): Modify to take in an additional parameter vmArgs and store it in
+	vmArgs.
+	(getVMArgs): New function. Return the value of 'java-vm-args' attribute.
+	* netx/net/sourceforge/jnlp/Parser.java: Fix comments to reflect either a
+	'java' or 'j2se' element.
+	(getResourceDesc): Treat 'java' element identically to 'j2se' element.
+	(getJRE): Read in the value of the 'java-vm-args' attribute. 
+
 2009-07-30  Gary Benson  <gbenson@redhat.com>
 
 	* ports/hotspot/src/share/vm/shark/sharkRuntime.hpp:
--- a/netx/net/sourceforge/jnlp/JNLPFile.java	Thu Jul 30 04:51:32 2009 -0400
+++ b/netx/net/sourceforge/jnlp/JNLPFile.java	Fri May 22 10:13:16 2009 -0400
@@ -505,7 +505,7 @@
             sourceLocation = parser.getFileLocation();
 
             info = parser.getInfo(root);
-            resources = parser.getResources(root, false); // false == not a j2se resources section
+            resources = parser.getResources(root, false); // false == not a j2se/java resources section
             launchType = parser.getLauncher(root);
             security = parser.getSecurity(root);
         }
--- a/netx/net/sourceforge/jnlp/JREDesc.java	Thu Jul 30 04:51:32 2009 -0400
+++ b/netx/net/sourceforge/jnlp/JREDesc.java	Fri May 22 10:13:16 2009 -0400
@@ -22,7 +22,7 @@
 import java.util.*;
 
 /**
- * The J2SE element.
+ * The J2SE/Java element.
  *
  * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
  * @version $Revision: 1.5 $
@@ -41,6 +41,9 @@
     /** maximum head size */
     private long maximumHeapSize;
 
+    /** args to pass to the vm */
+    private String vmArgs;
+    
     /** list of ResourceDesc objects */
     private List resources;
 
@@ -55,9 +58,12 @@
      * @param maximumHeadSize maximum head size
      * @param resources list of ResourceDesc objects
      */
-    public JREDesc(Version version, URL location, String initialHeapSize, String maximumHeapSize, List resources) {
+    public JREDesc(Version version, URL location, 
+            String vmArgs, String initialHeapSize, 
+            String maximumHeapSize, List resources) {
         this.version = version;
         this.location = location;
+        this.vmArgs = vmArgs;
         this.initialHeapSize = heapToLong(initialHeapSize);
         this.maximumHeapSize = heapToLong(maximumHeapSize);
         this.resources = resources;
@@ -110,6 +116,13 @@
     }
 
     /**
+     * Returns the additional arguments to pass to the Java VM
+     */
+    public String getVMArgs() {
+        return vmArgs;
+    }
+    
+    /**
      * Convert a heap size description string to a long value
      * indicating the heap min/max size.
      */
--- a/netx/net/sourceforge/jnlp/Parser.java	Thu Jul 30 04:51:32 2009 -0400
+++ b/netx/net/sourceforge/jnlp/Parser.java	Fri May 22 10:13:16 2009 -0400
@@ -186,7 +186,7 @@
      * node (jnlp or j2se).
      *
      * @param parent the parent node (either jnlp or j2se)
-     * @param j2se true if the resources are located under a j2se node
+     * @param j2se true if the resources are located under a j2se or java node
      * @throws ParseException if the JNLP file is invalid
      */
     public List getResources(Node parent, boolean j2se) throws ParseException {
@@ -208,7 +208,7 @@
      * Returns the ResourcesDesc element at the specified node.
      *
      * @param node the resources node
-     * @param j2se true if the resources are located under a j2se node
+     * @param j2se true if the resources are located under a j2se or java node
      * @throws ParseException if the JNLP file is invalid
      */
     public ResourcesDesc getResourcesDesc(Node node, boolean j2se) throws ParseException {
@@ -231,7 +231,7 @@
                 if (!isTrustedEnvironment())
                     throw new ParseException(R("PUntrustedNative"));
 
-            if ("j2se".equals(name)) {
+            if ("j2se".equals(name) || "java".equals(name)) {
                 if (getChildNode(root, "component-desc") != null)
                     if (strict)
                         throw new ParseException(R("PExtensionHasJ2SE"));
@@ -273,12 +273,13 @@
     /**
      * Returns the JRE element at the specified node.
      *
-     * @param node the j2se node 
+     * @param node the j2se/java node 
      * @throws ParseException if the JNLP file is invalid
      */
     public JREDesc getJRE(Node node) throws ParseException {
         Version version = getVersion(node, "version", null);
         URL location = getURL(node, "href", base);
+        String vmArgs = getAttribute(node, "java-vm-args",null);
         String initialHeap = getAttribute(node, "initial-heap-size", null);
         String maxHeap = getAttribute(node, "max-heap-size", null);
         List resources = getResources(node, true);
@@ -286,7 +287,7 @@
         // require version attribute
         getRequiredAttribute(node, "version", null);
 
-        return new JREDesc(version, location, initialHeap, maxHeap, resources);
+        return new JREDesc(version, location, vmArgs, initialHeap, maxHeap, resources);
     }
 
     /**