KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > coplets > basket > AbstractBasketTransformer


1 /*
2  * Copyright 2004-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.portal.coplets.basket;
17
18 import org.apache.avalon.framework.activity.Disposable;
19 import org.apache.avalon.framework.service.ServiceException;
20 import org.apache.avalon.framework.service.ServiceManager;
21 import org.apache.cocoon.transformation.AbstractSAXTransformer;
22
23 /**
24  * This is the base class for all basket transformers
25  *
26  * @version $Id: BasketTransformer.java 47047 2004-09-22 12:27:27Z vgritsenko $
27  */

28 public abstract class AbstractBasketTransformer extends AbstractSAXTransformer
29                                                implements Disposable {
30
31     /** The namespace URI to listen for. */
32     public static final String JavaDoc NAMESPACE_URI = "http://apache.org/cocoon/portal/basket/1.0";
33
34     /** The basket manager */
35     protected BasketManager basketManager;
36
37     /**
38      * Constructor
39      */

40     public AbstractBasketTransformer() {
41         super.defaultNamespaceURI = NAMESPACE_URI;
42     }
43
44     /* (non-Javadoc)
45      * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
46      */

47     public void service(ServiceManager manager) throws ServiceException {
48         super.service(manager);
49         this.basketManager = (BasketManager) this.manager.lookup(BasketManager.ROLE);
50     }
51
52     /* (non-Javadoc)
53      * @see org.apache.avalon.framework.activity.Disposable#dispose()
54      */

55     public void dispose() {
56         if (this.manager != null) {
57             this.manager.release(this.basketManager);
58         }
59         super.dispose();
60     }
61 }
62
Popular Tags