KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > source > SourceHandler


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.components.source;
17
18 import org.apache.avalon.framework.component.Component;
19 import org.apache.cocoon.ProcessingException;
20 import org.apache.cocoon.environment.Environment;
21 import org.apache.cocoon.environment.Source;
22
23 import java.io.IOException JavaDoc;
24 import java.net.MalformedURLException JavaDoc;
25 import java.net.URL JavaDoc;
26
27 /**
28  * @deprecated The Avalon Excalibur Source Resolving is now used.
29  *
30  * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
31  * @version CVS $Id: SourceHandler.java 30932 2004-07-29 17:35:38Z vgritsenko $
32  */

33 public interface SourceHandler extends Component {
34
35     String JavaDoc ROLE = "org.apache.cocoon.components.source.SourceHandler";
36
37     /**
38      * Get a <code>Source</code> object.
39      * @param environment This is optional.
40      */

41     Source getSource(Environment environment, String JavaDoc location)
42     throws ProcessingException, MalformedURLException JavaDoc, IOException JavaDoc;
43
44     /**
45      * Get a <code>Source</code> object.
46      * @param environment This is optional.
47      */

48     Source getSource(Environment environment, URL JavaDoc base, String JavaDoc location)
49     throws ProcessingException, MalformedURLException JavaDoc, IOException JavaDoc;
50
51     /**
52      * Add a new source factory.
53      * The factory is initialized by the handler, this means the
54      * handler test for the Avalon interfaces <code>Composable</code>,
55      * <code>Contextualizable</code> and <code>LogEnabled</code>.
56      * When the handler is disposed it should also test the
57      * <code>Disposable</code> interface.
58      * If a factory with the protocol already exists it is
59      * overridden by this new factory.
60      */

61     void addFactory(String JavaDoc protocol, SourceFactory factory)
62     throws ProcessingException;
63
64 }
65
Popular Tags