|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.util.WavesetProperties
A class that provides a cached interface to the waveset.properties file. This file originally contained general system operation options, but now contains mainly special options for debugging and testing.
If you have something that needs to be propgated to multiple web servers in a cluster, it should go into SystemConfiguration (which is backed by the repository) rather than this file.
If you have something that is specific to a particular server, it belongs in ServerConfiguration (which is part of SystemConfiguration).
The file is expected to contain various debug and test properties, which are intended for use only during development. Putting them in a file rather than in the repository makes them easier to view and modify. The file is also more convenient than putting a bunch of -D options in the launch scripts and JBuilder configuration.
See the Waveset.properties file for documentation on the available properties and what they do.
Calling the method getProperty()
will load the properties file
on the first request, and keep it in memory thereafter.
There is no provision for checking for file updates;
you will have to shut down the process to reload the file.
Nested Class Summary | |
static interface |
WavesetProperties.Listener
Implement this interface and call
to have your propertiesFileChanged() method called
whenever the underlying properties file changes. |
static interface |
WavesetProperties.PropertiesProvider
Properties provider to be used for loading waveset properties Currently this is used by the netbeans plugin to override the default WavesetProperties loading mechanism. |
Field Summary | |
static java.lang.String |
code_id
|
static int |
MAX_POST_FILE_SIZE_DEFAULT
This default value (10MB) can be overridden by specifying max.post.file.size . |
static java.lang.String |
MAX_POST_FILE_SIZE_PROPERTY
|
static int |
MAX_POST_MEMORY_SIZE_DEFAULT
This default value (8K) can be overridden by specifying max.post.memory.size . |
static java.lang.String |
MAX_POST_MEMORY_SIZE_PROPERTY
|
Constructor Summary | |
WavesetProperties()
|
Method Summary | |
static Message |
checkContentLength(int reqContentLength)
Check the specified length against maximum file size limit. |
static void |
commentProperty(java.lang.String name)
Comment a property out of the Waveset.properties file and store it. |
static void |
deRegisterListener(WavesetProperties.Listener listener)
|
static boolean |
getBoolean(java.lang.String name)
Get the value of a property as a boolean. |
static boolean |
getBoolean(java.lang.String name,
boolean dflt)
Get the value of a property as a boolean. |
static int |
getInt(java.lang.String name)
Get the value of a property as an integer. |
static int |
getInt(java.lang.String name,
int dflt)
Get the value of a property as an integer. |
static int |
getMaxPostFileSize()
|
static int |
getMaxPostMemorySize()
|
static java.util.Map |
getProperties()
Return a copy of the properties. |
static java.lang.Object |
getProperty(java.lang.String name)
Get the value of a property. |
static java.lang.String |
getString(java.lang.String name)
Get the value of a property as a string. |
static GenericObject |
getSystemConfiguration(LighthouseContext vm)
Get the system configuration object. |
static java.lang.Object |
getSystemConfiguration(LighthouseContext vm,
java.lang.String name)
Get a system configuration property value. |
static java.lang.String |
getVersion()
Get the value of the version property. |
static void |
propertiesChanged()
Notify all listeners that properties are changed |
static void |
registerListener(WavesetProperties.Listener listener)
Register a class to be notified when the properties file changes. |
static void |
reload()
Reload the properties from the file. |
static void |
setPropertiesProvider(WavesetProperties.PropertiesProvider provider)
Set the properties provider to be used for loading waveset properties. |
static void |
setProperty(java.lang.String name,
boolean value)
Modify the value of a boolean property temporarily. |
static void |
setProperty(java.lang.String name,
java.lang.Object value)
Modify the value of a property temporarily. |
static void |
storeProperty(java.lang.String name,
java.lang.Object value)
Modify the "permanent" value of a property. |
static void |
storeProperty(java.lang.String name,
java.lang.Object value,
boolean enableIfDisabled)
Modify the "permanent" value of a property. |
static void |
storeVersion(java.lang.String value)
Modify the "permanent" value of the version property. |
static boolean |
testProperty(java.lang.String name,
java.lang.Object expected)
Test a property value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
public static final int MAX_POST_MEMORY_SIZE_DEFAULT
max.post.memory.size
.
public static final java.lang.String MAX_POST_MEMORY_SIZE_PROPERTY
public static final int MAX_POST_FILE_SIZE_DEFAULT
max.post.file.size
.
public static final java.lang.String MAX_POST_FILE_SIZE_PROPERTY
Constructor Detail |
public WavesetProperties()
Method Detail |
public static void setPropertiesProvider(WavesetProperties.PropertiesProvider provider)
public static java.lang.Object getProperty(java.lang.String name)
public static java.util.Map getProperties() throws WavesetException
WavesetException
public static boolean testProperty(java.lang.String name, java.lang.Object expected)
public static java.lang.String getString(java.lang.String name)
public static int getInt(java.lang.String name, int dflt)
public static int getInt(java.lang.String name)
public static boolean getBoolean(java.lang.String name)
public static boolean getBoolean(java.lang.String name, boolean dflt)
public static java.lang.String getVersion()
public static void setProperty(java.lang.String name, java.lang.Object value)
These modifications will take priority over the values found in the Waveset.properties file until this class is reloaded.
Runtime modifications may or may not have any effect, it depends on who looks at the property and when. Most code tests the property once during initialization and then never again. So, it is best if you set property values very early during application initialization.
public static void setProperty(java.lang.String name, boolean value)
These modifications will take priority over the values found in the Waveset.properties file until this class is reloaded.
Runtime modifications may or may not have any effect, it depends on who looks at the property and when. Most code tests the property once during initialization and then never again. So, it is best if you set property values very early during application initialization.
public static void storeProperty(java.lang.String name, java.lang.Object value) throws WavesetException
name
- the property to update.value
- the value to replace any current value.
Changes the value stored in the Waveset.properties file
as well as the transient value
in the cached HashMap
object.
WavesetException
public static void storeProperty(java.lang.String name, java.lang.Object value, boolean enableIfDisabled) throws WavesetException
name
- the property to update.value
- the value to replace any current value.enableIfDisabled
- if true
and the property has been disabled
(e.g., by a comment preceding the property name),
the property will be re-enabled.
Changes the value stored in the Waveset.properties file
as well as the transient value
in the cached HashMap
object.
WavesetException
public static void commentProperty(java.lang.String name) throws WavesetException
name
- The name of the property to comment out.
WavesetException
- If the file cannot be read or written.public static void storeVersion(java.lang.String value) throws WavesetException
value
- the version value
WavesetException
public static void registerListener(WavesetProperties.Listener listener)
public static void deRegisterListener(WavesetProperties.Listener listener)
public static void propertiesChanged()
public static void reload()
public static int getMaxPostMemorySize()
public static int getMaxPostFileSize()
public static Message checkContentLength(int reqContentLength)
public static GenericObject getSystemConfiguration(LighthouseContext vm) throws WavesetException
WavesetException
public static java.lang.Object getSystemConfiguration(LighthouseContext vm, java.lang.String name) throws WavesetException
WavesetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |