KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > language > generator > ProgramGenerator


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.components.language.generator;
17
18 import org.apache.avalon.framework.component.Component;
19 import org.apache.avalon.framework.component.ComponentManager;
20 import org.apache.excalibur.source.Source;
21
22 import org.apache.cocoon.environment.SourceResolver;
23
24 /**
25  * This interface defines a loader for programs automatically built from XML
26  * documents written in a <code>MarkupLanguage</code>
27  *
28  * @author <a HREF="mailto:ricardo@apache.org">Ricardo Rocha</a>
29  * @version CVS $Id: ProgramGenerator.java 30932 2004-07-29 17:35:38Z vgritsenko $
30  */

31 public interface ProgramGenerator extends Component {
32
33     String JavaDoc ROLE = ProgramGenerator.class.getName();
34
35     /**
36      * Load a program built from an XML document written in a
37      * <code>MarkupLanguage</code>
38      *
39      * @param newManager The ComponentManager that it will be loaded with
40      * @param fileName The input document's <code>File</code> name
41      * @param markupLanguage The <code>MarkupLanguage</code> in which the input
42      * document is written
43      * @param programmingLanguage The <code>ProgrammingLanguage</code> in which
44      * the program must be written
45      * @return The loaded object
46      * @exception Exception If an error occurs during generation or loading
47      * @deprecated Pass Source object instead of file name.
48      */

49     CompiledComponent load(
50             ComponentManager newManager,
51             String JavaDoc fileName,
52             String JavaDoc markupLanguage,
53             String JavaDoc programmingLanguage,
54             SourceResolver resolver) throws Exception JavaDoc;
55
56     /**
57      * Load a program built from an XML document written in a
58      * <code>MarkupLanguage</code>
59      *
60      * @param newManager The ComponentManager that it will be loaded with
61      * @param source The input document's <code>File</code> name
62      * @param markupLanguage The <code>MarkupLanguage</code> in which the input
63      * document is written
64      * @param programmingLanguage The <code>ProgrammingLanguage</code> in which
65      * the program must be written
66      * @return The loaded object
67      * @exception Exception If an error occurs during generation or loading
68      */

69     CompiledComponent load(
70             ComponentManager newManager,
71             Source source,
72             String JavaDoc markupLanguage,
73             String JavaDoc programmingLanguage,
74             SourceResolver resolver) throws Exception JavaDoc;
75
76     /**
77      * Release a program instance built from an XML document written in a
78      * <code>MarkupLanguage</code>.
79      *
80      * @param component to be released.
81      */

82     void release(CompiledComponent component);
83
84     /**
85      * Remove a program from the generator's cache and dipose all
86      * instances of this program.
87      *
88      * @param source of the program to be removed.
89      */

90     void remove(Source source);
91 }
92
Popular Tags