org.apache.cocoon.configuration
Interface Settings

All Known Implementing Classes:
MutableSettings

public interface Settings

This object holds the global configuration of Cocoon.

Since:
1.0
Version:
$Id: Settings.java 587750 2007-10-24 02:35:22Z vgritsenko $

Field Summary
static String KEY_CACHE_DIRECTORY
          This parameter allows to specify where Cocoon should create its page and other objects cache.
static String KEY_CONTAINER_ENCODING
          Set encoding used by the container.
static String KEY_FORM_ENCODING
          Set form encoding.
static String KEY_LOAD_CLASSES
          This parameter is used to list classes that should be loaded at initialization time of the servlet.
static String KEY_RELOAD_DELAY
          Delay between reload checks for the configuration.
static String KEY_RELOADING
          Allow reinstantiating (reloading) of the cocoon instance.
static String KEY_WORK_DIRECTORY
          This parameter allows to specify where Cocoon should put it's working files.
static String PROPERTY_USER_SETTINGS
          Name of the property specifying a custom user properties file.
static String ROLE
          The role to lookup this bean.
 
Method Summary
 String getCacheDirectory()
           
 String getContainerEncoding()
           
 long getCreationTime()
          The creation time of the current settings instance.
 String getFormEncoding()
           
 List getLoadClasses()
           
 String getProperty(String key)
          Get the value of a property.
 String getProperty(String key, String defaultValue)
          Get the value of a property.
 List getPropertyNames()
          Return all available property names.
 List getPropertyNames(String keyPrefix)
          Return all available property names starting with the prefix.
 long getReloadDelay(String type)
          This method can be used by components to get the configured delay period inbetween checks.
 String getRunningMode()
          Return the current running mode.
 String getWorkDirectory()
           
 boolean isReloadingEnabled(String type)
          This method can be used by components to query if they are configured to check for reloading.
 

Field Detail

ROLE

public static final String ROLE
The role to lookup this bean.


PROPERTY_USER_SETTINGS

public static final String PROPERTY_USER_SETTINGS
Name of the property specifying a custom user properties file.

See Also:
Constant Field Values

KEY_LOAD_CLASSES

public static final String KEY_LOAD_CLASSES
This parameter is used to list classes that should be loaded at initialization time of the servlet. For example, JDBC Drivers used need to be named here. Additional entries may be inserted here during build depending on your build properties.

See Also:
Constant Field Values

KEY_CACHE_DIRECTORY

public static final String KEY_CACHE_DIRECTORY
This parameter allows to specify where Cocoon should create its page and other objects cache. The path specified can be either absolute or relative to the context path of the servlet. On windows platform, absolute directory must start with volume: C:\Path\To\Cache\Directory.

See Also:
Constant Field Values

KEY_WORK_DIRECTORY

public static final String KEY_WORK_DIRECTORY
This parameter allows to specify where Cocoon should put it's working files. The path specified is either absolute or relative to the context path of the Cocoon servlet. On windows platform, absolute directory must start with volume: C:\Path\To\Work\Directory.

See Also:
Constant Field Values

KEY_FORM_ENCODING

public static final String KEY_FORM_ENCODING
Set form encoding. This will be the character set used to decode request parameters. If not set the ISO-8859-1 encoding will be assumed.

See Also:
Constant Field Values

KEY_CONTAINER_ENCODING

public static final String KEY_CONTAINER_ENCODING
Set encoding used by the container. If not set the ISO-8859-1 encoding will be assumed. Since the servlet specification requires that the ISO-8859-1 encoding is used (by default), you should never change this value unless you have a buggy servlet container.

See Also:
Constant Field Values

KEY_RELOADING

public static final String KEY_RELOADING
Allow reinstantiating (reloading) of the cocoon instance. If this is set to "yes" or "true", a new cocoon instance can be created using the request parameter "cocoon-reload". It also enables that Cocoon is reloaded when cocoon.xconf changes. Default is no for security reasons.

See Also:
Constant Field Values

KEY_RELOAD_DELAY

public static final String KEY_RELOAD_DELAY
Delay between reload checks for the configuration.

See Also:
Constant Field Values
Method Detail

getProperty

public String getProperty(String key)
Get the value of a property.

Parameters:
key - The name of the property.
Returns:
The value of the property or null.

getProperty

public String getProperty(String key,
                          String defaultValue)
Get the value of a property.

Parameters:
key - The name of the property.
defaultValue - The value returned if the property is not available.
Returns:
The value of the property or if the property cannot be found the default value.

getPropertyNames

public List getPropertyNames(String keyPrefix)
Return all available property names starting with the prefix.

Parameters:
keyPrefix - The prefix each property name must have.
Returns:
A list of property names (including the prefix) or an empty list.

getPropertyNames

public List getPropertyNames()
Return all available property names.

Returns:
A list of all property names or an empty list.

getLoadClasses

public List getLoadClasses()
Returns:
Returns the loadClasses.
See Also:
KEY_LOAD_CLASSES

getWorkDirectory

public String getWorkDirectory()
Returns:
Returns the workDirectory.
See Also:
KEY_WORK_DIRECTORY

getFormEncoding

public String getFormEncoding()
Returns:
Returns the formEncoding.
See Also:
KEY_FORM_ENCODING

getContainerEncoding

public String getContainerEncoding()
Returns:
Returns the container encoding
See Also:
KEY_CONTAINER_ENCODING

getCacheDirectory

public String getCacheDirectory()
Returns:
Returns the cacheDirectory.
See Also:
KEY_CACHE_DIRECTORY

getCreationTime

public long getCreationTime()
The creation time of the current settings instance.

Returns:
The creation time.

isReloadingEnabled

public boolean isReloadingEnabled(String type)
This method can be used by components to query if they are configured to check for reloading.

Parameters:
type - The type of the component that wants to check for reload.
Returns:
Returns if reloading is enabled for this component.
See Also:
KEY_RELOADING

getReloadDelay

public long getReloadDelay(String type)
This method can be used by components to get the configured delay period inbetween checks.

Parameters:
type - The type of the component that wants to check for reload.
Returns:
Returns the delay inbetween checks in milliseconds.
See Also:
KEY_RELOAD_DELAY

getRunningMode

public String getRunningMode()
Return the current running mode.

Returns:
The current running mode.


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.