Top Description Inners Constructors Methods
org.eclipse.persistence.internal.sessions

public Class PropertiesHandler

extends Object
Class Inheritance
Imports
java.security.AccessController, .PrivilegedAction, java.util.HashMap, .Iterator, .Map, java.util.concurrent.TimeUnit, java.util.logging.Level, org.eclipse.persistence.annotations.IdValidation, org.eclipse.persistence.config.BatchWriting, .CacheType, .CommitOrderType, .EntityManagerProperties, .ExclusiveConnectionMode, .FlushClearCache, .LoggerType, .PersistenceUnitProperties, .ReferenceMode, .TargetDatabase, .TargetServer, org.eclipse.persistence.descriptors.DescriptorQueryManager, org.eclipse.persistence.internal.localization.ExceptionLocalization, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, .PrivilegedGetSystemProperty, org.eclipse.persistence.logging.SessionLog, org.eclipse.persistence.queries.ObjectLevelReadQuery

The class processes some of EclipseLink 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 "eclipselink.descriptor.customizer." prefix that allows to define properties like "eclipselink.descriptor.customizer.myPackage.MyClass"). EclipseLink properties and their values defined in org.eclipse.persistence.config package. To add a new property: Define a new property in PersistenceUnitProperties; 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 Also
PersistenceUnitProperties, CacheType, TargetDatabase, 05/28/2008-1.0M8 Andrei Ilitchev. - 224964: Provide support for Proxy Authentication through JPA. Added support for CONNECTION_EXCLUSIVE. Also added BooleanProp to allow simpler way of creating boolean-valued properties: instead of defining a new class for each new Boolean property just add a new instance of BooleanProp with property name and default: addProp(new BooleanProp(PersistenceUnitProperties.CONNECTION_EXCLUSIVE, "false")); Changed the existing boolean-valued properties to use this approach, also applied the same approach to LOGGING_LEVEL and CATEGORY_LOGGING_LEVEL_ Also introduced a new version of getSessionPropertyValue that takes properties: public static String getSessionPropertyValue(String name, Map m, AbstractSession session) { it's convenient for use in EntityManagerImpl: first searches the passed properties then (recursively) properties of the session, then System properties.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected static class
protected abstract static class
protected static class
protected static class
protected static class
protected static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String
getDefaultPropertyValue(String name)

INTERNAL: Returns the default property value that should be applied.

public static String
public static String
getPrefixedPropertyValue(String prefix, String suffix, Map<K, V> m)

INTERNAL: Gets property value from the map, if none found looks in System properties.

public static Map<K, V>
getPrefixValues(String prefix, Map<K, V> m)

INTERNAL: Gets properties' values from the map, if none found looks in System properties.

public static Map<K, V>
public static String
getPropertyValue(String name, Map<K, V> m)

INTERNAL: Gets property value from the map, if none found looks in System properties.

public static String
getPropertyValue(String name, Map<K, V> m, boolean useSystemAsDefault)

public static String
getPropertyValue(String name, String value)

INTERNAL: Given property name and value verifies and translates the value.

public static String
public static String
getPropertyValueLogDebug(String name, Map<K, V> m, AbstractSession session, boolean useSystemAsDefault)

public static String
protected static boolean
shouldUseDefault(String value)

INTERNAL: Empty String value indicates that the default property value should be used.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait