dev@glassfish.java.net

Re: Code Review : Bug #6402120

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Fri, 24 Mar 2006 15:03:46 -0800

Hi Seema,

looks good!

One comment, see inline ...

>------------------------------------------------------------------------
>
>Index: TldConfig.java
>===================================================================
>RCS file: /m/jws/appserv-webtier/src_imported/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/TldConfig.java,v
>retrieving revision 1.12.24.4
>diff -u -r1.12.24.4 TldConfig.java
>--- TldConfig.java 23 Mar 2006 05:33:34 -0000 1.12.24.4
>+++ TldConfig.java 24 Mar 2006 06:41:52 -0000
>@@ -75,7 +75,14 @@
>
> private static final String FILE_URL_PREFIX = "file:";
> private static final int FILE_URL_PREFIX_LEN = FILE_URL_PREFIX.length();
>-
>+
>+ // START CR 6402120
>+ /**
>+ * The variable that indicates whether a single or multiple JVMs
>+ * are running
>+ */
>+ private static boolean isSingleProcess = true;
>+ // END CR 6402120
>
> /*
> * Initializes the set of JARs that are known not to contain any TLDs
>@@ -209,7 +216,26 @@
> }
> // END SJSAS 8.1 5049111
>
>-
>+ // START CR 6402120
>+ /**
>+ * Sets the flag that indicates whether a single
>+ * or multiple JVMs are running.
>+ *
>+ * @param isSingleProcess true for a single JVM process, false otherwise
>+ */
>+ public static void setSingleProcess(boolean isSingleJVM) {
>
>

Please make sure the name of the param ("isSingleJVM")
matches that of the @param ("isSingleProcess").


Jan


>+ isSingleProcess = isSingleJVM;
>
>
>+ }
>+
>+ /**
>+ * Check if multiple JVMs are running
>+ *
>+ * @return true if a single JVM is running, false otherwise
>+ */
>+ public static boolean isSingleProcess() {
>+ return isSingleProcess;
>+ }
>+ // END CR 6402120
>
> /**
> * Set the validation feature of the XML parser used when
>@@ -291,7 +317,19 @@
>
> File tldCache=null;
>
>+ /* CR 6402120
> if (context instanceof StandardContext) {
>+ */
>+ // START CR 6402120
>+ if (log.isDebugEnabled()) {
>+ log.debug("Are multiple JVMs running ? " + (!isSingleProcess));
>+ }
>+
>+ // If multiple JVMs are running, then do not create tldCache.ser
>+ // file as it will cause exceptions on the server side
>+ // because of unsynchronized access of tldCache.ser file.
>+ if ((context instanceof StandardContext) && TldConfig.isSingleProcess()) {
>+ // END CR 6402120
> File workDir= (File)
> ((StandardContext)context).getServletContext().getAttribute(Globals.WORK_DIR_ATTR);
> tldCache=new File( workDir, "tldCache.ser");
>
>