KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > generation > ServletGenerator


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.generation;
17
18 import org.apache.avalon.framework.parameters.Parameters;
19
20 import org.apache.cocoon.ProcessingException;
21 import org.apache.cocoon.environment.Context;
22 import org.apache.cocoon.environment.ObjectModelHelper;
23 import org.apache.cocoon.environment.Request;
24 import org.apache.cocoon.environment.Response;
25 import org.apache.cocoon.environment.SourceResolver;
26
27 import org.xml.sax.SAXException JavaDoc;
28
29 import java.io.IOException JavaDoc;
30 import java.util.Map JavaDoc;
31
32 /**
33  *
34  * @author <a HREF="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
35  * @version CVS $Id: ServletGenerator.java 36466 2004-08-16 10:08:39Z cziegeler $
36  */

37 public abstract class ServletGenerator extends ComposerGenerator {
38
39     protected Request request;
40     protected Response response;
41     protected Context context;
42
43     public void setup(SourceResolver resolver, Map JavaDoc objectModel, String JavaDoc src, Parameters par)
44     throws ProcessingException, SAXException JavaDoc, IOException JavaDoc {
45
46         super.setup(resolver, objectModel, src, par);
47         this.request = ObjectModelHelper.getRequest(objectModel);
48         this.response = ObjectModelHelper.getResponse(objectModel);
49         this.context = ObjectModelHelper.getContext(objectModel);
50     }
51
52     /* (non-Javadoc)
53      * @see org.apache.avalon.excalibur.pool.Recyclable#recycle()
54      */

55     public void recycle() {
56         super.recycle();
57         this.request = null;
58         this.response = null;
59         this.context = null;
60     }
61 }
62
Popular Tags