org.apache.excalibur.source
Interface SourceFactory
- All Superinterfaces:
- Component
- All Known Implementing Classes:
- FileSourceFactory, FTPSourceFactory, HTTPClientSourceFactory, ResourceSourceFactory, URLSourceFactory
- public interface SourceFactory
- extends Component
A source factory creates new source objects.
Source factories are used to extend the source resolving mechanism with new URI schemes. A new source factory is added in order to handle a specific prototol. The SourceResolver delegates the handling of a URI containing this new scheme to the factory, and the factory can create a corresponding Source object.
- Version:
- $Id: SourceFactory.java,v 1.4 2004/02/28 11:47:26 cziegeler Exp $
- Author:
| Field Summary |
static java.lang.String |
ROLE
|
ROLE
public static final java.lang.String ROLE
-
getSource
public Source getSource(java.lang.String location,
java.util.Map parameters)
throws java.io.IOException,
java.net.MalformedURLException
-
Get a
Source object. The factory creates a new Source object that can be used by the application. However, when this source object is not needed anymore it has to be released again using the release(Source) method. This is achieved by using SourceResolver.release(Source) which finds the appropriate SourceFactory.
-
-
- Parameters:
location - The URI to resolve - this URI includes the scheme.
parameters - additionnal named parameters (optionnal and can be null) that drive the creation of the Source object. Each implementation must specify what parameters it accepts.
- Returns:
- the created source object.
- Throws:
java.io.IOException - if the source couldn't be created for some reason.
java.net.MalformedURLException
release
public void release(Source source)
-
Release a
Source object.
-
-
- Parameters:
source - the source to release.
Please see keelframework.org for information about new Keel releases.