Interface SourceFactory

All Superinterfaces:
All Known Implementing Classes:
CommonsVFSSourceFactory, 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.

$Id:,v 1.4 2004/02/28 11:47:26 cziegeler Exp $
Avalon Development Team

Field Summary
static java.lang.String ROLE
Method Summary
 Source getSource(java.lang.String location, java.util.Map parameters)
          Get a Source object.
 void release(Source source)
          Release a Source object.

Field Detail


public static final java.lang.String ROLE
Method Detail


public Source getSource(java.lang.String location,
                        java.util.Map parameters)
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.

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.
the created source object.
Throws: - if the source couldn't be created for some reason.


public void release(Source source)
Release a Source object.

source - the source to release.

Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.