|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cocoon.configuration.MutableSettings
This is an implementation of the Settings
object.
The value can either be set using the various setter methods
or through properties (configure(Properties)
.
The object can be set to read-only using makeReadOnly()
. From that
on the object is immutable and can't be changed anymore.
Field Summary | |
protected String |
cacheDirectory
This parameter allows to specify where Cocoon should create its page and other objects cache. |
protected long |
configurationReloadDelay
Delay between reload checks for the configuration. |
protected String |
containerEncoding
The container encoding. |
protected long |
creationTime
The time the cocoon instance was created. |
protected String |
formEncoding
Set form encoding. |
protected static String |
KEYPREFIX
Prefix for properties. |
protected List |
loadClasses
This parameter is used to list classes that should be loaded at initialization time of the servlet. |
protected Settings |
parent
The optional parent settings object. |
protected Properties |
properties
The properties used to configure Cocoon. |
protected boolean |
readOnly
Are we still mutable? |
protected boolean |
reloadingEnabled
Allow reinstantiating (reloading) of the cocoon instance. |
protected String |
runningMode
Running mode. |
protected String |
workDirectory
This parameter allows to specify where Cocoon should put it's working files. |
Fields inherited from interface org.apache.cocoon.configuration.Settings |
KEY_CACHE_DIRECTORY, KEY_CONTAINER_ENCODING, KEY_FORM_ENCODING, KEY_LOAD_CLASSES, KEY_RELOAD_DELAY, KEY_RELOADING, KEY_WORK_DIRECTORY, PROPERTY_USER_SETTINGS, ROLE |
Constructor Summary | |
MutableSettings(Settings parent)
Create a new child settings object. |
|
MutableSettings(String mode)
Create a new settings object. |
Method Summary | |
void |
addToLoadClasses(String className)
|
protected void |
checkSubSetting()
check if this configuration is tried to be set for a sub settings object. |
protected void |
checkWriteable()
check if this configuration is writeable. |
void |
configure(Properties props)
Fill from a properties object |
String |
getCacheDirectory()
|
String |
getContainerEncoding()
|
long |
getCreationTime()
The creation time of the current settings instance. |
String |
getFormEncoding()
|
List |
getLoadClasses()
|
String |
getProperty(String name)
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. |
void |
makeReadOnly()
Mark this object as read-only. |
void |
setCacheDirectory(String cacheDirectory)
|
void |
setConfigurationReloadDelay(long configurationReloadDelay)
|
void |
setContainerEncoding(String value)
Set the container encoding. |
void |
setCreationTime(long value)
Set the creation time of the current cocoon instance. |
void |
setFormEncoding(String formEncoding)
|
void |
setReloadingEnabled(boolean allowReload)
|
void |
setWorkDirectory(String workDirectory)
|
String |
toString()
|
protected String |
toString(List a)
Helper method to make a string out of a list of objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean readOnly
protected static final String KEYPREFIX
protected final Properties properties
protected boolean reloadingEnabled
protected final List loadClasses
protected String cacheDirectory
protected String workDirectory
protected String formEncoding
protected long configurationReloadDelay
protected long creationTime
protected String containerEncoding
Settings.KEY_CONTAINER_ENCODING
protected Settings parent
protected final String runningMode
Constructor Detail |
public MutableSettings(String mode)
public MutableSettings(Settings parent)
parent
- The parent settings object.Method Detail |
public void configure(Properties props)
public boolean isReloadingEnabled(String type)
Settings
isReloadingEnabled
in interface Settings
type
- The type of the component that wants to check for reload.
Settings.isReloadingEnabled(java.lang.String)
public String getCacheDirectory()
getCacheDirectory
in interface Settings
Settings.getCacheDirectory()
public String getFormEncoding()
getFormEncoding
in interface Settings
Settings.getFormEncoding()
public String getContainerEncoding()
getContainerEncoding
in interface Settings
Settings.getContainerEncoding()
public void setContainerEncoding(String value)
value
- The new encoding value.public List getLoadClasses()
getLoadClasses
in interface Settings
Settings.getLoadClasses()
public String getWorkDirectory()
getWorkDirectory
in interface Settings
Settings.getWorkDirectory()
public long getReloadDelay(String type)
Settings
getReloadDelay
in interface Settings
type
- The type of the component that wants to check for reload.
Settings.getReloadDelay(java.lang.String)
public String getProperty(String name)
Settings
getProperty
in interface Settings
name
- The name of the property.
Settings.getProperty(java.lang.String)
public String getProperty(String key, String defaultValue)
Settings
getProperty
in interface Settings
key
- The name of the property.defaultValue
- The value returned if the property is not available.
Settings.getProperty(java.lang.String, java.lang.String)
public String toString()
Object.toString()
protected String toString(List a)
public void setReloadingEnabled(boolean allowReload)
allowReload
- The allowReload to set.public void setCacheDirectory(String cacheDirectory)
cacheDirectory
- The cacheDirectory to set.public void setFormEncoding(String formEncoding)
formEncoding
- The formEncoding to set.public void addToLoadClasses(String className)
className
- The loadClasses to set.public void setWorkDirectory(String workDirectory)
workDirectory
- The workDirectory to set.public void setConfigurationReloadDelay(long configurationReloadDelay)
configurationReloadDelay
- The configurationReloadDelay to set.public void makeReadOnly()
protected final void checkWriteable() throws IllegalStateException
IllegalStateException
- if this setting is read-onlyprotected final void checkSubSetting() throws IllegalStateException
IllegalStateException
- if this setting is a sub settingpublic long getCreationTime()
Settings
getCreationTime
in interface Settings
Settings.getCreationTime()
public void setCreationTime(long value)
public List getPropertyNames(String keyPrefix)
Settings
getPropertyNames
in interface Settings
keyPrefix
- The prefix each property name must have.
Settings.getPropertyNames(java.lang.String)
public List getPropertyNames()
Settings
getPropertyNames
in interface Settings
Settings.getPropertyNames()
public String getRunningMode()
Settings
getRunningMode
in interface Settings
Settings.getRunningMode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |