Skip to main content

[webtier] small correction of the valve-patch

1 reply [Last post]
Anonymous

My patch for introducing valves which can be configured to take
parameters actually /did/ contain a bug.

The bug was in the deloyment/dol part of the code. In ValveNode I forgot
to add the code which iterates over each Node when writing out XML.
Thanks to Hong's hints about adding the jvm-option -Dwriteout.xml to
domains.xml I was able to detect this ommission.

This way I finally also found out when the method writeDescriptor() gets
called ;-)

Now as I wrote in my answer to the committer mail I am a bit unsure
about procedures. I've found a guidelines page on the wiki which among
other things says that commits have to be reviewed - thus I've attached
a diff to this mail. The review should be pretty straightforward given
the extreme smallness of this patch. If I have to consider anything
else, please let me know.

Thanks,

--
Wolfram Rittmeyer
Index: dol/src/main/java/com/sun/enterprise/deployment/node/runtime/web/ValveNode.java
===================================================================
--- dol/src/main/java/com/sun/enterprise/deployment/node/runtime/web/ValveNode.java (revision 24789)
+++ dol/src/main/java/com/sun/enterprise/deployment/node/runtime/web/ValveNode.java (working copy)
@@ -38,7 +38,6 @@

import com.sun.enterprise.deployment.node.XMLElement;
import com.sun.enterprise.deployment.runtime.web.Valve;
-import com.sun.enterprise.deployment.runtime.web.WebProperty;
import com.sun.enterprise.deployment.xml.RuntimeTagNames;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -99,4 +98,20 @@

return valve;
}
+
+ /**
+ * write the descriptor class to a DOM tree and return it
+ *
+ * @param parent node for the DOM tree
+ * @param node name for the descriptor
+ * @param the array of descriptors to write
+ */
+ public void writeDescriptor(Node parent, String nodeName, Valve[] valves) {
+ if (valves == null) {
+ return;
+ }
+ for (int i = 0; i < valves.length; i++) {
+ writeDescriptor(parent, nodeName, valves[i]);
+ }
+ }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jan Luehe

Hi Wolfram,

On 02/19/09 12:12 PM, Wolfram Rittmeyer wrote:
> My patch for introducing valves which can be configured to take
> parameters actually /did/ contain a bug.
>
> The bug was in the deloyment/dol part of the code. In ValveNode I
> forgot to add the code which iterates over each Node when writing out
> XML. Thanks to Hong's hints about adding the jvm-option -Dwriteout.xml
> to domains.xml I was able to detect this ommission.
>
> This way I finally also found out when the method writeDescriptor()
> gets called ;-)
>
> Now as I wrote in my answer to the committer mail I am a bit unsure
> about procedures. I've found a guidelines page on the wiki which among
> other things says that commits have to be reviewed - thus I've
> attached a diff to this mail. The review should be pretty
> straightforward given the extreme smallness of this patch. If I have
> to consider anything else, please let me know.

Thanks for the patch, and thanks to Hong for the "writeout.xml" system
property hint!

I've reviewed your diffs, and the look good to me.

You have already been granted commit privileges, so go ahead and commit! :)

Please follow this format in your commit message:

Fix for https://glassfish.dev.java.net/issues/show_bug.cgi?id=
("")

Reviewed by:

Tests run:

Once you've committed, update
https://glassfish.dev.java.net/issues/show_bug.cgi?id=
with the output of the commit command (which includes the new revision
numbers of any
affected files).

Let us know if you have any questions!

Thanks,

Jan

>
> Thanks,
>
> --
> Wolfram Rittmeyer
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net

[att1.html]