harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r413642 [12/12] - in /incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java: java/sql/ javax/sql/ javax/transaction/ javax/transaction/xa/ org/apache/harmony/sql/internal/common/
Date Mon, 12 Jun 2006 12:13:44 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetMetaData.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetMetaData.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetMetaData.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetMetaData.java Mon Jun 12 05:13:42 2006
@@ -11,14 +11,13 @@
  * 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 javax.sql;
-
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-
+ */
+
+package javax.sql;
+
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+
 /**
  * An interface which provides facilities for getting information about the
  * columns in a RowSet.
@@ -28,164 +27,255 @@
  * <p>
  * Application code would not mormally call this interface directly. It would be
  * called internally when <code>RowSet.execute</code> is called.
- * 
  */
-public interface RowSetMetaData extends ResultSetMetaData {
-
-	/**
-	 * Sets automatic numbering for a specified column in the RowSet.  If automatic numbering is
-	 * on, the column is read only.  The default value is for automatice numbering to be off.
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param autoIncrement true to set automatic numbering on, false to turn it off. 
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setAutoIncrement( int columnIndex, boolean autoIncrement ) throws SQLException;
-	
-	/**
-	 * Sets the case sensitive property for a specified column in the RowSet.  The default is that
-	 * the column is not case sensitive. 
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param caseSensitive true to make the column case sensitive, false to make it not case
-	 * sensitive.
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setCaseSensitive( int columnIndex, boolean caseSensitive ) throws SQLException;
-	
-	/**
-	 * Sets the Catalog Name for a specified column in the RowSet.
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param catalogName a string containing the new Catalog Name
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setCatalogName( int columnIndex, String catalogName ) throws SQLException;
-	
-	/**
-	 * Sets the number of columns in the Row Set.
-	 * @param columnCount an integer containing the number of columns in the RowSet.
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setColumnCount(int columnCount) throws SQLException;
-	
-	/**
-	 * Sets the normal maximum width in characters for a specified column in the RowSet.
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param displaySize an integer with the normal maximum column width in characters
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setColumnDisplaySize( int columnIndex, int displaySize ) throws SQLException;
-	
-	/**
-	 * 
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param theLabel
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setColumnLabel(int columnIndex, String theLabel) throws SQLException;
-	
-	/**
-	 * Sets the suggested column label for a specified column in the RowSet.  This label is
-	 * typically used in displaying or printing the column.
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param theColumnName a string containing the column label
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setColumnName(int columnIndex, String theColumnName) throws SQLException;
-	
-	/**
-	 * Sets the SQL type for a specified column in the RowSet
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param theSQLType an integer containing the SQL Type, as defined by java.sql.Types.
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setColumnType(int columnIndex, int theSQLType) throws SQLException;
-	
-	/**
-	 * Sets the Type Name for a specified column in the RowSet, where the data type is 
-	 * specific to the datasource.
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param theTypeName a string containing the Type Name for the colunm
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setColumnTypeName(int columnIndex, String theTypeName) throws SQLException;
-	
-	/**
-	 * Sets whether a specified column is a currency value.
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param isCurrency true if the column should be treated as a currency value, false if it
-	 * should not be treated as a currency value.
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setCurrency( int columnIndex, boolean isCurrency ) throws SQLException;
-	
-	/**
-	 * Sets whether a specified column can contain SQL NULL values.
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param nullability an integer which is one of the following values: 
-	 * ResultSetMetaData.columnNoNulls, ResultSetMetaData.columnNullable, or 
-	 * ResultSetMetaData.columnNullableUnknown
-	 * <p>
-	 * The default value is ResultSetMetaData.columnNullableUnknown
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setNullable( int columnIndex, int nullability ) throws SQLException;
-	
-	/**
-	 * Sets the number of decimal digits for a specified column in the RowSet.
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param thePrecision an integer containoing the number of decimal digits
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setPrecision( int columnIndex, int thePrecision ) throws SQLException;
-	
-	/**
-	 * For the column specified by <code>columnIndex</code> declares how many
-	 * digits there should be after a decimal point.
-	 * 
-	 * @param columnIndex
-	 *            the index number for the column, where the first column has
-	 *            index 1.
-	 * @param theScale
-	 *            an integer containing the number of digits after the decimal
-	 *            point
-	 * @throws SQLException
-	 *             if a problem occurs accessing the database
-	 */
-	public void setScale( int columnIndex, int theScale ) throws SQLException;
-	
-	/**
-	 * Sets the Schema Name for a specified column in the RowSet
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param theSchemaName a String containing the schema name
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setSchemaName( int columnIndex, String theSchemaName) throws SQLException;
-	
-	/**
-	 * Sets whether a specified column can be used in a search involving a WHERE clause. The
-	 * default value is false.
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param isSearchable true of the column can be used in a WHERE clause search, false otherwise.
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setSearchable( int columnIndex, boolean isSearchable ) throws SQLException;
-	
-	/**
-	 * Sets if a specified column can contain signed numbers
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param isSigned true if the column can contain signed numbers, false otherwise
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setSigned( int columnIndex, boolean isSigned ) throws SQLException;
-	
-	/**
-	 * Sets the Table Name for a specified column in the RowSet
-	 * @param columnIndex the index number for the column, where the first column has index 1.
-	 * @param theTableName a String containing the Table Name for the column
-	 * @throws SQLException if a problem occurs accessing the database 
-	 */
-	public void setTableName( int columnIndex, String theTableName ) throws SQLException;
-	
-	
-} // end interface RowSetMetaData
-
-
+public interface RowSetMetaData extends ResultSetMetaData {
+
+    /**
+     * Sets automatic numbering for a specified column in the RowSet. If
+     * automatic numbering is on, the column is read only. The default value is
+     * for automatice numbering to be off.
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param autoIncrement
+     *            true to set automatic numbering on, false to turn it off.
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setAutoIncrement(int columnIndex, boolean autoIncrement)
+            throws SQLException;
+
+    /**
+     * Sets the case sensitive property for a specified column in the RowSet.
+     * The default is that the column is not case sensitive.
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param caseSensitive
+     *            true to make the column case sensitive, false to make it not
+     *            case sensitive.
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setCaseSensitive(int columnIndex, boolean caseSensitive)
+            throws SQLException;
+
+    /**
+     * Sets the Catalog Name for a specified column in the RowSet.
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param catalogName
+     *            a string containing the new Catalog Name
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setCatalogName(int columnIndex, String catalogName)
+            throws SQLException;
+
+    /**
+     * Sets the number of columns in the Row Set.
+     * 
+     * @param columnCount
+     *            an integer containing the number of columns in the RowSet.
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setColumnCount(int columnCount) throws SQLException;
+
+    /**
+     * Sets the normal maximum width in characters for a specified column in the
+     * RowSet.
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param displaySize
+     *            an integer with the normal maximum column width in characters
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setColumnDisplaySize(int columnIndex, int displaySize)
+            throws SQLException;
+
+    /**
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param theLabel
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setColumnLabel(int columnIndex, String theLabel)
+            throws SQLException;
+
+    /**
+     * Sets the suggested column label for a specified column in the RowSet.
+     * This label is typically used in displaying or printing the column.
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param theColumnName
+     *            a string containing the column label
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setColumnName(int columnIndex, String theColumnName)
+            throws SQLException;
+
+    /**
+     * Sets the SQL type for a specified column in the RowSet
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param theSQLType
+     *            an integer containing the SQL Type, as defined by
+     *            java.sql.Types.
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setColumnType(int columnIndex, int theSQLType)
+            throws SQLException;
+
+    /**
+     * Sets the Type Name for a specified column in the RowSet, where the data
+     * type is specific to the datasource.
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param theTypeName
+     *            a string containing the Type Name for the colunm
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setColumnTypeName(int columnIndex, String theTypeName)
+            throws SQLException;
+
+    /**
+     * Sets whether a specified column is a currency value.
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param isCurrency
+     *            true if the column should be treated as a currency value,
+     *            false if it should not be treated as a currency value.
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setCurrency(int columnIndex, boolean isCurrency)
+            throws SQLException;
+
+    /**
+     * Sets whether a specified column can contain SQL NULL values.
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param nullability
+     *            an integer which is one of the following values:
+     *            ResultSetMetaData.columnNoNulls,
+     *            ResultSetMetaData.columnNullable, or
+     *            ResultSetMetaData.columnNullableUnknown
+     *            <p>
+     *            The default value is ResultSetMetaData.columnNullableUnknown
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setNullable(int columnIndex, int nullability)
+            throws SQLException;
+
+    /**
+     * Sets the number of decimal digits for a specified column in the RowSet.
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param thePrecision
+     *            an integer containoing the number of decimal digits
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setPrecision(int columnIndex, int thePrecision)
+            throws SQLException;
+
+    /**
+     * For the column specified by <code>columnIndex</code> declares how many
+     * digits there should be after a decimal point.
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param theScale
+     *            an integer containing the number of digits after the decimal
+     *            point
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setScale(int columnIndex, int theScale) throws SQLException;
+
+    /**
+     * Sets the Schema Name for a specified column in the RowSet
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param theSchemaName
+     *            a String containing the schema name
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setSchemaName(int columnIndex, String theSchemaName)
+            throws SQLException;
+
+    /**
+     * Sets whether a specified column can be used in a search involving a WHERE
+     * clause. The default value is false.
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param isSearchable
+     *            true of the column can be used in a WHERE clause search, false
+     *            otherwise.
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setSearchable(int columnIndex, boolean isSearchable)
+            throws SQLException;
+
+    /**
+     * Sets if a specified column can contain signed numbers
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param isSigned
+     *            true if the column can contain signed numbers, false otherwise
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setSigned(int columnIndex, boolean isSigned)
+            throws SQLException;
+
+    /**
+     * Sets the Table Name for a specified column in the RowSet
+     * 
+     * @param columnIndex
+     *            the index number for the column, where the first column has
+     *            index 1.
+     * @param theTableName
+     *            a String containing the Table Name for the column
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public void setTableName(int columnIndex, String theTableName)
+            throws SQLException;
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetReader.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetReader.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetReader.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetReader.java Mon Jun 12 05:13:42 2006
@@ -11,38 +11,38 @@
  * 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 javax.sql;
-
-import java.sql.SQLException;
-
-/**
- * An interface which provides functionality for a disconnected RowSet to get data from a data source
- * into its rows.  The RowSet calls the RowSetReader interface when the RowSet's execute method is
- * invoked - a RowSetReader must firat be registered with the RowSet for this to work.
- * 
- */
-public interface RowSetReader {
-
-	/**
-	 * Reads new data into the RowSet.  The calling RowSet object must itself implement the 
-	 * RowSetInternal interface and the RowSetReader must be registered as a Reader on the
-	 * RowSet.
-	 * <p>
-	 * This method adds rows into the calling RowSet.  The Reader may invoke any of the RowSet's
-	 * methods except for the <code>execute</code> method (calling execute will cause an
-	 * SQLException to be thrown).  However, when the Reader calls the RowSet's methods, no
-	 * events are sent to listeners - any listeners are informed by the calling RowSet's
-	 * execute method once the Reader returns from the readData method.
-	 * @param theCaller must be the calling RowSet object, which must have implemented the
-	 * RowSetInternal interface.
-	 * @throws SQLException if a problem occurs accessing the database or if the Reader calls
-	 * the RowSet.execute method. 
-	 */
-	public void readData(RowSetInternal theCaller) throws SQLException;
-	
-} // end interface RowSetReader
-
-
+ */
+
+package javax.sql;
+
+import java.sql.SQLException;
+
+/**
+ * An interface which provides functionality for a disconnected RowSet to get
+ * data from a data source into its rows. The RowSet calls the RowSetReader
+ * interface when the RowSet's execute method is invoked - a RowSetReader must
+ * firat be registered with the RowSet for this to work.
+ */
+public interface RowSetReader {
+
+    /**
+     * Reads new data into the RowSet. The calling RowSet object must itself
+     * implement the RowSetInternal interface and the RowSetReader must be
+     * registered as a Reader on the RowSet.
+     * <p>
+     * This method adds rows into the calling RowSet. The Reader may invoke any
+     * of the RowSet's methods except for the <code>execute</code> method
+     * (calling execute will cause an SQLException to be thrown). However, when
+     * the Reader calls the RowSet's methods, no events are sent to listeners -
+     * any listeners are informed by the calling RowSet's execute method once
+     * the Reader returns from the readData method.
+     * 
+     * @param theCaller
+     *            must be the calling RowSet object, which must have implemented
+     *            the RowSetInternal interface.
+     * @throws SQLException
+     *             if a problem occurs accessing the database or if the Reader
+     *             calls the RowSet.execute method.
+     */
+    public void readData(RowSetInternal theCaller) throws SQLException;
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetWriter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetWriter.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetWriter.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/RowSetWriter.java Mon Jun 12 05:13:42 2006
@@ -11,39 +11,40 @@
  * 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 javax.sql;
-
-import java.sql.SQLException;
-
-/**
- * An interface which provides functionality for a disconnected RowSet to put data updates back to
- * the data source from which the RowSet was originally populated.  An object implementing this 
- * interface is called a Writer.
- * <p>
- * The Writer must establish a connection to the RowSet's data source before writing the data.
- * The RowSet calling this interface must implement the RowSetInternal interface.
- * <p>
- * The Writer may encounter a situation where the updated data being written back to the 
- * data source has already been updated in the data source.  How a conflict of this kind is
- * handled is determined by the implementation of the Writer. 
- * 
- */
-public interface RowSetWriter {
-	
-	/**
-	 * Writes changes in the RowSet associated with this RowSetWriter back to its data source.
-	 * @param theRowSet the RowSet object.  This RowSet must a) Implement the RowSetInternal interface
-	 * and b) have have this RowSetWriter registered with it and c) must call this method
-	 * internally
-	 * @return true if the modified data was written, false otherwise (which typically implies 
-	 * some form of conflict)
-	 * @throws SQLException if a problem occurs accessing the database
-	 */
-	public boolean writeData(RowSetInternal theRowSet) throws SQLException;
-
-} // end interface RowSetWriter
-
-
+ */
+
+package javax.sql;
+
+import java.sql.SQLException;
+
+/**
+ * An interface which provides functionality for a disconnected RowSet to put
+ * data updates back to the data source from which the RowSet was originally
+ * populated. An object implementing this interface is called a Writer.
+ * <p>
+ * The Writer must establish a connection to the RowSet's data source before
+ * writing the data. The RowSet calling this interface must implement the
+ * RowSetInternal interface.
+ * <p>
+ * The Writer may encounter a situation where the updated data being written
+ * back to the data source has already been updated in the data source. How a
+ * conflict of this kind is handled is determined by the implementation of the
+ * Writer.
+ */
+public interface RowSetWriter {
+
+    /**
+     * Writes changes in the RowSet associated with this RowSetWriter back to
+     * its data source.
+     * 
+     * @param theRowSet
+     *            the RowSet object. This RowSet must a) Implement the
+     *            RowSetInternal interface and b) have have this RowSetWriter
+     *            registered with it and c) must call this method internally
+     * @return true if the modified data was written, false otherwise (which
+     *         typically implies some form of conflict)
+     * @throws SQLException
+     *             if a problem occurs accessing the database
+     */
+    public boolean writeData(RowSetInternal theRowSet) throws SQLException;
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XAConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XAConnection.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XAConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XAConnection.java Mon Jun 12 05:13:42 2006
@@ -11,32 +11,32 @@
  * 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 javax.sql;
-
-import java.sql.SQLException;
-import javax.transaction.xa.XAResource;
-
-/**
- * An interface that is used to support the participation of a database connection in distributed
- * transactions.  An XAConnection returns an XAResource object which can be used by a Transaction
- * Manager to manage the XAConnection as part of a distributed transaction.
- * <p>
- * It is not intended that this interface is used directly by application code.   It is designed for
- * use by system components which implement distributed transaction support.
- * 
- */
-public interface XAConnection extends PooledConnection {
-
-	/**
-	 * Gets an XAResource which a transaction manager can use to manage the participation of this
-	 * XAConnection in a distributed transaction.
-	 * @return an XAResource object
-	 * @throws SQLException if an error occurs in accessing the database.
-	 */
-	public XAResource getXAResource() throws SQLException;
-	
-} // end interface XAConnection
-
+ */
+
+package javax.sql;
+
+import java.sql.SQLException;
+import javax.transaction.xa.XAResource;
+
+/**
+ * An interface that is used to support the participation of a database
+ * connection in distributed transactions. An XAConnection returns an XAResource
+ * object which can be used by a Transaction Manager to manage the XAConnection
+ * as part of a distributed transaction.
+ * <p>
+ * It is not intended that this interface is used directly by application code.
+ * It is designed for use by system components which implement distributed
+ * transaction support.
+ */
+public interface XAConnection extends PooledConnection {
+
+    /**
+     * Gets an XAResource which a transaction manager can use to manage the
+     * participation of this XAConnection in a distributed transaction.
+     * 
+     * @return an XAResource object
+     * @throws SQLException
+     *             if an error occurs in accessing the database.
+     */
+    public XAResource getXAResource() throws SQLException;
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XADataSource.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XADataSource.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XADataSource.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/XADataSource.java Mon Jun 12 05:13:42 2006
@@ -11,91 +11,108 @@
  * 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 javax.sql;
-
-import java.sql.SQLException;
-import java.io.PrintWriter;
-
-/**
- * An interface for the creation of XAConnection objects.  Used internally within the package.
- * <p>
- * A class which implements the XADataSource interface is typically registered with a JNDI
- * naming service directory and is retrieved from there by name.
- * 
- */
-public interface XADataSource {
-	
-	/**
-	 * Gets the Login Timeout value for this XADataSource.  The Login Timeout is the maximum time
-	 * in seconds that the XADataSource will wait when opening a connection to a database. A Timeout
-	 * value of 0 implies either the system default timeout value (if there is one) or that there
-	 * is no timeout.  The default value for the Login Timeout is 0.
-	 * @return the Login Timeout value in seconds.
-	 * @throws SQLException if there is a problem accessing the database.
-	 */
-	public int getLoginTimeout() throws SQLException;
-	
-	/**
-	 * Sets the Login Timeout value for this XADataSource. The Login Timeout is the maximum time
-	 * in seconds that the XADataSource will wait when opening a connection to a database. A Timeout
-	 * value of 0 implies either the system default timeout value (if there is one) or that there
-	 * is no timeout.  The default value for the Login Timeout is 0.
-	 * @param theTimeout the new Login Timeout value in seconds.
-	 * @throws SQLException if there is a problem accessing the database.
-	 */
-	public void setLoginTimeout( int theTimeout ) throws SQLException;
-	
-	/**
-	 * Gets the Log Writer for this XADataSource.
-	 * <p>
-	 * The Log Writer is a stream to which all log and trace messages are sent from this
-	 * XADataSource. The Log Writer can be null, in which case, log and trace capture is
-	 * disabled.  The default value for the Log Writer when an XADataSource is created is null.
-	 * Note that the Log Writer for an XADataSource is not the same as the Log Writer used by
-	 * a <code>DriverManager</code>.
-	 * @return a PrintWriter which is the Log Writer for this XADataSource. Can be null, in which
-	 * case log writing is disabled for this XADataSource.
-	 * @throws SQLException
-	 */
-	public PrintWriter getLogWriter() throws SQLException;
-	
-	/**
-	 * Create a connection to a database which can then be used in a distributed transaction.
-	 * @return an XAConnection object representing the connection to the database, which can then
-	 * be used in a distributed transaction.
-	 * @throws SQLException if there is a problem accessing the database.
-	 */
-	public XAConnection getXAConnection() throws SQLException;
-	
-	/**
-	 * Create a connection to a database, using a supplied Username and Password, which can then be
-	 * used in a distributed transaction.
-	 * @param theUser a String containing a User Name for the database
-	 * @param thePassword a String containing the Password for the user identified by 
-	 * <code>theUser</code>
-	 * @return an XAConnection object representing the connection to the database, which can then
-	 * be used in a distributed transaction.
-	 * @throws SQLException if there is a problem accessing the database.
-	 */
-	public XAConnection getXAConnection(String theUser, String thePassword) throws SQLException;
-	
-	/**
-	 * Sets the Log Writer for this XADataSource.
-	 * <p>
-	 * The Log Writer is a stream to which all log and trace messages are sent from this
-	 * XADataSource. The Log Writer can be null, in which case, log and trace capture is
-	 * disabled.  The default value for the Log Writer when an XADataSource is created is null.
-	 * Note that the Log Writer for an XADataSource is not the same as the Log Writer used by
-	 * a <code>DriverManager</code>.
-	 * @param theWriter a PrintWriter to use as the Log Writer for this XADataSource.
-	 * @throws SQLException if there is a problem accessing the database.
-	 */
-	public void setLogWriter( PrintWriter theWriter ) throws SQLException;
-	
-
-} // end interface XADataSource
-
-
+ */
+
+package javax.sql;
+
+import java.sql.SQLException;
+import java.io.PrintWriter;
+
+/**
+ * An interface for the creation of XAConnection objects. Used internally within
+ * the package.
+ * <p>
+ * A class which implements the XADataSource interface is typically registered
+ * with a JNDI naming service directory and is retrieved from there by name.
+ */
+public interface XADataSource {
+
+    /**
+     * Gets the Login Timeout value for this XADataSource. The Login Timeout is
+     * the maximum time in seconds that the XADataSource will wait when opening
+     * a connection to a database. A Timeout value of 0 implies either the
+     * system default timeout value (if there is one) or that there is no
+     * timeout. The default value for the Login Timeout is 0.
+     * 
+     * @return the Login Timeout value in seconds.
+     * @throws SQLException
+     *             if there is a problem accessing the database.
+     */
+    public int getLoginTimeout() throws SQLException;
+
+    /**
+     * Sets the Login Timeout value for this XADataSource. The Login Timeout is
+     * the maximum time in seconds that the XADataSource will wait when opening
+     * a connection to a database. A Timeout value of 0 implies either the
+     * system default timeout value (if there is one) or that there is no
+     * timeout. The default value for the Login Timeout is 0.
+     * 
+     * @param theTimeout
+     *            the new Login Timeout value in seconds.
+     * @throws SQLException
+     *             if there is a problem accessing the database.
+     */
+    public void setLoginTimeout(int theTimeout) throws SQLException;
+
+    /**
+     * Gets the Log Writer for this XADataSource.
+     * <p>
+     * The Log Writer is a stream to which all log and trace messages are sent
+     * from this XADataSource. The Log Writer can be null, in which case, log
+     * and trace capture is disabled. The default value for the Log Writer when
+     * an XADataSource is created is null. Note that the Log Writer for an
+     * XADataSource is not the same as the Log Writer used by a
+     * <code>DriverManager</code>.
+     * 
+     * @return a PrintWriter which is the Log Writer for this XADataSource. Can
+     *         be null, in which case log writing is disabled for this
+     *         XADataSource.
+     * @throws SQLException
+     */
+    public PrintWriter getLogWriter() throws SQLException;
+
+    /**
+     * Create a connection to a database which can then be used in a distributed
+     * transaction.
+     * 
+     * @return an XAConnection object representing the connection to the
+     *         database, which can then be used in a distributed transaction.
+     * @throws SQLException
+     *             if there is a problem accessing the database.
+     */
+    public XAConnection getXAConnection() throws SQLException;
+
+    /**
+     * Create a connection to a database, using a supplied Username and
+     * Password, which can then be used in a distributed transaction.
+     * 
+     * @param theUser
+     *            a String containing a User Name for the database
+     * @param thePassword
+     *            a String containing the Password for the user identified by
+     *            <code>theUser</code>
+     * @return an XAConnection object representing the connection to the
+     *         database, which can then be used in a distributed transaction.
+     * @throws SQLException
+     *             if there is a problem accessing the database.
+     */
+    public XAConnection getXAConnection(String theUser, String thePassword)
+            throws SQLException;
+
+    /**
+     * Sets the Log Writer for this XADataSource.
+     * <p>
+     * The Log Writer is a stream to which all log and trace messages are sent
+     * from this XADataSource. The Log Writer can be null, in which case, log
+     * and trace capture is disabled. The default value for the Log Writer when
+     * an XADataSource is created is null. Note that the Log Writer for an
+     * XADataSource is not the same as the Log Writer used by a
+     * <code>DriverManager</code>.
+     * 
+     * @param theWriter
+     *            a PrintWriter to use as the Log Writer for this XADataSource.
+     * @throws SQLException
+     *             if there is a problem accessing the database.
+     */
+    public void setLogWriter(PrintWriter theWriter) throws SQLException;
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/InvalidTransactionException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/InvalidTransactionException.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/InvalidTransactionException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/InvalidTransactionException.java Mon Jun 12 05:13:42 2006
@@ -11,38 +11,37 @@
  * 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 javax.transaction;
-
-import java.rmi.RemoteException;
-import java.io.Serializable;
-
-/**
- * An exception which is thrown when a request contains invalid transaction context information.
- * 
- */
-public class InvalidTransactionException extends RemoteException implements Serializable {
-	
-	private static final long serialVersionUID = 3597320220337691496L;
-	
-	/**
-	 * Creates an InvalidTransactionException with no error message
-	 *
-	 */
-	public InvalidTransactionException() {
-		super();
-	} // end method InvalidTransactionException()
-	
-	/**
-	 * Creates an InvalidTransactionException with a specified error message
-	 * @param msg a string containing the error message
-	 */
-	public InvalidTransactionException(String msg) {
-		super( msg );
-	} // end method InvalidTransactionException( String )
-
-} // end class InvalidTransactionException
-
-
+ */
+
+package javax.transaction;
+
+import java.rmi.RemoteException;
+import java.io.Serializable;
+
+/**
+ * An exception which is thrown when a request contains invalid transaction
+ * context information.
+ */
+public class InvalidTransactionException extends RemoteException implements
+        Serializable {
+
+    private static final long serialVersionUID = 3597320220337691496L;
+
+    /**
+     * Creates an InvalidTransactionException with no error message
+     * 
+     */
+    public InvalidTransactionException() {
+        super();
+    } // end method InvalidTransactionException()
+
+    /**
+     * Creates an InvalidTransactionException with a specified error message
+     * 
+     * @param msg
+     *            a string containing the error message
+     */
+    public InvalidTransactionException(String msg) {
+        super(msg);
+    }
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRequiredException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRequiredException.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRequiredException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRequiredException.java Mon Jun 12 05:13:42 2006
@@ -11,39 +11,37 @@
  * 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 javax.transaction;
-
-import java.rmi.RemoteException;
-import java.io.Serializable;
-
-/**
- * An exception which is thrown when a request is made which supplied a null transaction
- * context in a situation where an active transaction is required.
- * 
- */
-public class TransactionRequiredException extends RemoteException implements Serializable {
-
-	private static final long serialVersionUID = -1898806419937446439L;
-	
-	/**
-	 * Creates a TransactionRequiredException with no error message.
-	 *
-	 */
-	public TransactionRequiredException() {
-		super();
-	} // end method TransactionRequiredException()
-	
-	/**
-	 * Creates a TransactionRequiredException with a specified error message.
-	 * @param msg a String holding the error message
-	 */
-	public TransactionRequiredException(String msg) {
-		super( msg );
-	} // end method TransactionRequiredException(String msg)
-	
-} // end class TransactionRequiredException
-
-
+ */
+
+package javax.transaction;
+
+import java.rmi.RemoteException;
+import java.io.Serializable;
+
+/**
+ * An exception which is thrown when a request is made which supplied a null
+ * transaction context in a situation where an active transaction is required.
+ */
+public class TransactionRequiredException extends RemoteException implements
+        Serializable {
+
+    private static final long serialVersionUID = -1898806419937446439L;
+
+    /**
+     * Creates a TransactionRequiredException with no error message.
+     * 
+     */
+    public TransactionRequiredException() {
+        super();
+    }
+
+    /**
+     * Creates a TransactionRequiredException with a specified error message.
+     * 
+     * @param msg
+     *            a String holding the error message
+     */
+    public TransactionRequiredException(String msg) {
+        super(msg);
+    }
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRolledbackException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRolledbackException.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRolledbackException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/TransactionRolledbackException.java Mon Jun 12 05:13:42 2006
@@ -11,39 +11,37 @@
  * 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 javax.transaction;
-
-import java.rmi.RemoteException;
-import java.io.Serializable;
-
-/**
- * An exception which is thrown to indicate that the transaction associated with a request
- * has been rolled back or marked for rollback. So the requested operation cannot be completed.
- * 
- */
-public class TransactionRolledbackException extends RemoteException implements Serializable {
-	
-	private static final long serialVersionUID = -3142798139623020577L;
-
-	/**
-	 * Creates a TransactionRolledbackException with no error message
-	 *
-	 */
-	public TransactionRolledbackException() {
-		super();
-	} // end method TransactionRolledbackException()
-	
-	/**
-	 * Creates a TransactionRolledbackException with a specified error message
-	 * @param msg a String containing the error message
-	 */
-	public TransactionRolledbackException(String msg) {
-		super( msg );
-	} // end method TransactionRolledbackException( String )
-	
-} // end class TransactionRolledbackException
-
-
+ */
+
+package javax.transaction;
+
+import java.rmi.RemoteException;
+import java.io.Serializable;
+
+/**
+ * An exception which is thrown to indicate that the transaction associated with
+ * a request has been rolled back or marked for rollback. So the requested
+ * operation cannot be completed.
+ */
+public class TransactionRolledbackException extends RemoteException implements
+        Serializable {
+
+    private static final long serialVersionUID = -3142798139623020577L;
+
+    /**
+     * Creates a TransactionRolledbackException with no error message
+     */
+    public TransactionRolledbackException() {
+        super();
+    }
+
+    /**
+     * Creates a TransactionRolledbackException with a specified error message
+     * 
+     * @param msg
+     *            a String containing the error message
+     */
+    public TransactionRolledbackException(String msg) {
+        super(msg);
+    }
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/XAException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/XAException.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/XAException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/XAException.java Mon Jun 12 05:13:42 2006
@@ -11,180 +11,190 @@
  * 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 javax.transaction.xa;
-import java.io.Serializable;
-
-/**
- * An XAException is an exception thrown by a Resource Manager to inform the Transaction Manaqer
- * of an error which has occurred in relation to a transaction branch.  In addition to the usual
- * exception message, an XAException carries an errorCode value which provides information about
- * the error, as defined by the series of integer values defined by the XAException class. 
- * 
- */
-public class XAException extends Exception implements Serializable {
-	
-	private static final long serialVersionUID = -8249683284832867751L;
-
-	/**
-	 * The errorCode which details the error that has occurred
-	 */
-	public int errorCode = 0;
-	
-	/**
-	 * Code which contains the inclusive lower bound of the rollback error codes
-	 */
-	public static final int XA_RBBASE		= 100;
-
-	/**
-	 * Code which means that the rollback occurred for an unspecified reason
-	 */
-	public static final int XA_RBROLLBACK	= 100;
-
-	/**
-	 * Code which means that rollback was caused by a communication failure
-	 */
-	public static final int XA_RBCOMMFAIL	= 101;
-
-	/**
-	 * Code which means that a failure occurred because a deadlock was detected
-	 */
-	public static final int XA_RBDEADLOCK	= 102;
-
-	/**
-	 * Code which means that a condition was detected than implies a violation of the integrity of
-	 * the resource
-	 */
-	public static final int XA_RBINTEGRITY	= 103;
-
-	/**
-	 * Code which means that the Resource Manager rolled back the transaction branch for a 
-	 * reason not separately listed
-	 */
-	public static final int XA_RBOTHER		= 104;
-
-	/**
-	 * Code which means that a protocol error occurred in the Resource Manager
-	 */
-	public static final int XA_RBPROTO		= 105;
-
-	/**
-	 * Code which means that a transaction branch took too long
-	 */
-	public static final int XA_RBTIMEOUT	= 106;
-
-	/**
-	 * Code which means that the caller may retry the transaction branch
-	 */
-	public static final int XA_RBTRANSIENT	= 107;
-
-	/**
-	 * Code which contains the inclusive upper bound of the rollback error codes
-	 */
-	public static final int XA_RBEND		= 107;
-
-	/**
-	 * Code which means that resumption must occur where the suspension occurred
-	 */
-	public static final int XA_NOMIGRATE	= 9;
-
-	/**
-	 * Code which means that the transaction branch may have been heuristically completed
-	 */
-	public static final int XA_HEURHAZ		= 8;
-
-	/**
-	 * Code which means that the transaction branch has been heuristically committed
-	 */
-	public static final int XA_HEURCOM		= 7;
-
-	/**
-	 * Code which means that the transaction branch has been neuristically rolled back
-	 */
-	public static final int XA_HEURRB		= 6;
-
-	/**
-	 * Code which means that the transaction branch has been heuristically committed and rolled back
-	 */
-	public static final int XA_HEURMIX		= 5;
-
-	/**
-	 * Code which means that the method returned with no effect and can be reissued
-	 */
-	public static final int XA_RETRY		= 4;
-
-	/**
-	 * Code which means that the transaction branch was read only and has been committed
-	 */
-	public static final int XA_RDONLY		= 3;
-
-	/**
-	 * Code which means that there is already an asynchronous operation outstanding
-	 */
-	public static final int XAER_ASYNC		= -2;
-
-	/**
-	 * Code which means that a Resource Manager error has occurred for the transaction branch
-	 */
-	public static final int XAER_RMERR		= -3;
-
-	/**
-	 * Code which means that the XID is not valid
-	 */
-	public static final int XAER_NOTA		= -4;
-
-	/**
-	 * Code which means that invalid arguments were supplied
-	 */
-	public static final int XAER_INVAL		= -5;
-	
-	/**
-	 * Code which means that the method was invoked in an impropoer context
-	 */
-	public static final int XAER_PROTO		= -6;
-
-	/**
-	 * Code which means that the Resource Manager is unavailable
-	 */
-	public static final int XAER_RMFAIL		= -7;
-
-	/**
-	 * Code which means that the XID already exists
-	 */
-	public static final int XAER_DUPID		= -8;
-
-	/**
-	 * Work is being done by the Resource Manager outside the boundaries of a
-	 * global transaction.
-	 */
-	public static final int XAER_OUTSIDE	= -9;
-	
-	/**
-	 * Creates an XAException with no message or errorcode
-	 */
-	public XAException() {
-		super();
-	} // end method XAException
-	
-	/**
-	 * Creates an XAException with a supplied message and no errorcode
-	 * @param theMessage a String containing the exception message 
-	 */
-	public XAException( String theMessage ) {
-		super( theMessage );
-	} // end method XAException( String )
-	
-	/**
-	 * Creates an XAException with a specified errorcode but no message
-	 * @param errcode an integer containing one of the XAException errorCode values
-	 */
-	public XAException(int errcode) {
-		super();
-		errorCode = errcode;
-	} // end method XAException( int )
-	
-} // end class XAException
-
-
+ */
+
+package javax.transaction.xa;
+
+import java.io.Serializable;
+
+/**
+ * An XAException is an exception thrown by a Resource Manager to inform the
+ * Transaction Manaqer of an error which has occurred in relation to a
+ * transaction branch. In addition to the usual exception message, an
+ * XAException carries an errorCode value which provides information about the
+ * error, as defined by the series of integer values defined by the XAException
+ * class.
+ */
+public class XAException extends Exception implements Serializable {
+
+    private static final long serialVersionUID = -8249683284832867751L;
+
+    /**
+     * The errorCode which details the error that has occurred
+     */
+    public int errorCode = 0;
+
+    /**
+     * Code which contains the inclusive lower bound of the rollback error codes
+     */
+    public static final int XA_RBBASE = 100;
+
+    /**
+     * Code which means that the rollback occurred for an unspecified reason
+     */
+    public static final int XA_RBROLLBACK = 100;
+
+    /**
+     * Code which means that rollback was caused by a communication failure
+     */
+    public static final int XA_RBCOMMFAIL = 101;
+
+    /**
+     * Code which means that a failure occurred because a deadlock was detected
+     */
+    public static final int XA_RBDEADLOCK = 102;
+
+    /**
+     * Code which means that a condition was detected than implies a violation
+     * of the integrity of the resource
+     */
+    public static final int XA_RBINTEGRITY = 103;
+
+    /**
+     * Code which means that the Resource Manager rolled back the transaction
+     * branch for a reason not separately listed
+     */
+    public static final int XA_RBOTHER = 104;
+
+    /**
+     * Code which means that a protocol error occurred in the Resource Manager
+     */
+    public static final int XA_RBPROTO = 105;
+
+    /**
+     * Code which means that a transaction branch took too long
+     */
+    public static final int XA_RBTIMEOUT = 106;
+
+    /**
+     * Code which means that the caller may retry the transaction branch
+     */
+    public static final int XA_RBTRANSIENT = 107;
+
+    /**
+     * Code which contains the inclusive upper bound of the rollback error codes
+     */
+    public static final int XA_RBEND = 107;
+
+    /**
+     * Code which means that resumption must occur where the suspension occurred
+     */
+    public static final int XA_NOMIGRATE = 9;
+
+    /**
+     * Code which means that the transaction branch may have been heuristically
+     * completed
+     */
+    public static final int XA_HEURHAZ = 8;
+
+    /**
+     * Code which means that the transaction branch has been heuristically
+     * committed
+     */
+    public static final int XA_HEURCOM = 7;
+
+    /**
+     * Code which means that the transaction branch has been neuristically
+     * rolled back
+     */
+    public static final int XA_HEURRB = 6;
+
+    /**
+     * Code which means that the transaction branch has been heuristically
+     * committed and rolled back
+     */
+    public static final int XA_HEURMIX = 5;
+
+    /**
+     * Code which means that the method returned with no effect and can be
+     * reissued
+     */
+    public static final int XA_RETRY = 4;
+
+    /**
+     * Code which means that the transaction branch was read only and has been
+     * committed
+     */
+    public static final int XA_RDONLY = 3;
+
+    /**
+     * Code which means that there is already an asynchronous operation
+     * outstanding
+     */
+    public static final int XAER_ASYNC = -2;
+
+    /**
+     * Code which means that a Resource Manager error has occurred for the
+     * transaction branch
+     */
+    public static final int XAER_RMERR = -3;
+
+    /**
+     * Code which means that the XID is not valid
+     */
+    public static final int XAER_NOTA = -4;
+
+    /**
+     * Code which means that invalid arguments were supplied
+     */
+    public static final int XAER_INVAL = -5;
+
+    /**
+     * Code which means that the method was invoked in an impropoer context
+     */
+    public static final int XAER_PROTO = -6;
+
+    /**
+     * Code which means that the Resource Manager is unavailable
+     */
+    public static final int XAER_RMFAIL = -7;
+
+    /**
+     * Code which means that the XID already exists
+     */
+    public static final int XAER_DUPID = -8;
+
+    /**
+     * Work is being done by the Resource Manager outside the boundaries of a
+     * global transaction.
+     */
+    public static final int XAER_OUTSIDE = -9;
+
+    /**
+     * Creates an XAException with no message or errorcode
+     */
+    public XAException() {
+        super();
+    }
+
+    /**
+     * Creates an XAException with a supplied message and no errorcode
+     * 
+     * @param theMessage
+     *            a String containing the exception message
+     */
+    public XAException(String theMessage) {
+        super(theMessage);
+    }
+
+    /**
+     * Creates an XAException with a specified errorcode but no message
+     * 
+     * @param errcode
+     *            an integer containing one of the XAException errorCode values
+     */
+    public XAException(int errcode) {
+        super();
+        errorCode = errcode;
+    }
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/XAResource.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/XAResource.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/XAResource.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/XAResource.java Mon Jun 12 05:13:42 2006
@@ -11,217 +11,257 @@
  * 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 javax.transaction.xa;
-
-/**
- * An interface which provides a mapping of the X/Open CAE Specification (for Distributed Transaction
- * processing) into Java.  The XAResource interface is used as the interface between a 
- * Transaction Manager and a Resource Manager for handling distributed transaction processing.
- * <p>
- * Typically, a JDBC driver or a JMS driver will implement the XAResource interface to support
- * Global Transactions on a database or on a message connection. 
- * 
- */
-public interface XAResource {
-	
-	/**
-	 * Flag to end a recovery scan
-	 */
-	public static final int TMENDRSCAN	= 0x800000;
-
-	/**
-	 * Flag to indicate that the caller is dissociation from a transaction branch and that it 
-	 * should be marked rollback only
-	 */
-	public static final int TMFAIL		= 0x20000000;
-
-	/**
-	 * Flag to indicate that the caller is joiing sn existing transaction branch.
-	 */
-	public static final int TMJOIN		= 0x200000;
-
-	/**
-	 * Flag that indicates that no flags options are selected. (ie a null flag)
-	 */
-	public static final int TMNOFLAGS	= 0;
-
-	/**
-	 * Flag that indicates the caller is using one-phase commit optimization
-	 */
-	public static final int TMONEPHASE	= 0x40000000;
-
-	/**
-	 * Flag that indicates the caller is resuming association with a suspended transaction branch
-	 */
-	public static final int TMRESUME	= 0x8000000;
-
-	/**
-	 * Flag that indicates the start of a recovery scan
-	 */
-	public static final int TMSTARTRSCAN	= 0x1000000;
-
-	/**
-	 * Flag that indicates the caller is dissociating from a transaction branch
-	 */
-	public static final int TMSUCCESS	= 0x4000000;
-
-	/**
-	 * Flag that indicates that the caller is suspending (not terminating) its association
-	 * with a transaction branch.
-	 */
-	public static final int TMSUSPEND	= 0x2000000;
-
-	/**
-	 * Flag that indicates that transaction work has been read only and has been 
-	 * committed normally
-	 */
-	public static final int XA_RDONLY	= 3;
-
-	/**
-	 * Flag that indicates that transaction work has been Prepared normally 
-	 */
-	public static final int XA_OK		= 0;
-	
-	/**
-	 * Commits a global transaction.
-	 * @param xid the XID which identifies the global transaction
-	 * @param onePhase true if the resource manager should use a one-phase commit protocol to 
-	 * commit the transaction
-	 * @throws XAException if an error occurred.
-	 * <p>
-	 * Possible errors are identified by the errorcode in the XAException and include:
-	 * XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, 
-	 * XAER_INVAL, or XAER_PROTO.  In addition, one of the XA_RB* errors can occur if the transaction
-	 * was not committed and <code>onePhase</code> was set to true.  On completion of this method,
-	 * the Resource Manager has rolled back the transaction and released resources held by the
-	 * transaction.
-	 */
-	public void commit(Xid xid, boolean onePhase) throws XAException;
-
-	/**
-	 * Ends the work done for a transaction branch. The Resource Manager
-	 * disconnects the XA resource from the transaction branch and allows the
-	 * transaction to complete.
-	 * 
-	 * @param xid
-	 *            the XID which identifies the global transaction. Should have
-	 *            previously been used as the parameter to a <code>start</code>
-	 *            method.
-	 * @param flags
-	 *            a flags integer - one of: XAResource.TMSUCCESS,
-	 *            XAResource.TMFAIL, or XAResource.TMSUSPEND.
-	 *            <p>
-	 *            TMSUCCESS means that this section of work completed
-	 *            successfully.
-	 *            <p>
-	 *            TMFAIL means that this section of work failed. The Resource
-	 *            Manager can mark the transaction for rollback only.
-	 *            <p>
-	 *            TMSUSPEND means that this section of work is suspended and not yet
-	 *            complete. The associated transaction context is also suspended
-	 *            and must be restarted with a call to {@link #start(Xid, int)}
-	 *            with the <code>TMRESUME</code> flag.
-	 * @throws XAException
-	 *             if an error occurs. Possible error identified in the
-	 *             errorcode include: XAER_RMERR, XAER_RMFAIL, XAER_NOTA,
-	 *             XAER_INVAL, XAER_PROTO, or XA_RB*.
-	 */
-	public void end(Xid xid, int flags) throws XAException;
-	
-	/**
-	 * Informs the Resource Manager that it can forget about a specified transaction branch.
-	 * @param xid the XID which identifies the global transaction.
-	 * @throws XAException if an error occurs. Possible error identified in the errorcode include:
-	 * XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.
-	 */
-	public void forget(Xid xid) throws XAException;
-	
-	/**
-	 * Gets the transaction timeout value for this XAResource.  The default timeout value is the 
-	 * default timeout value set for the Resource Manager.
-	 * @return the transaction timeout value for this XAResource in seconds.
-	 * @throws XAException if an error occurs. Possible error identified in the errorcode include:
-	 * XAER_RMERR and XAER_RMFAIL.
-	 */
-	public int getTransactionTimeout() throws XAException;
-	
-	/**
-	 * Returns true if the ResourceManager for this XAResource is the same as the Resource Manager
-	 * for a supplied XAResource.
-	 * @param theXAResource an XAResource object
-	 * @return true if the Resource Manager for this XAResource is the same as the Resource Manager
-	 * for <code>theXAResource</code>.
-	 * @throws XAException if an error occurs. Possible error identified in the errorcode include:
-	 * XAER_RMERR and XAER_RMFAIL.
-	 */
-	public boolean isSameRM(XAResource theXAResource) throws XAException;
-	
-	/**
-	 * Requests the Resource manager to prepare to commit a specified transaction.
-	 * @param xid  the XID which identifies the global transaction.
-	 * @return  an integer: XA_RDONLY or XA_OK. XA_OK implies that the transaction work has 
-	 * been prepared normally, XA_RDONLY implies that the transaction branch is read only and 
-	 * has been committed.  If there is a failure which requires a rollback, an XAException
-	 * is raised.
-	 * @throws XAException if an error occurs. Possible error identified in the errorcode include:
-	 * XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.
-	 */
-	public int prepare(Xid xid) throws XAException;
-	
-	/**
-	 * Get a list of prepared transaction branches.
-	 * <p>
-	 * Typically used by a transaction manager during recovery to find transaction branches that
-	 * are in prepared or heuristically completed states.
-	 * @param flag an integer.  Must be one of: XAResource.TMSTARTRSCAN, XAResource.TMENDRSCAN, 
-	 * XAResource.TMNOFLAGS.
-	 * @return an array of zero or more XIDs identifying the transaction branches in the prepared
-	 * or heuristically completed states.
-	 * @throws XAException if an error occurs. Possible error identified in the errorcode include:
-	 * XAER_RMERR, XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.
-	 */
-	public Xid[] recover(int flag) throws XAException;
-	
-	/**
-	 * Requests the Resource Manager to rollback a specified transaction branch.   
-	 * @param xid the XID which identifies the transaction branch.
-	 * @throws XAException if an error occurs. 
-	 */
-	public void rollback(Xid xid) throws XAException;
-	
-	/**
-	 * Sets the transaction timeout value for this XAResource. If the value is set to 0, the 
-	 * default timeout value for the Resource Manager is used.
-	 * @param seconds the new Timeout value in seconds
-	 * @return true if the transaction timeout value has been updated, false otherwise.
-	 * @throws XAException if an error occurs. Possible error identified in the errorcode include:
-	 * XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.
-	 */
-	public boolean setTransactionTimeout(int seconds) throws XAException;
-	
-	/**
-	 * Starts work for a specified transaction branch.
-	 * @param xid the XID which identifies the transaction branch.
-	 * @param flags an integer.  Must be one of XAResource.TMNOFLAGS, XAResource.TMJOIN, or 
-	 * XAResource.TMRESUME.
-	 * <p>
-	 * TMJOIN implies that the start applies to joiing a transaction previously passed to the
-	 * Resource Manager.
-	 * <p>
-	 * TMRESUME implies that the start applies to a suspended transaction that should be restarted.
-	 * <p>
-	 * If TMNOFLAGS is specified, then if the transaction has been previously seen by the 
-	 * Resource Manager, an XAException is raised with the code XAER_DUPID.
-	 * @throws XAException if an error occurs. Possible error identified in the errorcode include:
-	 * XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_DUPID, XAER_OUTSIDE, XAER_NOTA, XAER_INVAL, or 
-	 * XAER_PROTO.
-	 */
-	public void start(Xid xid, int flags) throws XAException;
-
-
-} // end interface XAResource
-
-
+ */
+
+package javax.transaction.xa;
+
+/**
+ * An interface which provides a mapping of the X/Open CAE Specification (for
+ * Distributed Transaction processing) into Java. The XAResource interface is
+ * used as the interface between a Transaction Manager and a Resource Manager
+ * for handling distributed transaction processing.
+ * <p>
+ * Typically, a JDBC driver or a JMS driver will implement the XAResource
+ * interface to support Global Transactions on a database or on a message
+ * connection.
+ */
+public interface XAResource {
+
+    /**
+     * Flag to end a recovery scan
+     */
+    public static final int TMENDRSCAN = 0x800000;
+
+    /**
+     * Flag to indicate that the caller is dissociation from a transaction
+     * branch and that it should be marked rollback only
+     */
+    public static final int TMFAIL = 0x20000000;
+
+    /**
+     * Flag to indicate that the caller is joiing sn existing transaction
+     * branch.
+     */
+    public static final int TMJOIN = 0x200000;
+
+    /**
+     * Flag that indicates that no flags options are selected. (ie a null flag)
+     */
+    public static final int TMNOFLAGS = 0;
+
+    /**
+     * Flag that indicates the caller is using one-phase commit optimization
+     */
+    public static final int TMONEPHASE = 0x40000000;
+
+    /**
+     * Flag that indicates the caller is resuming association with a suspended
+     * transaction branch
+     */
+    public static final int TMRESUME = 0x8000000;
+
+    /**
+     * Flag that indicates the start of a recovery scan
+     */
+    public static final int TMSTARTRSCAN = 0x1000000;
+
+    /**
+     * Flag that indicates the caller is dissociating from a transaction branch
+     */
+    public static final int TMSUCCESS = 0x4000000;
+
+    /**
+     * Flag that indicates that the caller is suspending (not terminating) its
+     * association with a transaction branch.
+     */
+    public static final int TMSUSPEND = 0x2000000;
+
+    /**
+     * Flag that indicates that transaction work has been read only and has been
+     * committed normally
+     */
+    public static final int XA_RDONLY = 3;
+
+    /**
+     * Flag that indicates that transaction work has been Prepared normally
+     */
+    public static final int XA_OK = 0;
+
+    /**
+     * Commits a global transaction.
+     * 
+     * @param xid
+     *            the XID which identifies the global transaction
+     * @param onePhase
+     *            true if the resource manager should use a one-phase commit
+     *            protocol to commit the transaction
+     * @throws XAException
+     *             if an error occurred.
+     *             <p>
+     *             Possible errors are identified by the errorcode in the
+     *             XAException and include: XA_HEURHAZ, XA_HEURCOM, XA_HEURRB,
+     *             XA_HEURMIX, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL,
+     *             or XAER_PROTO. In addition, one of the XA_RB* errors can
+     *             occur if the transaction was not committed and
+     *             <code>onePhase</code> was set to true. On completion of
+     *             this method, the Resource Manager has rolled back the
+     *             transaction and released resources held by the transaction.
+     */
+    public void commit(Xid xid, boolean onePhase) throws XAException;
+
+    /**
+     * Ends the work done for a transaction branch. The Resource Manager
+     * disconnects the XA resource from the transaction branch and allows the
+     * transaction to complete.
+     * 
+     * @param xid
+     *            the XID which identifies the global transaction. Should have
+     *            previously been used as the parameter to a <code>start</code>
+     *            method.
+     * @param flags
+     *            a flags integer - one of: XAResource.TMSUCCESS,
+     *            XAResource.TMFAIL, or XAResource.TMSUSPEND.
+     *            <p>
+     *            TMSUCCESS means that this section of work completed
+     *            successfully.
+     *            <p>
+     *            TMFAIL means that this section of work failed. The Resource
+     *            Manager can mark the transaction for rollback only.
+     *            <p>
+     *            TMSUSPEND means that this section of work is suspended and not
+     *            yet complete. The associated transaction context is also
+     *            suspended and must be restarted with a call to
+     *            {@link #start(Xid, int)} with the <code>TMRESUME</code>
+     *            flag.
+     * @throws XAException
+     *             if an error occurs. Possible error identified in the
+     *             errorcode include: XAER_RMERR, XAER_RMFAIL, XAER_NOTA,
+     *             XAER_INVAL, XAER_PROTO, or XA_RB*.
+     */
+    public void end(Xid xid, int flags) throws XAException;
+
+    /**
+     * Informs the Resource Manager that it can forget about a specified
+     * transaction branch.
+     * 
+     * @param xid
+     *            the XID which identifies the global transaction.
+     * @throws XAException
+     *             if an error occurs. Possible error identified in the
+     *             errorcode include: XAER_RMERR, XAER_RMFAIL, XAER_NOTA,
+     *             XAER_INVAL, or XAER_PROTO.
+     */
+    public void forget(Xid xid) throws XAException;
+
+    /**
+     * Gets the transaction timeout value for this XAResource. The default
+     * timeout value is the default timeout value set for the Resource Manager.
+     * 
+     * @return the transaction timeout value for this XAResource in seconds.
+     * @throws XAException
+     *             if an error occurs. Possible error identified in the
+     *             errorcode include: XAER_RMERR and XAER_RMFAIL.
+     */
+    public int getTransactionTimeout() throws XAException;
+
+    /**
+     * Returns true if the ResourceManager for this XAResource is the same as
+     * the Resource Manager for a supplied XAResource.
+     * 
+     * @param theXAResource
+     *            an XAResource object
+     * @return true if the Resource Manager for this XAResource is the same as
+     *         the Resource Manager for <code>theXAResource</code>.
+     * @throws XAException
+     *             if an error occurs. Possible error identified in the
+     *             errorcode include: XAER_RMERR and XAER_RMFAIL.
+     */
+    public boolean isSameRM(XAResource theXAResource) throws XAException;
+
+    /**
+     * Requests the Resource manager to prepare to commit a specified
+     * transaction.
+     * 
+     * @param xid
+     *            the XID which identifies the global transaction.
+     * @return an integer: XA_RDONLY or XA_OK. XA_OK implies that the
+     *         transaction work has been prepared normally, XA_RDONLY implies
+     *         that the transaction branch is read only and has been committed.
+     *         If there is a failure which requires a rollback, an XAException
+     *         is raised.
+     * @throws XAException
+     *             if an error occurs. Possible error identified in the
+     *             errorcode include: XA_RB*, XAER_RMERR, XAER_RMFAIL,
+     *             XAER_NOTA, XAER_INVAL, or XAER_PROTO.
+     */
+    public int prepare(Xid xid) throws XAException;
+
+    /**
+     * Get a list of prepared transaction branches.
+     * <p>
+     * Typically used by a transaction manager during recovery to find
+     * transaction branches that are in prepared or heuristically completed
+     * states.
+     * 
+     * @param flag
+     *            an integer. Must be one of: XAResource.TMSTARTRSCAN,
+     *            XAResource.TMENDRSCAN, XAResource.TMNOFLAGS.
+     * @return an array of zero or more XIDs identifying the transaction
+     *         branches in the prepared or heuristically completed states.
+     * @throws XAException
+     *             if an error occurs. Possible error identified in the
+     *             errorcode include: XAER_RMERR, XAER_RMFAIL, XAER_INVAL, and
+     *             XAER_PROTO.
+     */
+    public Xid[] recover(int flag) throws XAException;
+
+    /**
+     * Requests the Resource Manager to rollback a specified transaction branch.
+     * 
+     * @param xid
+     *            the XID which identifies the transaction branch.
+     * @throws XAException
+     *             if an error occurs.
+     */
+    public void rollback(Xid xid) throws XAException;
+
+    /**
+     * Sets the transaction timeout value for this XAResource. If the value is
+     * set to 0, the default timeout value for the Resource Manager is used.
+     * 
+     * @param seconds
+     *            the new Timeout value in seconds
+     * @return true if the transaction timeout value has been updated, false
+     *         otherwise.
+     * @throws XAException
+     *             if an error occurs. Possible error identified in the
+     *             errorcode include: XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.
+     */
+    public boolean setTransactionTimeout(int seconds) throws XAException;
+
+    /**
+     * Starts work for a specified transaction branch.
+     * 
+     * @param xid
+     *            the XID which identifies the transaction branch.
+     * @param flags
+     *            an integer. Must be one of XAResource.TMNOFLAGS,
+     *            XAResource.TMJOIN, or XAResource.TMRESUME.
+     *            <p>
+     *            TMJOIN implies that the start applies to joiing a transaction
+     *            previously passed to the Resource Manager.
+     *            <p>
+     *            TMRESUME implies that the start applies to a suspended
+     *            transaction that should be restarted.
+     *            <p>
+     *            If TMNOFLAGS is specified, then if the transaction has been
+     *            previously seen by the Resource Manager, an XAException is
+     *            raised with the code XAER_DUPID.
+     * @throws XAException
+     *             if an error occurs. Possible error identified in the
+     *             errorcode include: XA_RB*, XAER_RMERR, XAER_RMFAIL,
+     *             XAER_DUPID, XAER_OUTSIDE, XAER_NOTA, XAER_INVAL, or
+     *             XAER_PROTO.
+     */
+    public void start(Xid xid, int flags) throws XAException;
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/Xid.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/Xid.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/Xid.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/transaction/xa/Xid.java Mon Jun 12 05:13:42 2006
@@ -11,46 +11,47 @@
  * 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 javax.transaction.xa;
-
-/**
- * An interface which provides a mapping for the X/Open XID transaction identifier structure.
- * The Xid interface is used by the Transaction Manager and the Resource managers.  It is not
- * typically used by application programs.
- * 
- */
-public interface Xid {
-	
-	/**
-	 * The maximum number of bytes which will be returned by getGlobaltransaction Id
-	 */
-	public static final int MAXGTRIDSIZE	= 64;
-
-	/**
-	 * The maximum number of bytes which will be returned by getBranchQualifier
-	 */
-	public static final int MAXBQUALSIZE	= 64;
-	
-	/**
-	 * Gets the transaction branch qualifier component of the XID.
-	 * @return an array of bytes containing the transaction branch qualifier.
-	 */
-	public byte[] getBranchQualifier();
-	
-	/**
-	 * Gets the format identifier component of the XID.
-	 * @return an integer containing the format identifier.  0 means the OSI CCR format.
-	 */
-	public int getFormatId();
-	
-	/**
-	 * Gets the global transaction identifier component of the XID.
-	 * @return an array of bytes containing the global transaction identifier.
-	 */
-	public byte[] getGlobalTransactionId();
-
-} // end interface Xid
-
+ */
+
+package javax.transaction.xa;
+
+/**
+ * An interface which provides a mapping for the X/Open XID transaction
+ * identifier structure. The Xid interface is used by the Transaction Manager
+ * and the Resource managers. It is not typically used by application programs.
+ */
+public interface Xid {
+
+    /**
+     * The maximum number of bytes which will be returned by
+     * getGlobaltransaction Id
+     */
+    public static final int MAXGTRIDSIZE = 64;
+
+    /**
+     * The maximum number of bytes which will be returned by getBranchQualifier
+     */
+    public static final int MAXBQUALSIZE = 64;
+
+    /**
+     * Gets the transaction branch qualifier component of the XID.
+     * 
+     * @return an array of bytes containing the transaction branch qualifier.
+     */
+    public byte[] getBranchQualifier();
+
+    /**
+     * Gets the format identifier component of the XID.
+     * 
+     * @return an integer containing the format identifier. 0 means the OSI CCR
+     *         format.
+     */
+    public int getFormatId();
+
+    /**
+     * Gets the global transaction identifier component of the XID.
+     * 
+     * @return an array of bytes containing the global transaction identifier.
+     */
+    public byte[] getGlobalTransactionId();
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/common/ClassUtils.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/common/ClassUtils.java?rev=413642&r1=413641&r2=413642&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/common/ClassUtils.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/common/ClassUtils.java Mon Jun 12 05:13:42 2006
@@ -11,51 +11,55 @@
  * 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.harmony.sql.internal.common;
-
-/**
- * A class containing sets of utility functions relating to Classes, ClassLoaders and associated
- * aspects of Java
- * 
- */
-public class ClassUtils {
-
-	/**
-	 * Gets the ClassLoader of method that called the method which called this method.
-	 * ie if C2.m2() calls this method, and C1.m1() calls C2.m2(), this method returns the
-	 * ClassLoader for class C1.
-	 * @return The ClassLoader of the caller's caller.
-	 * TODO - needs completing
-	 */
-	public static ClassLoader getCallerClassLoader() {
-		return null;
-	} // end method getCallerClassLoader
-	
-	/**
-	 * Finds if a supplied Object belongs to the given ClassLoader.
-	 * @param theObject the object to check
-	 * @param theClassLoader the ClassLoader 
-	 * @return true if the Object does belong to the ClassLoader, false otherwise
-	 */
-	public static boolean isClassFromClassLoader( Object theObject, ClassLoader theClassLoader ) {
-		
-		if( (theObject == null) || (theClassLoader == null) ) return false;
-		
-		Class objectClass = theObject.getClass();
-		
-		try {
-			Class checkClass = Class.forName(objectClass.getName(), true, theClassLoader);
-			if( checkClass == objectClass ) return true;
-		} catch ( Throwable t ) {
-			
-		} // end try
-		
-		return false;
-	} // end method isClassFromClassLoader( Object, ClassLoader )
-	
-} // end class ClassUtils
-
-
+ */
+
+package org.apache.harmony.sql.internal.common;
+
+/**
+ * A class containing sets of utility functions relating to Classes,
+ * ClassLoaders and associated aspects of Java.
+ */
+public class ClassUtils {
+
+    /**
+     * Gets the ClassLoader of method that called the method which called this
+     * method. ie if C2.m2() calls this method, and C1.m1() calls C2.m2(), this
+     * method returns the ClassLoader for class C1.
+     * 
+     * @return The ClassLoader of the caller's caller. TODO - needs completing
+     */
+    public static ClassLoader getCallerClassLoader() {
+        return null;
+    }
+
+    /**
+     * Finds if a supplied Object belongs to the given ClassLoader.
+     * 
+     * @param theObject
+     *            the object to check
+     * @param theClassLoader
+     *            the ClassLoader
+     * @return true if the Object does belong to the ClassLoader, false
+     *         otherwise
+     */
+    public static boolean isClassFromClassLoader(Object theObject,
+            ClassLoader theClassLoader) {
+
+        if ((theObject == null) || (theClassLoader == null)) {
+            return false;
+        }
+
+        Class objectClass = theObject.getClass();
+
+        try {
+            Class checkClass = Class.forName(objectClass.getName(), true,
+                    theClassLoader);
+            if (checkClass == objectClass) {
+                return true;
+            }
+        } catch (Throwable t) {
+            // Empty
+        }
+        return false;
+    }
+}



Mime
View raw message