KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > source > impl > EmptySourceFactory


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.components.source.impl;
17
18 import java.io.IOException JavaDoc;
19 import java.net.MalformedURLException JavaDoc;
20 import java.util.Map JavaDoc;
21
22 import org.apache.avalon.framework.logger.AbstractLogEnabled;
23 import org.apache.avalon.framework.thread.ThreadSafe;
24 import org.apache.excalibur.source.Source;
25 import org.apache.excalibur.source.SourceFactory;
26
27 /**
28  * A factory for 'empty:' sources (see {@link EmptySource}).
29  *
30  * @version $Id: EmptySourceFactory.java 292330 2005-09-28 22:07:18Z vgritsenko $
31  * @since 2.1.8
32  */

33 public class EmptySourceFactory extends AbstractLogEnabled
34                                 implements SourceFactory, ThreadSafe {
35
36     /**
37      * Get an {@link EmptySource} object.
38      *
39      * @param location The URI to resolve - this URI includes the scheme.
40      * @param parameters this is optional and not used here
41      *
42      * @see org.apache.excalibur.source.SourceFactory#getSource(java.lang.String, java.util.Map)
43      */

44     public Source getSource(String JavaDoc location, Map JavaDoc parameters)
45     throws IOException JavaDoc, MalformedURLException JavaDoc {
46         return new EmptySource(location);
47     }
48
49     /**
50      * @see org.apache.excalibur.source.SourceFactory#release(org.apache.excalibur.source.Source)
51      */

52     public void release(Source source) {
53         // Do nothing here
54
}
55 }
56
Popular Tags