| java.lang.Object org.apache.openjpa.lib.conf.Configurations
Configurations | public class Configurations (Code) | | Utility methods dealing with configuration.
author: Abe White |
Inner Class :public interface Runnable | |
Method Summary | |
public static String | combinePlugins(String orig, String override) Return a plugin string that combines the properties of the given plugin
strings, where properties of override will override the
same properties of orig . | public static void | configureInstance(Object obj, Configuration conf, String properties) Configures the given object with the given properties by
matching the properties string to the object's setter
methods. | public static void | configureInstance(Object obj, Configuration conf, String properties, String configurationName) Configures the given object with the given properties by
matching the properties string to the object's setter
methods. | public static void | configureInstance(Object obj, Configuration conf, Properties properties) Configures the given object with the given properties by
matching the properties string to the object's setter
methods. | public static void | configureInstance(Object obj, Configuration conf, Properties properties, String configurationName) Configures the given object with the given properties by
matching the properties string to the object's setter
methods. | public static boolean | containsProperty(String partialKey, Map props) Test whether the map contains the given partial key, prefixed with any
possible configuration prefix. | public static String | getClassName(String plugin) Return the class name from the given plugin string, or null if none. | public static List | getFullyQualifiedAnchorsInPropertiesLocation(Options opts) Return a List of all the fully-qualified anchors specified in the
properties location listed in opts . | public static String | getPlugin(String clsName, String props) Combine the given class name and properties into a plugin string. | public static String | getProperties(String plugin) Return the properties part of the given plugin string, or null if none. | public static Object | getProperty(String partialKey, Map m) Get the property under the given partial key, prefixed with any possible
configuration prefix. | public static Object | lookup(String name) Looks up the given name in JNDI. | public static Object | newInstance(String clsName, ClassLoader loader) Create the instance with the given class name, using the given
class loader. | public static Object | newInstance(String clsName, Configuration conf, String props, ClassLoader loader) Create and configure an instance with the given class name and
properties. | static Object | newInstance(String clsName, Value val, Configuration conf, ClassLoader loader, boolean fatal) Helper method used by members of this package to instantiate plugin
values. | public static Options | parseProperties(String properties) Parse a set of properties from a comma-separated string. | public static void | populateConfiguration(Configuration conf, Options opts) Set the given
Configuration instance from the command line
options provided. | public static Object | removeProperty(String partialKey, Map props) Remove the property under the given partial key, prefixed with any
possible configuration prefix. | public static boolean | runAgainstAllAnchors(Options opts, Configurations.Runnable runnable) Runs runnable against all the anchors in the configuration
pointed to by opts . | public static String | serializeProperties(Map map) Turn a set of properties into a comma-separated string. |
combinePlugins | public static String combinePlugins(String orig, String override)(Code) | | Return a plugin string that combines the properties of the given plugin
strings, where properties of override will override the
same properties of orig .
|
configureInstance | public static void configureInstance(Object obj, Configuration conf, String properties)(Code) | | Configures the given object with the given properties by
matching the properties string to the object's setter
methods. The properties string should be in the form
"prop1=val1, prop2=val2 ...". Does not validate that setter
methods exist for the properties.
throws: RuntimeException - on configuration error |
configureInstance | public static void configureInstance(Object obj, Configuration conf, String properties, String configurationName)(Code) | | Configures the given object with the given properties by
matching the properties string to the object's setter
methods. The properties string should be in the form
"prop1=val1, prop2=val2 ...". Validates that setter methods
exist for the properties.
throws: RuntimeException - on configuration error |
configureInstance | public static void configureInstance(Object obj, Configuration conf, Properties properties)(Code) | | Configures the given object with the given properties by
matching the properties string to the object's setter
methods. Does not validate that setter methods exist for the properties.
throws: RuntimeException - on configuration error |
configureInstance | public static void configureInstance(Object obj, Configuration conf, Properties properties, String configurationName)(Code) | | Configures the given object with the given properties by
matching the properties string to the object's setter
methods. If configurationName is
non-null , validates that setter methods exist for
the properties.
throws: RuntimeException - on configuration error |
containsProperty | public static boolean containsProperty(String partialKey, Map props)(Code) | | Test whether the map contains the given partial key, prefixed with any
possible configuration prefix.
|
getClassName | public static String getClassName(String plugin)(Code) | | Return the class name from the given plugin string, or null if none.
|
getFullyQualifiedAnchorsInPropertiesLocation | public static List getFullyQualifiedAnchorsInPropertiesLocation(Options opts)(Code) | | Return a List of all the fully-qualified anchors specified in the
properties location listed in opts . If no properties
location is listed in opts , this returns whatever the
product derivations can find in their default configurations.
If the properties location specified in opts already
contains an anchor spec, this returns that anchor. Note that in this
fully-qualified-input case, the logic involving product derivations
and resource parsing is short-circuited, so this method
should not be used as a means to test that a particular anchor is
defined in a given location by invoking with a fully-qualified anchor.
This does not mutate opts .
since: 1.1.0 |
getPlugin | public static String getPlugin(String clsName, String props)(Code) | | Combine the given class name and properties into a plugin string.
|
getProperties | public static String getProperties(String plugin)(Code) | | Return the properties part of the given plugin string, or null if none.
|
getProperty | public static Object getProperty(String partialKey, Map m)(Code) | | Get the property under the given partial key, prefixed with any possible
configuration prefix.
|
lookup | public static Object lookup(String name)(Code) | | Looks up the given name in JNDI. If the name is null, null is returned.
|
newInstance | public static Object newInstance(String clsName, ClassLoader loader)(Code) | | Create the instance with the given class name, using the given
class loader. No configuration of the instance is performed by
this method.
|
parseProperties | public static Options parseProperties(String properties)(Code) | | Parse a set of properties from a comma-separated string.
|
populateConfiguration | public static void populateConfiguration(Configuration conf, Options opts)(Code) | | Set the given
Configuration instance from the command line
options provided. All property names of the given configuration are
recognized; additionally, if a properties or
p argument exists, the resource it
points to will be loaded and set into the given configuration instance.
It can point to either a file or a resource name.
|
removeProperty | public static Object removeProperty(String partialKey, Map props)(Code) | | Remove the property under the given partial key, prefixed with any
possible configuration prefix.
|
runAgainstAllAnchors | public static boolean runAgainstAllAnchors(Options opts, Configurations.Runnable runnable)(Code) | | Runs runnable against all the anchors in the configuration
pointed to by opts . Each invocation gets a fresh clone of
opts with the properties option set
appropriately.
since: 1.1.0 |
serializeProperties | public static String serializeProperties(Map map)(Code) | | Turn a set of properties into a comma-separated string.
|
|
|