org.apache.jcs.utils.props
Class AbstractPropertyContainer

java.lang.Object
  extended by org.apache.jcs.utils.props.AbstractPropertyContainer
Direct Known Subclasses:
PartitionedCacheAccess

public abstract class AbstractPropertyContainer
extends Object

Provides a mechanism to load properties into objects.

Functions that depend on properties should call ensureProperties() before it uses any properties.


Constructor Summary
AbstractPropertyContainer()
           
 
Method Summary
 void ensureProperties()
          Makes sure an AbstractPropertyClass has all the properties it needs.
 Properties getProperties()
           
 PropertiesFactory getPropertiesFactory()
           
 String getPropertiesGroup()
           
 String getPropertiesHeading()
           
protected abstract  void handleProperties()
          Sets fields for properties, and verifies that all necessary properties are there.
 void initializeProperties()
          Loads the properties and then calls handleProperties.
 void setProperties(Properties properties)
           
 void setPropertiesFactory(PropertiesFactory propertiesFactory)
           
 void setPropertiesGroup(String propertiesGroup)
           
 void setPropertiesHeading(String propertiesHeading)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPropertyContainer

public AbstractPropertyContainer()
Method Detail

ensureProperties

public void ensureProperties()
                      throws ConfigurationException
Makes sure an AbstractPropertyClass has all the properties it needs.

Synchronized mutators so multiple threads cannot cause problems. We wouldn't want the properties heading to get changed as we were processing the properties.

Throws:
ConfigurationException - on configuration failure

initializeProperties

public void initializeProperties()
                          throws ConfigurationException
Loads the properties and then calls handleProperties. Typically, you don't need to call this. This is primarily intended for reinitialization.

If the properties object is null, when you call ensureProperties initialize will be called.

Throws:
ConfigurationException - on configuration failure

handleProperties

protected abstract void handleProperties()
                                  throws ConfigurationException
Sets fields for properties, and verifies that all necessary properties are there.

Throws:
ConfigurationException - on configuration failure

getProperties

public Properties getProperties()
Returns:
Returns the properties.

setProperties

public void setProperties(Properties properties)
Parameters:
properties - The properties to set.

getPropertiesHeading

public String getPropertiesHeading()
Returns:
Returns the propertiesHeading.

setPropertiesHeading

public void setPropertiesHeading(String propertiesHeading)
Parameters:
propertiesHeading - The propertiesHeading to set.

getPropertiesFactory

public PropertiesFactory getPropertiesFactory()
Returns:
Returns the propertiesFactory.

setPropertiesFactory

public void setPropertiesFactory(PropertiesFactory propertiesFactory)
Parameters:
propertiesFactory - The propertiesFactory to set.

getPropertiesGroup

public String getPropertiesGroup()
Returns:
Returns the propertiesGroup.

setPropertiesGroup

public void setPropertiesGroup(String propertiesGroup)
Parameters:
propertiesGroup - The propertiesGroup to set.


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.