org.springframework.extensions.surf.render
Class AbstractProcessor

java.lang.Object
  extended by org.springframework.extensions.surf.render.AbstractProcessor
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener, Processor
Direct Known Subclasses:
EmptyRegionRenderer, FreemarkerProcessor, JSPProcessor, WebScriptProcessor

public abstract class AbstractProcessor
extends Object
implements Processor, org.springframework.context.ApplicationListener, org.springframework.context.ApplicationContextAware


Constructor Summary
AbstractProcessor()
           
 
Method Summary
 void execute(ProcessorContext processorContext, RenderFocus focus)
          Executes the given focus of the processor output using the given processor context
abstract  void executeBody(ProcessorContext processorContext)
          Executes the "body" of the processor output using the given processor context.
 void executeFooter(ProcessorContext processorContext)
          Executes the "footer" of the processor output using the given processor context.
 void executeHeader(ProcessorContext processorContext)
          Executes the "header" of the processor output using the given processor context.
protected  String getProperty(ProcessorContext processorContext, String propertyName)
          Returns a configuration property from the rendering processor descriptor.
protected  ProcessorContext.ProcessorDescriptor getRenderingDescriptor(ProcessorContext processorContext)
          Helper method which returns the appropriate processor descriptor from the given processor descriptor for the current render mode.
protected  ProcessorContext.ProcessorDescriptor getRenderingDescriptor(ProcessorContext processorContext, RenderMode renderMode)
           
 void init(org.springframework.context.ApplicationContext applicationContext)
          Initialisation hook point.
 void onApplicationEvent(org.springframework.context.ApplicationEvent event)
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.extensions.surf.render.Processor
exists
 

Constructor Detail

AbstractProcessor

public AbstractProcessor()
Method Detail

onApplicationEvent

public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
Specified by:
onApplicationEvent in interface org.springframework.context.ApplicationListener

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

init

public void init(org.springframework.context.ApplicationContext applicationContext)
Description copied from interface: Processor
Initialisation hook point. This will be called exactly once when the processor is instantiated. It does not have access to request time information.

Specified by:
init in interface Processor
Parameters:
applicationContext - the application context

execute

public void execute(ProcessorContext processorContext,
                    RenderFocus focus)
             throws RendererExecutionException
Description copied from interface: Processor
Executes the given focus of the processor output using the given processor context

Specified by:
execute in interface Processor
Throws:
RendererExecutionException

executeHeader

public void executeHeader(ProcessorContext processorContext)
                   throws RendererExecutionException
Description copied from interface: Processor
Executes the "header" of the processor output using the given processor context.

Specified by:
executeHeader in interface Processor
Parameters:
processorContext - processorContext
Throws:
RendererExecutionException

executeBody

public abstract void executeBody(ProcessorContext processorContext)
                          throws RendererExecutionException
Description copied from interface: Processor
Executes the "body" of the processor output using the given processor context.

Specified by:
executeBody in interface Processor
Parameters:
processorContext - processorContext
Throws:
RendererExecutionException

executeFooter

public void executeFooter(ProcessorContext processorContext)
                   throws RendererExecutionException
Description copied from interface: Processor
Executes the "footer" of the processor output using the given processor context.

Specified by:
executeFooter in interface Processor
Parameters:
processorContext - processorContext
Throws:
RendererExecutionException

getRenderingDescriptor

protected ProcessorContext.ProcessorDescriptor getRenderingDescriptor(ProcessorContext processorContext)
Helper method which returns the appropriate processor descriptor from the given processor descriptor for the current render mode. For example, if the current render mode is "view", then this will return the processor descriptor for the processor to be used during "view" processing. This descriptor contains all of the relevant metadata for the processor about how to proceed.

Parameters:
processorContext -
Returns:
processor descriptor

getRenderingDescriptor

protected ProcessorContext.ProcessorDescriptor getRenderingDescriptor(ProcessorContext processorContext,
                                                                      RenderMode renderMode)

getProperty

protected String getProperty(ProcessorContext processorContext,
                             String propertyName)
Returns a configuration property from the rendering processor descriptor.

Parameters:
processorContext -
propertyName -
Returns:
property value as string


Copyright © 2009 SpringSource, Inc. All Rights Reserved.