FileDocCategorySizeDatePackage
PropertiesHandler.javaAPI DocGlassfish v2 API21675Tue Jul 03 19:09:50 BST 2007oracle.toplink.essentials.internal.ejb.cmp3.base

PropertiesHandler

public class PropertiesHandler extends Object
The class processes some of TopLink properties. The class may be used for any properties, but it only makes sense to use it in the following two cases: 1. There is a set of legal values defined either requiring translation (like CacheTypeProp); or not (like LoggingLevelProp). 2. Property is really a prefix from which the property obtained by appending entity or class name (like DescriptorCustomizerProp - it corresponds to "toplink.descriptor.customizer." prefix that allows to define propereties like "toplink.descriptor.customizer.myPackage.MyClass"). TopLink properties and their values defined in oracle.toplink.essentials.config package. To add a new property: Define a new property in TopLinkProperties; Add a class containing property's values if required to config package (like CacheType); Alternatively values may be already defined elsewhere (like in LoggingLevelProp). Add an inner class to this class extending Prop corresponding to the new property (like CacheTypeProp); The first constructor parameter is property name; the second is default value; In constructor provide 2-dimensional value array in case the values should be translated (like CacheTypeProp); in case translation is not required provide a single-dimension array (like LoggingLevelProp). In inner class Prop static initializer addProp an instance of the new prop class (like addProp(new CacheTypeProp())).
see
TopLinkProperties
see
CacheType
see
TargetDatabase
see
TargetServer

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.StringgetDefaultPropertyValue(java.lang.String name)
INTERNAL: Returns the default property value that should be applied. Throws IllegalArgumentException in case the name doesn't correspond to any property.

        return Prop.getDefaultPropertyValueToApply(name, null);
    
public static java.lang.StringgetDefaultPropertyValueLogDebug(java.lang.String name, oracle.toplink.essentials.internal.sessions.AbstractSession session)

        return Prop.getDefaultPropertyValueToApply(name, session);
    
public static java.util.MapgetPrefixValues(java.lang.String prefix, java.util.Map m)
INTERNAL: Gets properties' values from the map, if none found looks in System properties. In the returned map values keyed by suffixes. Use it with prefixes (like "oracle.toplink.cache-type."). Could be used on simple properties (not prefixes, too), but will always return either an empty map or a map containing a single value keyed by an empty String. Throws IllegalArgumentException in case the property value is illegal.

        return Prop.getPrefixValuesToApply(prefix, m, null);
    
public static java.util.MapgetPrefixValuesLogDebug(java.lang.String prefix, java.util.Map m, oracle.toplink.essentials.internal.sessions.AbstractSession session)

        return Prop.getPrefixValuesToApply(prefix, m, session);
    
public static java.lang.StringgetPrefixedPropertyValue(java.lang.String prefix, java.lang.String suffix, java.util.Map m)
INTERNAL: Gets property value from the map, if none found looks in System properties. Use this to get a value for a prefixed property: for "oracle.toplink.cache-type.Employee" pass "oracle.toplink.cache-type.", "Employee". Throws IllegalArgumentException in case the property value is illegal.

        return (String)getPrefixValues(prefix, m).get(suffix);
    
public static java.lang.StringgetPropertyValueLogDebug(java.lang.String name, java.util.Map m, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Gets property value from the map, if none found looks in System properties. Use this to get a value for a non-prefixed property. Could be used on prefixes (like "oracle.toplink.cache-type.") too, but will always return null Throws IllegalArgumentException in case the property value is illegal.

        return Prop.getPropertyValueToApply(name, m, session);
    
protected static booleanshouldUseDefault(java.lang.String value)
INTERNAL: Empty String value indicates that the default property value should be used.

        return value != null &&  value.length() == 0;