cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkazimirc...@apache.org
Subject svn commit: r1170103 - in /cayenne/main/trunk/framework: cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/ cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/ cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configurati...
Date Tue, 13 Sep 2011 10:02:55 GMT
Author: dkazimirchyk
Date: Tue Sep 13 10:02:54 2011
New Revision: 1170103

URL: http://svn.apache.org/viewvc?rev=1170103&view=rev
Log:
CAY-1608 Implement constructor injection support for DefaultAdhocObjectFactory

moved AdhocObjectFactory to cayenne-di-unpublished and implemented constructor injection for
it using ConstructorInjectingProvider

Added:
    cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/AdhocObjectFactory.java
    cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/DefaultAdhocObjectFactory.java
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/AdhocObjectFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/DefaultAdhocObjectFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DelegatingDataSourceFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/util/Util.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDataSourceFactoryLoaderTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDbAdapterProvider.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java

Added: cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/AdhocObjectFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/AdhocObjectFactory.java?rev=1170103&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/AdhocObjectFactory.java
(added)
+++ cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/AdhocObjectFactory.java
Tue Sep 13 10:02:54 2011
@@ -0,0 +1,33 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.di;
+
+/**
+ * Creates objects for user-provided String class names, injecting dependencies into them.
+ * 
+ * @since 3.1
+ */
+public interface AdhocObjectFactory {
+
+    /**
+     * Returns an instance of "className" that implements "superType", injecting
+     * dependencies from the registry into it.
+     */
+    <T> T newInstance(Class<? super T> superType, String className);
+}

Added: cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/DefaultAdhocObjectFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/DefaultAdhocObjectFactory.java?rev=1170103&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/DefaultAdhocObjectFactory.java
(added)
+++ cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/DefaultAdhocObjectFactory.java
Tue Sep 13 10:02:54 2011
@@ -0,0 +1,181 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.di.spi;
+
+import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.di.AdhocObjectFactory;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.di.Injector;
+import org.apache.cayenne.di.Provider;
+
+/**
+ * A default implementation of {@link AdhocObjectFactory} that creates objects using
+ * default no-arg constructor and injects dependencies into annotated fields. Note that
+ * constructor injection is not supported by this factory.
+ * 
+ * @since 3.1
+ */
+public class DefaultAdhocObjectFactory implements AdhocObjectFactory {
+
+    @Inject
+    protected Injector injector;
+
+    public <T> T newInstance(Class<? super T> superType, String className) {
+
+        if (superType == null) {
+            throw new NullPointerException("Null superType");
+        }
+
+        if (className == null) {
+            throw new NullPointerException("Null className");
+        }
+
+        Class<T> type;
+        try {
+            type = (Class<T>)getJavaClass(className);
+        }
+        catch (ClassNotFoundException e) {
+            throw new CayenneRuntimeException(
+                    "Invalid class %s of type %s",
+                    e,
+                    className,
+                    superType.getName());
+        }
+
+        if (!superType.isAssignableFrom(type)) {
+            throw new CayenneRuntimeException(
+                    "Class %s is not assignable to %s",
+                    className,
+                    superType.getName());
+        }
+
+        T instance;
+        try {
+            Provider<T> provider0 = new ConstructorInjectingProvider<T>(type,
(DefaultInjector)injector);
+            Provider<T> provider1 = new FieldInjectingProvider<T>(provider0,
(DefaultInjector)injector);
+            instance = provider1.get();
+        }
+        catch (Exception e) {
+            throw new CayenneRuntimeException(
+                    "Error creating instance of class %s of type %s",
+                    e,
+                    className,
+                    superType.getName());
+        }
+
+        return instance;
+    }
+
+    public Class<?> getJavaClass(String className) throws ClassNotFoundException {
+
+        // is there a better way to get array class from string name?
+
+        if (className == null) {
+            throw new ClassNotFoundException("Null class name");
+        }
+
+        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+
+        if (classLoader == null) {
+            classLoader = DefaultAdhocObjectFactory.class.getClassLoader();
+        }
+
+        // use custom logic on failure only, assuming primitives and arrays are not that
+        // common
+        try {
+            return Class.forName(className, true, classLoader);
+        }
+        catch (ClassNotFoundException e) {
+            if (!className.endsWith("[]")) {
+                if ("byte".equals(className)) {
+                    return Byte.TYPE;
+                }
+                else if ("int".equals(className)) {
+                    return Integer.TYPE;
+                }
+                else if ("short".equals(className)) {
+                    return Short.TYPE;
+                }
+                else if ("char".equals(className)) {
+                    return Character.TYPE;
+                }
+                else if ("double".equals(className)) {
+                    return Double.TYPE;
+                }
+                else if ("long".equals(className)) {
+                    return Long.TYPE;
+                }
+                else if ("float".equals(className)) {
+                    return Float.TYPE;
+                }
+                else if ("boolean".equals(className)) {
+                    return Boolean.TYPE;
+                }
+                // try inner class often specified with "." instead of $
+                else {
+                    int dot = className.lastIndexOf('.');
+                    if (dot > 0 && dot + 1 < className.length()) {
+                        className = className.substring(0, dot)
+                                + "$"
+                                + className.substring(dot + 1);
+                        try {
+                            return Class.forName(className, true, classLoader);
+                        }
+                        catch (ClassNotFoundException nestedE) {
+                            // ignore, throw the original exception...
+                        }
+                    }
+                }
+
+                throw e;
+            }
+
+            if (className.length() < 3) {
+                throw new IllegalArgumentException("Invalid class name: " + className);
+            }
+
+            // TODO: support for multi-dim arrays
+            className = className.substring(0, className.length() - 2);
+
+            if ("byte".equals(className)) {
+                return byte[].class;
+            }
+            else if ("int".equals(className)) {
+                return int[].class;
+            }
+            else if ("short".equals(className)) {
+                return short[].class;
+            }
+            else if ("char".equals(className)) {
+                return char[].class;
+            }
+            else if ("double".equals(className)) {
+                return double[].class;
+            }
+            else if ("float".equals(className)) {
+                return float[].class;
+            }
+            else if ("boolean".equals(className)) {
+                return boolean[].class;
+            }
+
+            return Class.forName("[L" + className + ";", true, classLoader);
+        }
+    }
+}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java?rev=1170103&r1=1170102&r2=1170103&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
Tue Sep 13 10:02:54 2011
@@ -31,12 +31,12 @@ import org.apache.cayenne.access.DataNod
 import org.apache.cayenne.access.dbsync.SchemaUpdateStrategy;
 import org.apache.cayenne.cache.NestedQueryCache;
 import org.apache.cayenne.cache.QueryCache;
-import org.apache.cayenne.configuration.AdhocObjectFactory;
 import org.apache.cayenne.configuration.ConfigurationTree;
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.DataChannelDescriptorLoader;
 import org.apache.cayenne.configuration.DataChannelDescriptorMerger;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.Provider;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactory.java?rev=1170103&r1=1170102&r2=1170103&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactory.java
Tue Sep 13 10:02:54 2011
@@ -26,11 +26,11 @@ import java.util.List;
 import javax.sql.DataSource;
 
 import org.apache.cayenne.CayenneRuntimeException;
-import org.apache.cayenne.configuration.AdhocObjectFactory;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.dba.AutoAdapter;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.Provider;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DelegatingDataSourceFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DelegatingDataSourceFactory.java?rev=1170103&r1=1170102&r2=1170103&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DelegatingDataSourceFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DelegatingDataSourceFactory.java
Tue Sep 13 10:02:54 2011
@@ -25,9 +25,9 @@ import java.util.concurrent.ConcurrentHa
 import javax.sql.DataSource;
 
 import org.apache.cayenne.CayenneRuntimeException;
-import org.apache.cayenne.configuration.AdhocObjectFactory;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.configuration.RuntimeProperties;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.BeforeScopeEnd;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.spi.ScopeEventBinding;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java?rev=1170103&r1=1170102&r2=1170103&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java
Tue Sep 13 10:02:54 2011
@@ -29,12 +29,10 @@ import org.apache.cayenne.access.jdbc.De
 import org.apache.cayenne.ashwood.AshwoodEntitySorter;
 import org.apache.cayenne.cache.MapQueryCacheProvider;
 import org.apache.cayenne.cache.QueryCache;
-import org.apache.cayenne.configuration.AdhocObjectFactory;
 import org.apache.cayenne.configuration.ConfigurationNameMapper;
 import org.apache.cayenne.configuration.DataChannelDescriptorLoader;
 import org.apache.cayenne.configuration.DataChannelDescriptorMerger;
 import org.apache.cayenne.configuration.DataMapLoader;
-import org.apache.cayenne.configuration.DefaultAdhocObjectFactory;
 import org.apache.cayenne.configuration.DefaultConfigurationNameMapper;
 import org.apache.cayenne.configuration.DefaultDataChannelDescriptorMerger;
 import org.apache.cayenne.configuration.DefaultObjectStoreFactory;
@@ -57,9 +55,11 @@ import org.apache.cayenne.dba.postgres.P
 import org.apache.cayenne.dba.sqlite.SQLiteSniffer;
 import org.apache.cayenne.dba.sqlserver.SQLServerSniffer;
 import org.apache.cayenne.dba.sybase.SybaseSniffer;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.ListBuilder;
 import org.apache.cayenne.di.Module;
+import org.apache.cayenne.di.spi.DefaultAdhocObjectFactory;
 import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.event.EventManager;
 import org.apache.cayenne.log.CommonsJdbcEventLogger;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/util/Util.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/util/Util.java?rev=1170103&r1=1170102&r2=1170103&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/util/Util.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/util/Util.java
Tue Sep 13 10:02:54 2011
@@ -57,6 +57,7 @@ import javax.xml.parsers.SAXParserFactor
 import org.apache.cayenne.Cayenne;
 import org.apache.cayenne.PersistenceState;
 import org.apache.cayenne.Persistent;
+import org.apache.cayenne.di.spi.DefaultAdhocObjectFactory;
 import org.apache.cayenne.reflect.ArcProperty;
 import org.apache.cayenne.reflect.AttributeProperty;
 import org.apache.cayenne.reflect.PropertyVisitor;
@@ -69,6 +70,12 @@ import org.xml.sax.XMLReader;
  * Contains various unorganized static utility methods used across Cayenne.
  */
 public class Util {
+    
+    private static DefaultAdhocObjectFactory objectFactory;
+    
+    static {
+        objectFactory = new DefaultAdhocObjectFactory();
+    }
 
     /**
      * Converts URL to file. Throws {@link IllegalArgumentException} if the URL is not a
@@ -644,100 +651,7 @@ public class Util {
      * @since 1.2
      */
     public static Class<?> getJavaClass(String className) throws ClassNotFoundException
{
-
-        // is there a better way to get array class from string name?
-
-        if (className == null) {
-            throw new ClassNotFoundException("Null class name");
-        }
-
-        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-
-        if (classLoader == null) {
-            classLoader = Util.class.getClassLoader();
-        }
-
-        // use custom logic on failure only, assuming primitives and arrays are not that
-        // common
-        try {
-            return Class.forName(className, true, classLoader);
-        }
-        catch (ClassNotFoundException e) {
-            if (!className.endsWith("[]")) {
-                if ("byte".equals(className)) {
-                    return Byte.TYPE;
-                }
-                else if ("int".equals(className)) {
-                    return Integer.TYPE;
-                }
-                else if ("short".equals(className)) {
-                    return Short.TYPE;
-                }
-                else if ("char".equals(className)) {
-                    return Character.TYPE;
-                }
-                else if ("double".equals(className)) {
-                    return Double.TYPE;
-                }
-                else if ("long".equals(className)) {
-                    return Long.TYPE;
-                }
-                else if ("float".equals(className)) {
-                    return Float.TYPE;
-                }
-                else if ("boolean".equals(className)) {
-                    return Boolean.TYPE;
-                }
-                // try inner class often specified with "." instead of $
-                else {
-                    int dot = className.lastIndexOf('.');
-                    if (dot > 0 && dot + 1 < className.length()) {
-                        className = className.substring(0, dot)
-                                + "$"
-                                + className.substring(dot + 1);
-                        try {
-                            return Class.forName(className, true, classLoader);
-                        }
-                        catch (ClassNotFoundException nestedE) {
-                            // ignore, throw the original exception...
-                        }
-                    }
-                }
-
-                throw e;
-            }
-
-            if (className.length() < 3) {
-                throw new IllegalArgumentException("Invalid class name: " + className);
-            }
-
-            // TODO: support for multi-dim arrays
-            className = className.substring(0, className.length() - 2);
-
-            if ("byte".equals(className)) {
-                return byte[].class;
-            }
-            else if ("int".equals(className)) {
-                return int[].class;
-            }
-            else if ("short".equals(className)) {
-                return short[].class;
-            }
-            else if ("char".equals(className)) {
-                return char[].class;
-            }
-            else if ("double".equals(className)) {
-                return double[].class;
-            }
-            else if ("float".equals(className)) {
-                return float[].class;
-            }
-            else if ("boolean".equals(className)) {
-                return boolean[].class;
-            }
-
-            return Class.forName("[L" + className + ";", true, classLoader);
-        }
+        return objectFactory.getJavaClass(className);
     }
 
     static void setReverse(

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java?rev=1170103&r1=1170102&r2=1170103&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
Tue Sep 13 10:02:54 2011
@@ -36,23 +36,23 @@ import org.apache.cayenne.access.dbsync.
 import org.apache.cayenne.access.dbsync.ThrowOnPartialOrCreateSchemaStrategy;
 import org.apache.cayenne.ashwood.AshwoodEntitySorter;
 import org.apache.cayenne.cache.QueryCache;
-import org.apache.cayenne.configuration.AdhocObjectFactory;
 import org.apache.cayenne.configuration.ConfigurationNameMapper;
 import org.apache.cayenne.configuration.ConfigurationTree;
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.DataChannelDescriptorLoader;
 import org.apache.cayenne.configuration.DataChannelDescriptorMerger;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
-import org.apache.cayenne.configuration.DefaultAdhocObjectFactory;
 import org.apache.cayenne.configuration.DefaultConfigurationNameMapper;
 import org.apache.cayenne.configuration.DefaultDataChannelDescriptorMerger;
 import org.apache.cayenne.configuration.mock.MockDataSourceFactory;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.oracle.OracleAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.Module;
+import org.apache.cayenne.di.spi.DefaultAdhocObjectFactory;
 import org.apache.cayenne.event.EventManager;
 import org.apache.cayenne.event.MockEventManager;
 import org.apache.cayenne.log.CommonsJdbcEventLogger;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDataSourceFactoryLoaderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDataSourceFactoryLoaderTest.java?rev=1170103&r1=1170102&r2=1170103&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDataSourceFactoryLoaderTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDataSourceFactoryLoaderTest.java
Tue Sep 13 10:02:54 2011
@@ -22,17 +22,17 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 import junit.framework.TestCase;
 
-import org.apache.cayenne.configuration.AdhocObjectFactory;
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
-import org.apache.cayenne.configuration.DefaultAdhocObjectFactory;
 import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.configuration.mock.MockDataSourceFactory1;
 import org.apache.cayenne.conn.DataSourceInfo;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.Module;
+import org.apache.cayenne.di.spi.DefaultAdhocObjectFactory;
 import org.apache.cayenne.log.CommonsJdbcEventLogger;
 import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.resource.ResourceLocator;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java?rev=1170103&r1=1170102&r2=1170103&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
Tue Sep 13 10:02:54 2011
@@ -30,16 +30,16 @@ import java.util.List;
 import junit.framework.TestCase;
 
 import org.apache.cayenne.access.jdbc.BatchQueryBuilderFactory;
-import org.apache.cayenne.configuration.AdhocObjectFactory;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
-import org.apache.cayenne.configuration.DefaultAdhocObjectFactory;
 import org.apache.cayenne.dba.AutoAdapter;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.sybase.SybaseAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.Module;
+import org.apache.cayenne.di.spi.DefaultAdhocObjectFactory;
 import org.apache.cayenne.log.CommonsJdbcEventLogger;
 import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.DbEntity;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDbAdapterProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDbAdapterProvider.java?rev=1170103&r1=1170102&r2=1170103&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDbAdapterProvider.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDbAdapterProvider.java
Tue Sep 13 10:02:54 2011
@@ -19,10 +19,10 @@
 package org.apache.cayenne.unit.di.server;
 
 import org.apache.cayenne.ConfigurationException;
-import org.apache.cayenne.configuration.AdhocObjectFactory;
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.Provider;
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java?rev=1170103&r1=1170102&r2=1170103&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
Tue Sep 13 10:02:54 2011
@@ -26,8 +26,6 @@ import org.apache.cayenne.access.DataNod
 import org.apache.cayenne.access.DefaultObjectMapRetainStrategy;
 import org.apache.cayenne.access.ObjectMapRetainStrategy;
 import org.apache.cayenne.access.jdbc.BatchQueryBuilderFactory;
-import org.apache.cayenne.configuration.AdhocObjectFactory;
-import org.apache.cayenne.configuration.DefaultAdhocObjectFactory;
 import org.apache.cayenne.configuration.DefaultObjectStoreFactory;
 import org.apache.cayenne.configuration.DefaultRuntimeProperties;
 import org.apache.cayenne.configuration.ObjectStoreFactory;
@@ -50,8 +48,10 @@ import org.apache.cayenne.dba.postgres.P
 import org.apache.cayenne.dba.sqlite.SQLiteAdapter;
 import org.apache.cayenne.dba.sqlserver.SQLServerAdapter;
 import org.apache.cayenne.dba.sybase.SybaseAdapter;
+import org.apache.cayenne.di.AdhocObjectFactory;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.Module;
+import org.apache.cayenne.di.spi.DefaultAdhocObjectFactory;
 import org.apache.cayenne.di.spi.DefaultScope;
 import org.apache.cayenne.log.CommonsJdbcEventLogger;
 import org.apache.cayenne.log.JdbcEventLogger;



Mime
View raw message