|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.core.config.AbstractBaseConfig org.kuali.rice.core.config.JAXBConfigImpl
public class JAXBConfigImpl
This implementation of the Config interface uses JAXB to parse the config file and maintains an internal copy of all properties in their "raw" form (without any nested properties resolved). This allows properties to be added in stages and still alter values of properties previously read in. It also has settings for whether system properties should override all properties or only serve as default when the property has not been defined.
Nested Class Summary | |
---|---|
class |
JAXBConfigImpl.ConfigNamespaceURIFilter
This is a SAX filter that adds the config xml namespace to the document if the document does not have a namespace (for backwards compatibility). |
Field Summary |
---|
Fields inherited from interface org.kuali.rice.core.config.Config |
---|
ALT_OJB_FILE, ALT_SPRING_FILE, BAM_ENABLED, BASE_WEB_SERVICE_URL_WORKFLOW_CLIENT_FILE, BASE_WEB_SERVICE_WSDL_PATH, BATCH_MODE, BUS_DEPLOYED_SERVICES, CLIENT_PROTOCOL, CREDENTIALS_SOURCE_FACTORY, DATASOURCE_DRIVER_NAME, DATASOURCE_OJB_SEQUENCE_MANAGER, DATASOURCE_OJB_SEQUENCE_MANAGER_CLASS, DATASOURCE_PASSWORD, DATASOURCE_PLATFORM, DATASOURCE_POOL_MAX_SIZE, DATASOURCE_POOL_MAXWAIT, DATASOURCE_POOL_MIN_SIZE, DATASOURCE_POOL_SIZE, DATASOURCE_POOL_VALIDATION_QUERY, DATASOURCE_URL, DATASOURCE_USERNAME, DEFAULT_KEW_NOTE_CLASS, DEFAULT_NOTE_CLASS, DEV_MODE, DOCUMENT_LOCK_TIMEOUT, EDL_CONFIG_LOCATION, EMAIL_SECURITY_PATH, EMBEDDED_PLUGIN_DEFAULT_CURRENT_CLASS_LOADER, EMBEDDED_PLUGIN_LOCATIAON, ENABLE_EMAIL_REMINDER_LIFECYCLE, ENABLE_XML_PIPELINE_LIFECYCLE, ENVIRONMENT, EXTRA_CLASSES_DIR, EXTRA_LIB_DIR, FIRST_DAILY_EMAIL_DELIVERY_DATE, FIRST_WEEKLY_EMAIL_DELIVERY_DATE, KEN_URL, KEW_URL, KEYSTORE_ALIAS, KEYSTORE_FILE, KEYSTORE_PASSWORD, KIM_URL, KR_URL, LOG4J_SETTINGS_PATH, LOG4J_SETTINGS_PROPS, LOG4J_SETTINGS_RELOADINTERVAL_MINS, LOG4J_SETTINGS_XML, M_BEANS, MESSAGE_PERSISTENCE, NODE_PROPERTIES_PATH, OJB_PLATFORM, OUT_BOX_DEFAULT_PREFERENCE_ON, OUT_BOX_MODE, PLUGIN_DIR, PORTAL_SHOW_SAMPLE_APP, REFRESH_RATE, SERVICE_NAMESPACE, SERVICE_SERVLET_URL, STORE_AND_FORWARD, THREAD_POOL_SIZE, TRANSACTION_TIMEOUT, WEB_SERVICE_CONNECT_RETRY, WSDL_LOCATION_WORKFLOW_CLIENT_FILE |
Constructor Summary | |
---|---|
JAXBConfigImpl()
|
|
JAXBConfigImpl(org.kuali.rice.core.config.Config config)
|
|
JAXBConfigImpl(java.util.List<java.lang.String> fileLocs)
|
|
JAXBConfigImpl(java.util.List<java.lang.String> fileLocs,
org.kuali.rice.core.config.Config config)
|
|
JAXBConfigImpl(java.util.List<java.lang.String> fileLocs,
java.util.Properties properties)
|
|
JAXBConfigImpl(java.util.Properties properties)
|
|
JAXBConfigImpl(java.lang.String fileLoc)
|
|
JAXBConfigImpl(java.lang.String fileLoc,
org.kuali.rice.core.config.Config config)
|
|
JAXBConfigImpl(java.lang.String fileLoc,
java.util.Properties properties)
|
Method Summary | |
---|---|
protected void |
configureBuiltIns()
Configures built-in properties. |
protected int |
generateRandomInteger(java.lang.String rangeSpec)
Generates a random integer in the range specified by the specifier, in the format: min-max |
java.lang.Object |
getObject(java.lang.String key)
|
java.util.Map<java.lang.String,java.lang.Object> |
getObjects()
|
java.util.Properties |
getProperties()
|
java.lang.String |
getProperty(java.lang.String key)
|
boolean |
isSystemOverride()
|
void |
overrideProperty(java.lang.String name,
java.lang.String value)
|
void |
parseConfig()
|
protected void |
parseConfig(java.lang.String filename,
javax.xml.bind.Unmarshaller unmarshaller,
int depth)
|
protected java.lang.String |
parseValue(java.lang.String value,
java.util.Set<java.lang.String> keySet)
This method parses the value string to find all nested properties (foo=${nested}) and replaces them with the value returned from calling resolve(). |
void |
putConfig(org.kuali.rice.core.config.Config config)
|
void |
putObject(java.lang.String key,
java.lang.Object value)
|
void |
putObjects(java.util.Map<java.lang.String,java.lang.Object> objects)
|
void |
putProperties(java.util.Properties properties)
|
void |
putProperty(java.lang.String key,
java.lang.String value)
This overrided the property. |
void |
removeObject(java.lang.String key)
|
void |
removeProperty(java.lang.String key)
|
protected java.lang.String |
replaceVariable(java.lang.String name,
java.lang.String value)
This method is used when reading in new properties to check if there is a direct reference to the key in the value. |
protected java.lang.String |
resolve(java.lang.String key)
|
protected java.lang.String |
resolve(java.lang.String key,
java.util.Set keySet)
This method will determine the value for a property by looking it up in the raw properties. |
protected void |
resolveRawToCache()
This method iterates through the raw properties and stores their resolved values in the resolved properties map, which acts as a cache so we don't have to run the recursion every time getProperty() is called. |
protected void |
setProperty(java.lang.String name,
java.lang.String value)
|
void |
setSystemOverride(boolean systemOverride)
If set to true then system properties will always be checked first, disregarding any values in the config. |
protected Config |
unmarshal(javax.xml.bind.Unmarshaller unmarshaller,
java.io.InputStream in)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JAXBConfigImpl()
public JAXBConfigImpl(org.kuali.rice.core.config.Config config)
public JAXBConfigImpl(java.lang.String fileLoc, org.kuali.rice.core.config.Config config)
public JAXBConfigImpl(java.util.List<java.lang.String> fileLocs, org.kuali.rice.core.config.Config config)
public JAXBConfigImpl(java.lang.String fileLoc)
public JAXBConfigImpl(java.util.List<java.lang.String> fileLocs)
public JAXBConfigImpl(java.util.Properties properties)
public JAXBConfigImpl(java.lang.String fileLoc, java.util.Properties properties)
public JAXBConfigImpl(java.util.List<java.lang.String> fileLocs, java.util.Properties properties)
Method Detail |
---|
public java.lang.Object getObject(java.lang.String key)
getObject
in interface org.kuali.rice.core.config.Config
getObject
in class AbstractBaseConfig
public java.util.Map<java.lang.String,java.lang.Object> getObjects()
getObjects
in interface org.kuali.rice.core.config.Config
getObjects
in class AbstractBaseConfig
public java.util.Properties getProperties()
getProperties
in interface org.kuali.rice.core.config.Config
getProperties
in class AbstractBaseConfig
public java.lang.String getProperty(java.lang.String key)
getProperty
in interface org.kuali.rice.core.config.Config
getProperty
in class AbstractBaseConfig
public void overrideProperty(java.lang.String name, java.lang.String value)
overrideProperty
in interface org.kuali.rice.core.config.Config
overrideProperty
in class AbstractBaseConfig
public void putProperty(java.lang.String key, java.lang.String value)
org.kuali.rice.core.config.Config#putProperty(java.lang.String, java.lang.Object)
public void putProperties(java.util.Properties properties)
public void parseConfig() throws java.io.IOException
parseConfig
in interface org.kuali.rice.core.config.Config
parseConfig
in class AbstractBaseConfig
java.io.IOException
protected void parseConfig(java.lang.String filename, javax.xml.bind.Unmarshaller unmarshaller, int depth) throws java.io.IOException
java.io.IOException
protected void setProperty(java.lang.String name, java.lang.String value)
protected java.lang.String resolve(java.lang.String key)
protected java.lang.String resolve(java.lang.String key, java.util.Set keySet)
key
- they key of the property for which to determine the valuekeySet
- contains all keys used so far in this recursion. used to check for circular references.
protected java.lang.String parseValue(java.lang.String value, java.util.Set<java.lang.String> keySet)
value
- the string to search for nest propertieskeySet
- contains all keys used so far in this recursion. used to check for circular references.
protected java.lang.String replaceVariable(java.lang.String name, java.lang.String value)
ex: path=/usr/bin;${someVar} path=${path};/some/other/path resolves to: path=/usr/bin;${someVar};/some/other/pathIt does not resolve the the value from rawProperties as it could contain nested properties that might change later. If the property does not exist in the rawProperties it will check for a default system property now to prevent a circular reference error.
name
- the property namevalue
- the value to check for nested property of the same name
protected void resolveRawToCache()
protected void configureBuiltIns()
protected int generateRandomInteger(java.lang.String rangeSpec)
rangeSpec
- a range specification, 'min-max'
public boolean isSystemOverride()
public void setSystemOverride(boolean systemOverride)
systemOverride
- protected Config unmarshal(javax.xml.bind.Unmarshaller unmarshaller, java.io.InputStream in) throws java.lang.Exception
java.lang.Exception
public void putObject(java.lang.String key, java.lang.Object value)
public void putObjects(java.util.Map<java.lang.String,java.lang.Object> objects)
public void removeObject(java.lang.String key)
public void removeProperty(java.lang.String key)
public void putConfig(org.kuali.rice.core.config.Config config)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |