org.apache.cocoon.components.source.impl
Class ContextSourceFactory

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.components.source.impl.ContextSourceFactory
All Implemented Interfaces:
Contextualizable, Serviceable, SourceFactory, ThreadSafe, URIAbsolutizer

public class ContextSourceFactory
extends org.apache.cocoon.util.AbstractLogEnabled
implements SourceFactory, Serviceable, Contextualizable, ThreadSafe, URIAbsolutizer

A factory for the context protocol using the context of the servlet api. It builds the source by asking the environment context for the real URL (see Context.getResource(String)) and then resolving this real URL.

Version:
$Id: ContextSourceFactory.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
protected  ServiceManager manager
          The ServiceManager
protected  ServletContext servletContext
          Http servlet context - if available
 
Fields inherited from interface org.apache.excalibur.source.SourceFactory
ROLE
 
Constructor Summary
ContextSourceFactory()
           
 
Method Summary
 String absolutize(String baseURI, String location)
           
 void contextualize(Context context)
           
 Source getSource(String location, Map parameters)
           
 void release(Source source)
           
 void service(ServiceManager manager)
           
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected ServiceManager manager
The ServiceManager


servletContext

protected ServletContext servletContext
Http servlet context - if available

Constructor Detail

ContextSourceFactory

public ContextSourceFactory()
Method Detail

service

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

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)

getSource

public Source getSource(String location,
                        Map parameters)
                 throws IOException
Specified by:
getSource in interface SourceFactory
Throws:
IOException
See Also:
SourceFactory.getSource(java.lang.String, java.util.Map)

release

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

absolutize

public String absolutize(String baseURI,
                         String location)
Specified by:
absolutize in interface URIAbsolutizer
See Also:
URIAbsolutizer.absolutize(java.lang.String, java.lang.String)


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.