public interface IResourceFactory
IResource
objects.
Instances of this interface are created by the eclipse extension framework
for Aggregator extensions that implement the
com.ibm.jaggr.core.resourcefactory
extension point.
Aggregator extensions may also register resource factories by calling
IExtensionInitializer.IExtensionRegistrar.registerExtension(Object, Properties, InitParams, String, String, IAggregatorExtension)
when the extension's
IExtensionInitializer.initialize(IAggregator, IAggregatorExtension, IExtensionRegistrar)
method is called (assuming the extension implements the
IExtensionInitializer
interface).
The extension point defines the scheme
attribute which is used by the
aggregator to select the extension implementation based on the scheme of the
URI for which the IResource
is being requested. See
IAggregator.newResource(URI)
for a description of how the aggregator
selects an IResourceFactory
for a URI.
IResource newResource(URI uri)
IResource
object for the specified URI. This method
must not fail due to non-existence of the resource specified by the URL.
If the resource doesn't exist, a valid resource object that returns
exists() == false
and throws an IOException for other
methods that require existence of the resource should be returned.
This method is free to convert the provided URI as needed so that the URI
returned by IResource.getURI()
for the returned object does not
need to be the same as the provided URI. For example, the factory may
convert a bundleentry
URI into a file
uri, or
else it may need to convert a URI using a pseudo scheme such as
namedbundleentry
into a URI that is supported by the
platform.
uri
- The resource URI. The concrete implementation of the returned
type is determined by the URI scheme.IResource
object for the specified URI. The returned
object MUST be serialiable.boolean handles(URI uri)
Copyright © 2011-2015 IBM. All Rights Reserved.