openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r406215 [2/10] - in /incubator/openjpa/trunk/openjpa-lib: ./ java/ java/org/ java/org/apache/ java/org/apache/openjpa/ java/org/apache/openjpa/lib/ java/org/apache/openjpa/lib/conf/ java/org/apache/openjpa/lib/jdbc/ java/org/apache/openjpa/...
Date Sun, 14 May 2006 03:26:02 GMT
Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/PluginListValue.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/PluginListValue.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/PluginListValue.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/PluginListValue.java Sat May 13 20:25:56 2006
@@ -0,0 +1,263 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.conf;
+
+
+import java.lang.reflect.*;
+import java.util.*;
+
+
+/**
+ *	<p>A list of plugins.  Defaults and aliases on plugin lists apply only
+ *	to individual class names.</p>
+ *
+ *	@see	PluginValue
+ *	@author	Abe White
+ */
+public class PluginListValue
+	extends ObjectValue
+{
+	private static final String[] EMPTY = new String[0];
+
+	private String[] _names	= EMPTY;
+	private String[] _props	= EMPTY;	
+
+
+	public PluginListValue (String prop)
+	{
+		super (prop);
+	}
+
+	
+	/**
+	 *	The plugin class names.
+	 */
+	public String[] getClassNames ()
+	{
+		return _names;
+	}
+
+
+	/**
+	 *	The plugin class names.
+	 */
+	public void setClassNames (String[] names)
+	{
+		if (names == null)
+			names = EMPTY;
+		_names = names;
+		set (null, true);
+		valueChanged ();
+	}
+
+	
+	/**
+	 *	The plugin properties.
+	 */
+	public String[] getProperties ()
+	{
+		return _props;
+	}
+
+
+	/**
+	 *	The plugin properties.
+	 */
+	public void setProperties (String[] props)
+	{
+		if (props == null)
+			props = EMPTY;
+		_props = props;
+		set (null, true);
+		valueChanged ();
+	}
+
+
+	/** 
+	 *  Instantiate the plugins as instances of the given class.
+	 */
+	public Object[] instantiate (Class elemType, Configuration conf)
+	{
+		return instantiate (elemType, conf, true);
+	}
+
+
+	/** 
+	 *  Instantiate the plugins as instances of the given class.
+	 */
+	public Object[] instantiate (Class elemType, Configuration conf,
+		boolean fatal)
+	{
+		Object[] ret;
+		if (_names.length == 0)
+			ret = (Object[]) Array.newInstance (elemType, 0);
+		else
+		{
+			ret = (Object[]) Array.newInstance (elemType, _names.length);
+			for (int i = 0; i < ret.length; i++)
+			{
+				ret[i] = newInstance (_names[i], elemType, conf, fatal);
+				Configurations.configureInstance (ret[i], conf, _props[i], 
+					getProperty ());
+			}
+		}
+		set (ret, true);
+		return ret;
+	}
+
+
+	/**
+	 *	Allow subclasses to instantiate additional plugins.  This method does
+	 *	not perform configuration.
+	 */
+	public Object newInstance (String clsName, Class type, 
+		Configuration conf, boolean fatal)
+	{
+		return Configurations.newInstance (clsName, this, conf,
+			type.getClassLoader (), fatal);
+	}
+
+
+	/**
+	 *	Override to recognize aliases of the class name without the attached	
+	 *	properties string.
+	 */
+	public String getString ()
+	{
+		if (_names.length == 0)
+			return null;
+
+		StringBuffer buf = new StringBuffer ();
+		for (int i = 0; i < _names.length; i++)
+		{
+			if (i > 0)
+				buf.append (", ");
+			buf.append (Configurations.getPlugin (alias(_names[i]), _props[i]));
+		}
+		if (buf.length () == 0)
+			return null;
+		return buf.toString ();
+	}
+
+
+	/**
+	 *	Override to recognize aliases of the plugin name without the attached	
+	 *	properties string.
+	 */
+	public void setString (String str)
+	{
+		if (str == null || str.length () == 0)
+			str = getDefault ();
+		if (str == null || str.length () == 0)
+		{
+			_names = EMPTY;
+			_props = EMPTY;
+			set (null, true);
+			valueChanged ();
+			return;
+		}
+
+		// split up the string; each element might be a class name, or a
+		// class name with properties settings
+		List plugins = new ArrayList ();
+		StringBuffer plugin = new StringBuffer ();
+		boolean inParen = false;
+		char c;
+		for (int i = 0; i < str.length (); i++)
+		{
+			c = str.charAt (i);
+			switch (c)
+			{
+			case '(':
+				inParen = true;
+				plugin.append (c);
+				break;
+			case ')':
+				inParen = false;
+				plugin.append (c);
+				break;
+			case ',':
+				if (inParen)
+					plugin.append (c);
+				else
+				{
+					plugins.add (plugin.toString ());
+					plugin = new StringBuffer ();
+				}
+				break;
+			default:
+				plugin.append (c);
+			}
+		}
+		if (plugin.length () > 0)
+			plugins.add (plugin.toString ());
+
+		// parse each plugin element into its name and properties
+		List names = new ArrayList ();
+		List props = new ArrayList ();
+		String clsName;
+		for (int i = 0; i < plugins.size (); i++)
+		{
+			str = (String) plugins.get (i);
+			clsName = unalias (Configurations.getClassName (str));
+			if (clsName != null)
+			{
+				names.add (clsName);
+				props.add (Configurations.getProperties (str));
+			}
+		}
+		_names = (String[]) names.toArray (new String[names.size ()]);
+		_props = (String[]) props.toArray (new String[props.size ()]);
+		set (null, true);
+		valueChanged ();
+	}
+
+
+	public Class getValueType ()
+	{
+		return Object[].class;
+	}
+
+
+	protected void objectChanged ()
+	{
+		Object[] vals = (Object[]) get ();
+		if (vals == null || vals.length == 0)
+			_names = EMPTY;
+		else
+		{
+			_names = new String[vals.length];
+			for (int i = 0; i < vals.length; i++)
+				_names[i] = (vals[i] == null) ? null 
+					: vals[i].getClass ().getName ();
+		}
+		_props = EMPTY;
+	}
+
+
+	protected String getInternalString ()
+	{
+		// should never get called
+		throw new IllegalStateException ();
+	}
+
+
+	protected void setInternalString (String str)
+	{
+		// should never get called
+		throw new IllegalStateException ();
+	}
+}

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/PluginListValue.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/PluginValue.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/PluginValue.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/PluginValue.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/PluginValue.java Sat May 13 20:25:56 2006
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.conf;
+
+
+import org.apache.commons.lang.*;
+
+import org.apache.openjpa.lib.util.*;
+
+
+/**
+ *	<p>A plugin {@link Value} consisting of plugin name and properties.  
+ *	Plugins should be specified in the form:<br /> 
+ *	<code>&lt;plugin-name&gt;(&lt;prop1&gt;=&lt;val1&gt;, ...)</code><br />
+ *	Both the plugin name and prop list are optional, so that the following
+ *	forms are also valid:<br />
+ *	<code>&lt;plugin-name&gt;</code><br />
+ *	<code>&lt;prop1&gt;=&lt;val1&gt; ...</code></p>
+ *
+ *	<p>Defaults and aliases on plugin values apply only to the plugin name.</p>
+ *
+ *	@author	Abe White
+ */
+public class PluginValue
+	extends ObjectValue
+{
+	private static final Localizer _loc = Localizer.forPackage
+		(PluginValue.class);
+
+	private final boolean	_singleton;
+	private String 			_name 	= null;
+	private String 			_props 	= null;
+
+
+	public PluginValue (String prop, boolean singleton)
+	{
+		super (prop);
+		_singleton = singleton;
+	}
+
+
+	/**
+	 *	Whether this value is a singleton.
+	 */
+	public boolean isSingleton ()
+	{
+		return _singleton;
+	}
+
+	
+	/**
+	 *	The plugin class name.
+	 */
+	public String getClassName ()
+	{
+		return _name;
+	}
+
+
+	/**
+	 *	The plugin class name.
+	 */
+	public void setClassName (String name)
+	{
+		String oldName = _name;
+		_name = name;
+		if (!StringUtils.equals (oldName, name))
+		{
+			if (_singleton)
+				set (null, true);
+			valueChanged ();
+		}
+	}
+
+
+	/**
+	 *	The plugin properties.
+	 */
+	public String getProperties ()
+	{
+		return _props;	
+	}
+
+
+	/**
+	 *	The plugin properties.
+	 */
+	public void setProperties (String props)
+	{
+		String oldProps = _props;
+		_props = props;
+		if (!StringUtils.equals (oldProps, props))
+		{
+			if (_singleton)
+				set (null, true);
+			valueChanged ();
+		}
+	}
+
+
+	/** 
+	 *  Instantiate the plugin as an instance of the given class. Equivalent
+	 *	to <code>instantiate (type, conf, true)</code>.
+	 */
+	public Object instantiate (Class type, Configuration conf)
+	{
+		return instantiate (type, conf, true);
+	}
+
+
+	/** 
+	 *  Instantiate the plugin as an instance of the given class.
+	 */
+	public Object instantiate (Class type, Configuration conf, boolean fatal)
+	{ 
+		Object obj = newInstance (_name, type, conf, true);
+		Configurations.configureInstance (obj, conf, _props, 
+			(fatal) ? getProperty () : null);
+		if (_singleton)
+			set (obj, true);
+		return obj;
+	}
+
+
+	/**
+	 *	Allow subclasses to instantiate additional plugins.  This method does
+	 *	not perform configuration.
+	 */
+	public Object newInstance (String clsName, Class type, 
+		Configuration conf, boolean fatal)
+	{
+		return Configurations.newInstance (clsName, this, conf,
+			type.getClassLoader (), fatal);
+	}
+
+
+	public void set (Object obj, boolean derived)
+	{
+		if (!_singleton)
+			throw new IllegalStateException (_loc.get ("not-singleton",
+				getProperty ()));
+		super.set (obj, derived);
+	}
+
+
+	public String getString ()
+	{
+		return Configurations.getPlugin (alias (_name), _props);
+	}
+
+
+	public void setString (String str)
+	{
+		_name = Configurations.getClassName (str);
+		_name = unalias (_name);
+		_props = Configurations.getProperties (str);
+		if (_singleton)
+			set (null, true);
+		valueChanged ();
+	}
+
+
+	public Class getValueType ()
+	{
+		return Object.class;
+	}
+
+
+	protected void objectChanged ()
+	{
+		Object obj = get ();
+		_name = (obj == null) ? unalias (null) : obj.getClass ().getName ();
+		_props = null;
+	}
+
+
+	protected String getInternalString ()
+	{
+		// should never get called
+		throw new IllegalStateException ();
+	}
+
+
+	protected void setInternalString (String str)
+	{
+		// should never get called
+		throw new IllegalStateException ();
+	}
+}

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/PluginValue.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/StringListValue.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/StringListValue.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/StringListValue.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/StringListValue.java Sat May 13 20:25:56 2006
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.conf;
+
+
+import serp.util.*;
+
+
+/**
+ *	<p>A comma-separated list of string values.</p>
+ *
+ *	@author	Abe White
+ */
+public class StringListValue
+	extends Value
+{
+	public static final String[] EMPTY = new String[0];
+
+ 	private String[] _values = EMPTY;
+
+
+	public StringListValue (String prop)
+	{
+		super (prop);
+	}
+
+
+	/**
+	 *	The internal value.
+	 */
+	public void set (String[] values)
+	{
+		_values = (values == null) ? EMPTY : values;
+		valueChanged ();
+	}
+
+
+	/**
+	 *	The internal value.
+	 */
+	public String[] get ()
+	{
+		return _values;
+	}
+
+
+	public Class getValueType ()
+	{
+		return String[].class;
+	}
+
+
+	protected String getInternalString ()
+	{
+		return Strings.join (_values, ", ");
+	}
+
+
+	protected void setInternalString (String val)
+	{
+		String[] vals = Strings.split (val, ",", 0);
+		if (vals != null)
+			for (int i = 0; i < vals.length; i++)
+				vals[i] = vals[i].trim ();
+		set (vals);
+	}
+
+
+	protected void setInternalObject (Object obj)
+	{
+		set ((String[]) obj);
+	}
+}
+

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/StringListValue.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/StringValue.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/StringValue.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/StringValue.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/StringValue.java Sat May 13 20:25:56 2006
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.conf;
+
+import org.apache.commons.lang.*;
+
+
+/**
+ *	A string {@link Value}.
+ *
+ *	@author	Marc Prud'hommeaux
+ */
+public class StringValue
+	extends Value
+{
+ 	private String value;
+
+
+	public StringValue (String prop)
+	{
+		super (prop);
+	}
+
+
+	public Class getValueType ()
+	{
+		return String.class;
+	}
+
+
+	/**
+	 *	The internal value.
+	 */
+	public String get ()
+	{
+		return value;
+	}
+
+
+	/**
+	 *	The internal value.
+	 */
+	public void set (String value)
+	{
+		String oldValue = this.value;
+		this.value = value;
+		if (!StringUtils.equals (value, oldValue))
+			valueChanged ();
+	}
+
+
+	protected String getInternalString ()
+	{
+		return get ();
+	}
+
+
+	protected void setInternalString (String val)
+	{
+		set (val);
+	}
+
+
+	protected void setInternalObject (Object obj)
+	{
+		set ((String) obj);
+	}
+}
+

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/StringValue.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/Value.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/Value.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/Value.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/Value.java Sat May 13 20:25:56 2006
@@ -0,0 +1,378 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.conf;
+
+
+import java.util.*;
+
+import org.apache.commons.lang.*;
+
+import org.apache.openjpa.lib.util.*;
+
+
+/** 
+ *  A configuration value.
+ *  
+ *  @author  Marc Prud'hommeaux
+ */
+public abstract class Value
+	implements Cloneable
+{
+	private static final String[] EMPTY_ALIASES = new String[0];
+	private static final Localizer s_loc = Localizer.forPackage (Value.class);
+
+	private String 			prop	= null;
+	private String 			def 	= null;
+	private String[] 		aliases	= null;
+	private ValueListener	listen	= null;
+	private boolean			aliasListComprehensive = false;
+
+
+	/**
+	 *  Constructor.  Supply the property name.
+	 *
+	 *	@see	#setProperty
+	 */
+	public Value (String prop)
+	{
+		setProperty (prop);
+	}
+
+
+	/**
+	 *	Default constructor.
+	 */
+	public Value ()
+	{
+	}
+
+
+	/** 
+	 *  The property name that will be used when setting or
+	 *  getting this value in a {@link Map}.
+	 */
+	public String getProperty ()
+	{
+		return prop;
+	}
+
+
+	/** 
+	 *  The property name that will be used when setting or
+	 *  getting this value in a {@link Map}.
+	 */
+	public void setProperty (String prop)
+	{
+		this.prop = prop;
+	}
+
+
+	/**
+	 *	Aliases for the value in the form key1, value1, key2, value2, ...
+	 *	All alias values must be in string form.
+	 */
+	public String[] getAliases ()
+	{
+		return (aliases == null) ? EMPTY_ALIASES : aliases;
+	}
+
+
+	/**
+	 *	Aliases for the value in the form key1, value1, key2, value2, ...
+	 *	All alias values must be in string form.
+	 */
+	public void setAliases (String[] aliases)
+	{
+		this.aliases = aliases;
+	}
+
+
+	/**
+	 *	Replaces an existing alias, or adds the given alias to the front of the
+	 *	alias list if it does not already exist.  All alias values must be in 
+	 *	string form.
+	 */
+	public void setAlias (String key, String value)
+	{
+		String[] aliases = getAliases ();
+		for (int i = 0; i < aliases.length; i += 2)
+		{
+			if (key.equals (aliases[i]))
+			{
+				aliases[i + 1] = value;
+				return;
+			}
+		}
+
+		// add as new alias
+		String[] newAliases = new String[aliases.length + 2];
+		System.arraycopy (aliases, 0, newAliases, 2, aliases.length);
+		newAliases[0] = key;
+		newAliases[1] = value;
+		this.aliases = newAliases;
+	}
+
+
+	/**
+	 *	Whether or not the alias list defines all possible settings for this
+	 *	value. If so, an error will be generated when attempting to invoke
+	 *	any method on this value with an unknown option.
+	 */
+	public boolean isAliasListComprehensive ()
+	{
+		return aliasListComprehensive;
+	}
+
+
+	/**
+	 *	Whether or not the alias list defines all possible settings for this
+	 *	value. If so, an error will be generated when attempting to invoke
+	 *	any method on this value with an unknown option.
+	 */
+	public void setAliasListComprehensive (boolean aliasListIsComprehensive)
+	{
+		this.aliasListComprehensive = aliasListIsComprehensive;
+	}
+
+
+	/**
+	 *	Alias the given setting.
+	 */
+	public String alias (String str)
+	{
+		return alias (str, aliases, false);
+	}
+
+
+	/**
+	 *	Alias the given setting.
+	 */
+	protected String alias (String str, String[] aliases, boolean nullNotFound)
+	{
+		if (str != null)
+			str = str.trim ();
+		if (aliases == null || aliases.length == 0)
+			return (nullNotFound) ? null : str;
+
+		boolean empty = str != null && str.length () == 0;
+		for (int i = 1; i < aliases.length; i += 2)
+			if (StringUtils.equals (str, aliases[i])
+				|| (empty && aliases[i] == null))
+				return aliases[i - 1];	
+		return (nullNotFound) ? null : str;
+	}
+
+
+	/**
+	 *	Unalias the given setting.
+	 */
+	public String unalias (String str)
+	{
+		return unalias (str, aliases, false);
+	}
+
+
+	/**
+	 *	Unalias the given setting.
+	 */
+	protected String unalias (String str, String[] aliases, 
+		boolean nullNotFound)
+	{
+		if (str != null)
+			str = str.trim ();
+
+		boolean empty = str != null && str.length () == 0;
+		if (str == null || (empty && def != null))
+			str = def;
+		if (aliases != null)
+			for (int i = 0; i < aliases.length; i += 2)
+				if (StringUtils.equals (str, aliases[i])
+					|| StringUtils.equals (str, aliases[i+1])
+					|| (empty && aliases[i] == null))
+					return aliases[i + 1];
+
+		if (isAliasListComprehensive () && aliases != null)
+			throw new ParseException (s_loc.get ("invalid-enumerated-config",
+				getProperty (), str, Arrays.asList (aliases)));
+
+		return (nullNotFound) ? null : str;
+	}
+
+
+	/**
+	 *	The default value for the property as a string.
+	 */
+	public String getDefault ()
+	{
+		return def;
+	}
+
+
+	/**
+	 *	The default value for the propert as a string.
+	 */
+	public void setDefault (String def)
+	{
+		this.def = def;
+	}
+
+
+	/**
+	 *	Return a stringified version of this value.  If the current value has
+	 *	a short alias key, the alias key is returned.
+	 */
+	public String getString ()
+	{
+		return alias (getInternalString ());
+	}
+
+
+	/**
+	 *	Set this value from the given string.  If the given string is null or
+	 *	empty and a default is defined, the default is used.  If the given 
+	 *	string (or default) is an alias key, it will be converted to the 
+	 *	corresponding value internally. 
+	 */
+	public void setString (String val)
+	{
+		String str = unalias (val);
+		try
+		{
+			setInternalString (str);
+		}
+		catch (ParseException pe)
+		{
+			throw pe;
+		}
+		catch (RuntimeException re)
+		{
+			throw new ParseException (prop + ": " + val, re);
+		}
+	}
+
+
+	/**
+	 *	Set this value as an object.
+	 */
+	public void setObject (Object obj)
+	{
+		// if setting to null set as string to get defaults into play
+		if (obj == null && def != null)
+			setString (null);
+		else
+		{
+			try
+			{
+				setInternalObject (obj);
+			}
+			catch (ParseException pe)
+			{
+				throw pe;
+			}
+			catch (RuntimeException re)
+			{
+				throw new ParseException (prop + ": " + obj, re);
+			}
+		}
+	}
+
+
+	/** 
+	 *  Returns the type of the property that this Value represents.
+	 */
+	public abstract Class getValueType ();
+
+
+	/**
+ 	 *	Return the internal string form of this value.
+	 */
+	protected abstract String getInternalString ();
+
+
+	/**
+	 *	Set this value from the given string.
+	 */
+	protected abstract void setInternalString (String str);
+
+
+	/**
+	 *	Set this value from an object.
+	 */
+	protected abstract void setInternalObject (Object obj);
+
+
+	/**
+	 *	Listener for value changes.
+	 */
+	public ValueListener getListener ()
+	{
+		return this.listen;
+	}
+
+
+	/**
+	 *	Listener for value changes.
+	 */
+	public void setListener (ValueListener listen)
+	{
+		this.listen = listen;
+	}
+
+
+	/**
+	 *	Subclasses should call this method when their inernal value changes.
+	 */
+	public void valueChanged ()
+	{
+		if (listen != null)
+			listen.valueChanged (this);
+	}
+
+
+	public int hashCode ()
+	{
+		String str = getString ();
+		int strHash =  (str == null) ? 0 : str.hashCode ();
+		int propHash = (prop == null) ? 0 : prop.hashCode ();
+		return strHash ^ propHash;
+	}
+
+
+	public boolean equals (Object other)
+	{
+		if (other == this)
+			return true;
+		if (!(other instanceof Value))
+			return false;
+
+		Value o = (Value)other;
+		return StringUtils.equals (prop, o.getProperty ()) 
+			&& StringUtils.equals (getString (), o.getString ());	
+	}
+
+
+	public Object clone ()
+	{
+		try
+		{
+			return super.clone ();
+		}
+		catch (CloneNotSupportedException cnse)
+		{
+			return null;	
+		}
+	}
+}

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/Value.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/ValueListener.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/ValueListener.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/ValueListener.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/ValueListener.java Sat May 13 20:25:56 2006
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.conf;
+
+
+/**
+ *	<p>Components can listen on {@link Value} objects for changes directly.</p>
+ *
+ *	@author		Abe White
+ */
+public interface ValueListener
+{
+	/**
+	 *	Callback used by {@link Value} objects to notify listener of 
+	 *	change.
+	 */
+	public void valueChanged (Value val);
+}

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/ValueListener.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/package.html
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/package.html?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/package.html (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/package.html Sat May 13 20:25:56 2006
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+<html>
+<body>
+	<p><strong>Configuration Framework</strong></p>
+	<p>
+		This package provides an extendable product configuration framework.
+	</p>
+</body>
+</html>

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/conf/package.html
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/AbstractJDBCListener.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/AbstractJDBCListener.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/AbstractJDBCListener.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/AbstractJDBCListener.java Sat May 13 20:25:56 2006
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.jdbc;
+
+
+/** 
+ *  An abstract implementation of the {@link JDBCListener}
+ *  listener. It allows simple implementation of fine-grained
+ *  event handling.
+ *
+ *  @author  Marc Prud'hommeaux
+ */
+public class AbstractJDBCListener
+	implements JDBCListener
+{
+	/** 
+	 *  Catch-all for unhandled events.  This method is called by all other
+	 *	event methods if you do not override them.  Does nothing by default.
+	 */
+	protected void eventOccurred (JDBCEvent event)
+	{
+	}
+
+
+	public void beforePrepareStatement (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void afterPrepareStatement (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void beforeCreateStatement (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void afterCreateStatement (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void beforeExecuteStatement (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void afterExecuteStatement (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void beforeCommit (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void afterCommit (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void beforeRollback (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void afterRollback (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void beforeReturn (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void afterReturn (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void afterConnect (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+
+
+	public void beforeClose (JDBCEvent event)
+	{
+		eventOccurred (event);
+	}
+}
+

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/AbstractJDBCListener.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConfiguringConnectionDecorator.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConfiguringConnectionDecorator.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConfiguringConnectionDecorator.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConfiguringConnectionDecorator.java Sat May 13 20:25:56 2006
@@ -0,0 +1,209 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.jdbc;
+
+
+import java.sql.*;
+
+
+/**
+ *	<p>Connection decorator that can configure some properties of the 
+ *	underlying connection.  Understands the following properties:
+ *	<ul>
+ *	<li>QueryTimeout</li>
+ *	<li>TransactionIsolation ({@link Connection} constants)</li>
+ *	<li>AutoCommit</li>
+ *	</ul></p>
+ *
+ *	@author		Abe White
+ *	@nojavadoc
+ */
+public class ConfiguringConnectionDecorator
+	implements ConnectionDecorator
+{
+	private int 	_isolation 		= -1;
+	private int 	_queryTimeout	= -1;
+	private Boolean	_autoCommit		= null;
+
+
+	/**
+	 *	The number of seconds to wait for a query to execute before
+	 *	terminating it.
+	 */
+	public int getQueryTimeout ()
+	{
+		return _queryTimeout;
+	}
+
+
+	/**
+	 *	The number of seconds to wait for a query to execute before
+	 *	terminating it.
+	 */
+	public void setQueryTimeout (int timeout)
+	{
+		_queryTimeout = timeout;
+	}
+
+
+	/**
+	 *	The transaction isolation level.
+	 */
+	public int getTransactionIsolation ()
+	{
+		return _isolation;
+	}
+
+
+	/**
+	 *	The transaction isolation level.
+	 */
+	public void setTransactionIsolation (int isolation)
+	{
+		_isolation = isolation;
+	}
+
+
+	/**
+	 *	Whether auto commit should be on.  Use null to keep
+	 *	the connection's default setting.  Defaults to null.
+	 */
+	public Boolean getAutoCommit ()
+	{
+	 	return _autoCommit;
+	}
+
+
+	/**
+	 *	Whether auto commit should be on.  Use null to keep
+	 *	the connection's default setting.  Defaults to null.
+	 */
+	public void setAutoCommit (Boolean autoCommit)
+	{
+	 	_autoCommit = autoCommit;
+	}
+
+
+	public Connection decorate (Connection conn)
+		throws SQLException
+	{
+		if (_isolation == Connection.TRANSACTION_NONE || _queryTimeout != -1
+			|| _autoCommit != null)
+			conn = new ConfiguringConnection (conn);
+		if (_isolation != -1 && _isolation != Connection.TRANSACTION_NONE)
+			conn.setTransactionIsolation (_isolation);
+		return conn;
+	}
+
+
+	/**
+	 *	Decorator to configure connection components correctly.
+	 */
+	private class ConfiguringConnection
+		extends DelegatingConnection
+	{
+		private boolean _curAutoCommit = false;
+
+
+		public ConfiguringConnection (Connection conn)
+			throws SQLException
+		{
+			super (conn);
+			if (_autoCommit != null)
+			{
+				_curAutoCommit = ConfiguringConnection.this.getAutoCommit ();
+				if (_curAutoCommit != _autoCommit.booleanValue ())
+					setAutoCommit (_autoCommit.booleanValue ());
+			}
+		}
+
+
+		public void setAutoCommit (boolean auto)
+			throws SQLException
+		{
+			if (_isolation != TRANSACTION_NONE)
+			{
+				super.setAutoCommit (auto);
+				_curAutoCommit = auto;
+			}
+		}
+
+
+		public void commit ()
+			throws SQLException
+		{
+			if (_isolation != TRANSACTION_NONE)
+				super.commit ();
+			if (_autoCommit != null
+				&& _autoCommit.booleanValue () != _curAutoCommit)
+				setAutoCommit (_autoCommit.booleanValue ());
+		}
+
+
+		public void rollback ()
+			throws SQLException
+		{
+			if (_isolation != TRANSACTION_NONE)
+				super.rollback ();
+			if (_autoCommit != null
+				&& _autoCommit.booleanValue () != _curAutoCommit)
+				setAutoCommit (_autoCommit.booleanValue ());
+		}
+
+
+		protected PreparedStatement prepareStatement (String sql, boolean wrap)
+			throws SQLException
+		{
+			PreparedStatement stmnt = super.prepareStatement (sql, wrap);
+			if (_queryTimeout != -1)
+				stmnt.setQueryTimeout (_queryTimeout);
+			return stmnt;
+		}
+
+
+		protected PreparedStatement prepareStatement (String sql, int rsType,
+			int rsConcur, boolean wrap)
+			throws SQLException
+		{
+			PreparedStatement stmnt = super.prepareStatement (sql, rsType, 
+				rsConcur, wrap);
+			if (_queryTimeout != -1)
+				stmnt.setQueryTimeout (_queryTimeout);
+			return stmnt;
+		}
+
+
+		protected Statement createStatement (boolean wrap)
+			throws SQLException
+		{
+			Statement stmnt = super.createStatement (wrap);
+			if (_queryTimeout != -1)
+				stmnt.setQueryTimeout (_queryTimeout);
+			return stmnt;
+		}
+
+
+		protected Statement createStatement (int rsType, int rsConcur, 
+			boolean wrap)
+			throws SQLException
+		{
+			Statement stmnt = super.createStatement (rsType, rsConcur, wrap);
+			if (_queryTimeout != -1)
+				stmnt.setQueryTimeout (_queryTimeout);
+			return stmnt;
+		}
+	}
+}

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConfiguringConnectionDecorator.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConnectionDecorator.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConnectionDecorator.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConnectionDecorator.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConnectionDecorator.java Sat May 13 20:25:56 2006
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.jdbc;
+
+
+import java.sql.*;
+
+
+/**
+ *	<p>A connection decorator can wrap {@link Connection}s before they are
+ *	returned to the user to add functionality.</p>
+ *
+ *	@author	Abe White
+ */
+public interface ConnectionDecorator
+{
+	/**
+	 *	Decorate the given connection if desired.
+	 */
+	public Connection decorate (Connection conn)
+		throws SQLException;
+}

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConnectionDecorator.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConnectionRequestInfo.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConnectionRequestInfo.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConnectionRequestInfo.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConnectionRequestInfo.java Sat May 13 20:25:56 2006
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.jdbc;
+
+
+import org.apache.commons.lang.*;
+
+
+/**
+ *	<p>Information about a JDBC connection request.</p>
+ *
+ *	@author		Marc Prud'hommeaux
+ *	@nojavadoc
+ */
+public class ConnectionRequestInfo
+{
+	public String user = null;
+	public String pass = null;
+
+
+	public ConnectionRequestInfo ()
+	{
+	}
+
+
+	public ConnectionRequestInfo (String user, String pass)
+	{
+		this.user = user;
+		this.pass = pass;
+	}
+
+
+	public int hashCode ()
+	{
+		return (((user == null) ? 0 : user.hashCode ())
+			+ ((pass == null) ? 0 : pass.hashCode ()))
+			% Integer.MAX_VALUE;
+	}
+
+
+	public boolean equals (Object other)
+	{
+		if (other == this)
+			return true;
+		if (!(other instanceof ConnectionRequestInfo))
+			return false;
+
+		ConnectionRequestInfo cri = (ConnectionRequestInfo) other;
+		return StringUtils.equals (user, cri.user)
+			&& StringUtils.equals (pass, cri.pass);
+	}
+}

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/ConnectionRequestInfo.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java Sat May 13 20:25:56 2006
@@ -0,0 +1,178 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.jdbc;
+
+
+import java.sql.*;
+import java.util.*;
+import javax.sql.*;
+
+import org.apache.openjpa.lib.log.*;
+
+
+/** 
+ *  Provies basic logging facilities to a DataSource.
+ *  
+ *  @author  Marc Prud'hommeaux
+ *	@nojavadoc
+ */
+public class DataSourceLogs
+{
+	private Log _jdbcLog	= null;
+	private Log _sqlLog		= null;
+
+
+	public DataSourceLogs ()
+	{
+	}
+
+
+	public DataSourceLogs (Log jdbcLog, Log sqlLog)
+	{
+		_jdbcLog = jdbcLog;
+		_sqlLog = sqlLog;
+	}
+
+
+	/**
+	 *	The log to write JDBC messages to.
+	 */
+	public Log getJDBCLog ()
+	{
+		return (_jdbcLog == null) ? NoneLogFactory.NoneLog.getInstance () 
+			: _jdbcLog;
+	}
+
+
+	/**
+	 *	The log to write JDBC messages to.
+	 */
+	public void setJDBCLog (Log log)
+	{
+		_jdbcLog = log;
+	}
+
+
+	/**
+	 *	Return true if JDBC logging is enabled.
+	 */
+	public boolean isJDBCEnabled ()
+	{
+		return (_jdbcLog != null && _jdbcLog.isTraceEnabled ());
+	}
+
+
+	/**
+	 *	The log to write SQL messages to.
+	 */
+	public Log getSQLLog ()
+	{
+		return (_sqlLog == null) ? NoneLogFactory.NoneLog.getInstance () 
+			: _sqlLog;
+	}
+
+
+	/**
+	 *	The log to write SQL messages to.
+	 */
+	public void setSQLLog (Log log)
+	{
+		_sqlLog = log;
+	}
+
+
+	/**
+	 *	Return true if SQL logging is enabled.
+	 */
+	public boolean isSQLEnabled ()
+	{
+		return (_sqlLog != null && _sqlLog.isTraceEnabled ());
+	}
+
+
+	/**
+	 *	Log a JDBC message on behalf of the given connection.
+	 */
+	public void logJDBC (String msg, Connection conn)
+	{
+		log (msg, conn, _jdbcLog);
+	}
+
+
+	/**
+	 *	Log a JDBC message on behalf of the given connection.
+	 */
+	public void logJDBC (String msg, long startTime, Connection conn)
+	{
+		log (msg, conn, _jdbcLog, startTime);
+	}
+
+
+	/**
+	 *	Log a SQL message on behalf of the given connection.
+	 */
+	public void logSQL (String msg, Connection conn)
+	{
+		log (msg, conn, _sqlLog);
+	}
+
+
+	/**
+	 *	Log a SQL message on behalf of the given connection.
+	 */
+	public void logSQL (String msg, long startTime, Connection conn)
+	{
+		log (msg, conn, _sqlLog, startTime);
+	}
+
+
+	/**
+	 *	Log a message to the given logger.
+	 */
+	private static void log (String msg, Connection conn, Log log)
+	{
+		log (msg, conn, log, -1);
+	}
+
+
+	/**
+	 *	Log a message to the given logger.
+	 */
+	private static void log (String msg, Connection conn,
+		Log log, long startTime)
+	{
+		if (log == null || !log.isTraceEnabled ())
+			return;
+
+		long totalTime = -1;
+		if (startTime != -1)
+			totalTime = System.currentTimeMillis () - startTime;
+
+		StringBuffer buf = new StringBuffer (25 + msg.length ());
+		buf.append ("<t ").append (Thread.currentThread ().hashCode ());
+		if (conn != null)
+			buf.append (", ").append (conn);
+		buf.append ("> ");
+
+		// in the time != -1, append time profiling information
+		if (totalTime != -1)
+			buf.append ("[").append (totalTime).append (" ms] ");
+
+		buf.append (msg);
+		log.trace (buf.toString ());
+	}
+}
+

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DecoratingDataSource.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DecoratingDataSource.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DecoratingDataSource.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DecoratingDataSource.java Sat May 13 20:25:56 2006
@@ -0,0 +1,172 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.jdbc;
+
+
+import java.sql.*;
+import java.util.*;
+import javax.sql.*;
+
+
+/**
+ *	<p>Delegating data source that maintains a list of 
+ *	{@link ConnectionDecorator}s.</p>
+ *
+ *	@author		Abe White
+ *	@nojavadoc
+ */
+public class DecoratingDataSource
+	extends DelegatingDataSource
+{
+	private static final int INITIAL_SIZE = 7;
+
+	private volatile List 	_decorators	= null;
+	private boolean			_conf		= false;
+
+
+	/**
+	 *	Constructor.  Supply wrapped data source.
+	 */
+	public DecoratingDataSource (DataSource ds)
+	{
+		super (ds);
+	}
+
+
+	/**
+	 *	Whether the datasource is in configuration mode.  Configuration mode
+	 *	allows more efficient modification of the decorator chain.  No 
+	 *	connections can be obtained while in configuration mode.
+	 */
+	public boolean isConfiguring ()
+	{
+		return _conf;
+	}
+
+
+	/**
+	 *	Whether the datasource is in configuration mode.  Configuration mode
+	 *	allows more efficient modification of the decorator chain.  No 
+	 *	connections can be obtained while in configuration mode.
+	 */
+	public void setConfiguring (boolean conf)
+	{
+		_conf = conf;
+	}
+
+
+	/**
+	 *	Return a read-only list of connection decorators in the order they were
+	 *	added.
+	 */
+	public Collection getDecorators ()
+	{
+		return (_decorators == null) ? Collections.EMPTY_LIST
+			: Collections.unmodifiableCollection (_decorators);
+	}
+
+
+	/**
+	 *	Add a connection decorator.
+	 */
+	public synchronized void addDecorator (ConnectionDecorator decorator)
+	{
+		if (decorator == null)
+			throw new NullPointerException ("decorator == null");
+
+		if (_conf)
+		{
+			if (_decorators == null)
+				_decorators = new ArrayList (INITIAL_SIZE);
+			_decorators.add (decorator);
+		}
+		else
+		{
+			// copy so we don't have to synchronize iteration in decorate
+			int size = (_decorators == null) ? 1 : _decorators.size () + 1;
+			List copy = new ArrayList (Math.max (INITIAL_SIZE, size));
+			if (_decorators != null)
+				copy.addAll (_decorators);		
+			copy.add (decorator);
+			_decorators = copy;
+		}
+	}
+
+
+	/**
+	 *	Remove a connection decorator.
+	 */
+	public synchronized boolean removeDecorator (ConnectionDecorator decorator)
+	{
+		if (decorator == null || _decorators == null 
+			|| !_decorators.contains (decorator))
+			return false;
+
+		if (_conf)
+			_decorators.remove (decorator);
+		else
+		{
+			// copy so we don't have to synchronize iteration in decorate
+			List copy = new ArrayList (Math.max (INITIAL_SIZE, 
+				_decorators.size () - 1));
+			for (int i = 0; i < _decorators.size (); i++)
+				if (_decorators.get (i) != decorator)
+					copy.add (_decorators.get (i));
+			_decorators = copy;
+		}
+		return true;
+	}
+
+
+	/**
+	 *	Clear all decorators.
+	 */
+	public synchronized void clearDecorators ()
+	{
+		_decorators = null;
+	}
+
+
+	public Connection getConnection ()
+		throws SQLException
+	{
+		Connection conn = super.getConnection ();
+		return decorate (conn);
+	}
+
+
+	public Connection getConnection (String user, String pass)
+		throws SQLException
+	{
+		Connection conn = super.getConnection (user, pass);
+		return decorate (conn);
+	}
+
+
+	private Connection decorate (Connection conn)
+		throws SQLException
+	{
+		if (_conf)
+			throw new IllegalStateException ();
+
+		// use local in case _decorators replaced during loop
+		List dec = _decorators;
+		if (dec != null)
+			for (int i = 0; i < dec.size (); i++)
+				conn = ((ConnectionDecorator) dec.get (i)).decorate (conn);	
+		return conn;
+	}
+}

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DecoratingDataSource.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DelegatingCallableStatement.java
URL: http://svn.apache.org/viewcvs/incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DelegatingCallableStatement.java?rev=406215&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DelegatingCallableStatement.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DelegatingCallableStatement.java Sat May 13 20:25:56 2006
@@ -0,0 +1,1251 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.jdbc;
+
+
+import java.io.*;
+import java.math.*;
+import java.net.*;
+import java.sql.*;
+import java.sql.Date;		
+import java.util.*;
+
+import org.apache.openjpa.lib.util.*;
+import org.apache.openjpa.lib.util.Closeable; 
+
+
+/**
+ *	<p>{@link CallableStatement} that delegates to an internal statement.</p>
+ *
+ *	@author		Abe White
+ */
+public class DelegatingCallableStatement 
+	implements CallableStatement, Closeable
+{
+	private final CallableStatement 			_stmnt;
+	private final DelegatingCallableStatement	_del;
+	private final Connection					_conn;
+
+
+	public DelegatingCallableStatement (CallableStatement stmnt, 
+		Connection conn)
+	{
+		_conn = conn;
+		_stmnt = stmnt;
+		if (_stmnt instanceof DelegatingCallableStatement)
+			_del = (DelegatingCallableStatement) _stmnt;
+		else
+			_del = null;
+	}
+
+
+	private ResultSet wrapResult (boolean wrap, ResultSet rs)
+	{
+		if (!wrap)
+			return rs;
+
+		// never wrap null
+		if (rs == null)
+			return null;
+
+		return new DelegatingResultSet (rs, this);
+	}
+
+
+	/**
+	 *	Return the wrapped statement.
+	 */
+	public CallableStatement getDelegate ()
+	{
+		return _stmnt;
+	}
+
+
+	/**
+	 *	Return the base underlying data store statement.
+	 */
+	public CallableStatement getInnermostDelegate ()
+	{
+		return (_del == null) ? _stmnt : _del.getInnermostDelegate ();
+	}
+
+
+	public int hashCode ()
+	{
+		return getInnermostDelegate ().hashCode ();
+	}
+
+
+	public boolean equals (Object other)
+	{
+		if (other == this)
+			return true;
+		if (other instanceof DelegatingCallableStatement)
+			other = ((DelegatingCallableStatement) other).
+				getInnermostDelegate ();
+		return getInnermostDelegate ().equals (other);
+	}
+
+
+	public String toString ()
+	{
+		StringBuffer buf = new StringBuffer ("prepstmnt ").append (hashCode ());
+		appendInfo (buf);
+		return buf.toString ();
+	}
+
+
+	protected void appendInfo (StringBuffer buf)
+	{
+		if (_del != null)
+			_del.appendInfo (buf);
+	}
+
+
+    public ResultSet executeQuery (String str) 
+		throws SQLException
+	{
+		return executeQuery (true);
+	}
+
+
+	/**
+ 	 *	Execute the query, with the option of not wrapping it in a
+	 *	{@link DelegatingResultSet}, which is the default.
+	 */
+	protected ResultSet executeQuery (String sql, boolean wrap)
+		throws SQLException
+	{
+		ResultSet rs;
+		if (_del != null)
+			rs = _del.executeQuery (sql, false);
+		else
+			rs = _stmnt.executeQuery (sql);
+
+		return wrapResult (wrap, rs);
+	}
+
+
+    public int executeUpdate (String str) 
+		throws SQLException
+	{
+		return _stmnt.executeUpdate (str);
+	}
+
+
+    public boolean execute (String str) 
+		throws SQLException
+	{
+		return _stmnt.execute (str);
+	}
+
+
+    public void close () 
+		throws SQLException
+	{
+		_stmnt.close ();
+	}
+
+
+    public int getMaxFieldSize () 
+		throws SQLException
+	{
+		return _stmnt.getMaxFieldSize ();
+	}
+
+
+    public void setMaxFieldSize (int i) 
+		throws SQLException
+	{
+		_stmnt.setMaxFieldSize (i);
+	}
+
+
+    public int getMaxRows () 
+		throws SQLException
+	{
+		return _stmnt.getMaxRows ();
+	}
+
+
+    public void setMaxRows (int i) 
+		throws SQLException
+	{
+		_stmnt.setMaxRows (i);
+	}
+
+
+    public void setEscapeProcessing (boolean bool) 
+		throws SQLException
+	{
+		_stmnt.setEscapeProcessing (bool);
+	}
+
+
+    public int getQueryTimeout () 
+		throws SQLException
+	{
+		return _stmnt.getQueryTimeout ();
+	}
+
+
+    public void setQueryTimeout (int i) 
+		throws SQLException
+	{
+		_stmnt.setQueryTimeout (i);
+	}
+
+
+    public void cancel () 
+		throws SQLException
+	{
+		_stmnt.cancel ();
+	}
+
+
+    public SQLWarning getWarnings () 
+		throws SQLException
+	{
+		return _stmnt.getWarnings ();
+	}
+
+
+    public void clearWarnings () 
+		throws SQLException
+	{
+		_stmnt.clearWarnings ();
+	}
+
+
+    public void setCursorName (String str) 
+		throws SQLException
+	{
+		_stmnt.setCursorName (str);
+	}
+
+
+    public ResultSet getResultSet () 
+		throws SQLException
+	{
+		return getResultSet (true);
+	}
+
+
+	/**
+ 	 *	Get the last result set, with the option of not wrapping it in a
+	 *	{@link DelegatingResultSet}, which is the default.
+	 */
+	protected ResultSet getResultSet (boolean wrap)
+		throws SQLException
+	{
+		ResultSet rs;
+		if (_del != null)
+			rs = _del.getResultSet (false);
+		else
+			rs = _stmnt.getResultSet ();
+
+		return wrapResult (wrap, rs);
+	}
+
+
+    public int getUpdateCount () 
+		throws SQLException
+	{
+		return _stmnt.getUpdateCount ();
+	}
+
+
+    public boolean getMoreResults () 
+		throws SQLException
+	{
+		return _stmnt.getMoreResults ();
+	}
+
+
+    public void setFetchDirection (int i) 
+		throws SQLException
+	{
+		_stmnt.setFetchDirection (i);
+	}
+
+
+    public int getFetchDirection () 
+		throws SQLException
+	{
+		return _stmnt.getFetchDirection ();
+	}
+
+
+    public void setFetchSize (int i) 
+		throws SQLException
+	{
+		_stmnt.setFetchSize (i);
+	}
+
+
+    public int getFetchSize () 
+		throws SQLException
+	{
+		return _stmnt.getFetchSize ();
+	}
+
+
+    public int getResultSetConcurrency () 
+		throws SQLException
+	{
+		return _stmnt.getResultSetConcurrency ();
+	}
+
+
+    public int getResultSetType () 
+		throws SQLException
+	{
+		return _stmnt.getResultSetType ();
+	}
+
+
+    public void addBatch (String str) 
+		throws SQLException
+	{
+		_stmnt.addBatch (str);
+	}
+
+
+    public void clearBatch () 
+		throws SQLException
+	{
+		_stmnt.clearBatch ();
+	}
+
+
+    public int[] executeBatch ()
+		throws SQLException
+	{
+		return _stmnt.executeBatch ();
+	}
+
+
+    public Connection getConnection () 
+		throws SQLException
+	{
+		return _conn;
+	}
+
+
+	public ResultSet executeQuery () 
+		throws SQLException
+	{
+		return executeQuery (true);
+	}
+
+
+	/**
+ 	 *	Execute the query, with the option of not wrapping it in a
+	 *	{@link DelegatingResultSet}, which is the default.
+	 */
+	protected ResultSet executeQuery (boolean wrap)
+		throws SQLException
+	{
+		ResultSet rs;
+		if (_del != null)
+			rs = _del.executeQuery (false);
+		else
+			rs = _stmnt.executeQuery ();
+
+		return wrapResult (wrap, rs);
+	}
+
+
+	public int executeUpdate  () 
+		throws SQLException
+	{
+		return _stmnt.executeUpdate ();
+	}
+
+
+	public void setNull (int i1, int i2) 
+		throws SQLException
+	{
+		_stmnt.setNull (i1, i2);
+	}
+
+
+	public void setBoolean (int i, boolean b) 
+		throws SQLException
+	{
+		_stmnt.setBoolean (i, b);
+	}
+
+
+	public void setByte (int i, byte b) 
+		throws SQLException
+	{
+		_stmnt.setByte (i, b);
+	}
+
+
+	public void setShort (int i, short s) 
+		throws SQLException
+	{
+		_stmnt.setShort (i, s);
+	}
+
+
+	public void setInt (int i1, int i2) 
+		throws SQLException
+	{
+		_stmnt.setInt (i1, i2);
+	}
+
+
+	public void setLong (int i, long l) 
+		throws SQLException
+	{
+		_stmnt.setLong (i, l);
+	}
+
+
+	public void setFloat (int i, float f) 
+		throws SQLException
+	{
+		_stmnt.setFloat (i, f);
+	}
+
+
+	public void setDouble (int i, double d) 
+		throws SQLException
+	{
+		_stmnt.setDouble (i, d);
+	}
+
+
+	public void setBigDecimal (int i, BigDecimal bd) 
+		throws SQLException
+	{
+		_stmnt.setBigDecimal (i, bd);
+	}
+
+
+	public void setString (int i, String s) 
+		throws SQLException
+	{
+		_stmnt.setString (i, s);
+	}
+
+
+	public void setBytes (int i, byte[] b) 
+		throws SQLException
+	{
+		_stmnt.setBytes (i, b);
+	}
+
+
+	public void setDate (int i, Date d) 
+		throws SQLException
+	{
+		_stmnt.setDate (i, d);
+	}
+
+
+	public void setTime (int i, Time t) 
+		throws SQLException
+	{
+		_stmnt.setTime (i, t);
+	}
+
+
+	public void setTimestamp (int i, Timestamp t) 
+		throws SQLException
+	{
+		_stmnt.setTimestamp (i, t);
+	}
+
+
+	public void setAsciiStream (int i1, InputStream is, int i2) 
+		throws SQLException
+	{
+		_stmnt.setAsciiStream (i1, is, i2);
+	}
+
+
+	public void setUnicodeStream (int i1, InputStream is, int i2) 
+		throws SQLException
+	{
+		_stmnt.setUnicodeStream (i1, is, i2);
+	}
+
+
+	public void setBinaryStream (int i1, InputStream is, int i2) 
+		throws SQLException
+	{
+		_stmnt.setBinaryStream (i1, is, i2);
+	}
+
+
+    public void clearParameters () 
+		throws SQLException
+	{
+		_stmnt.clearParameters ();
+	}
+
+
+	public void setObject (int i1, Object o, int i2, int i3) 
+		throws SQLException
+	{
+		_stmnt.setObject (i1, o, i2, i3);
+	}
+
+
+	public void setObject (int i1, Object o, int i2)
+		throws SQLException
+	{
+		_stmnt.setObject (i1, o, i2);
+	}
+
+
+	public void setObject (int i, Object o) 
+		throws SQLException
+	{
+		_stmnt.setObject (i, o);
+	}
+
+
+    public boolean execute () 
+		throws SQLException
+	{
+		return _stmnt.execute ();
+	}
+
+
+    public void addBatch () 
+		throws SQLException
+	{
+		_stmnt.addBatch ();
+	}
+
+
+	public void setCharacterStream (int i1, Reader r, int i2)
+		throws SQLException
+	{
+		_stmnt.setCharacterStream (i1, r, i2);
+	}
+
+
+	public void setRef (int i, Ref r) 
+		throws SQLException
+	{
+		_stmnt.setRef (i, r);
+	}
+
+
+	public void setBlob (int i, Blob b) 
+		throws SQLException
+	{
+		_stmnt.setBlob (i, b);
+	}
+
+
+	public void setClob (int i, Clob c) 
+		throws SQLException
+	{
+		_stmnt.setClob (i, c);
+	}
+
+
+	public void setArray (int i, Array a) 
+		throws SQLException
+	{
+		_stmnt.setArray (i, a);
+	}
+
+
+    public ResultSetMetaData getMetaData () 
+		throws SQLException
+	{
+		return _stmnt.getMetaData ();
+	}
+
+
+	public void setDate (int i, Date d, Calendar c) 
+		throws SQLException
+	{
+		_stmnt.setDate (i, d, c);
+	}
+
+
+	public void setTime (int i, Time t, Calendar c) 
+		throws SQLException
+	{
+		_stmnt.setTime (i, t, c);
+	}
+
+
+	public void setTimestamp (int i, Timestamp t, Calendar c) 
+		throws SQLException
+	{
+		_stmnt.setTimestamp (i, t, c);
+	}
+
+
+	public void setNull (int i1, int i2, String s) 
+		throws SQLException
+	{
+		_stmnt.setNull (i1, i2, s);
+	}
+
+
+	// JDBC 3.0 (unsupported) methods follow; these are required to be able 
+	// to compile against JDK 1.4
+
+
+	public boolean getMoreResults (int i)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public ResultSet getGeneratedKeys ()
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public int executeUpdate (String s, int i) 
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public int executeUpdate (String s, int[] ia)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public int executeUpdate (String s, String[] sa)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public boolean execute (String s, int i)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public boolean execute (String s, int[] ia)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public boolean execute (String s, String[] sa)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public int getResultSetHoldability ()
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setURL (int i, URL url)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public ParameterMetaData getParameterMetaData ()
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	/////////////////////////////
+	// CallableStatement methods
+	/////////////////////////////
+
+
+	public void registerOutParameter (int i1, int i2)
+		throws SQLException
+	{
+		_stmnt.registerOutParameter (i1, i2);
+	}
+
+
+	public void registerOutParameter (int i1, int i2, int i3)
+		throws SQLException
+	{
+		_stmnt.registerOutParameter (i1, i2, i3);
+	}
+
+
+	public boolean wasNull ()
+		throws SQLException
+	{
+		return _stmnt.wasNull ();
+	}
+
+
+	public String getString (int i)
+		throws SQLException
+	{
+		return _stmnt.getString (i);
+	}
+
+
+	public boolean getBoolean (int i)
+		throws SQLException
+	{
+		return _stmnt.getBoolean (i);
+	}
+
+
+	public byte getByte (int i)
+		throws SQLException
+	{
+		return _stmnt.getByte (i);
+	}
+
+
+	public short getShort (int i)
+		throws SQLException
+	{
+		return _stmnt.getShort (i);
+	}
+
+
+	public int getInt (int i)
+		throws SQLException
+	{
+		return _stmnt.getInt (i);
+	}
+
+
+	public long getLong (int i)
+		throws SQLException
+	{
+		return _stmnt.getLong (i);
+	}
+
+
+	public float getFloat (int i)
+		throws SQLException
+	{
+		return _stmnt.getFloat (i);
+	}
+
+
+	public double getDouble (int i)
+		throws SQLException
+	{
+		return _stmnt.getDouble (i);
+	}
+
+
+	public BigDecimal getBigDecimal (int a, int b)
+		throws SQLException
+	{
+		return _stmnt.getBigDecimal (a, b);
+	}
+
+
+	public byte[] getBytes (int i)
+		throws SQLException
+	{
+		return _stmnt.getBytes (i);
+	}
+
+
+	public Date getDate (int i)
+		throws SQLException
+	{
+		return _stmnt.getDate (i);
+	}
+
+
+	public Time getTime (int i)
+		throws SQLException
+	{
+		return _stmnt.getTime (i);
+	}
+
+
+	public Timestamp getTimestamp (int i)
+		throws SQLException
+	{
+		return _stmnt.getTimestamp (i);
+	}
+
+
+	public Object getObject (int i)
+		throws SQLException
+	{
+		return _stmnt.getObject (i);
+	}
+
+
+	public BigDecimal getBigDecimal (int i)
+		throws SQLException
+	{
+		return _stmnt.getBigDecimal (i);
+	}
+
+
+	public Object getObject (int i, Map m)
+		throws SQLException
+	{
+		return _stmnt.getObject (i, m);
+	}
+
+
+	public Ref getRef (int i)
+		throws SQLException
+	{
+		return _stmnt.getRef (i);
+	}
+
+
+	public Blob getBlob (int i)
+		throws SQLException
+	{
+		return _stmnt.getBlob (i);
+	}
+
+
+	public Clob getClob (int i)
+		throws SQLException
+	{
+		return _stmnt.getClob (i);
+	}
+
+
+	public Array getArray (int i)
+		throws SQLException
+	{
+		return _stmnt.getArray (i);
+	}
+
+
+	public Date getDate (int i, Calendar c)
+		throws SQLException
+	{
+		return _stmnt.getDate (i, c);
+	}
+
+
+	public Time getTime (int i, Calendar c)
+		throws SQLException
+	{
+		return _stmnt.getTime (i, c);
+	}
+
+
+	public Timestamp getTimestamp (int i, Calendar c)
+		throws SQLException
+	{
+		return _stmnt.getTimestamp (i, c);
+	}
+
+
+	public void registerOutParameter (int i1, int i2, String s)
+		throws SQLException
+	{
+		_stmnt.registerOutParameter (i1, i2, s);
+	}
+
+
+	// JDBC 3.0 (unsupported) methods follow; these are required to be able 
+	// to compile against JDK 1.4
+
+
+	public void registerOutParameter (String s, int i)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void registerOutParameter (String s, int i1, int i2)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void registerOutParameter (String s1, int i, String s2)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public URL getURL (int i)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setURL (String a, URL b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public URL getURL (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setNull (String a, int b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setBoolean (String a, boolean b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setByte (String a, byte b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setShort (String a, short b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setInt (String a, int b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setLong (String a, long b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setFloat (String a, float b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setDouble (String a, double b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setBigDecimal (String a, BigDecimal b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setString (String a, String b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setBytes (String a, byte[] b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setDate (String a, Date b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setTime (String a, Time b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setTimestamp (String a, Timestamp b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setAsciiStream (String a, InputStream b, int c)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setBinaryStream (String a, InputStream b, int c)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setObject (String a, Object b, int c, int d)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setObject (String a, Object b, int c)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setObject (String a, Object b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setCharacterStream (String a, Reader b, int c)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setDate (String a, Date b, Calendar c)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setTime (String a, Time b, Calendar c)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setTimestamp (String a, Timestamp b, Calendar c)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public void setNull (String a, int b, String c)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public String getString (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public boolean getBoolean (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public byte getByte (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public short getShort (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public int getInt (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public long getLong (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public float getFloat (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public double getDouble (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public byte[] getBytes (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Date getDate (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Time getTime (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Timestamp getTimestamp (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Object getObject (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public BigDecimal getBigDecimal (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Object getObject (String a, Map b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Ref getRef (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Blob getBlob (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Clob getClob (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Array getArray (String a)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Date getDate (String a, Calendar b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Time getTime (String a, Calendar b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+
+
+	public Timestamp getTimestamp (String a, Calendar b)
+		throws SQLException
+	{
+		throw new UnsupportedOperationException ();
+	}
+}

Propchange: incubator/openjpa/trunk/openjpa-lib/java/org/apache/openjpa/lib/jdbc/DelegatingCallableStatement.java
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message