01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.components.source;
18:
19: import org.apache.avalon.framework.component.Component;
20: import org.apache.cocoon.ProcessingException;
21: import org.apache.cocoon.environment.Environment;
22: import org.apache.cocoon.environment.Source;
23:
24: import java.io.IOException;
25: import java.net.MalformedURLException;
26: import java.net.URL;
27:
28: /**
29: * @deprecated The Avalon Excalibur Source Resolving is now used.
30: *
31: * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
32: * @version CVS $Id: SourceHandler.java 433543 2006-08-22 06:22:54Z crossley $
33: */
34: public interface SourceHandler extends Component {
35:
36: String ROLE = "org.apache.cocoon.components.source.SourceHandler";
37:
38: /**
39: * Get a <code>Source</code> object.
40: * @param environment This is optional.
41: */
42: Source getSource(Environment environment, String location)
43: throws ProcessingException, MalformedURLException,
44: IOException;
45:
46: /**
47: * Get a <code>Source</code> object.
48: * @param environment This is optional.
49: */
50: Source getSource(Environment environment, URL base, String location)
51: throws ProcessingException, MalformedURLException,
52: IOException;
53:
54: /**
55: * Add a new source factory.
56: * The factory is initialized by the handler, this means the
57: * handler test for the Avalon interfaces <code>Composable</code>,
58: * <code>Contextualizable</code> and <code>LogEnabled</code>.
59: * When the handler is disposed it should also test the
60: * <code>Disposable</code> interface.
61: * If a factory with the protocol already exists it is
62: * overridden by this new factory.
63: */
64: void addFactory(String protocol, SourceFactory factory)
65: throws ProcessingException;
66:
67: }
|