KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > components > modules > input > AbstractModule


1 /*
2  * Copyright 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.components.modules.input;
17
18 import java.util.Collections JavaDoc;
19 import java.util.Iterator JavaDoc;
20 import java.util.Map JavaDoc;
21
22 import org.apache.avalon.framework.configuration.Configuration;
23 import org.apache.avalon.framework.configuration.ConfigurationException;
24 import org.apache.avalon.framework.service.ServiceException;
25 import org.apache.avalon.framework.service.ServiceManager;
26 import org.apache.avalon.framework.service.Serviceable;
27 import org.apache.avalon.framework.thread.ThreadSafe;
28 import org.apache.cocoon.components.modules.input.InputModule;
29
30 /**
31  * @version CVS $Id: AbstractModule.java 148910 2005-01-28 18:19:44Z cziegeler $
32  */

33 public abstract class AbstractModule
34 implements InputModule, Serviceable, ThreadSafe {
35     
36     /**
37      * The service manager.
38      */

39     protected ServiceManager manager;
40     
41     /* (non-Javadoc)
42      * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
43      */

44     public void service(ServiceManager manager) throws ServiceException {
45         this.manager = manager;
46     }
47
48     /* (non-Javadoc)
49      * @see org.apache.cocoon.components.modules.input.InputModule#getAttributeNames(org.apache.avalon.framework.configuration.Configuration, java.util.Map)
50      */

51     public Iterator JavaDoc getAttributeNames(Configuration modeConf, Map JavaDoc objectModel) {
52         return Collections.EMPTY_LIST.iterator();
53     }
54
55     /* (non-Javadoc)
56      * @see org.apache.cocoon.components.modules.input.InputModule#getAttributeValues(java.lang.String, org.apache.avalon.framework.configuration.Configuration, java.util.Map)
57      */

58     public Object JavaDoc[] getAttributeValues(String JavaDoc name, Configuration modeConf, Map JavaDoc objectModel)
59     throws ConfigurationException {
60         Object JavaDoc[] result = new Object JavaDoc[1];
61         result[0] = this.getAttribute(name, modeConf, objectModel);
62         return result;
63     }
64 }
65
Popular Tags