org.apache.cocoon.components.blocks
Class BlockManager

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.components.blocks.BlockManager
All Implemented Interfaces:
Block, Configurable, Contextualizable, Disposable, Initializable, LogEnabled, Processor, Serviceable

public class BlockManager
extends AbstractLogEnabled
implements Block, Configurable, Contextualizable, Disposable, Initializable, Serviceable

Version:
SVN $Id: BlockManager.java 327987 2005-10-24 07:15:56Z cziegeler $

Nested Class Summary
 
Nested classes inherited from class org.apache.cocoon.Processor
Processor.InternalPipelineDescription
 
Field Summary
static String ROLE
           
 
Fields inherited from interface org.apache.cocoon.components.blocks.Block
NAME, SUPER
 
Constructor Summary
BlockManager()
           
 
Method Summary
 URI absolutizeURI(URI uriToResolve, URI base)
          Takes the scheme specific part of a block URI (the scheme is the responsibilty of the BlockSource) and resolve it with respect to the blocks mount point.
 Processor.InternalPipelineDescription buildPipeline(Environment environment)
          Process the given Environment to assemble a ProcessingPipeline.
 void configure(Configuration config)
           
 void contextualize(Context context)
           
 void dispose()
           
 Object getAttribute(String name)
          Gets an attribute
 Configuration[] getComponentConfigurations()
          Get the sitemap component configurations
 String getContext()
          Get the context URI for this processor
 String getMountPath()
          Get the mount path of the block
 String getProperty(String name)
          Get a block property
 Processor getRootProcessor()
          Get the root processor parent of this processor.
 SourceResolver getSourceResolver()
          Get the source resolver for this processor
 void initialize()
           
 boolean process(Environment environment)
          Process the given Environment producing the output.
 Object removeAttribute(String name)
          Remove an attribute.
 URI resolveURI(URI uri, URI base)
          Parses and resolves the scheme specific part of a block URI with respect to the base URI of the current sitemap.
 void service(ServiceManager manager)
           
 void setAttribute(String name, Object value)
          Sets an attribute
 void setBlocksManager(BlocksManager blocksManager)
           
 
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

ROLE

public static String ROLE
Constructor Detail

BlockManager

public BlockManager()
Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

contextualize

public void contextualize(Context context)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException

configure

public void configure(Configuration config)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException

initialize

public void initialize()
                throws Exception
Specified by:
initialize in interface Initializable
Throws:
Exception

dispose

public void dispose()
Specified by:
dispose in interface Disposable

setBlocksManager

public void setBlocksManager(BlocksManager blocksManager)

getMountPath

public String getMountPath()
Get the mount path of the block

Specified by:
getMountPath in interface Block

getProperty

public String getProperty(String name)
Get a block property

Specified by:
getProperty in interface Block

absolutizeURI

public URI absolutizeURI(URI uriToResolve,
                         URI base)
                  throws URISyntaxException
Takes the scheme specific part of a block URI (the scheme is the responsibilty of the BlockSource) and resolve it with respect to the blocks mount point.

Specified by:
absolutizeURI in interface Block
Throws:
URISyntaxException

resolveURI

public URI resolveURI(URI uri,
                      URI base)
               throws URISyntaxException
Parses and resolves the scheme specific part of a block URI with respect to the base URI of the current sitemap. The scheme specific part of the block URI has the form foo:/bar when refering to another block, in this case only an absolute path is allowed. For reference to the own block, both absolute /bar and relative ./foo paths are allowed.

Specified by:
resolveURI in interface Block
Throws:
URISyntaxException

process

public boolean process(Environment environment)
                throws Exception
Description copied from interface: Processor
Process the given Environment producing the output.

Specified by:
process in interface Processor
Returns:
If the processing is successfull true is returned. If no match is found in the sitemap false is returned.
Throws:
Exception

buildPipeline

public Processor.InternalPipelineDescription buildPipeline(Environment environment)
                                                    throws Exception
Description copied from interface: Processor
Process the given Environment to assemble a ProcessingPipeline. Don't forget to release the pipeline using Processor.InternalPipelineDescription.release().

Specified by:
buildPipeline in interface Processor
Throws:
Exception

getComponentConfigurations

public Configuration[] getComponentConfigurations()
Description copied from interface: Processor
Get the sitemap component configurations

Specified by:
getComponentConfigurations in interface Processor

getRootProcessor

public Processor getRootProcessor()
Description copied from interface: Processor
Get the root processor parent of this processor.

Specified by:
getRootProcessor in interface Processor

getSourceResolver

public SourceResolver getSourceResolver()
Description copied from interface: Processor
Get the source resolver for this processor

Specified by:
getSourceResolver in interface Processor

getContext

public String getContext()
Description copied from interface: Processor
Get the context URI for this processor

Specified by:
getContext in interface Processor

getAttribute

public Object getAttribute(String name)
Description copied from interface: Processor
Gets an attribute

Specified by:
getAttribute in interface Processor
See Also:
Processor.getAttribute(java.lang.String)

removeAttribute

public Object removeAttribute(String name)
Description copied from interface: Processor
Remove an attribute.

Specified by:
removeAttribute in interface Processor
See Also:
Processor.removeAttribute(java.lang.String)

setAttribute

public void setAttribute(String name,
                         Object value)
Description copied from interface: Processor
Sets an attribute

Specified by:
setAttribute in interface Processor
See Also:
Processor.setAttribute(java.lang.String, java.lang.Object)


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