org.hippoecm.hst.core.component
Class GenericHstComponent

java.lang.Object
  extended by org.hippoecm.hst.core.component.GenericHstComponent
All Implemented Interfaces:
HstComponent
Direct Known Subclasses:
BaseHstComponent, GenericPortletPrefsEditor, SimpleDispatcherHstComponent, SpringBridgeHstComponent, StandardContainerComponent

public class GenericHstComponent
extends Object
implements HstComponent

The GenericHstComponent class provides a default implementation for the HstComponent interface.

It provides a base class to be subclassed to create HstComponents. Common practice is that HstComponentConfiguration's whose only purpose is layout (markup) and do not have actual behavior, use this default HstComponent implementation as their component classname, see HstComponentInfo.getComponentClassName().

A subclass of GenericHstComponent can override methods, usually one of the following:

NOTE: HstComponent's typically run on multithreaded servers, so take care that a HstComponent must handle concurrent requests and be careful to synchronize access to shared resources (in other words, be thread safe, see HstComponent). Shared resources include in-memory data such as instance or class variables and external objects such as files, database connections, and network connections.

Version:
$Id: GenericHstComponent.java 35726 2012-08-14 09:18:25Z aschrijvers $

Field Summary
static String RESOURCE_PATH_BY_RESOURCE_ID
          Configuration key for flag whether or not to allow resource path resolving by resourceID as fallback.
 
Constructor Summary
GenericHstComponent()
           
 
Method Summary
 void destroy()
          Allows the component to destroy itself
 void doAction(HstRequest request, HstResponse response)
          Allows the component to process actions
 void doBeforeRender(HstRequest request, HstResponse response)
          Allows the component to do some business logic processing before rendering
 void doBeforeServeResource(HstRequest request, HstResponse response)
          Allows the component to do some business logic processing before serving resource
protected  ComponentConfiguration getComponentConfiguration()
           
 void init(javax.servlet.ServletContext servletContext, ComponentConfiguration componentConfig)
          Allows the component to initialize itself
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_PATH_BY_RESOURCE_ID

public static final String RESOURCE_PATH_BY_RESOURCE_ID
Configuration key for flag whether or not to allow resource path resolving by resourceID as fallback.

See Also:
Constant Field Values
Constructor Detail

GenericHstComponent

public GenericHstComponent()
Method Detail

init

public void init(javax.servlet.ServletContext servletContext,
                 ComponentConfiguration componentConfig)
          throws HstComponentException
Description copied from interface: HstComponent
Allows the component to initialize itself

Specified by:
init in interface HstComponent
Parameters:
servletContext - the servletConfig of the HST container servlet
componentConfig - the componentConfigBean configuration
Throws:
HstComponentException

destroy

public void destroy()
             throws HstComponentException
Description copied from interface: HstComponent
Allows the component to destroy itself

Specified by:
destroy in interface HstComponent
Throws:
HstComponentException

doAction

public void doAction(HstRequest request,
                     HstResponse response)
              throws HstComponentException
Description copied from interface: HstComponent
Allows the component to process actions

Specified by:
doAction in interface HstComponent
Throws:
HstComponentException

doBeforeRender

public void doBeforeRender(HstRequest request,
                           HstResponse response)
                    throws HstComponentException
Description copied from interface: HstComponent
Allows the component to do some business logic processing before rendering

Specified by:
doBeforeRender in interface HstComponent
Throws:
HstComponentException

doBeforeServeResource

public void doBeforeServeResource(HstRequest request,
                                  HstResponse response)
                           throws HstComponentException
Description copied from interface: HstComponent
Allows the component to do some business logic processing before serving resource

Specified by:
doBeforeServeResource in interface HstComponent
Throws:
HstComponentException

getComponentConfiguration

protected ComponentConfiguration getComponentConfiguration()


Copyright © 2008-2012 Hippo. All Rights Reserved.