cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r432060 [1/2] - in /incubator/cayenne/main/trunk: ./ core/cayenne-jdk1.4-core/ core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/ core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/ core/cayenne-jdk1.4-core/src/ma...
Date Wed, 16 Aug 2006 22:50:29 GMT
Author: aadamchik
Date: Wed Aug 16 15:50:25 2006
New Revision: 432060

URL: http://svn.apache.org/viewvc?rev=432060&view=rev
Log:
CAY-631 - removing Log4J dependency - first pass

Removed:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/tools/AntAppender.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/tools/CayenneTask.java
Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/pom.xml
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DataDomain.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DataRowStore.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DbGenerator.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DbLoader.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/QueryLogger.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/ToManyList.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/Configuration.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/ConnectionProperties.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DefaultConfiguration.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/FileConfiguration.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/JNDIDataSourceFactory.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/RuntimeLoadDelegate.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/ServletUtil.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/WebApplicationContextFilter.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/ContainerPoolFactory.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/PoolManager.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/PooledConnectionImpl.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/DbAdapterFactoryChain.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/TypesHandler.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectTranslator.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ApplicationProject.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/CayenneUserDir.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/DataMapProject.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/Project.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ProjectConfigurator.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ProjectDataSourceFactory.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/validator/TreeNodeValidator.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/service/BaseRemoteService.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/service/HttpRemoteService.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/tools/CayenneGenerator.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/tools/DataPortTask.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/tools/DbGeneratorTask.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/tools/DeploymentConfigurator.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/util/ResourceLocator.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/util/WebApplicationResourceLocator.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/wocompat/parser/Parser.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/wocompat/parser/Parser.jj
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/wocompat/parser/ParserTokenManager.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/CayenneExceptionTst.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/TranslationTestCase.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/access/DataContextExtrasTst.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/access/DataContextSerializationTst.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/access/ToManyListTst.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/access/trans/QualifierTranslatorTst.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/access/util/DefaultOperationObserverTst.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/unit/AbstractAccessStack.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/unit/AccessStackAdapter.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/unit/BasicTestCase.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/unit/CayenneTestResources.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/unit/XMLDataSetFactory.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.5-core/pom.xml
    incubator/cayenne/main/trunk/core/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/cspi/CjpaPersistenceProvider.java
    incubator/cayenne/main/trunk/modeler/dvmodeler/pom.xml
    incubator/cayenne/main/trunk/modeler/modeler/pom.xml
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/FileClassLoadingService.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/Main.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/ModelerPreferences.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeView.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/action/ImportEOModelAction.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/action/OpenProjectAction.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/action/ProjectOpener.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/dialog/datadomain/CacheSyncConfigController.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbLoaderHelper.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfoController.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfoDialog.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfoModel.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidationDisplayHandler.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjAttributeTableModel.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipTab.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectPropertiesPanel.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/util/CayenneController.java
    incubator/cayenne/main/trunk/modeler/modeler/src/main/java/org/apache/cayenne/modeler/util/LongRunningTask.java
    incubator/cayenne/main/trunk/other/cayenne-regression-profiler/src/main/java/org/apache/cayenne/profile/TestDataSourceFactory.java
    incubator/cayenne/main/trunk/pom.xml

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/pom.xml?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/pom.xml (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/pom.xml Wed Aug 16 15:50:25 2006
@@ -62,11 +62,6 @@
 		</dependency>
 
 		<dependency>
-			<groupId>log4j</groupId>
-			<artifactId>log4j</artifactId>
-		</dependency>
-
-		<dependency>
 			<groupId>jgroups</groupId>
 			<artifactId>jgroups-all</artifactId>
 		</dependency>

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DataDomain.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DataDomain.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DataDomain.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DataDomain.java Wed Aug 16 15:50:25 2006
@@ -45,7 +45,6 @@
 import org.apache.cayenne.util.Util;
 import org.apache.commons.collections.Transformer;
 import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.log4j.Logger;
 
 /**
  * DataDomain performs query routing functions in Cayenne. DataDomain creates single data
@@ -61,8 +60,6 @@
  */
 public class DataDomain implements QueryEngine, DataChannel {
 
-    private static final Logger logObj = Logger.getLogger(DataDomain.class);
-
     public static final String SHARED_CACHE_ENABLED_PROPERTY = "cayenne.DataDomain.sharedCache";
     public static final boolean SHARED_CACHE_ENABLED_DEFAULT = true;
 
@@ -219,29 +216,6 @@
 
         Object dataContextFactory = localMap.get(DATA_CONTEXT_FACTORY_PROPERTY);
         Object queryCacheFactory = localMap.get(QUERY_CACHE_FACTORY_PROPERTY);
-
-        if (logObj.isDebugEnabled()) {
-            logObj.debug("DataDomain property "
-                    + SHARED_CACHE_ENABLED_PROPERTY
-                    + " = "
-                    + sharedCacheEnabled);
-            logObj.debug("DataDomain property "
-                    + VALIDATING_OBJECTS_ON_COMMIT_PROPERTY
-                    + " = "
-                    + validatingObjectsOnCommit);
-            logObj.debug("DataDomain property "
-                    + USING_EXTERNAL_TRANSACTIONS_PROPERTY
-                    + " = "
-                    + usingExternalTransactions);
-            logObj.debug("DataDomain property "
-                    + DATA_CONTEXT_FACTORY_PROPERTY
-                    + " = "
-                    + dataContextFactory);
-            logObj.debug("DataDomain property "
-                    + QUERY_CACHE_FACTORY_PROPERTY
-                    + " = "
-                    + queryCacheFactory);
-        }
 
         // init ivars from properties
         this.sharedCacheEnabled = (sharedCacheEnabled != null)

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DataRowStore.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DataRowStore.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DataRowStore.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DataRowStore.java Wed Aug 16 15:50:25 2006
@@ -42,7 +42,8 @@
 import org.apache.cayenne.event.EventSubject;
 import org.apache.commons.collections.ExtendedProperties;
 import org.apache.commons.collections.map.LRUMap;
-import org.apache.log4j.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * A fixed size cache of DataRows keyed by ObjectId.
@@ -56,7 +57,7 @@
  */
 public class DataRowStore implements Serializable {
 
-    private static Logger logObj = Logger.getLogger(DataRowStore.class);
+    private static Log logger = LogFactory.getLog(DataRowStore.class);
 
     // property keys
     public static final String SNAPSHOT_EXPIRATION_PROPERTY = "cayenne.DataRowStore.snapshot.expiration";
@@ -156,20 +157,20 @@
                 EVENT_BRIDGE_FACTORY_PROPERTY,
                 EVENT_BRIDGE_FACTORY_DEFAULT);
 
-        if (logObj.isDebugEnabled()) {
-            logObj.debug("DataRowStore property "
+        if (logger.isDebugEnabled()) {
+            logger.debug("DataRowStore property "
                     + SNAPSHOT_EXPIRATION_PROPERTY
                     + " = "
                     + snapshotsExpiration);
-            logObj.debug("DataRowStore property "
+            logger.debug("DataRowStore property "
                     + SNAPSHOT_CACHE_SIZE_PROPERTY
                     + " = "
                     + snapshotsCacheSize);
-            logObj.debug("DataRowStore property "
+            logger.debug("DataRowStore property "
                     + REMOTE_NOTIFICATION_PROPERTY
                     + " = "
                     + notifyRemote);
-            logObj.debug("DataRowStore property "
+            logger.debug("DataRowStore property "
                     + EVENT_BRIDGE_FACTORY_PROPERTY
                     + " = "
                     + eventBridgeFactory);
@@ -373,8 +374,8 @@
             return;
         }
 
-        if (logObj.isDebugEnabled()) {
-            logObj.debug("remote event: " + event);
+        if (logger.isDebugEnabled()) {
+            logger.debug("remote event: " + event);
         }
 
         Collection deletedSnapshotIds = event.getDeletedIds();
@@ -386,7 +387,7 @@
                 && invalidatedSnapshotIds.isEmpty()
                 && diffs.isEmpty()
                 && indirectlyModifiedIds.isEmpty()) {
-            logObj.warn("processRemoteEvent.. bogus call... no changes.");
+            logger.warn("processRemoteEvent.. bogus call... no changes.");
             return;
         }
 
@@ -420,7 +421,7 @@
                 && invalidatedSnapshotIds.isEmpty()
                 && updatedSnapshots.isEmpty()
                 && indirectlyModifiedIds.isEmpty()) {
-            logObj.warn("postSnapshotsChangeEvent.. bogus call... no changes.");
+            logger.warn("postSnapshotsChangeEvent.. bogus call... no changes.");
             return;
         }
 
@@ -492,7 +493,7 @@
                     // case 4 above... have to throw out the snapshot since
                     // no good options exist to tell how to merge the two.
                     if (oldSnapshot.getVersion() != newSnapshot.getReplacesVersion()) {
-                        logObj
+                        logger
                                 .debug("snapshot version changed, don't know what to do... Old: "
                                         + oldSnapshot
                                         + ", New: "
@@ -557,8 +558,8 @@
                     invalidatedSnapshotIDs,
                     indirectlyModifiedIds);
 
-            if (logObj.isDebugEnabled()) {
-                logObj.debug("postSnapshotsChangeEvent: " + event);
+            if (logger.isDebugEnabled()) {
+                logger.debug("postSnapshotsChangeEvent: " + event);
             }
 
             // synchronously notify listeners; leaving it up to the listeners to
@@ -592,7 +593,7 @@
                 remoteNotificationsHandler.shutdown();
             }
             catch (Exception ex) {
-                logObj.info("Exception shutting down EventBridge.", ex);
+                logger.info("Exception shutting down EventBridge.", ex);
             }
             remoteNotificationsHandler = null;
         }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DbGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DbGenerator.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DbGenerator.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DbGenerator.java Wed Aug 16 15:50:25 2006
@@ -35,7 +35,6 @@
 
 import javax.sql.DataSource;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.conn.DriverDataSource;
@@ -50,6 +49,8 @@
 import org.apache.cayenne.map.DerivedDbEntity;
 import org.apache.cayenne.validation.SimpleValidationFailure;
 import org.apache.cayenne.validation.ValidationResult;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * Utility class that generates database schema based on Cayenne mapping. It is a logical
@@ -59,7 +60,7 @@
  */
 public class DbGenerator {
 
-    private Logger logObj = Logger.getLogger(DbGenerator.class);
+    private Log logObj = LogFactory.getLog(DbGenerator.class);
 
     protected DbAdapter adapter;
     protected DataMap map;

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DbLoader.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DbLoader.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DbLoader.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/DbLoader.java Wed Aug 16 15:50:25 2006
@@ -34,8 +34,6 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.log4j.Logger;
-import org.objectstyle.ashwood.dbutil.Table;
 import org.apache.cayenne.CayenneException;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.TypesMapping;
@@ -51,6 +49,9 @@
 import org.apache.cayenne.util.EntityMergeSupport;
 import org.apache.cayenne.util.NameConverter;
 import org.apache.cayenne.util.Util;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.objectstyle.ashwood.dbutil.Table;
 
 /**
  * Utility class that does reverse engineering of the database. It can create DataMaps
@@ -61,7 +62,7 @@
  */
 public class DbLoader {
 
-    private static Logger logObj = Logger.getLogger(DbLoader.class);
+    private static Log logObj = LogFactory.getLog(DbLoader.class);
 
     // TODO: remove this hardcoded stuff once delegate starts to support procedure
     // loading...

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/QueryLogger.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/QueryLogger.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/QueryLogger.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/QueryLogger.java Wed Aug 16 15:50:25 2006
@@ -26,24 +26,23 @@
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.util.IDUtil;
 import org.apache.cayenne.util.Util;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * QueryLogger is intended to log special events that happen whenever Cayenne interacts
  * with a database. This includes execution of generated SQL statements, result counts,
  * connection events, etc. Normally QueryLogger methods are not invoked directly by the
- * user. Rather it is a single logging point used by the framework.
+ * . Rather it is a single logging point used by the framework.
  * <p>
- * Internally QueryLogger uses Log4J. See a chapter on logging in Cayenne User Guide on
- * how to setup Log4J.
+ * Internally QueryLogger uses commons-logging at the "info" level.
  * </p>
  * 
  * @author Andrus Adamchik
  */
 public class QueryLogger {
 
-    private static final Logger logObj = Logger.getLogger(QueryLogger.class);
+    private static final Log logObj = LogFactory.getLog(QueryLogger.class);
 
     public static final int TRIM_VALUES_THRESHOLD = 300;
 
@@ -145,26 +144,11 @@
     }
 
     /**
-     * Returns current logging level.
-     */
-    public static Level getLoggingLevel() {
-        Level level = (Level) logLevel.get();
-        return (level != null) ? level : Level.INFO;
-    }
-
-    /**
-     * Sets logging level for the current thread.
-     */
-    public static void setLoggingLevel(Level level) {
-        logLevel.set(level);
-    }
-
-    /**
      * @since 1.2 logs an arbitrary message using logging level setup for QueryLogger.
      */
     public static void log(String message) {
         if (message != null) {
-            logObj.log(getLoggingLevel(), message);
+            logObj.info(message);
         }
     }
 
@@ -175,7 +159,7 @@
      */
     public static void logConnect(String dataSource) {
         if (isLoggable()) {
-            logObj.log(getLoggingLevel(), "Connecting. JNDI path: " + dataSource);
+            logObj.info("Connecting. JNDI path: " + dataSource);
         }
     }
 
@@ -192,7 +176,7 @@
             buf.append("\n\tLogin: ").append(userName);
             buf.append("\n\tPassword: *******");
 
-            logObj.log(getLoggingLevel(), buf.toString());
+            logObj.info(buf.toString());
         }
     }
 
@@ -229,7 +213,7 @@
                 buf.append(" pool information unavailable");
             }
 
-            logObj.log(getLoggingLevel(), buf.toString());
+            logObj.info(buf.toString());
         }
     }
 
@@ -237,14 +221,14 @@
      * @since 1.2
      */
     public static void logConnectSuccess() {
-        logObj.log(getLoggingLevel(), "+++ Connecting: SUCCESS.");
+        logObj.info("+++ Connecting: SUCCESS.");
     }
 
     /**
      * @since 1.2
      */
     public static void logConnectFailure(Throwable th) {
-        logObj.log(getLoggingLevel(), "*** Connecting: FAILURE.", th);
+        logObj.info("*** Connecting: FAILURE.", th);
     }
 
     /**
@@ -283,7 +267,7 @@
                 buf.append(" - prepared in ").append(time).append(" ms.");
             }
 
-            logObj.log(getLoggingLevel(), buf.toString());
+            logObj.info(buf.toString());
         }
     }
 
@@ -305,7 +289,7 @@
             }
 
             buf.append(']');
-            logObj.log(getLoggingLevel(), buf.toString());
+            logObj.info(buf.toString());
         }
     }
 
@@ -334,7 +318,7 @@
                 buf.append(" - took ").append(time).append(" ms.");
             }
 
-            logObj.log(getLoggingLevel(), buf.toString());
+            logObj.info(buf.toString());
         }
     }
 
@@ -345,13 +329,13 @@
         if (isLoggable()) {
 
             if (count < 0) {
-                logObj.log(getLoggingLevel(), "=== updated ? rows");
+                logObj.info("=== updated ? rows");
             }
             else {
                 String countStr = (count == 1) ? "=== updated 1 row." : "=== updated "
                         + count
                         + " rows.";
-                logObj.log(getLoggingLevel(), countStr);
+                logObj.info(countStr);
             }
         }
     }
@@ -360,21 +344,21 @@
      * @since 1.2
      */
     public static void logBeginTransaction(String transactionLabel) {
-        logObj.log(getLoggingLevel(), "--- " + transactionLabel);
+        logObj.info("--- " + transactionLabel);
     }
 
     /**
      * @since 1.2
      */
     public static void logCommitTransaction(String transactionLabel) {
-        logObj.log(getLoggingLevel(), "+++ " + transactionLabel);
+        logObj.info("+++ " + transactionLabel);
     }
 
     /**
      * @since 1.2
      */
     public static void logRollbackTransaction(String transactionLabel) {
-        logObj.log(getLoggingLevel(), "*** " + transactionLabel);
+        logObj.info("*** " + transactionLabel);
     }
 
     /**
@@ -386,12 +370,12 @@
                 th = Util.unwindException(th);
             }
 
-            logObj.log(getLoggingLevel(), "*** error.", th);
+            logObj.info("*** error.", th);
 
             if (th instanceof SQLException) {
                 SQLException sqlException = ((SQLException) th).getNextException();
                 while (sqlException != null) {
-                    logObj.log(getLoggingLevel(), "*** nested SQL error.", sqlException);
+                    logObj.info("*** nested SQL error.", sqlException);
                     sqlException = sqlException.getNextException();
                 }
             }
@@ -406,7 +390,7 @@
             String countStr = (count == 1) ? "--- will run 1 query." : "--- will run "
                     + count
                     + " queries.";
-            logObj.log(getLoggingLevel(), countStr);
+            logObj.info(countStr);
         }
     }
 
@@ -417,7 +401,6 @@
      * @since 1.2
      */
     public static boolean isLoggable() {
-        return logObj.isEnabledFor(getLoggingLevel());
+        return logObj.isInfoEnabled();
     }
-
 }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/ToManyList.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/ToManyList.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/ToManyList.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/ToManyList.java Wed Aug 16 15:50:25 2006
@@ -358,10 +358,26 @@
             removedFromUnresolved = new LinkedList();
         }
 
-        removedFromUnresolved.addLast(object);
+        // No point in adding a new or transient object -- these will never be fetched from the database.
+        boolean shouldAddToRemovedFromUnresolvedList = true;
+        if (object instanceof DataObject) {
+            DataObject dataObject = (DataObject) object;
+            if ( (dataObject.getPersistenceState() == PersistenceState.TRANSIENT)
+              || (dataObject.getPersistenceState() == PersistenceState.NEW) ) {
+                shouldAddToRemovedFromUnresolvedList = false;
+            }
+        }
+
+        if (shouldAddToRemovedFromUnresolvedList) {
+            removedFromUnresolved.addLast(object);
+        }
 
         // this is really meaningless, since we don't know
         // if an object was present in the list
         return true;
+    }
+    
+    public String toString() {
+        return getClass().getName() + "@" + System.identityHashCode(this);
     }
 }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/Configuration.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/Configuration.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/Configuration.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/Configuration.java Wed Aug 16 15:50:25 2006
@@ -21,7 +21,6 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -38,9 +37,8 @@
 import org.apache.cayenne.util.CayenneMap;
 import org.apache.cayenne.util.ResourceLocator;
 import org.apache.commons.collections.Predicate;
-import org.apache.log4j.BasicConfigurator;
-import org.apache.log4j.Logger;
-import org.apache.log4j.PropertyConfigurator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * This class is an entry point to Cayenne. It loads all configuration files and
@@ -58,14 +56,12 @@
  */
 public abstract class Configuration {
 
-    private static Logger logObj = Logger.getLogger(Configuration.class);
+    private static Log logObj = LogFactory.getLog(Configuration.class);
 
-    public static final String DEFAULT_LOGGING_PROPS_FILE = ".cayenne/cayenne-log.properties";
     public static final String DEFAULT_DOMAIN_FILE = "cayenne.xml";
     public static final Class DEFAULT_CONFIGURATION_CLASS = DefaultConfiguration.class;
 
     protected static Configuration sharedConfiguration = null;
-    private static boolean loggingConfigured = false;
 
     public static final Predicate ACCEPT_ALL_DATAVIEWS = new Predicate() {
 
@@ -94,69 +90,6 @@
     protected EventManager eventManager;
 
     /**
-     * Configures Cayenne logging properties. Search for the properties file called
-     * <code>cayenne-log.properties</code> is first done in $HOME/.cayenne, then in
-     * CLASSPATH.
-     */
-    public synchronized static void configureCommonLogging() {
-        if (!Configuration.isLoggingConfigured()) {
-            // create a simple CLASSPATH/$HOME locator
-            ResourceLocator locator = new ResourceLocator();
-            locator.setSkipAbsolutePath(true);
-            locator.setSkipClasspath(false);
-            locator.setSkipCurrentDirectory(true);
-            locator.setSkipHomeDirectory(false);
-
-            // and load the default logging config file
-            URL configURL = locator.findResource(DEFAULT_LOGGING_PROPS_FILE);
-            Configuration.configureCommonLogging(configURL);
-        }
-    }
-
-    /**
-     * Configures Cayenne logging properties using properties found at the specified URL.
-     */
-    public synchronized static void configureCommonLogging(URL propsFile) {
-        if (!Configuration.isLoggingConfigured()) {
-            if (propsFile != null) {
-                PropertyConfigurator.configure(propsFile);
-                logObj.debug("configured log4j from: " + propsFile);
-            }
-            else {
-                BasicConfigurator.configure();
-                logObj.debug("configured log4j with BasicConfigurator.");
-            }
-
-            // remember configuration success
-            Configuration.setLoggingConfigured(true);
-        }
-    }
-
-    /**
-     * Indicates whether Log4j has been initialized, either by cayenne or otherwise. If an
-     * external setup has been detected, {@link #setLoggingConfigured}will be called to
-     * remember this.
-     */
-    public static boolean isLoggingConfigured() {
-        if (!loggingConfigured) {
-            // check for existing log4j setup
-            if (Logger.getRootLogger().getAllAppenders().hasMoreElements()) {
-                Configuration.setLoggingConfigured(true);
-            }
-        }
-
-        return loggingConfigured;
-    }
-
-    /**
-     * Indicate whether Log4j has been initialized. Can be used when subclasses customize
-     * the initialization process, or to configure Log4J outside of Cayenne.
-     */
-    public synchronized static void setLoggingConfigured(boolean state) {
-        loggingConfigured = state;
-    }
-
-    /**
      * Use this method as an entry point to all Cayenne access objects.
      * <p>
      * Note that if you want to provide a custom Configuration, make sure you call one of
@@ -265,9 +198,6 @@
      */
     protected Configuration(String domainConfigurationName) {
 
-        // set up logging
-        this.configureLogging();
-
         // set domain configuration name
         this.setDomainConfigurationName(domainConfigurationName);
 
@@ -310,14 +240,6 @@
     protected abstract InputStream getMapConfiguration(String name);
 
     protected abstract InputStream getViewConfiguration(String location);
-
-    /**
-     * Configures log4J. This implementation calls
-     * {@link Configuration#configureCommonLogging}.
-     */
-    protected void configureLogging() {
-        Configuration.configureCommonLogging();
-    }
 
     /**
      * Returns the name of the main domain configuration resource. Defaults to

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/ConnectionProperties.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/ConnectionProperties.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/ConnectionProperties.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/ConnectionProperties.java Wed Aug 16 15:50:25 2006
@@ -30,10 +30,9 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.collections.ExtendedProperties;
-import org.apache.log4j.Logger;
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.project.CayenneUserDir;
+import org.apache.commons.collections.ExtendedProperties;
 
 /**
  * ConnectionProperties handles a set of DataSourceInfo objects 
@@ -44,7 +43,7 @@
  * @author Andrus Adamchik
  */
 public class ConnectionProperties {
-    static final Logger logObj = Logger.getLogger(ConnectionProperties.class);
+    
 
     public static final String EMBEDDED_DATASOURCE = "internal_embedded_datasource";
     public static final String EMBEDDED_DATASOURCE_DBADAPTER = "org.apache.cayenne.dba.hsqldb.HSQLDBAdapter";
@@ -89,7 +88,7 @@
                 createSamplePropertiesFile(f);
             }
         } catch (IOException e) {
-            logObj.warn("Error loading connection properties. Ignoring..", e);
+            // ignoring
         }
 
         return new ConnectionProperties(new ExtendedProperties());

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java Wed Aug 16 15:50:25 2006
@@ -31,11 +31,12 @@
 import org.apache.commons.dbcp.DriverManagerConnectionFactory;
 import org.apache.commons.dbcp.PoolableConnectionFactory;
 import org.apache.commons.dbcp.PoolingDataSource;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.commons.pool.KeyedObjectPoolFactory;
 import org.apache.commons.pool.ObjectPool;
 import org.apache.commons.pool.impl.GenericKeyedObjectPoolFactory;
 import org.apache.commons.pool.impl.GenericObjectPool;
-import org.apache.log4j.Logger;
 
 /**
  * An implementation of DataSourceFactory that instantiates a DataSource from Apache
@@ -200,7 +201,7 @@
  */
 public class DBCPDataSourceFactory implements DataSourceFactory {
 
-    private static final Logger logger = Logger.getLogger(DBCPDataSourceFactory.class);
+    private static final Log logger = LogFactory.getLog(DBCPDataSourceFactory.class);
 
     /**
      * Suffix of the properties file

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DefaultConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DefaultConfiguration.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DefaultConfiguration.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DefaultConfiguration.java Wed Aug 16 15:50:25 2006
@@ -21,10 +21,11 @@
 
 import java.io.InputStream;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.ConfigurationException;
 import org.apache.cayenne.util.ResourceLocator;
 import org.apache.cayenne.util.Util;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * Subclass of Configuration that uses the System CLASSPATH to locate resources.
@@ -33,7 +34,7 @@
  */
 public class DefaultConfiguration extends Configuration {
 
-    private static Logger logObj = Logger.getLogger(DefaultConfiguration.class);
+    private static Log logger = LogFactory.getLog(DefaultConfiguration.class);
 
     /**
      * the default ResourceLocator used for CLASSPATH loading
@@ -66,7 +67,7 @@
             throw new ConfigurationException("cannot use null as domain file name.");
         }
 
-        logObj.debug("using domain file name: " + domainConfigurationName);
+        logger.debug("using domain file name: " + domainConfigurationName);
 
         // configure CLASSPATH-only locator
         ResourceLocator locator = new ResourceLocator();
@@ -128,7 +129,7 @@
      * set in a subclass. Always returns <code>true</code>.
      */
     public boolean canInitialize() {
-        logObj.debug("canInitialize started.");
+        logger.debug("canInitialize started.");
         // allow to proceed
         return true;
     }
@@ -138,7 +139,7 @@
      * maps, initializes all domain Nodes and their DataSources.
      */
     public void initialize() throws Exception {
-        logObj.debug("initialize starting.");
+        logger.debug("initialize starting.");
 
         InputStream in = this.getDomainConfiguration();
         if (in == null) {
@@ -166,7 +167,7 @@
         }
 
         // log successful initialization
-        logObj.debug("initialize finished.");
+        logger.debug("initialize finished.");
     }
 
     /**
@@ -175,7 +176,7 @@
      */
     public void didInitialize() {
         // empty default implementation
-        logObj.debug("didInitialize finished.");
+        logger.debug("didInitialize finished.");
     }
 
     /**

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java Wed Aug 16 15:50:25 2006
@@ -29,7 +29,8 @@
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.conn.PoolManager;
 import org.apache.cayenne.util.Util;
-import org.apache.log4j.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.InputSource;
@@ -48,7 +49,7 @@
 // sequential invocations of getDataSource() will have side effects....
 public class DriverDataSourceFactory implements DataSourceFactory {
 
-    private static Logger logObj = Logger.getLogger(DriverDataSourceFactory.class);
+    private static final Log logger = LogFactory.getLog(DriverDataSourceFactory.class);
 
     protected XMLReader parser;
     protected DataSourceInfo driverInfo;
@@ -106,11 +107,11 @@
      * internally from "getDataSource"
      */
     protected void load(String location) throws Exception {
-        logObj.info("loading driver information from '" + location + "'.");
+        logger.info("loading driver information from '" + location + "'.");
 
         InputStream in = this.getInputStream(location);
         if (in == null) {
-            logObj.info("Error: location '" + location + "' not found.");
+            logger.info("Error: location '" + location + "' not found.");
             throw new ConfigurationException(
                     "Can't find DataSource configuration file at " + location);
         }
@@ -141,7 +142,7 @@
                 new DriverHandler(parser, this).init(localName, atts);
             }
             else {
-                logObj.info("<driver> must be the root element. <"
+                logger.info("<driver> must be the root element. <"
                         + localName
                         + "> is unexpected.");
                 throw new SAXException("Config file is not of expected XML type. '"
@@ -160,7 +161,7 @@
 
         public void init(String name, Attributes attrs) {
             String className = attrs.getValue("", "class");
-            logObj.info("loading driver " + className);
+            logger.info("loading driver " + className);
             driverInfo = new DataSourceInfo();
             driverInfo.setJdbcDriver(className);
         }
@@ -187,7 +188,7 @@
                         .init(localName, atts, driverInfo);
             }
             else {
-                logObj.info("<login, url, connectionPool> are valid. <"
+                logger.info("<login, url, connectionPool> are valid. <"
                         + localName
                         + "> is unexpected.");
                 throw new SAXException("Config file is not of expected XML type");
@@ -212,7 +213,7 @@
                 throws SAXException {
             driverInfo.setDataSourceUrl(atts.getValue("value"));
             if (driverInfo.getDataSourceUrl() == null) {
-                logObj.info("error: <url> has no 'value'.");
+                logger.info("error: <url> has no 'value'.");
                 throw new SAXException("'<url value=' attribute is required.");
             }
         }
@@ -231,7 +232,7 @@
         }
 
         public void init(String name, Attributes atts, DataSourceInfo driverInfo) {
-            logObj.info("loading user name and password.");
+            logger.info("loading user name and password.");
             driverInfo.setUserName(atts.getValue("userName"));
             driverInfo.setPassword(atts.getValue("password"));
         }
@@ -261,7 +262,7 @@
                     driverInfo.setMaxConnections(Integer.parseInt(max));
             }
             catch (NumberFormatException nfex) {
-                logObj.info("Error loading numeric attribute", nfex);
+                logger.info("Error loading numeric attribute", nfex);
                 throw new SAXException("Error reading numeric attribute.", nfex);
             }
         }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/FileConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/FileConfiguration.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/FileConfiguration.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/FileConfiguration.java Wed Aug 16 15:50:25 2006
@@ -21,9 +21,10 @@
 
 import java.io.File;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.ConfigurationException;
 import org.apache.cayenne.util.ResourceLocator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * FileConfiguration loads a Cayenne configuraton file from a given
@@ -32,7 +33,7 @@
  * @author Holger Hoffstaette
  */
 public class FileConfiguration extends DefaultConfiguration {
-	private static Logger logObj = Logger.getLogger(FileConfiguration.class);
+    private static final Log logger = LogFactory.getLog(FileConfiguration.class);
 
 	/**
 	 * The domain file used for this configuration
@@ -88,7 +89,7 @@
 	public FileConfiguration(File domainConfigurationFile) {
 		super();
 
-		logObj.debug("using domain file: " + domainConfigurationFile);
+		logger.debug("using domain file: " + domainConfigurationFile);
 
 		// set the project file
 		this.setProjectFile(domainConfigurationFile);

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/JNDIDataSourceFactory.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/JNDIDataSourceFactory.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/JNDIDataSourceFactory.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/JNDIDataSourceFactory.java Wed Aug 16 15:50:25 2006
@@ -26,7 +26,8 @@
 
 import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.util.Util;
-import org.apache.log4j.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * Looks up DataSource objects via JNDI.
@@ -35,7 +36,7 @@
  */
 public class JNDIDataSourceFactory implements DataSourceFactory {
 
-    private static final Logger logObj = Logger.getLogger(JNDIDataSourceFactory.class);
+    private static final Log logger = LogFactory.getLog(JNDIDataSourceFactory.class);
 
     protected Configuration parentConfig;
 
@@ -54,7 +55,7 @@
         }
         catch (Exception ex) {
 
-            logObj.info("failed JNDI lookup, attempt to load "
+            logger.info("failed JNDI lookup, attempt to load "
                     + "from local preferences. Location key:"
                     + location);
 
@@ -64,7 +65,7 @@
             }
             catch (Exception preferencesException) {
 
-                logObj.info("failed loading from local preferences", Util
+                logger.info("failed loading from local preferences", Util
                         .unwindException(preferencesException));
 
                 // giving up ... rethrow original exception...

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/RuntimeLoadDelegate.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/RuntimeLoadDelegate.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/RuntimeLoadDelegate.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/RuntimeLoadDelegate.java Wed Aug 16 15:50:25 2006
@@ -33,7 +33,8 @@
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.MapLoader;
-import org.apache.log4j.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.xml.sax.InputSource;
 
 /**
@@ -42,6 +43,8 @@
  * @author Andrus Adamchik
  */
 public class RuntimeLoadDelegate implements ConfigLoaderDelegate {
+    
+    private static final Log logger = LogFactory.getLog(RuntimeLoadDelegate.class);
 
     // TODO: andrus, 7/17/2006 - these variables, and project upgrade logic should be
     // refactored out of the MapLoader. In fact we should either modify raw XML during the
@@ -49,8 +52,6 @@
     final static String _1_2_PACKAGE_PREFIX = "org.objectstyle.cayenne.";
     final static String _2_0_PACKAGE_PREFIX = "org.apache.cayenne.";
 
-    private static Logger logObj = Logger.getLogger(RuntimeLoadDelegate.class);
-
     protected Map domains = new HashMap();
     protected Map views = new HashMap();
     protected ConfigStatus status;
@@ -98,7 +99,7 @@
     }
 
     public boolean loadError(Throwable th) {
-        logObj.info("Parser Exception.", th);
+        logger.info("Parser Exception.", th);
         status.getOtherFailures().add(th.getMessage());
         return false;
     }
@@ -127,7 +128,7 @@
             domain = findDomain(domainName);
         }
         catch (FindException ex) {
-            logObj.info("Error: Domain is not loaded: " + domainName);
+            logger.info("Error: Domain is not loaded: " + domainName);
             throw new ConfigurationException("Domain is not loaded: " + domainName);
         }
 
@@ -136,11 +137,11 @@
 
     public void shouldLoadDataDomain(String domainName) {
         if (domainName == null) {
-            logObj.info("Error: unnamed <domain>.");
+            logger.info("Error: unnamed <domain>.");
             throw new ConfigurationException("Domain 'name' attribute must be not null.");
         }
 
-        logObj.info("loaded domain: " + domainName);
+        logger.info("loaded domain: " + domainName);
         domains.put(domainName, new DataDomain(domainName));
     }
 
@@ -154,7 +155,7 @@
             domain = findDomain(domainName);
         }
         catch (FindException ex) {
-            logObj.info("Error: Domain is not loaded: " + domainName);
+            logger.info("Error: Domain is not loaded: " + domainName);
             throw new ConfigurationException("Domain is not loaded: " + domainName);
         }
 
@@ -193,7 +194,7 @@
         // load DataMap
         InputStream mapIn = config.getMapConfiguration(location);
         if (mapIn == null) {
-            logObj.info("Warning: map location not found.");
+            logger.info("Warning: map location not found.");
             getStatus().addFailedMap(mapName, location, "map location not found");
             return null;
         }
@@ -201,7 +202,7 @@
         try {
             DataMap map = new MapLoader().loadDataMap(new InputSource(mapIn));
 
-            logObj.info("loaded <map name='"
+            logger.info("loaded <map name='"
                     + mapName
                     + "' location='"
                     + location
@@ -214,7 +215,7 @@
             return map;
         }
         catch (Exception dmex) {
-            logObj.info("Warning: map loading failed.", dmex);
+            logger.info("Warning: map loading failed.", dmex);
             getStatus().addFailedMap(
                     mapName,
                     location,
@@ -240,7 +241,7 @@
             String adapter,
             String factory) {
 
-        logObj.info("loading <node name='"
+        logger.info("loading <node name='"
                 + nodeName
                 + "' datasource='"
                 + dataSource
@@ -256,12 +257,12 @@
         adapter = convertClassNameFromV1_2(adapter);
 
         if (dataSource == null) {
-            logObj.info("Warning: <node> '" + nodeName + "' has no 'datasource'.");
+            logger.info("Warning: <node> '" + nodeName + "' has no 'datasource'.");
         }
 
         if (factory == null) {
             if (config.getDataSourceFactory() != null) {
-                logObj.info("Warning: <node> '" + nodeName + "' without 'factory'.");
+                logger.info("Warning: <node> '" + nodeName + "' without 'factory'.");
             }
             else {
                 throw new ConfigurationException("Error: <node> '"
@@ -284,21 +285,21 @@
                     ? confFactory
                     : (DataSourceFactory) Class.forName(factory).newInstance();
 
-            logObj.info("using factory: " + localFactory.getClass().getName());
+            logger.info("using factory: " + localFactory.getClass().getName());
 
             localFactory.initializeWithParentConfiguration(config);
             DataSource ds = localFactory.getDataSource(dataSource);
             if (ds != null) {
-                logObj.info("loaded datasource.");
+                logger.info("loaded datasource.");
                 node.setDataSource(ds);
             }
             else {
-                logObj.info("Warning: null datasource.");
+                logger.info("Warning: null datasource.");
                 getStatus().getFailedDataSources().put(nodeName, dataSource);
             }
         }
         catch (Exception ex) {
-            logObj.info("Error: DataSource load failed", ex);
+            logger.info("Error: DataSource load failed", ex);
             getStatus().addFailedDataSource(
                     nodeName,
                     dataSource,
@@ -311,7 +312,7 @@
             findDomain(domainName).addNode(node);
         }
         catch (FindException ex) {
-            logObj.info("Error: can't load node, unknown domain: " + domainName);
+            logger.info("Error: can't load node, unknown domain: " + domainName);
             getStatus().addFailedDataSource(
                     nodeName,
                     nodeName,
@@ -350,7 +351,7 @@
                 return;
             }
             catch (Exception ex) {
-                logObj.info("instantiating adapter failed", ex);
+                logger.info("instantiating adapter failed", ex);
                 getStatus().addFailedAdapter(
                         node.getName(),
                         adapterName,
@@ -358,18 +359,18 @@
             }
         }
 
-        logObj.info("no adapter set, using automatic adapter.");
+        logger.info("no adapter set, using automatic adapter.");
         node.setAdapter(new AutoAdapter(new NodeDataSource(node)));
     }
 
     public void shouldLinkDataMap(String domainName, String nodeName, String mapName) {
 
         if (mapName == null) {
-            logObj.info("<map-ref> has no 'name'.");
+            logger.info("<map-ref> has no 'name'.");
             throw new ConfigurationException("<map-ref> has no 'name'.");
         }
 
-        logObj.info("loaded map-ref: " + mapName + ".");
+        logger.info("loaded map-ref: " + mapName + ".");
         DataMap map = null;
         DataNode node = null;
 
@@ -377,7 +378,7 @@
             map = findMap(domainName, mapName);
         }
         catch (FindException ex) {
-            logObj.info("Error: unknown map: " + mapName);
+            logger.info("Error: unknown map: " + mapName);
             getStatus().addFailedMapRefs(mapName, "unknown map: " + mapName);
             return;
         }
@@ -386,7 +387,7 @@
             node = findNode(domainName, nodeName);
         }
         catch (FindException ex) {
-            logObj.info("Error: unknown node: " + nodeName);
+            logger.info("Error: unknown node: " + nodeName);
             getStatus().addFailedMapRefs(mapName, "unknown node: " + nodeName);
             return;
         }
@@ -454,7 +455,7 @@
 
         config.setDataViewLocations(views);
 
-        logObj.info("finished configuration loading in "
+        logger.info("finished configuration loading in "
                 + (System.currentTimeMillis() - startTime)
                 + " ms.");
     }
@@ -464,7 +465,7 @@
      */
     public void startedLoading() {
         startTime = System.currentTimeMillis();
-        logObj.info("started configuration loading.");
+        logger.info("started configuration loading.");
     }
 
     /**

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/ServletUtil.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/ServletUtil.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/ServletUtil.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/ServletUtil.java Wed Aug 16 15:50:25 2006
@@ -22,7 +22,6 @@
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpSession;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.util.ResourceLocator;
 import org.apache.cayenne.util.WebApplicationResourceLocator;
@@ -47,8 +46,6 @@
  */
 public class ServletUtil {
 
-    private static Logger logObj = Logger.getLogger(ServletUtil.class);
-
     /**
      * A name of the web application initialization parameter used to specify extra paths
      * where Cayenne XML files might be located. E.g. "/WEB-INF/cayenne".
@@ -77,8 +74,6 @@
 
             if (locator instanceof WebApplicationResourceLocator) {
                 if (((WebApplicationResourceLocator) locator).getServletContext() == context) {
-                    logObj
-                            .info("Configuration is already initialized with this context, reusing.");
                     return oldConfig;
                 }
             }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/WebApplicationContextFilter.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/WebApplicationContextFilter.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/WebApplicationContextFilter.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conf/WebApplicationContextFilter.java Wed Aug 16 15:50:25 2006
@@ -31,7 +31,6 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.access.DataContext;
 
 /**
@@ -86,8 +85,6 @@
  */
 public class WebApplicationContextFilter implements Filter {
 
-    private static Logger logger = Logger.getLogger(WebApplicationContextFilter.class);
-
     /**
      * Does nothing. As per the servlet specification, gets called by the container when
      * the filter is taken out of service.
@@ -118,29 +115,20 @@
             ServletResponse response,
             FilterChain chain) throws IOException, ServletException {
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("start WebApplicationContextFilter.doFilter. URL - "
-                    + ((HttpServletRequest) request).getRequestURL());
-        }
-
+    
         if (request instanceof HttpServletRequest) {
             HttpSession session = ((HttpServletRequest) request).getSession(true);
             DataContext dataContext = ServletUtil.getSessionContext(session);
 
             if (dataContext == null) {
-                logger.debug("DataContext was null. Throwing Exception");
-
+               
                 throw new ServletException("DataContext was null and could "
                         + "not be bound to thread.");
             }
 
             DataContext.bindThreadDataContext(dataContext);
-            logger.debug("DataContext bound, continuing in chain");
-        }
-        else {
-            logger.debug("requests that are not HttpServletRequest are not supported..");
         }
-
+        
         try {
             chain.doFilter(request, response);
         }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/ContainerPoolFactory.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/ContainerPoolFactory.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/ContainerPoolFactory.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/ContainerPoolFactory.java Wed Aug 16 15:50:25 2006
@@ -27,8 +27,6 @@
 import javax.naming.Reference;
 import javax.naming.spi.ObjectFactory;
 
-import org.apache.log4j.Logger;
-
 
 /**
  * <p>Basic JNDI object factory that creates an instance of
@@ -89,10 +87,7 @@
  *
  * @author Andrus Adamchik
  */
-
 public class ContainerPoolFactory implements ObjectFactory {
-    private static Logger logObj = Logger.getLogger(ContainerPoolFactory.class);
-
 
     /**
      * <p>Creates and returns a new <code>PoolManager</code> instance.  If no
@@ -115,13 +110,11 @@
         // We only know how to deal with <code>javax.naming.Reference</code>s
         // that specify a class name of "javax.sql.DataSource"
         if ((obj == null) || !(obj instanceof Reference)) {
-            logObj.info("unsupported or null reference: " + obj);
             return null;
         }
 
         Reference ref = (Reference) obj;
         if (!"javax.sql.DataSource".equals(ref.getClassName())) {
-            logObj.info("unsupported type: " + ref.getClassName());
             return null;
         }
 
@@ -167,8 +160,6 @@
             username = ra.getContent().toString();
         }
 
-        logObj.info("Loading datasource driver: " + driver);
-        logObj.info("Connecting to URL: " + url);
         return new PoolManager(driver, url, min, max, username, password);
     }
 }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/PoolManager.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/PoolManager.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/PoolManager.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/PoolManager.java Wed Aug 16 15:50:25 2006
@@ -33,20 +33,15 @@
 import javax.sql.DataSource;
 import javax.sql.PooledConnection;
 
-import org.apache.log4j.Logger;
-
 /**
  * PoolManager is a pooling DataSource impementation. 
  * Internally to obtain connections PoolManager uses either a JDBC driver 
  * or another pooling datasource.
- *
- * <p>TODO: create a low priority thread that will do pool maintenance.</p>
- *
+ * 
  * @author Andrus Adamchik
  */
 public class PoolManager implements DataSource, ConnectionEventListener {
-    private static Logger logObj = Logger.getLogger(PoolManager.class);
-    
+
     /** 
      * Defines a maximum time in milliseconds that a connection
      * request could wait in the connection queue. After this period
@@ -265,7 +260,7 @@
             try {
                 con.close();
             } catch (SQLException ex) {
-                logObj.info("Error closing connection. Ignoring.", ex);
+                // ignore
             }
         }
     }
@@ -359,15 +354,12 @@
             return uncheckConnection(pooledConnection);
         }
         catch (SQLException ex) {
-            logObj.info("Error getting connection", ex);
 
             try {
                 pooledConnection.close();
             }
             catch (SQLException ignored) {
             }
-
-            logObj.info("Reconnecting...");
             
             // do one reconnect attempt...
             pooledConnection = uncheckPooledConnection(userName, password);
@@ -543,7 +535,6 @@
 
                     if (unused > 0 && total > median) {
                         pool.shrinkPool(1);
-                        logObj.debug("decreased pool size to " + (total - 1) + " connections.");
                     }
                 }
             }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/PooledConnectionImpl.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/PooledConnectionImpl.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/PooledConnectionImpl.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/conn/PooledConnectionImpl.java Wed Aug 16 15:50:25 2006
@@ -32,8 +32,6 @@
 import javax.sql.DataSource;
 import javax.sql.PooledConnection;
 
-import org.apache.log4j.Logger;
-
 /**
  * PooledConnectionImpl is an implementation of a pooling wrapper for the database
  * connection as per JDBC3 spec. Most of the modern JDBC drivers should have its own
@@ -43,8 +41,6 @@
  */
 public class PooledConnectionImpl implements PooledConnection {
 
-    private static Logger logObj = Logger.getLogger(PooledConnectionImpl.class);
-
     private Connection connectionObj;
     private List connectionEventListeners;
     private boolean hadErrors;
@@ -159,13 +155,6 @@
     public void connectionErrorNotification(SQLException exception) {
         // hint for later to avoid returning bad connections to the pool
         hadErrors = true;
-
-        if (logObj.isDebugEnabled()) {
-            logObj
-                    .debug(
-                            "Child connection error, retiring pooled connection.",
-                            exception);
-        }
 
         synchronized (connectionEventListeners) {
             if (connectionEventListeners.size() == 0)

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/DbAdapterFactoryChain.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/DbAdapterFactoryChain.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/DbAdapterFactoryChain.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/DbAdapterFactoryChain.java Wed Aug 16 15:50:25 2006
@@ -25,8 +25,6 @@
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.log4j.Logger;
-
 /**
  * A facade for a collection of DbAdapterFactories. Can be configured to autodetect all
  * adapters known to Cayenne or can work with custom factories.
@@ -39,8 +37,6 @@
 // specify the adapter class in the modeler, so this may be a non-issue.
 class DbAdapterFactoryChain implements DbAdapterFactory {
 
-    private static final Logger logObj = Logger.getLogger(DbAdapterFactoryChain.class);
-
     List factories;
 
     DbAdapterFactoryChain(Collection factories) {
@@ -53,10 +49,6 @@
      * DbAdapter. If none of the factories match the database, returns null.
      */
     public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
-
-        if (logObj.isInfoEnabled()) {
-            logObj.info("DB name: " + md.getDatabaseProductName());
-        }
 
         // match against configured predicated factories
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/TypesHandler.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/TypesHandler.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/TypesHandler.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/TypesHandler.java Wed Aug 16 15:50:25 2006
@@ -28,7 +28,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.util.Util;
 import org.xml.sax.Attributes;
@@ -44,7 +43,6 @@
  * @author Andrus Adamchik
  */
 public class TypesHandler {
-    private static Logger logObj = Logger.getLogger(TypesHandler.class);
 
     private static Map handlerMap = new HashMap();
 
@@ -141,7 +139,6 @@
                 }
                 catch (Exception ex) {
                     currentType = TypesMapping.NOT_DEFINED;
-                    logObj.info("type not found: '" + strType + "', ignoring.");
                 }
             }
             else if (DB_TYPE_TAG.equals(localName)) {

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java Wed Aug 16 15:50:25 2006
@@ -24,7 +24,6 @@
 import java.sql.Types;
 import java.util.Iterator;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.trans.QualifierTranslator;
@@ -62,7 +61,6 @@
  * @since 1.1
  */
 public class OpenBaseAdapter extends JdbcAdapter {
-    private static Logger logObj = Logger.getLogger(OpenBaseAdapter.class);
 
     public OpenBaseAdapter() {
         // init defaults
@@ -245,8 +243,7 @@
                 "Relationship has no joins: " + rel.getName());
         }
         else if (joinsLen > 1) {
-            logObj.warn(
-                "Only a single join relationships are supported by OpenBase. Ignoring extra joins.");
+            // ignore extra joins
         }
 
         DbJoin join = (DbJoin) rel.getJoins().get(0);

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java Wed Aug 16 15:50:25 2006
@@ -46,8 +46,6 @@
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLAction;
 import org.apache.cayenne.query.UpdateBatchQuery;
-import org.apache.cayenne.util.Util;
-import org.apache.log4j.Logger;
 
 /**
  * DbAdapter implementation for <a href="http://www.oracle.com">Oracle RDBMS </a>. Sample
@@ -70,8 +68,6 @@
  */
 public class OracleAdapter extends JdbcAdapter {
 
-    private static Logger logObj = Logger.getLogger(OracleAdapter.class);
-
     public static final String ORACLE_FLOAT = "FLOAT";
     public static final String ORACLE_BLOB = "BLOB";
     public static final String ORACLE_CLOB = "CLOB";
@@ -113,9 +109,7 @@
 
         }
         catch (Throwable th) {
-            logObj.debug("Error getting Oracle driver information, ignoring. "
-                    + "Note that certain adapter features will be disabled.", Util
-                    .unwindException(th));
+            // ignoring...
         }
     }
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectTranslator.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectTranslator.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectTranslator.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectTranslator.java Wed Aug 16 15:50:25 2006
@@ -24,7 +24,6 @@
 import java.sql.PreparedStatement;
 import java.sql.Statement;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.trans.SelectTranslator;
 import org.apache.cayenne.query.QueryMetadata;
@@ -36,8 +35,6 @@
  */
 public class OracleSelectTranslator extends SelectTranslator {
 
-    private static Logger logObj = Logger.getLogger(OracleSelectTranslator.class);
-
     private static boolean testedDriver;
     private static boolean useOptimizations;
     private static Method statementSetRowPrefetch;
@@ -90,14 +87,6 @@
         catch (Exception ex) {
             useOptimizations = false;
             statementSetRowPrefetch = null;
-
-            StringBuffer buf = new StringBuffer();
-            buf
-                    .append("Unknown Oracle statement type: [")
-                    .append(st.getClass().getName())
-                    .append("]. No Oracle optimizations applied.");
-
-            logObj.info(buf.toString());
         }
     }
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ApplicationProject.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ApplicationProject.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ApplicationProject.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ApplicationProject.java Wed Aug 16 15:50:25 2006
@@ -26,7 +26,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.ConfigurationException;
 import org.apache.cayenne.access.DataDomain;
 import org.apache.cayenne.access.DataNode;
@@ -43,8 +42,6 @@
  */
 public class ApplicationProject extends Project {
 
-    private static Logger logObj = Logger.getLogger(ApplicationProject.class);
-
     protected Configuration configuration;
 
     /**
@@ -101,8 +98,6 @@
      * Initializes internal <code>Configuration</code> object and then calls super.
      */
     protected void postInitialize(File projectFile) {
-        logObj.debug("postInitialize: " + projectFile);
-
         loadProject();
         super.postInitialize(projectFile);
     }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/CayenneUserDir.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/CayenneUserDir.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/CayenneUserDir.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/CayenneUserDir.java Wed Aug 16 15:50:25 2006
@@ -21,8 +21,6 @@
 
 import java.io.File;
 
-import org.apache.log4j.Logger;
-
 /**
  * CayenneUserDir represents a directory where all Cayenne-related information 
  * is stored on the user machine. This is normally a <code>$HOME/.cayenne</code>
@@ -31,8 +29,7 @@
  * @author Andrus Adamchik
  */
 public class CayenneUserDir {
-	static final Logger logObj = Logger.getLogger(CayenneUserDir.class);
-	
+
     protected static CayenneUserDir sharedInstance;
 
     public static final String CAYENNE_DIR = ".cayenne";
@@ -74,17 +71,14 @@
 
         if (tmpDir.exists() && !tmpDir.isDirectory()) {
             tmpDir = null;
-            logObj.warn(tmpDir + " is not a directory.");
         }
         else if (tmpDir.exists() && !tmpDir.canRead()) {
             tmpDir = null;
-            logObj.warn(tmpDir + " is not readable.");
         }
         else if (!tmpDir.exists()) {
             tmpDir.mkdirs();
             if (!tmpDir.exists()) {
                 tmpDir = null;
-                logObj.warn("Couldn't create " + tmpDir);
             }
         }
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/DataMapProject.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/DataMapProject.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/DataMapProject.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/DataMapProject.java Wed Aug 16 15:50:25 2006
@@ -25,7 +25,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.conf.ConfigStatus;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.MapLoader;
@@ -38,8 +37,6 @@
  */
 public class DataMapProject extends Project {
 
-    private static Logger logObj = Logger.getLogger(DataMapProject.class);
-
     protected DataMap map;
 
     /**
@@ -76,7 +73,6 @@
                 map = new MapLoader().loadDataMap(new InputSource(in));
 
                 String fileName = resolveSymbolicName(projectFile);
-                logObj.error("resolving: " + projectFile + " to " + fileName);
                 String mapName = (fileName != null && fileName
                         .endsWith(DataMapFile.LOCATION_SUFFIX))
                         ? fileName.substring(0, fileName.length()

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/Project.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/Project.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/Project.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/Project.java Wed Aug 16 15:50:25 2006
@@ -29,7 +29,6 @@
 import org.apache.cayenne.conf.ConfigStatus;
 import org.apache.cayenne.conf.Configuration;
 import org.apache.cayenne.project.validator.Validator;
-import org.apache.log4j.Logger;
 
 /**
  * Describes a model of Cayenne project. Project is a set of files in the filesystem
@@ -43,8 +42,6 @@
  */
 public abstract class Project {
 
-    private static final Logger logObj = Logger.getLogger(Project.class);
-
     public static final String CURRENT_PROJECT_VERSION = "2.0";
     static final int UPGRADE_STATUS_OLD = -1;
     static final int UPGRADE_STATUS_CURRENT = 0;
@@ -60,7 +57,6 @@
      * Factory method to create the right project type given project file.
      */
     public static Project createProject(File projectFile) {
-        logObj.debug("createProject: " + projectFile);
         String fileName = projectFile.getName();
 
         if (fileName.endsWith(Configuration.DEFAULT_DOMAIN_FILE)) {
@@ -121,7 +117,6 @@
      * builds a file list and checks for upgrades.
      */
     protected void postInitialize(File projectFile) {
-        logObj.debug("postInitialize with: " + projectFile);
         // take a snapshot of files used by the project
         files = Collections.synchronizedList(buildFileList());
         upgradeMessages = Collections.synchronizedList(new ArrayList());
@@ -240,7 +235,6 @@
         }
         catch (IOException e) {
             // error converting path
-            logObj.info("Can't convert to canonical form.", e);
             return null;
         }
     }
@@ -276,7 +270,6 @@
         }
         catch (IOException e) {
             // error converting path
-            logObj.info("Can't convert to canonical form.", e);
             return null;
         }
     }
@@ -420,16 +413,10 @@
             Iterator modified = modifiedFiles.iterator();
             while (modified.hasNext()) {
                 ProjectFile f = (ProjectFile) modified.next();
-
-                if (logObj.isDebugEnabled()) {
-                    logObj.info("Saving file " + f.resolveFile());
-                }
-
                 f.saveTemp();
             }
         }
         catch (Exception ex) {
-            logObj.info("*** Project save failed, reverting.", ex);
 
             // revert
             Iterator modified = modifiedFiles.iterator();
@@ -461,30 +448,20 @@
                 boolean delete = false;
                 if (f.isRenamed()) {
                     delete = true;
-                    logObj.info("File renamed, deleting old version: " + file);
                 }
                 else if (f.getObject() == null) {
                     delete = true;
-                    logObj.info("Null internal object, deleting file: " + file);
                 }
                 else if (!existingObjects.contains(f.getObject())) {
                     delete = true;
-                    logObj
-                            .info("Object deleted from the project, deleting file: "
-                                    + file);
                 }
                 else if (!f.canHandleObject()) {
                     // this happens too - node can start using JNDI for instance
                     delete = true;
-                    logObj
-                            .info("Can no longer handle the object, deleting file: "
-                                    + file);
                 }
 
                 if (delete) {
-                    if (!deleteFile(file)) {
-                        logObj.info("*** Failed to delete file, ignoring.");
-                    }
+                    deleteFile(file);
                 }
             }
         }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ProjectConfigurator.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ProjectConfigurator.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ProjectConfigurator.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ProjectConfigurator.java Wed Aug 16 15:50:25 2006
@@ -23,7 +23,6 @@
 import java.io.IOException;
 import java.util.Iterator;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.conf.Configuration;
 import org.apache.cayenne.util.Util;
 import org.apache.cayenne.util.ZipUtil;
@@ -34,7 +33,6 @@
  * @author Andrus Adamchik
  */
 public class ProjectConfigurator {
-    private static Logger logObj = Logger.getLogger(ProjectConfigurator.class);
     protected ProjectConfigInfo info;
 
     public ProjectConfigurator(ProjectConfigInfo info) {
@@ -179,9 +177,7 @@
      *  Deletes a temporary directories and files created.
      */
     protected void cleanup(File dir) {
-        if (!Util.delete(dir.getPath(), true)) {
-            logObj.info("Can't delete temporary directory: " + dir);
-        }
+        Util.delete(dir.getPath(), true);
     }
 
     /**

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ProjectDataSourceFactory.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ProjectDataSourceFactory.java?rev=432060&r1=432059&r2=432060&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ProjectDataSourceFactory.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/project/ProjectDataSourceFactory.java Wed Aug 16 15:50:25 2006
@@ -23,7 +23,6 @@
 
 import javax.sql.DataSource;
 
-import org.apache.log4j.Logger;
 import org.apache.cayenne.ConfigurationException;
 import org.apache.cayenne.conf.DriverDataSourceFactory;
 import org.apache.cayenne.conn.DataSourceInfo;
@@ -36,8 +35,6 @@
  */
 public class ProjectDataSourceFactory extends DriverDataSourceFactory {
 
-    private static Logger logObj = Logger.getLogger(ProjectDataSourceFactory.class);
-
     protected File projectDir;
 
     public ProjectDataSourceFactory(File projectDir) throws Exception {
@@ -50,7 +47,7 @@
             this.load(location);
         }
         catch (ConfigurationException e) {
-            logObj.info("No data source at '" + location + "', ignoring.");
+            // ignoring
         }
 
         return new ProjectDataSource(this.getDriverInfo());



Mime
View raw message