KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > ProcessorWrapper


1 /*
2  * Copyright 1999-2005 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;
17
18 import java.util.Map JavaDoc;
19
20 import org.apache.avalon.framework.activity.Disposable;
21 import org.apache.avalon.framework.component.Component;
22 import org.apache.avalon.framework.thread.ThreadSafe;
23 import org.apache.cocoon.components.pipeline.ProcessingPipeline;
24 import org.apache.cocoon.environment.Environment;
25
26 /**
27  * This class is a wrapper around the real processor (the <code>Cocoon</code> class).
28  * It is necessary to avoid infinite dispose loops
29  * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
30  * @deprecated This class is not used anymore and will be removed with 2.2
31  * @version CVS $Id: ProcessorWrapper.java 151221 2005-02-03 20:22:12Z cziegeler $
32  */

33 public final class ProcessorWrapper
34 implements Processor, Component, Disposable, ThreadSafe {
35
36     private Processor processor;
37
38     public void dispose() {
39         this.processor = null;
40     }
41
42     public ProcessorWrapper(Processor processor) {
43         this.processor = processor;
44     }
45
46     /**
47      * Process the given <code>Environment</code> producing the output
48      */

49     public boolean process(Environment environment)
50     throws Exception JavaDoc {
51         return this.processor.process(environment);
52     }
53
54     /**
55      * Process the given <code>Environment</code> to assemble
56      * a <code>ProcessingPipeline</code>.
57      * @since 2.1
58      */

59     public ProcessingPipeline buildPipeline(Environment environment)
60     throws Exception JavaDoc {
61         return this.processor.buildPipeline(environment);
62     }
63
64     /**
65      * Get the sitemap component configurations
66      * @since 2.1
67      */

68     public Map JavaDoc getComponentConfigurations() {
69         return this.processor.getComponentConfigurations();
70     }
71     
72     /**
73      * Get the root parent processor of this processor
74      * @since 2.1.1
75      */

76     public Processor getRootProcessor() {
77         return this.processor.getRootProcessor();
78     }
79
80 }
81
Popular Tags