Note: forwarded message attached.
=====
Davanum Srinivas - http://jguru.com/dims/
__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com
--- Begin Message ---
Vadim,
Please see my other email that i sent just now...
- Am open to discussion on what the preload flag means. Am sorry if i tripped on
another
"feature".
- The duplicate code is needed because even if the source code (.java) is missing but
if the
classes are present in the classloader, we should use it.
Am open to suggestions, patches, criticism...But please try it out
"-Dbuild.precompile=true"
feature in the build script. Again, Please see my other email that i sent just now...
Thanks,
dims
--- Vadim Gritsenko <[EMAIL PROTECTED]> wrote:
> Dims,
>
> I can't get this one:
>
> > + if (programInstance != null && !this.preload &&
> > this.autoReload) {
>
> You are basically disabling realod feature? Preload is true by default
> (IIRC), so XSPs and sitemaps won't be recompiled anymore.
>
> Another one:
>
> > + try {
> > + Class program = this.loadProgram(filename,
> baseDirectory);
> > + Object testInstance = program.newInstance();
> > + return new JavaProgram(program);
> > + } catch (Throwable t) {
> > + //Ignore errors if any.
> > + }
>
> Next line does the same:
>
> return new JavaProgram(this.loadProgram(filename,
> baseDirectory));
>
> So why duplicate?
>
> Vadim
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 08, 2002 2:07 PM
> > To: [EMAIL PROTECTED]
> > Subject: cvs commit: xml-
> > cocoon2/src/java/org/apache/cocoon/components/language/programming
> > CompiledProgrammingLanguage.java
> >
> > dims 02/02/08 11:07:05
> >
> > Modified: . build.xml
> >
> src/java/org/apache/cocoon/components/language/generator
> > ProgramGeneratorImpl.java
> >
> src/java/org/apache/cocoon/components/language/programming
> > CompiledProgrammingLanguage.java
> > Log:
> > Finally, "build.precompile=true" works....
> >
> > Revision Changes Path
> > 1.160 +1 -0 xml-cocoon2/build.xml
> >
> > Index: build.xml
> > ===================================================================
> > RCS file: /home/cvs/xml-cocoon2/build.xml,v
> > retrieving revision 1.159
> > retrieving revision 1.160
> > diff -u -r1.159 -r1.160
> > --- build.xml 7 Feb 2002 23:28:34 -0000 1.159
> > +++ build.xml 8 Feb 2002 19:07:04 -0000 1.160
> > @@ -1026,6 +1026,7 @@
> > <fileset dir="lib/optional">
> > <include name="**/*.jar"/>
> > </fileset>
> > + <pathelement location="${build.war}/WEB-INF/classes"/>
> > <pathelement location="${build.dir}/${name}.jar"/>
> > <pathelement location="${tools.jar}"/>
> > </classpath>
> >
> >
> >
> > 1.8 +2 -2 xml-
> >
> cocoon2/src/java/org/apache/cocoon/components/language/generator/Program
> Genera
> > torImpl.java
> >
> > Index: ProgramGeneratorImpl.java
> > ===================================================================
> > RCS file: /home/cvs/xml-
> >
> cocoon2/src/java/org/apache/cocoon/components/language/generator/Program
> Genera
> > torImpl.java,v
> > retrieving revision 1.7
> > retrieving revision 1.8
> > diff -u -r1.7 -r1.8
> > --- ProgramGeneratorImpl.java 7 Feb 2002 04:07:27 -0000
> 1.7
> > +++ ProgramGeneratorImpl.java 8 Feb 2002 19:07:05 -0000
> 1.8
> > @@ -93,7 +93,7 @@
> > *
> > * @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
> > * @author <a href="mailto:[EMAIL PROTECTED]">Vadim
> Gritsenko</a>
> > - * @version CVS $Id: ProgramGeneratorImpl.java,v 1.7 2002/02/07
> 04:07:27
> > vgritsenko Exp $
> > + * @version CVS $Id: ProgramGeneratorImpl.java,v 1.8 2002/02/08
> 19:07:05
> > dims Exp $
> > */
> > public class ProgramGeneratorImpl extends AbstractLoggable
> > implements ProgramGenerator, Contextualizable, Composable,
> > Parameterizable,
> > @@ -269,7 +269,7 @@
> > * FIXME: It's the program (not the instance) that must
> > * be queried for changes!!!
> > */
> > - if (programInstance != null && this.autoReload) {
> > + if (programInstance != null && !this.preload &&
> > this.autoReload) {
> > // Autoreloading: Unload program if its source is
> modified
> > long lastModified = source.getLastModified();
> > if (lastModified == 0 ||
> > programInstance.modifiedSince(lastModified)) {
> >
> >
> >
> > 1.6 +12 -1 xml-
> >
> cocoon2/src/java/org/apache/cocoon/components/language/programming/Compi
> ledPro
> > grammingLanguage.java
> >
> > Index: CompiledProgrammingLanguage.java
> > ===================================================================
> > RCS file: /home/cvs/xml-
> >
> cocoon2/src/java/org/apache/cocoon/components/language/programming/Compi
> ledPro
> > grammingLanguage.java,v
> > retrieving revision 1.5
> > retrieving revision 1.6
> > diff -u -r1.5 -r1.6
> > --- CompiledProgrammingLanguage.java 7 Feb 2002 04:07:27
> -0000 1.5
> > +++ CompiledProgrammingLanguage.java 8 Feb 2002 19:07:05
> -0000 1.6
> > @@ -73,7 +73,7 @@
> > * A compiled programming language. This class extends
> > <code>AbstractProgrammingLanguage</code> adding support for
> compilation
> > * and object program files
> > * @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
> > - * @version CVS $Id: CompiledProgrammingLanguage.java,v 1.5
> 2002/02/07
> > 04:07:27 vgritsenko Exp $
> > + * @version CVS $Id: CompiledProgrammingLanguage.java,v 1.6
> 2002/02/08
> > 19:07:05 dims Exp $
> > */
> > public abstract class CompiledProgrammingLanguage extends
> > AbstractProgrammingLanguage implements Contextualizable {
> >
> > @@ -177,6 +177,17 @@
> > * @exception LanguageException If an error occurs during
> compilation
> > */
> > public Program load(String filename, File baseDirectory, String
> > encoding) throws LanguageException {
> > +
> > + // Used for preload/precompile option.
> > + // Don't need to test for existence of the Source code.
> > + try {
> > + Class program = this.loadProgram(filename,
> baseDirectory);
> > + Object testInstance = program.newInstance();
> > + return new JavaProgram(program);
> > + } catch (Throwable t) {
> > + //Ignore errors if any.
> > + }
> > +
> > // Does object file exist? Load and return instance
> > File objectFile = new File(baseDirectory, new
> >
> StringBuffer(filename).append(".").append(this.getObjectExtension()).toS
> tring(
> > ));
> > if (objectFile.exists() && objectFile.isFile() &&
> > objectFile.canRead()) {
> >
> >
> >
> >
> > ----------------------------------------------------------------------
> > In case of troubles, e-mail: [EMAIL PROTECTED]
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
=====
Davanum Srinivas - http://jguru.com/dims/
__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com
--- End Message ---
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]