| java.lang.Object com.opensymphony.oscache.base.Config
Config | public class Config implements java.io.Serializable(Code) | | Responsible for holding the Cache configuration properties. If the default
constructor is used, this class will load the properties from the
cache.configuration .
author: Fabian Crabus version: $Revision: 412 $ |
Constructor Summary | |
public | Config() Create an OSCache Config that loads properties from oscache.properties.
The file must be present in the root of OSCache's classpath. | public | Config(Properties p) Create an OSCache configuration with the specified properties.
Note that it is the responsibility of the caller to provide valid
properties as no error checking is done to ensure that required
keys are present. |
Config | public Config()(Code) | | Create an OSCache Config that loads properties from oscache.properties.
The file must be present in the root of OSCache's classpath. If the file
cannot be loaded, an error will be logged and the configuration will
remain empty.
|
Config | public Config(Properties p)(Code) | | Create an OSCache configuration with the specified properties.
Note that it is the responsibility of the caller to provide valid
properties as no error checking is done to ensure that required
keys are present. If you're unsure of what keys should be present,
have a look at a sample oscache.properties file.
Parameters: p - The properties to use for this configuration. If null,then the default properties are loaded from the oscache.properties file. |
getProperties | public Properties getProperties()(Code) | | Retrieves all of the configuration properties. This property set
should be treated as immutable.
The configuration properties. |
getProperty | public String getProperty(String key)(Code) | | Retrieve the value of the named configuration property. If the property
cannot be found this method will return null .
Parameters: key - The name of the property. The property value, or null if the value couldnot be found. throws: IllegalArgumentException - if the supplied key is null. |
loadProperties | public static Properties loadProperties(URL url, String info)(Code) | | Load the properties from the specified URL.
Parameters: url - a non null value of the URL to the properties Parameters: info - additional logger information if the properties can't be read the loaded properties specified by the URL since: 2.4 |
loadProperties | public static Properties loadProperties(String filename, String info)(Code) | | Load the specified properties file from the classpath. If the file
cannot be found or loaded, an error will be logged and no
properties will be set.
Parameters: filename - the properties file with path Parameters: info - additional logger information if file can't be read the loaded properties specified by the filename since: 2.4 |
set | public void set(Object key, Object value)(Code) | | Sets a configuration property.
Parameters: key - The unique name for this property. Parameters: value - The value assigned to this property. throws: IllegalArgumentException - if the supplied key is null. |
|
|