Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 31065 invoked from network); 21 Dec 2005 22:22:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Dec 2005 22:22:35 -0000 Received: (qmail 92215 invoked by uid 500); 21 Dec 2005 22:22:34 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 92181 invoked by uid 500); 21 Dec 2005 22:22:34 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 92170 invoked by uid 500); 21 Dec 2005 22:22:33 -0000 Received: (qmail 92167 invoked by uid 99); 21 Dec 2005 22:22:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2005 14:22:33 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 21 Dec 2005 14:22:31 -0800 Received: (qmail 30879 invoked by uid 1797); 21 Dec 2005 22:22:10 -0000 Date: 21 Dec 2005 22:22:10 -0000 Message-ID: <20051221222210.30878.qmail@minotaur.apache.org> From: tomdz@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb/src/java/org/apache/ojb/broker PBKey.java PersistenceBrokerSQLException.java PBFactoryException.java PBListener.java PBLifeCycleListener.java OJBRuntimeException.java PBStateListener.java Identity.java PersistenceBrokerEvent.java PBLifeCycleEvent.java PBState.java TransactionNotInProgressException.java OptimisticLockException.java PersistenceBroker.java PersistenceBrokerInternal.java MtoNImplementor.java ManageableCollection.java PersistenceBrokerException.java TransactionAbortedException.java OJBException.java TransactionInProgressException.java PBStateEvent.java PersistenceBrokerFactory.java PersistenceBrokerAware.java IdentityFactory.java KeyConstraintViolatedException.java X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N tomdz 2005/12/21 14:22:10 Modified: src/java/org/apache/ojb/broker Tag: OJB_1_0_RELEASE PBKey.java PersistenceBrokerSQLException.java PBFactoryException.java PBListener.java PBLifeCycleListener.java OJBRuntimeException.java PBStateListener.java Identity.java PersistenceBrokerEvent.java PBLifeCycleEvent.java PBState.java TransactionNotInProgressException.java OptimisticLockException.java PersistenceBroker.java PersistenceBrokerInternal.java MtoNImplementor.java ManageableCollection.java PersistenceBrokerException.java TransactionAbortedException.java OJBException.java TransactionInProgressException.java PBStateEvent.java PersistenceBrokerFactory.java PersistenceBrokerAware.java IdentityFactory.java KeyConstraintViolatedException.java Log: Updated license Fixed Javadoc errors Revision Changes Path No revision No revision 1.11.2.3 +38 -15 db-ojb/src/java/org/apache/ojb/broker/PBKey.java Index: PBKey.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBKey.java,v retrieving revision 1.11.2.2 retrieving revision 1.11.2.3 diff -u -r1.11.2.2 -r1.11.2.3 --- PBKey.java 22 Dec 2004 21:34:05 -0000 1.11.2.2 +++ PBKey.java 21 Dec 2005 22:22:07 -0000 1.11.2.3 @@ -1,8 +1,6 @@ package org.apache.ojb.broker; -import java.io.Serializable; - -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -17,28 +15,31 @@ * limitations under the License. */ +import java.io.Serializable; + /** * A immutable key to identify PB instances in pools, ... *
* The used jcdAlias name represents an alias for a connection * defined in the repository file. * - * @author Armin Waibel + * @author Armin Waibel * @version $Id$ */ public class PBKey implements Cloneable, Serializable { - static final long serialVersionUID = -8858811398162391578L; + private static final long serialVersionUID = -8858811398162391578L; private final String jcdAlias; private final String user; private final String password; private int hashCode; /** - * Constructor for new PBKey. - * @param jcdAlias alias name, defined in the repository file. - * @param user - * @param password + * Creates a new PBKey. + * + * @param jcdAlias The jdbc connection descriptor name as defined in the repository file + * @param user The username + * @param password The password */ public PBKey(final String jcdAlias, final String user, final String password) { @@ -48,13 +49,18 @@ } /** - * Convenience constructor for PBKey(jcdAlias, null, null) + * Convenience constructor for PBKey(jcdAlias, null, null). + * + * @param jcdAlias The jdbc connection descriptor name as defined in the repository file */ public PBKey(final String jcdAlias) { this(jcdAlias, null, null); } + /** + * {@inheritDoc} + */ public boolean equals(Object obj) { if (obj == this) @@ -72,7 +78,7 @@ } /** - * Returns an 'deep' copy of this key. + * {@inheritDoc} */ protected Object clone() throws CloneNotSupportedException { @@ -80,8 +86,7 @@ } /** - * Return the hash code of this PBKey, - * formed by the repository-, user-, password-name. + * {@inheritDoc} */ public int hashCode() { @@ -94,6 +99,9 @@ return hashCode; } + /** + * {@inheritDoc} + */ public String toString() { return this.getClass().getName() + ": jcdAlias="+jcdAlias+", user="+user+ @@ -101,7 +109,9 @@ } /** - * Returns the jcd-alias name, defined in the repository file. + * Returns the jdbc connection descriptor name as defined in the repository file. + * + * @return The JCD alias */ public String getAlias() { @@ -109,6 +119,9 @@ } /** + * Returns the jdbc connection descriptor name as defined in the repository file. + * + * @return The JCD alias * @deprecated use {@link #getAlias} instead. */ public String getRepositoryFile() @@ -116,11 +129,21 @@ return jcdAlias; } + /** + * Returns the username. + * + * @return The username + */ public String getUser() { return user; } + /** + * Returns the password. + * + * @return The password + */ public String getPassword() { return password; 1.8.2.2 +38 -17 db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerSQLException.java Index: PersistenceBrokerSQLException.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerSQLException.java,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -r1.8.2.1 -r1.8.2.2 --- PersistenceBrokerSQLException.java 12 Dec 2004 01:49:43 -0000 1.8.2.1 +++ PersistenceBrokerSQLException.java 21 Dec 2005 22:22:07 -0000 1.8.2.2 @@ -1,8 +1,6 @@ package org.apache.ojb.broker; -import java.sql.SQLException; - -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -17,43 +15,66 @@ * limitations under the License. */ +import java.sql.SQLException; + /** + * Encapsulates a SQL exception thrown during a broker action. * - * @author Thomas Mahler + * @author Thomas Mahler * @version $Id$ - * */ public class PersistenceBrokerSQLException extends PersistenceBrokerException { - private String SQLState = null; + private String sqlState = null; + /** + * Creates a new exception instance. + */ public PersistenceBrokerSQLException() { super(); } - public PersistenceBrokerSQLException(SQLException t) + /** + * Creates a new exception instance. + * + * @param cause The base exception + */ + public PersistenceBrokerSQLException(SQLException cause) { - super(t); - SQLState = t.getSQLState(); + super(cause); + sqlState = cause.getSQLState(); } - public PersistenceBrokerSQLException(String message) + /** + * Creates a new exception instance. + * + * @param msg The exception message + */ + public PersistenceBrokerSQLException(String msg) { - super(message); + super(msg); } - public PersistenceBrokerSQLException(String message, SQLException t) + /** + * Creates a new exception instance. + * + * @param msg The exception message + * @param cause The base exception + */ + public PersistenceBrokerSQLException(String msg, SQLException cause) { - super(message,t); - SQLState = t.getSQLState(); + super(msg, cause); + sqlState = cause.getSQLState(); } /** - * Returns the SQLState of the underlying {@link java.sql.SQLException}. + * Returns the SQL state of the underlying {@link java.sql.SQLException}. + * + * @return The SQL state */ public String getSQLState() { - return SQLState; + return sqlState; } } 1.4.2.1 +28 -5 db-ojb/src/java/org/apache/ojb/broker/PBFactoryException.java Index: PBFactoryException.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBFactoryException.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -r1.4 -r1.4.2.1 --- PBFactoryException.java 4 Apr 2004 23:53:30 -0000 1.4 +++ PBFactoryException.java 21 Dec 2005 22:22:07 -0000 1.4.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -14,24 +14,47 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +/** + * Is thrown by the persistence broker factory. + */ public class PBFactoryException extends OJBRuntimeException { + /** + * Creates a new exception instance. + */ public PBFactoryException() { } - public PBFactoryException(String message) + /** + * Creates a new exception instance. + * + * @param msg The exception message + */ + public PBFactoryException(String msg) { - super(message); + super(msg); } + /** + * Creates a new exception instance. + * + * @param cause The base exception + */ public PBFactoryException(Throwable cause) { super(cause); } - public PBFactoryException(String message, Throwable cause) + /** + * Creates a new exception instance. + * + * @param msg The exception message + * @param cause The base exception + */ + public PBFactoryException(String msg, Throwable cause) { - super(message, cause); + super(msg, cause); } } 1.4.2.1 +2 -2 db-ojb/src/java/org/apache/ojb/broker/PBListener.java Index: PBListener.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBListener.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -r1.4 -r1.4.2.1 --- PBListener.java 4 Apr 2004 23:53:30 -0000 1.4 +++ PBListener.java 21 Dec 2005 22:22:07 -0000 1.4.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2003-2004 The Apache Software Foundation +/* Copyright 2003-2005 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. 1.6.2.1 +24 -24 db-ojb/src/java/org/apache/ojb/broker/PBLifeCycleListener.java Index: PBLifeCycleListener.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBLifeCycleListener.java,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- PBLifeCycleListener.java 4 Apr 2004 23:53:30 -0000 1.6 +++ PBLifeCycleListener.java 21 Dec 2005 22:22:07 -0000 1.6.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2003-2004 The Apache Software Foundation +/* Copyright 2003-2005 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. @@ -26,57 +26,57 @@ * Persistent objects should implement the {@link PersistenceBrokerAware} * interface to be notified on persistent method calls via callback. * - * @author Armin Waibel + * @author Armin Waibel * @version $Id$ */ public interface PBLifeCycleListener extends PBListener { /** - * Called before an object is stored by a PersistenceBroker - * @param event event object - * @throws PersistenceBrokerException + * Called before an object will be stored by a persistence broker. + * + * @param event The event object */ public void beforeInsert(PBLifeCycleEvent event) throws PersistenceBrokerException; /** - * Called after object instance has been stored by a PersistenceBroker - * @param event event object - * @throws PersistenceBrokerException + * Called after an object instance has been stored by a persistence broker. + * + * @param event The event object */ public void afterInsert(PBLifeCycleEvent event) throws PersistenceBrokerException; /** - * Called before an object is updated by a PersistenceBroker - * @param event event object - * @throws PersistenceBrokerException + * Called before an object will be updated by a persistence broker. + * + * @param event The event object */ public void beforeUpdate(PBLifeCycleEvent event) throws PersistenceBrokerException; /** - * Called after object instance has been stored by a PersistenceBroker - * @param event event object - * @throws PersistenceBrokerException + * Called after an object has been stored by a persistence broker. + * + * @param event The event object */ public void afterUpdate(PBLifeCycleEvent event) throws PersistenceBrokerException; /** - * Called before object instance is deleted by a PersistenceBroker - * @param event event object - * @throws PersistenceBrokerException + * Called before an object will be deleted by a persistence broker. + * + * @param event The event object */ public void beforeDelete(PBLifeCycleEvent event) throws PersistenceBrokerException; /** - * Called after object instance has been deleted by a PersistenceBroker - * @param event - * @throws PersistenceBrokerException + * Called after an object has been deleted by a persistence broker. + * + * @param event The event object */ public void afterDelete(PBLifeCycleEvent event) throws PersistenceBrokerException; /** - * Called after object instance has been looked up by a PersistenceBroker - * @param event - * @throws PersistenceBrokerException + * Called after an object has been looked up by a persistence broker. + * + * @param event The event object */ public void afterLookup(PBLifeCycleEvent event) throws PersistenceBrokerException; } 1.5.2.1 +22 -4 db-ojb/src/java/org/apache/ojb/broker/OJBRuntimeException.java Index: OJBRuntimeException.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/OJBRuntimeException.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- OJBRuntimeException.java 4 Apr 2004 23:53:30 -0000 1.5 +++ OJBRuntimeException.java 21 Dec 2005 22:22:07 -0000 1.5.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -20,26 +20,44 @@ /** * Base class of all runtime exceptions used in OJB. * - * @author Thomas Mahler + * @author Thomas Mahler * @version $Id$ - * */ public class OJBRuntimeException extends NestableRuntimeException { + /** + * Creates a new exception instance. + */ public OJBRuntimeException() { } + /** + * Creates a new exception instance. + * + * @param msg The exception message + */ public OJBRuntimeException(String msg) { super(msg); } + /** + * Creates a new exception instance. + * + * @param cause The base exception + */ public OJBRuntimeException(Throwable cause) { super(cause); } + /** + * Creates a new exception instance. + * + * @param msg The exception message + * @param cause The base exception + */ public OJBRuntimeException(String msg, Throwable cause) { super(msg, cause); 1.3.2.2 +28 -12 db-ojb/src/java/org/apache/ojb/broker/PBStateListener.java Index: PBStateListener.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBStateListener.java,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -r1.3.2.1 -r1.3.2.2 --- PBStateListener.java 9 Apr 2005 22:41:39 -0000 1.3.2.1 +++ PBStateListener.java 21 Dec 2005 22:22:07 -0000 1.3.2.2 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2003-2004 The Apache Software Foundation +/* Copyright 2003-2005 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. @@ -19,50 +19,66 @@ * The listener interface for receiving PersistenceBroker * state changes. * - * @author Armin Waibel + * @author Armin Waibel * @version $Id$ */ public interface PBStateListener extends PBListener { /** - * Called after the {@link org.apache.ojb.broker.PersistenceBroker} - * instance was obtained from pool. + * Called after the {@link org.apache.ojb.broker.PersistenceBroker} instance was + * obtained from the pool. + * + * @param event The event object */ public void afterOpen(PBStateEvent event); /** - * Called before a PersistenceBroker transaction was started. + * Called before a transaction was started. + * + * @param event The event object */ public void beforeBegin(PBStateEvent event); /** - * Called after a PersistenceBroker transaction was started. + * Called after a transaction was started. + * + * @param event The event object */ public void afterBegin(PBStateEvent event); /** - * Called before a PersistenceBroker commit was called. + * Called before a transaction will be comitted. + * + * @param event The event object */ public void beforeCommit(PBStateEvent event); /** - * Called after a PersistenceBroker commit was called. + * Called after a transaction was comitted. + * + * @param event The event object */ public void afterCommit(PBStateEvent event); /** - * Called before a PersistenceBroker rollback was called. + * Called before a transaction will be rolled back. + * + * @param event The event object */ public void beforeRollback(PBStateEvent event); /** - * Called after a PersistenceBroker rollback was called. + * Called after a transaction was rolled back. + * + * @param event The event object */ public void afterRollback(PBStateEvent event); /** * Called before the {@link org.apache.ojb.broker.PersistenceBroker} - * instance was returned to pool. + * instance will be returned to the pool. + * + * @param event The event object */ public void beforeClose(PBStateEvent event); } 1.36.2.14 +48 -38 db-ojb/src/java/org/apache/ojb/broker/Identity.java Index: Identity.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/Identity.java,v retrieving revision 1.36.2.13 retrieving revision 1.36.2.14 diff -u -r1.36.2.13 -r1.36.2.14 --- Identity.java 14 Dec 2005 12:18:44 -0000 1.36.2.13 +++ Identity.java 21 Dec 2005 22:22:07 -0000 1.36.2.14 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -65,34 +65,33 @@ *

* @see org.apache.ojb.broker.IdentityFactory - * @author Thomas Mahler + * @author Thomas Mahler * @version $Id$ */ public class Identity implements Serializable { - static final long serialVersionUID = 3182285550574178710L; + /** Unique id for serialization purposes. */ + private static final long serialVersionUID = 3182285550574178710L; private static final int IS_TRANSIENT = 3; private static final int IS_PERMANENT = 17; /** - * used for hashCode calculation. + * Used for hashCode calculation. */ private static final int iConstant = 37; /** - * the top-level Class of the identified object
- * ie: an Interface + * The top-level Class of the identified object, ie. an interface. */ private Class m_objectsTopLevelClass; /** - * the real Class of the identified object
- * ie: the implementing Class + * The real Class of the identified object, ie. the implementing class. */ private Class m_objectsRealClass = null; /** - * The ordered list of primary key values maintaining the objects identity in the underlying RDBMS + * The ordered list of primary key values maintaining the objects identity in the underlying RDBMS. */ private Object[] m_pkValues; @@ -160,10 +159,10 @@ } /** - * For internal use! Use {@link IdentityFactory} to create object identity. - *
- * OJB user have to use {@link IdentityFactory} to create object identity. - * + * Constructor for internal use. Use {@link IdentityFactory} to create an object identity. + * + * @param objectToIdentitify The object for which to create the identity + * @param targetBroker The persistence broker */ public Identity(final Object objectToIdentitify, final PersistenceBroker targetBroker) { @@ -172,10 +171,11 @@ } /** - * For internal use! Use {@link IdentityFactory} to create object identity. - *
- * OJB user have to use {@link IdentityFactory} to create object identity. - * + * Constructor for internal use. Use {@link IdentityFactory} to create an object identity. + * + * @param objectToIdentitify The object for which to create the identity + * @param targetBroker The persistence broker + * @param cld The class descriptor */ public Identity(final Object objectToIdentitify, final PersistenceBroker targetBroker, final ClassDescriptor cld) { @@ -235,8 +235,11 @@ } /** - * Factory method that returns an Identity object from the given - * byte array - see {@link #serialize}. + * Factory method that returns an Identity object created from a serializated representation. + * + * @param anArray The serialized representation + * @return The identity + * @see {@link #serialize}. * @deprecated */ public static Identity fromByteArray(final byte[] anArray) throws PersistenceBrokerException @@ -261,17 +264,22 @@ } } + /** + * Determines whether the identity is transient. + * + * @return true if the identity is transient + */ public boolean isTransient() { return isTransient == IS_TRANSIENT; } /** - * Return the top-level class of the real - * subject (means class name of a base class, + * Returns the top-level class of the real subject (base class, * base interface denoted in the repository or - * objects real class name if none top-level was found) + * objects real class if no top-level was found). * + * @return The top level class */ public Class getObjectsTopLevelClass() { @@ -279,7 +287,9 @@ } /** - * Return the "real" Class of the real subject + * Return the "real" class of the real subject. + * + * @return The real class */ public Class getObjectsRealClass() { @@ -287,7 +297,9 @@ } /** - * Set the objects real class + * Set the real class of the subject. + * + * @param objectsRealClass The real class */ public void setObjectsRealClass(final Class objectsRealClass) { @@ -295,7 +307,9 @@ } /** - * Return a serialized Identity as byte[]. + * Return the serialized form of this Identity. + * + * @return The serialized representation * @see #fromByteArray * @deprecated */ @@ -348,8 +362,9 @@ /** * OJB can handle only classes that declare at least one primary key attribute, * this method checks this condition. - * @exception ClassNotPersistenceCapableException thrown if no primary key is - * specified for the objects class + * + * @param realObject The real object to check + * @throws ClassNotPersistenceCapableException thrown if no primary key is specified for the objects class */ protected void checkForPrimaryKeys(final Object realObject) throws ClassNotPersistenceCapableException { @@ -364,8 +379,9 @@ } /** - * return the list of Primary Key Values of the real subject - * @return Object[] + * Returns the primary key values of the real subject. + * + * @return The pk values */ public Object[] getPrimaryKeyValues() { @@ -373,8 +389,7 @@ } /** - * Compare this Identity object to any other object. This comparison is delegated - * to the super-class. + * {@inheritDoc} */ public boolean equals(final Object obj) { @@ -409,12 +424,7 @@ } /** - * Calculate a hashcode for this Identity. The Hashcode should be - * equal for Identities where Identity.equals() returns true. Therefore - * all primary key values that return a hashcode depending on its content - * (this is assumed for String and Number) are taken into account. Additionally - * the hashCode() of the top-level class name of this Identity is representing - * is taken into account. + * {@inheritDoc} */ public int hashCode() { 1.3.2.1 +4 -3 db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerEvent.java Index: PersistenceBrokerEvent.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerEvent.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -r1.3 -r1.3.2.1 --- PersistenceBrokerEvent.java 4 Apr 2004 23:53:30 -0000 1.3 +++ PersistenceBrokerEvent.java 21 Dec 2005 22:22:07 -0000 1.3.2.1 @@ -1,8 +1,6 @@ package org.apache.ojb.broker; -import org.apache.ojb.broker.util.event.OjbEvent; - -/* Copyright 2003-2004 The Apache Software Foundation +/* Copyright 2003-2005 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. @@ -16,6 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +import org.apache.ojb.broker.util.event.OjbEvent; + public class PersistenceBrokerEvent extends OjbEvent { public PersistenceBrokerEvent(PersistenceBroker broker) 1.5.2.1 +86 -12 db-ojb/src/java/org/apache/ojb/broker/PBLifeCycleEvent.java Index: PBLifeCycleEvent.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBLifeCycleEvent.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- PBLifeCycleEvent.java 4 Apr 2004 23:53:30 -0000 1.5 +++ PBLifeCycleEvent.java 21 Dec 2005 22:22:07 -0000 1.5.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2003-2004 The Apache Software Foundation +/* Copyright 2003-2005 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. @@ -27,22 +27,36 @@ * Because of performance reasons OJB intern reuse instances of this class * by reset target object. * - * @author
Armin Waibel + * @author Armin Waibel * @version $Id$ */ public final class PBLifeCycleEvent extends PersistenceBrokerEvent { + /** Denotes an event that happens before the insertion of an object. */ public static final int TYPE_BEFORE_INSERT = 1; + /** Denotes an event that happens before the deletion of an object. */ public static final int TYPE_BEFORE_DELETE = 2; + /** Denotes an event that happens before the update of an object. */ public static final int TYPE_BEFORE_UPDATE = 3; + /** Denotes an event that happens after the update of an object. */ public static final int TYPE_AFTER_UPDATE = 4; + /** Denotes an event that happens after the deletion of an object. */ public static final int TYPE_AFTER_DELETE = 5; + /** Denotes an event that happens after the lookup of an object. */ public static final int TYPE_AFTER_LOOKUP = 6; + /** Denotes an event that happens after the insertion of an object. */ public static final int TYPE_AFTER_INSERT = 7; private Type eventType; private Object target; + /** + * Creates a new event instance. + * + * @param broker The broker + * @param target The object which caused the event + * @param eventType The type of the event + */ public PBLifeCycleEvent(PersistenceBroker broker, Object target, Type eventType) { super(broker); @@ -50,6 +64,12 @@ this.eventType = eventType; } + /** + * Creates a new event instance. + * + * @param broker The broker + * @param type The type of the event + */ public PBLifeCycleEvent(PersistenceBroker broker, Type type) { super(broker); @@ -57,20 +77,27 @@ } /** - * Try to find an {@link PersistenceBrokerAware} target object. + * Returns the target object as an instance of {@link PersistenceBrokerAware} if possible. + * + * @return The {@link PersistenceBrokerAware} instance if there is a target and it implements + * this interface */ public PersistenceBrokerAware getPersitenceBrokerAware() { - if (target != null && target instanceof PersistenceBrokerAware) + if ((target != null) && (target instanceof PersistenceBrokerAware)) { - return (PersistenceBrokerAware) target; + return (PersistenceBrokerAware)target; } else + { return null; + } } /** - * Set the object the event belongs to. + * Set the object that caused the event. + * + * @param obj The object */ public void setTarget(Object obj) { @@ -78,13 +105,18 @@ } /** - * Returns the object the event belongs to. + * Returns the object that caused the event. + * + * @return The object */ public Object getTarget() { return target; } + /** + * {@inheritDoc} + */ public String toString() { ToStringBuilder buf = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE); @@ -94,31 +126,51 @@ return buf.toString(); } + /** + * Returns the event type. + * + * @return The event type + */ public Type getEventType() { return eventType; } - //********************************************************************** - // Immutable inner class - //********************************************************************** + /** + * Enum-like class for the event types. + */ public static class Type { + /** Denotes an event that happens before the insertion of an object. */ public static final Type BEFORE_INSERT = new Type(TYPE_BEFORE_INSERT); + /** Denotes an event that happens before the update of an object. */ public static final Type BEFORE_UPDATE = new Type(TYPE_BEFORE_UPDATE); + /** Denotes an event that happens after the insertion of an object. */ public static final Type AFTER_INSERT = new Type(TYPE_AFTER_INSERT); + /** Denotes an event that happens after the update of an object. */ public static final Type AFTER_UPDATE = new Type(TYPE_AFTER_UPDATE); + /** Denotes an event that happens before the deletion of an object. */ public static final Type BEFORE_DELETE = new Type(TYPE_BEFORE_DELETE); + /** Denotes an event that happens after the deletion of an object. */ public static final Type AFTER_DELETE = new Type(TYPE_AFTER_DELETE); + /** Denotes an event that happens after the lookup of an object. */ public static final Type AFTER_LOOKUP = new Type(TYPE_AFTER_LOOKUP); private int type; + /** + * Creates a new instance. + * + * @param type The type value + */ protected Type(int type) { this.type = type; } + /** + * {@inheritDoc} + */ public final boolean equals(Object obj) { if (obj == this) @@ -133,19 +185,27 @@ return type == ((Type) obj).type; } + /** + * {@inheritDoc} + */ public final int hashCode() { return type; } /** - * Returns an unique identifier of the used eventType. + * Returns the type id. + * + * @return The type id */ public final int typeId() { return type; } + /** + * {@inheritDoc} + */ public String toString() { return this.getClass().getName() + " [type= " + typeAsName(type) + "]"; @@ -154,19 +214,33 @@ private static String typeAsName(int type) { if (type == TYPE_AFTER_DELETE) + { return "AFTER_DELETE"; + } else if (type == TYPE_AFTER_LOOKUP) + { return "AFTER_LOOKUP"; + } else if (type == TYPE_AFTER_INSERT) + { return "AFTER_INSERT"; + } else if (type == TYPE_AFTER_UPDATE) + { return "AFTER_UPDATE"; + } else if (type == TYPE_BEFORE_DELETE) + { return "BEFORE_DELETE"; + } else if (type == TYPE_BEFORE_INSERT) + { return "BEFORE_INSERT"; + } else if (type == TYPE_BEFORE_UPDATE) + { return "BEFORE_UPDATE"; + } else { throw new OJBRuntimeException("Could not find type with typeId " + type); 1.6.2.1 +8 -6 db-ojb/src/java/org/apache/ojb/broker/PBState.java Index: PBState.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBState.java,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- PBState.java 4 Apr 2004 23:53:30 -0000 1.6 +++ PBState.java 21 Dec 2005 22:22:07 -0000 1.6.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -16,14 +16,16 @@ */ /** - * Trace the life cycle of an {@link org.apache.ojb.broker.PersistenceBroker} instance. + * Interface for tracing the life cycle of an {@link org.apache.ojb.broker.PersistenceBroker} instance. * * @version $Id$ */ public interface PBState { - // is moved to PB interface - // public boolean isClosed(); - + /** + * Is called when the persistence broker is activated or passivated (or closed). + * + * @param closed Whether the broker is passivated (closed) + */ public void setClosed(boolean closed); } 1.6.2.1 +26 -13 db-ojb/src/java/org/apache/ojb/broker/TransactionNotInProgressException.java Index: TransactionNotInProgressException.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/TransactionNotInProgressException.java,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- TransactionNotInProgressException.java 4 Apr 2004 23:53:30 -0000 1.6 +++ TransactionNotInProgressException.java 21 Dec 2005 22:22:07 -0000 1.6.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -16,15 +16,16 @@ */ /** + * Is created when an action was tried that requires a transaction, and there was no + * transaction in progress. * - * @author Thomas Mahler + * @author Thomas Mahler * @version $Id$ - * */ public class TransactionNotInProgressException extends PersistenceBrokerException { /** - * Constructor for TransactionNotInProgressException. + * Creates a new exception instance. */ public TransactionNotInProgressException() { @@ -32,21 +33,33 @@ } /** - * Constructor for TransactionNotInProgressException. - * @param s + * Creates a new exception instance. + * + * @param msg The exception message */ - public TransactionNotInProgressException(String s) + public TransactionNotInProgressException(String msg) { - super(s); + super(msg); } /** - * Constructor for TransactionNotInProgressException. - * @param t + * Creates a new exception instance. + * + * @param cause The base exception */ - public TransactionNotInProgressException(Throwable t) + public TransactionNotInProgressException(Throwable cause) { - super(t); + super(cause); } + /** + * Creates a new exception instance. + * + * @param msg The exception message + * @param cause The base exception + */ + public TransactionNotInProgressException(String msg, Throwable cause) + { + super(msg, cause); + } } 1.7.2.1 +30 -22 db-ojb/src/java/org/apache/ojb/broker/OptimisticLockException.java Index: OptimisticLockException.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/OptimisticLockException.java,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -r1.7 -r1.7.2.1 --- OptimisticLockException.java 4 Apr 2004 23:53:30 -0000 1.7 +++ OptimisticLockException.java 21 Dec 2005 22:22:07 -0000 1.7.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -17,16 +17,18 @@ /** - * @author Thomas Mahler + * Exception that is thrown if a violation of an optimistic lock was detected. + * + * @author Thomas Mahler * @version $Id$ */ public class OptimisticLockException extends PersistenceBrokerException { - - protected Object sourceObject; + /** The violating object. */ + private Object sourceObject; /** - * Constructor for OptimisticLockException. + * Creates a new exception instance. */ public OptimisticLockException() { @@ -34,36 +36,41 @@ } /** - * Constructor for OptimisticLockException. - * @param s + * Creates a new exception instance. + * + * @param msg The exception message */ - public OptimisticLockException(String s) + public OptimisticLockException(String msg) { - super(s); + super(msg); } /** - * Constructor for OptimisticLockException. - * @param s + * Creates a new exception instance. + * + * @param msg The exception message + * @param source The violating object */ - public OptimisticLockException(String s, Object source) + public OptimisticLockException(String msg, Object source) { - super(s); + super(msg); sourceObject = source; } /** - * Constructor for OptimisticLockException. - * @param t + * Creates a new exception instance. + * + * @param cause The base exception */ - public OptimisticLockException(Throwable t) + public OptimisticLockException(Throwable cause) { - super(t); + super(cause); } /** - * Gets the sourceObject. - * @return Returns a Object + * Gets the violating object. + * + * @return The object */ public Object getSourceObject() { @@ -71,8 +78,9 @@ } /** - * Sets the sourceObject. - * @param sourceObject The sourceObject to set + * Sets the violating object. + * + * @param sourceObject The object */ public void setSourceObject(Object sourceObject) { 1.30.2.5 +2 -2 db-ojb/src/java/org/apache/ojb/broker/PersistenceBroker.java Index: PersistenceBroker.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PersistenceBroker.java,v retrieving revision 1.30.2.4 retrieving revision 1.30.2.5 diff -u -r1.30.2.4 -r1.30.2.5 --- PersistenceBroker.java 7 Jul 2005 17:00:09 -0000 1.30.2.4 +++ PersistenceBroker.java 21 Dec 2005 22:22:08 -0000 1.30.2.5 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. 1.1.2.5 +10 -10 db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerInternal.java Index: PersistenceBrokerInternal.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerInternal.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- PersistenceBrokerInternal.java 9 Aug 2005 20:03:20 -0000 1.1.2.4 +++ PersistenceBrokerInternal.java 21 Dec 2005 22:22:08 -0000 1.1.2.5 @@ -1,14 +1,6 @@ package org.apache.ojb.broker; -import java.util.Enumeration; - -import org.apache.ojb.broker.accesslayer.RelationshipPrefetcherFactory; -import org.apache.ojb.broker.core.QueryReferenceBroker; -import org.apache.ojb.broker.core.proxy.ProxyFactory; -import org.apache.ojb.broker.metadata.ClassDescriptor; -import org.apache.ojb.broker.query.Query; - -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -23,6 +15,14 @@ * limitations under the License. */ +import java.util.Enumeration; + +import org.apache.ojb.broker.accesslayer.RelationshipPrefetcherFactory; +import org.apache.ojb.broker.core.QueryReferenceBroker; +import org.apache.ojb.broker.core.proxy.ProxyFactory; +import org.apache.ojb.broker.metadata.ClassDescriptor; +import org.apache.ojb.broker.query.Query; + /** * Internal used extended version of {@link PersistenceBroker} * 1.7.2.4 +51 -14 db-ojb/src/java/org/apache/ojb/broker/MtoNImplementor.java Index: MtoNImplementor.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/MtoNImplementor.java,v retrieving revision 1.7.2.3 retrieving revision 1.7.2.4 diff -u -r1.7.2.3 -r1.7.2.4 --- MtoNImplementor.java 9 May 2005 14:26:55 -0000 1.7.2.3 +++ MtoNImplementor.java 21 Dec 2005 22:22:08 -0000 1.7.2.4 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2003-2004 The Apache Software Foundation +/* Copyright 2003-2005 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. @@ -15,7 +15,6 @@ * limitations under the License. */ - import org.apache.ojb.broker.core.proxy.ProxyHelper; import org.apache.ojb.broker.metadata.CollectionDescriptor; @@ -24,7 +23,7 @@ *
* The "left / right" notation is only used to differ both sides of the relation. * - * @author
Leandro Rodrigo Saad Cruz + * @author Leandro Rodrigo Saad Cruz * @version $Id$ */ public class MtoNImplementor @@ -36,20 +35,26 @@ private CollectionDescriptor leftDescriptor; /** + * Creates a new instance. + * + * @param pb The currently used {@link PersistenceBroker} instance + * @param leftDescriptor The collection descriptor for the left side + * @param left The left side object + * @param right The right side object * @deprecated */ - public MtoNImplementor(PersistenceBroker pb, CollectionDescriptor codLeft, Object left, Object right) + public MtoNImplementor(PersistenceBroker pb, CollectionDescriptor leftDescriptor, Object left, Object right) { - init(codLeft, left, right); + init(leftDescriptor, left, right); } /** - * Constructor for m:n entry. + * Creates a new instance. * - * @param pb Current used {@link PersistenceBroker} instance. - * @param leftFieldName Field name of the left m:n reference. - * @param left The left side object. - * @param right The right side object. + * @param pb The currently used {@link PersistenceBroker} instance + * @param leftFieldName Field name of the left m:n reference + * @param left The left side object + * @param right The right side object */ public MtoNImplementor(PersistenceBroker pb, String leftFieldName, Object left, Object right) { @@ -61,9 +66,17 @@ init(cod, left, right); } - public MtoNImplementor(CollectionDescriptor leftDescriptor, Object leftObject, Object rightObject) + /** + * Creates a new instance. + * + * @param leftDescriptor The collection descriptor for the left side + * @param left The left side object + * @param right The right side object + * @deprecated + */ + public MtoNImplementor(CollectionDescriptor leftDescriptor, Object left, Object right) { - init(leftDescriptor, leftObject, rightObject); + init(leftDescriptor, left, right); } private void init(CollectionDescriptor leftDescriptor, Object left, Object right) @@ -79,29 +92,53 @@ rightClass = ProxyHelper.getRealClass(rightObject); } + /** + * Returns the collection descriptor for the left side of the m:n collection. + * + * @return The collection descriptor + */ public CollectionDescriptor getLeftDescriptor() { return leftDescriptor; } + /** + * Returns the class of the left side of the m:n collection. + * + * @return The class of the left side + */ public Class getLeftClass() { return leftClass; } + /** + * Returns the class of the right side of the m:n collection. + * + * @return The class of the right side + */ public Class getRightClass() { return rightClass; } + /** + * Returns the object for the left side of the m:n collection. + * + * @return The object for the left side + */ public Object getLeftObject() { return leftObject; } + /** + * Returns the object for the right side of the m:n collection. + * + * @return The object for the right side + */ public Object getRightObject() { return rightObject; } } - 1.7.2.1 +17 -10 db-ojb/src/java/org/apache/ojb/broker/ManageableCollection.java Index: ManageableCollection.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/ManageableCollection.java,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -r1.7 -r1.7.2.1 --- ManageableCollection.java 4 Apr 2004 23:53:30 -0000 1.7 +++ ManageableCollection.java 21 Dec 2005 22:22:08 -0000 1.7.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -24,35 +24,42 @@ * The methods have a prefix "ojb" that indicates that these methods are "technical" methods, required * by OJB and not to be used in business code. * - * @author Thomas Mahler + * @author Thomas Mahler * @version $Id$ */ public interface ManageableCollection extends java.io.Serializable { - static final long serialVersionUID = -4324379872849598226L; /** - * add a single Object to the Collection. This method is used during reading Collection elements - * from the database. Thus it is is save to cast anObject to the underlying element type of the + * Adds a single object to the Collection. This method is used during reading collection elements + * from the database. Thus it is safe to cast the object to the underlying element type of the * collection. + * + * @param anObject The object to add */ void ojbAdd(Object anObject); /** - * adds a Collection to this collection. Used in reading Extents from the Database. - * Thus it is save to cast otherCollection to this.getClass(). + * Adds another collection to this collection. Used in reading extents from the database. + * Thus it is safe to cast the given collection to this class. + * + * @param otherCollection The added collection */ void ojbAddAll(ManageableCollection otherCollection); /** - * returns an Iterator over all elements in the collection. Used during store and delete Operations. - * If the implementor does not return an iterator over ALL elements, OJB cannot store and delete all elements properly. + * Returns an iterator over all elements in the collection. Used during store and delete + * operations. If the implementor does not return an iterator over ALL elements, OJB cannot + * store and delete all elements properly. * + * @return The iterator */ Iterator ojbIterator(); /** * A callback method to implement 'removal-aware' (track removed objects and delete * them by its own) collection implementations. + * + * @param broker The persistence broker */ public void afterStore(PersistenceBroker broker) throws PersistenceBrokerException; } 1.9.2.1 +2 -2 db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerException.java Index: PersistenceBrokerException.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerException.java,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -r1.9 -r1.9.2.1 --- PersistenceBrokerException.java 22 May 2004 09:51:26 -0000 1.9 +++ PersistenceBrokerException.java 21 Dec 2005 22:22:08 -0000 1.9.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. 1.7.2.1 +24 -16 db-ojb/src/java/org/apache/ojb/broker/TransactionAbortedException.java Index: TransactionAbortedException.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/TransactionAbortedException.java,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -r1.7 -r1.7.2.1 --- TransactionAbortedException.java 4 Apr 2004 23:53:30 -0000 1.7 +++ TransactionAbortedException.java 21 Dec 2005 22:22:08 -0000 1.7.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -16,15 +16,15 @@ */ /** - * - * @author Thomas Mahler + * Is created when a transaction was aborted. + * + * @author Thomas Mahler * @version $Id$ - * */ public class TransactionAbortedException extends PersistenceBrokerException { /** - * Constructor for TransactionAbortedException. + * Creates a new exception instance. */ public TransactionAbortedException() { @@ -32,25 +32,33 @@ } /** - * Constructor for TransactionAbortedException. - * @param s + * Creates a new exception instance. + * + * @param msg The exception message */ - public TransactionAbortedException(String s) + public TransactionAbortedException(String msg) { - super(s); + super(msg); } /** - * Constructor for TransactionAbortedException. - * @param t + * Creates a new exception instance. + * + * @param cause The base exception */ - public TransactionAbortedException(Throwable t) + public TransactionAbortedException(Throwable cause) { - super(t); + super(cause); } - public TransactionAbortedException(String message, Throwable cause) + /** + * Creates a new exception instance. + * + * @param msg The exception message + * @param cause The base exception + */ + public TransactionAbortedException(String msg, Throwable cause) { - super(message, cause); + super(msg, cause); } } 1.5.2.1 +22 -4 db-ojb/src/java/org/apache/ojb/broker/OJBException.java Index: OJBException.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/OJBException.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- OJBException.java 4 Apr 2004 23:53:30 -0000 1.5 +++ OJBException.java 21 Dec 2005 22:22:08 -0000 1.5.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -20,26 +20,44 @@ /** * Base class of all exceptions used in OJB. * - * @author Thomas Mahler + * @author Thomas Mahler * @version $Id$ */ - public class OJBException extends NestableException { + /** + * Creates a new exception instance. + */ public OJBException() { } + /** + * Creates a new exception instance. + * + * @param msg The exception message + */ public OJBException(String msg) { super(msg); } + /** + * Creates a new exception instance. + * + * @param cause The base exception + */ public OJBException(Throwable cause) { super(cause); } + /** + * Creates a new exception instance. + * + * @param msg The exception message + * @param cause The base exception + */ public OJBException(String msg, Throwable cause) { super(msg, cause); 1.6.2.1 +25 -13 db-ojb/src/java/org/apache/ojb/broker/TransactionInProgressException.java Index: TransactionInProgressException.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/TransactionInProgressException.java,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- TransactionInProgressException.java 4 Apr 2004 23:53:30 -0000 1.6 +++ TransactionInProgressException.java 21 Dec 2005 22:22:08 -0000 1.6.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -16,15 +16,15 @@ */ /** - * - * @author Thomas Mahler - * @version $Id$ + * Is called when an action was tried while there was already a transaction in progress. * + * @author Thomas Mahler + * @version $Id$ */ public class TransactionInProgressException extends PersistenceBrokerException { /** - * Constructor for TransactionInProgressException. + * Creates a new exception instance. */ public TransactionInProgressException() { @@ -32,21 +32,33 @@ } /** - * Constructor for TransactionInProgressException. - * @param s + * Creates a new exception instance. + * + * @param msg The exception message */ - public TransactionInProgressException(String s) + public TransactionInProgressException(String msg) { - super(s); + super(msg); } /** - * Constructor for TransactionInProgressException. - * @param t + * Creates a new exception instance. + * + * @param cause The base exception */ - public TransactionInProgressException(Throwable t) + public TransactionInProgressException(Throwable cause) { - super(t); + super(cause); } + /** + * Creates a new exception instance. + * + * @param msg The exception message + * @param cause The base exception + */ + public TransactionInProgressException(String msg, Throwable cause) + { + super(msg, cause); + } } 1.5.2.1 +71 -36 db-ojb/src/java/org/apache/ojb/broker/PBStateEvent.java Index: PBStateEvent.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBStateEvent.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- PBStateEvent.java 4 Apr 2004 23:53:30 -0000 1.5 +++ PBStateEvent.java 21 Dec 2005 22:22:08 -0000 1.5.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2003-2004 The Apache Software Foundation +/* Copyright 2003-2005 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. @@ -17,34 +17,50 @@ import org.apache.commons.lang.builder.ToStringBuilder; - /** * The PBStateEvent encapsulates information about * the life-cycle/transaction demarcation of the used {@link org.apache.ojb.broker.PersistenceBroker} * instance. * - * @author Armin Waibel + * @author Armin Waibel * @version $Id$ */ public final class PBStateEvent extends PersistenceBrokerEvent { + /** Denotes an event that happens before the broker will be closed. */ public static final int KEY_BEFORE_CLOSE = 1; + /** Denotes an event that happens before a transaction will be started. */ public static final int KEY_BEFORE_BEGIN = 2; + /** Denotes an event that happens before a transaction will be comitted. */ public static final int KEY_BEFORE_COMMIT = 3; + /** Denotes an event that happens before a transaction will be rolled back. */ public static final int KEY_BEFORE_ROLLBACK = 4; + /** Denotes an event that happens after a transaction was started. */ public static final int KEY_AFTER_BEGIN = 5; + /** Denotes an event that happens after a transaction was comitted. */ public static final int KEY_AFTER_COMMIT = 6; + /** Denotes an event that happens after a broker was opened. */ public static final int KEY_AFTER_OPEN = 7; + /** Denotes an event that happens after a transaction was rolled back. */ public static final int KEY_AFTER_ROLLBACK = 8; private Type eventType; + /** + * Creates a new event instance. + * + * @param broker The broker + * @param eventType The type of the event + */ public PBStateEvent(PersistenceBroker broker, Type eventType) { super(broker); this.eventType = eventType; } + /** + * {@inheritDoc} + */ public String toString() { ToStringBuilder buf = new ToStringBuilder(this); @@ -53,58 +69,53 @@ return buf.toString(); } + /** + * Returns the event type. + * + * @return The event type + */ public Type getEventType() { return eventType; } - //********************************************************************** - // Immutable inner class - //********************************************************************** + /** + * Enum-like class for the event types. + */ public static class Type { - /** - * Caused after a PersistenceBroker transaction was started. - */ + /** Denotes an event that happens before a transaction will be started. */ public static final Type BEFORE_BEGIN = new Type(KEY_BEFORE_BEGIN); - /** - * Caused after a PersistenceBroker transaction was started. - */ + /** Denotes an event that happens after a transaction was started. */ public static final Type AFTER_BEGIN = new Type(KEY_AFTER_BEGIN); - /** - * Caused before a PersistenceBroker commit was called. - */ + /** Denotes an event that happens before a transaction will be comitted. */ public static final Type BEFORE_COMMIT = new Type(KEY_BEFORE_COMMIT); - /** - * Caused after a PersistenceBroker commit was called. - */ + /** Denotes an event that happens after a transaction was comitted. */ public static final Type AFTER_COMMIT = new Type(KEY_AFTER_COMMIT); - /** - * Caused before a PersistenceBroker rollback was called. - */ + /** Denotes an event that happens before a transaction will be rolled back. */ public static final Type BEFORE_ROLLBACK = new Type(KEY_BEFORE_ROLLBACK); - /** - * Caused after a PersistenceBroker roolback was called. - */ + /** Denotes an event that happens after a transaction was rolled back. */ public static final Type AFTER_ROLLBACK = new Type(KEY_AFTER_ROLLBACK); - /** - * Caused after the {@link org.apache.ojb.broker.PersistenceBroker} - * instance was obtained from pool. - */ + /** Denotes an event that happens after a broker was opened. */ public static final Type AFTER_OPEN = new Type(KEY_AFTER_OPEN); - /** - * Caused before the {@link org.apache.ojb.broker.PersistenceBroker} - * instance was returned to pool. - */ + /** Denotes an event that happens before the broker will be closed. */ public static final Type BEFORE_CLOSE = new Type(KEY_BEFORE_CLOSE); private int type; - protected Type(int id) + /** + * Creates a new instance. + * + * @param type The type value + */ + protected Type(int type) { - this.type = id; + this.type = type; } + /** + * {@inheritDoc} + */ public final boolean equals(Object obj) { if (obj == this) @@ -119,19 +130,27 @@ return type == ((Type) obj).type; } + /** + * {@inheritDoc} + */ public final int hashCode() { return type; } /** - * Returns an unique identifier of the used type. + * Returns the type id. + * + * @return The type id */ public final int typeId() { return type; } + /** + * {@inheritDoc} + */ public String toString() { return this.getClass().getName() + " [type= " + typeAsName(type) + "]"; @@ -140,21 +159,37 @@ private String typeAsName(int aType) { if (aType == KEY_AFTER_BEGIN) + { return "AFTER_BEGIN"; + } else if (aType == KEY_AFTER_COMMIT) + { return "AFTER_COMMIT"; + } else if (aType == KEY_AFTER_OPEN) + { return "AFTER_OPEN"; + } else if (aType == KEY_AFTER_ROLLBACK) + { return "AFTER_ROLLBACK"; + } else if (aType == KEY_BEFORE_BEGIN) + { return "BEFORE_BEGIN"; + } else if (aType == KEY_BEFORE_CLOSE) + { return "BEFORE_CLOSE"; + } else if (aType == KEY_BEFORE_COMMIT) + { return "BEFORE_COMMIT"; + } else if (aType == KEY_BEFORE_ROLLBACK) + { return "BEFORE_ROLLBACK"; + } else { throw new OJBRuntimeException("Could not find type " + aType); 1.23.2.2 +2 -2 db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerFactory.java Index: PersistenceBrokerFactory.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerFactory.java,v retrieving revision 1.23.2.1 retrieving revision 1.23.2.2 diff -u -r1.23.2.1 -r1.23.2.2 --- PersistenceBrokerFactory.java 24 Jul 2005 23:56:11 -0000 1.23.2.1 +++ PersistenceBrokerFactory.java 21 Dec 2005 22:22:08 -0000 1.23.2.2 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. 1.7.2.1 +2 -2 db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerAware.java Index: PersistenceBrokerAware.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PersistenceBrokerAware.java,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -r1.7 -r1.7.2.1 --- PersistenceBrokerAware.java 4 Apr 2004 23:53:30 -0000 1.7 +++ PersistenceBrokerAware.java 21 Dec 2005 22:22:08 -0000 1.7.2.1 @@ -1,6 +1,6 @@ package org.apache.ojb.broker; -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. 1.2.2.4 +41 -22 db-ojb/src/java/org/apache/ojb/broker/IdentityFactory.java Index: IdentityFactory.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/IdentityFactory.java,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -u -r1.2.2.3 -r1.2.2.4 --- IdentityFactory.java 14 Dec 2005 12:19:51 -0000 1.2.2.3 +++ IdentityFactory.java 21 Dec 2005 22:22:08 -0000 1.2.2.4 @@ -1,5 +1,20 @@ package org.apache.ojb.broker; +/* Copyright 2002-2005 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. + */ + import org.apache.ojb.broker.metadata.ClassDescriptor; /** @@ -29,8 +44,8 @@ * Build a unique {@link org.apache.ojb.broker.Identity} for the given * persistence capable object. * - * @param obj The object to build the {@link Identity} for. - * @return The a new created Identity object. + * @param obj The object to build the {@link Identity} for + * @return The new Identity object */ Identity buildIdentity(Object obj); @@ -38,10 +53,9 @@ * Build a unique {@link org.apache.ojb.broker.Identity} for the given * persistence capable object. * - * @param cld The {@link org.apache.ojb.broker.metadata.ClassDescriptor} of the - * object. - * @param obj The object to build the {@link Identity} for. - * @return The a new created Identity object. + * @param cld The {@link org.apache.ojb.broker.metadata.ClassDescriptor} of the object + * @param obj The object to build the {@link Identity} for + * @return The new Identity object. */ Identity buildIdentity(ClassDescriptor cld, Object obj); @@ -50,27 +64,32 @@ * for the given primary key values (composite PK's) of a * persistence capable object. * - * @param realClass The class of the associated object. - * @param topLevelClass The top-level class of the associated object. - * @param pkFieldName The field names of the PK fields. - * @param pkValues The PK values. - * @return The a new created Identity object. + * @param realClass The class of the associated object + * @param topLevelClass The top-level class of the associated object + * @param pkFieldName The field names of the PK fields + * @param pkValues The PK values + * @return The new Identity object */ Identity buildIdentity(Class realClass, Class topLevelClass, String[] pkFieldName, Object[] pkValues); /** - * Convenience method for - * {@link #buildIdentity(java.lang.Class, java.lang.Class, java.lang.String[], java.lang.Object[])} + * Convenience shortcut method for + * {@link #buildIdentity(java.lang.Class, java.lang.Class, java.lang.String[], java.lang.Object[])}. + * + * @param realClass The class of the associated object + * @param pkFieldName The field names of the PK fields + * @param pkValues The PK values + * @return The new Identity object */ - Identity buildIdentity(Class realClass, String[] fieldName, Object[] pkValues); + Identity buildIdentity(Class realClass, String[] pkFieldName, Object[] pkValues); /** * Convenience method for persistent objects with single primary key. * NOTE: Do not use for objects with composed PK! * - * @param realClass The class of the associated object. - * @param pkValue The PK value. - * @return The a new created Identity object. + * @param realClass The class of the associated object + * @param pkValue The PK value + * @return The new Identity object * @see #buildIdentity(java.lang.Class, java.lang.String[], java.lang.Object[]) */ Identity buildIdentity(Class realClass, Object pkValue); @@ -81,10 +100,10 @@ * the correct order based on the declaration of the {@link org.apache.ojb.broker.metadata.FieldDescriptor} * in the mapping file. * - * @param realClass The class of the associated object. - * @param topLevelClass The top-level class of the associated object. - * @param pkValues The PK values. - * @return The a new created Identity object. + * @param realClass The class of the associated object + * @param topLevelClass The top-level class of the associated object + * @param pkValues The PK values + * @return The new Identity object */ Identity buildIdentity(Class realClass, Class topLevelClass, Object[] pkValues); } 1.5.2.2 +30 -12 db-ojb/src/java/org/apache/ojb/broker/KeyConstraintViolatedException.java Index: KeyConstraintViolatedException.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/KeyConstraintViolatedException.java,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -u -r1.5.2.1 -r1.5.2.2 --- KeyConstraintViolatedException.java 27 Nov 2004 23:46:32 -0000 1.5.2.1 +++ KeyConstraintViolatedException.java 21 Dec 2005 22:22:08 -0000 1.5.2.2 @@ -1,8 +1,6 @@ package org.apache.ojb.broker; -import java.sql.SQLException; - -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 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. @@ -17,31 +15,51 @@ * limitations under the License. */ +import java.sql.SQLException; + /** * Exception indicate an SQL key contraint violation. * - * @author Matthew Baird + * @author Matthew Baird * @version $Id$ */ - public class KeyConstraintViolatedException extends PersistenceBrokerSQLException { + /** + * Creates a new exception instance. + */ public KeyConstraintViolatedException() { } - public KeyConstraintViolatedException(SQLException t) + /** + * Creates a new exception instance. + * + * @param base The wrapped exception + */ + public KeyConstraintViolatedException(SQLException base) { - super(t); + super(base); } - public KeyConstraintViolatedException(String message) + /** + * Creates a new exception instance. + * + * @param msg The exception message + */ + public KeyConstraintViolatedException(String msg) { - super(message); + super(msg); } - public KeyConstraintViolatedException(String message, SQLException t) + /** + * Creates a new exception instance. + * + * @param msg The exception message + * @param base The wrapped exception + */ + public KeyConstraintViolatedException(String msg, SQLException base) { - super(message, t); + super(msg, base); } } --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org