org.apache.cocoon.components.source
Class CocoonSourceResolver

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.components.source.CocoonSourceResolver
All Implemented Interfaces:
Component, Contextualizable, Disposable, LogEnabled, Serviceable, SourceResolver, SourceResolver, ThreadSafe

public class CocoonSourceResolver
extends AbstractLogEnabled
implements SourceResolver, Contextualizable, Serviceable, Disposable, ThreadSafe

This is the default implementation of the SourceResolver for Cocoon. The implementation is based on the original source resolver implementation from the Excalibur project.

Since:
2.2
Version:
CVS $Id: CocoonSourceResolver.java 292497 2005-09-29 18:11:42Z bloritsch $
Author:
Carsten Ziegeler

Field Summary
protected  URL baseURL
          The base URL
protected  Core core
          The core
protected  SourceResolver customResolver
          A (optional) custom source resolver
protected  ServiceManager manager
          The service manager
 
Fields inherited from interface org.apache.excalibur.source.SourceResolver
METHOD, ROLE, URI_ENCODING, URI_PARAMETERS
 
Constructor Summary
CocoonSourceResolver()
           
 
Method Summary
protected  String absolutize(SourceFactory factory, String baseURI, String systemID)
          Makes an absolute URI based on a baseURI and a relative URI.
 void contextualize(Context context)
           
 void dispose()
           
protected  ComponentLocator getComponentLocator()
          Get the component locator.
protected  SourceFactory getSourceFactory(ComponentLocator m, String scheme)
          Get the SourceFactory
 void release(Source source)
           
 Source resolveURI(String location)
           
 Source resolveURI(String location, String baseURI, Map parameters)
           
 void service(ServiceManager manager)
          Obtain a reference to the SourceResolver with "/Cocoon" hint
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

customResolver

protected SourceResolver customResolver
A (optional) custom source resolver


manager

protected ServiceManager manager
The service manager


baseURL

protected URL baseURL
The base URL


core

protected Core core
The core

Constructor Detail

CocoonSourceResolver

public CocoonSourceResolver()
Method Detail

contextualize

public void contextualize(Context context)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException
See Also:
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)

resolveURI

public Source resolveURI(String location,
                         String baseURI,
                         Map parameters)
                  throws MalformedURLException,
                         IOException,
                         SourceException
Specified by:
resolveURI in interface SourceResolver
Throws:
MalformedURLException
IOException
SourceException
See Also:
SourceResolver.resolveURI(java.lang.String, java.lang.String, java.util.Map)

resolveURI

public Source resolveURI(String location)
                  throws MalformedURLException,
                         IOException,
                         SourceException
Specified by:
resolveURI in interface SourceResolver
Throws:
MalformedURLException
IOException
SourceException
See Also:
SourceResolver.resolveURI(java.lang.String)

service

public void service(ServiceManager manager)
             throws ServiceException
Obtain a reference to the SourceResolver with "/Cocoon" hint

Specified by:
service in interface Serviceable
Throws:
ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

dispose

public void dispose()
Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()

getComponentLocator

protected ComponentLocator getComponentLocator()
Get the component locator.


getSourceFactory

protected SourceFactory getSourceFactory(ComponentLocator m,
                                         String scheme)
                                  throws ProcessingException
Get the SourceFactory

Throws:
ProcessingException

release

public void release(Source source)
Specified by:
release in interface SourceResolver
See Also:
SourceResolver.release(org.apache.excalibur.source.Source)

absolutize

protected String absolutize(SourceFactory factory,
                            String baseURI,
                            String systemID)
Makes an absolute URI based on a baseURI and a relative URI.



Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.