stephan 2003/03/05 10:40:48
Modified: src/blocks/chaperon/java/org/apache/cocoon/transformation LexicalTransformer.java ParserTransformer.java PatternTransformer.java Log: The transient store seems to have problems serializing the inner classes of the transformers. Revision Changes Path 1.4 +13 -6 xml-cocoon2/src/blocks/chaperon/java/org/apache/cocoon/transformation/LexicalTransformer.java Index: LexicalTransformer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/java/org/apache/cocoon/transformation/LexicalTransformer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- LexicalTransformer.java 3 Mar 2003 18:08:53 -0000 1.3 +++ LexicalTransformer.java 5 Mar 2003 18:40:48 -0000 1.4 @@ -193,15 +193,9 @@ LexicalAutomatonEntry entry = (LexicalAutomatonEntry) store.get(this.lexiconSource.getURI()); // If the parser table has changed, rebuild the parser table - - /*if (entry!=null) - System.out.println("entry.getValidity()="+entry.getValidity()); - System.out.println("this.lexiconSource.getValidity()="+this.lexiconSource.getValidity()+" of - "+this.lexiconSource.getURI());*/ if ((entry==null) || (entry.getValidity()==null) || (entry.getValidity().isValid(this.lexiconSource.getValidity())<= 0)) { - /* (!entry.getValidity().isValid(this.lexiconSource.getValidity()))) { */ this.logger.info("(Re)building the automaton from '"+ this.lexiconSource.getURI()+"'"); @@ -225,6 +219,7 @@ this.logger.info("Store automaton into store for '"+ this.lexiconSource.getURI()+"'"); + store.store(this.lexiconSource.getURI(), new LexicalAutomatonEntry(this.automaton, this.lexiconSource.getValidity())); @@ -341,6 +336,18 @@ */ public LexicalAutomaton getLexicalAutomaton() { return this.automaton; + } + + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { + out.writeObject(validity); + out.writeObject(automaton); + } + + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException { + validity = (SourceValidity)in.readObject(); + automaton = (LexicalAutomaton)in.readObject(); } } } 1.4 +15 -8 xml-cocoon2/src/blocks/chaperon/java/org/apache/cocoon/transformation/ParserTransformer.java Index: ParserTransformer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/java/org/apache/cocoon/transformation/ParserTransformer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ParserTransformer.java 3 Mar 2003 18:08:53 -0000 1.3 +++ ParserTransformer.java 5 Mar 2003 18:40:48 -0000 1.4 @@ -4,7 +4,7 @@ The Apache Software License, Version 1.1 ============================================================================ - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved. + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: @@ -116,9 +116,6 @@ implements Transformer, LogEnabled, Composable, Parameterizable, Recyclable, Disposable, CacheableProcessingComponent { - /** Namespace for the SAX events. */ -/* public final static String NS = "http://apache.org/cocoon/lexemes/1.0";*/ - private XMLConsumer consumer = null; private String grammar = null; @@ -178,7 +175,6 @@ setLexicalHandler(consumer); adapter.setContentHandler(consumer); -// adapter.setNamespace(NS); } /** @@ -215,7 +211,6 @@ if ((entry==null) || (entry.getValidity()==null) || (entry.getValidity().isValid(this.grammarSource.getValidity()))<= 0) { - this.logger.info("(Re)building the automaton from '"+ this.grammarSource.getURI()+"'"); @@ -322,7 +317,7 @@ /** * This class represent a entry in a store to cache - * the parser automaton. + * the parser automaton. */ public class ParserAutomatonEntry implements Serializable { private SourceValidity validity = null; @@ -356,6 +351,18 @@ */ public ParserAutomaton getParserAutomaton() { return this.automaton; + } + + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { + out.writeObject(validity); + out.writeObject(automaton); + } + + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException { + validity = (SourceValidity) in.readObject(); + automaton = (ParserAutomaton) in.readObject(); } } } 1.6 +13 -1 xml-cocoon2/src/blocks/chaperon/java/org/apache/cocoon/transformation/PatternTransformer.java Index: PatternTransformer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/java/org/apache/cocoon/transformation/PatternTransformer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- PatternTransformer.java 3 Mar 2003 18:08:53 -0000 1.5 +++ PatternTransformer.java 5 Mar 2003 18:40:48 -0000 1.6 @@ -530,5 +530,17 @@ public LexicalAutomaton getLexicalAutomaton() { return this.automaton; } + + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { + out.writeObject(validity); + out.writeObject(automaton); + } + + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException { + validity = (SourceValidity)in.readObject(); + automaton = (LexicalAutomaton)in.readObject(); + } } }