org.apache.shale.clay.config.beans
Interface ConfigBean

All Superinterfaces:
Comparable
All Known Implementing Classes:
ComponentConfigBean, TemplateComponentConfigBean, TemplateConfigBean

public interface ConfigBean
extends Comparable

This interfaces should be implemented by a object pool that is registered with the ConfigBeanFactory.


Nested Class Summary
static interface ConfigBean.ConfigDefinition
          Top-level interface that defines a single configuration file entry.
 
Method Summary
 void assignParent(ComponentBean b)
          Sets the isA parent's for a ComponentBean.
 void checkTree(ComponentBean b)
          Verifies there is not a duplicate component id within a naming container.
 void destroy()
          This method is invoked with the application is unloaded.
 ComponentBean getElement(String id)
          Factory method that returns a ComponentBean using an identifier.
 ServletContext getServletContext()
          Returns an instance of the ServletContext set by the init(ServletContext) method.
 int getWeight()
          A ordering weight used by the ConfigBeanFactory for determining the ConfigBean that will return a ComponentBean for a jsfid.
 void init(ServletContext context)
          Initialization method passing the ServletContext.
 void realizingInheritance(ComponentBean b)
          Fixes up the meta inheritance of a ComponentBean.
 boolean refresh(boolean forceReload)
          This method should be called from key points in the application to invoke automatic reloading of the configuration files if they have been modified since last reloaded.
 boolean validMoniker(String id)
          Returns true if the jsfid can be used by the getElement(jsfid) to return a ComponentBean.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getElement

ComponentBean getElement(String id)

Factory method that returns a ComponentBean using an identifier.

Parameters:
id - jsfid of a config bean
Returns:
config bean

validMoniker

boolean validMoniker(String id)

Returns true if the jsfid can be used by the getElement(jsfid) to return a ComponentBean.

Parameters:
id - jsfid of a config bean
Returns:
true if the config bean is handled here

getWeight

int getWeight()

A ordering weight used by the ConfigBeanFactory for determining the ConfigBean that will return a ComponentBean for a jsfid.

Returns:
ordinal value representing the handlers precedence

init

void init(ServletContext context)

Initialization method passing the ServletContext.

Parameters:
context - web container servlet context

destroy

void destroy()

This method is invoked with the application is unloaded. The ConfigBeanFactory will invoke this method on all registered ConfigBean. This sequence will be started by the ClayConfigureListener


getServletContext

ServletContext getServletContext()

Returns an instance of the ServletContext set by the init(ServletContext) method.

Returns:
web container servlet context

realizingInheritance

void realizingInheritance(ComponentBean b)

Fixes up the meta inheritance of a ComponentBean. It assumes that assignParent(ComponentBean has already been called

Parameters:
b - config bean needing inheritance resolved

assignParent

void assignParent(ComponentBean b)

Sets the isA parent's for a ComponentBean. The next step would be to call the realizeInheritance(ComponentBean) method.

Parameters:
b - config bean needing heritage fixed-up

refresh

boolean refresh(boolean forceReload)

This method should be called from key points in the application to invoke automatic reloading of the configuration files if they have been modified since last reloaded. If the parameter forceReload is true, all files will be reloaded. The return value is true, if the files were reloaded.

Parameters:
forceReload - true if all template and config files are reloaded
Returns:
true if a modifed file was found

checkTree

void checkTree(ComponentBean b)

Verifies there is not a duplicate component id within a naming container. A root ComponentBean is passed as a single parameter.

Parameters:
b - root config bean


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.