cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [1/5] cayenne git commit: CAY-2165 Explicit "contribution" API for easier expansion of DI collections and maps
Date Sun, 11 Dec 2016 12:13:57 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master dba3dc4b4 -> 22f6bd256


CAY-2165 Explicit "contribution" API for easier expansion of DI collections and maps


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/850eb19a
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/850eb19a
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/850eb19a

Branch: refs/heads/master
Commit: 850eb19a97ab2e3f862b0e0fd4a3b936bc9a320c
Parents: dba3dc4
Author: Andrus Adamchik <andrus@objectstyle.com>
Authored: Sun Dec 11 14:49:30 2016 +0300
Committer: Andrus Adamchik <andrus@objectstyle.com>
Committed: Sun Dec 11 14:49:30 2016 +0300

----------------------------------------------------------------------
 .../cayenne/java8/CayenneJava8Module.java       |   4 +-
 .../apache/cayenne/joda/CayenneJodaModule.java  |  20 +-
 .../configuration/server/ServerModule.java      | 233 ++++++++++---------
 .../server/DataDomainProviderTest.java          |   4 +-
 .../server/DefaultDbAdapterFactoryTest.java     |   8 +-
 .../unit/di/server/ServerCaseModule.java        |   4 +-
 .../tools/configuration/ToolsModule.java        |   5 +-
 7 files changed, 144 insertions(+), 134 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/850eb19a/cayenne-java8/src/main/java/org/apache/cayenne/java8/CayenneJava8Module.java
----------------------------------------------------------------------
diff --git a/cayenne-java8/src/main/java/org/apache/cayenne/java8/CayenneJava8Module.java
b/cayenne-java8/src/main/java/org/apache/cayenne/java8/CayenneJava8Module.java
index 563c3c0..7a565a6 100644
--- a/cayenne-java8/src/main/java/org/apache/cayenne/java8/CayenneJava8Module.java
+++ b/cayenne-java8/src/main/java/org/apache/cayenne/java8/CayenneJava8Module.java
@@ -20,6 +20,7 @@
 package org.apache.cayenne.java8;
 
 import org.apache.cayenne.configuration.Constants;
+import org.apache.cayenne.configuration.server.ServerModule;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.Module;
 import org.apache.cayenne.java8.access.types.LocalDateTimeType;
@@ -33,8 +34,7 @@ public class CayenneJava8Module implements Module {
 
     @Override
     public void configure(Binder binder) {
-        binder
-                .bindList(Constants.SERVER_DEFAULT_TYPES_LIST)
+        ServerModule.contributeDefaultExtendedTypes(binder)
                 .add(new LocalDateType())
                 .add(new LocalTimeType())
                 .add(new LocalDateTimeType());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/850eb19a/cayenne-joda/src/main/java/org/apache/cayenne/joda/CayenneJodaModule.java
----------------------------------------------------------------------
diff --git a/cayenne-joda/src/main/java/org/apache/cayenne/joda/CayenneJodaModule.java b/cayenne-joda/src/main/java/org/apache/cayenne/joda/CayenneJodaModule.java
index d37e994..0d88053 100644
--- a/cayenne-joda/src/main/java/org/apache/cayenne/joda/CayenneJodaModule.java
+++ b/cayenne-joda/src/main/java/org/apache/cayenne/joda/CayenneJodaModule.java
@@ -22,6 +22,7 @@ package org.apache.cayenne.joda;
  */
 
 import org.apache.cayenne.configuration.Constants;
+import org.apache.cayenne.configuration.server.ServerModule;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.Module;
 import org.apache.cayenne.joda.access.types.DateTimeType;
@@ -32,17 +33,20 @@ import org.apache.cayenne.joda.access.types.LocalTimeType;
 /**
  * Include this module when creating a ServerRuntime in order to add support for
  * joda-time ObjAttributes.
- * 
+ *
  * @since 4.0
  */
 public class CayenneJodaModule implements Module {
 
-	public CayenneJodaModule() {
-	}
+    public CayenneJodaModule() {
+    }
 
-	@Override
-	public void configure(Binder binder) {
-		binder.bindList(Constants.SERVER_DEFAULT_TYPES_LIST).add(new DateTimeType()).add(new LocalDateType())
-				.add(new LocalTimeType()).add(new LocalDateTimeType());
-	}
+    @Override
+    public void configure(Binder binder) {
+        ServerModule.contributeDefaultExtendedTypes(binder)
+                .add(new DateTimeType())
+                .add(new LocalDateType())
+                .add(new LocalTimeType())
+                .add(new LocalDateTimeType());
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/850eb19a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java
b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java
index 286edce..5f188de 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java
@@ -31,24 +31,7 @@ import org.apache.cayenne.access.translator.batch.BatchTranslatorFactory;
 import org.apache.cayenne.access.translator.batch.DefaultBatchTranslatorFactory;
 import org.apache.cayenne.access.translator.select.DefaultSelectTranslatorFactory;
 import org.apache.cayenne.access.translator.select.SelectTranslatorFactory;
-import org.apache.cayenne.access.types.BigDecimalType;
-import org.apache.cayenne.access.types.BigIntegerType;
-import org.apache.cayenne.access.types.BooleanType;
-import org.apache.cayenne.access.types.ByteArrayType;
-import org.apache.cayenne.access.types.ByteType;
-import org.apache.cayenne.access.types.CalendarType;
-import org.apache.cayenne.access.types.CharType;
-import org.apache.cayenne.access.types.DateType;
-import org.apache.cayenne.access.types.DoubleType;
-import org.apache.cayenne.access.types.FloatType;
-import org.apache.cayenne.access.types.IntegerType;
-import org.apache.cayenne.access.types.LongType;
-import org.apache.cayenne.access.types.ShortType;
-import org.apache.cayenne.access.types.TimeType;
-import org.apache.cayenne.access.types.TimestampType;
-import org.apache.cayenne.access.types.UUIDType;
-import org.apache.cayenne.access.types.UtilDateType;
-import org.apache.cayenne.access.types.VoidType;
+import org.apache.cayenne.access.types.*;
 import org.apache.cayenne.ashwood.AshwoodEntitySorter;
 import org.apache.cayenne.cache.MapQueryCacheProvider;
 import org.apache.cayenne.cache.QueryCache;
@@ -107,130 +90,152 @@ import java.util.GregorianCalendar;
 
 /**
  * A DI module containing all Cayenne server runtime configuration.
- * 
+ *
  * @since 3.1
  */
 public class ServerModule implements Module {
 
-	private static final int DEFAULT_MAX_ID_QUALIFIER_SIZE = 10000;
-
-	protected String[] configurationLocations;
-
-	/**
-	 * Creates a ServerModule with at least one configuration location. For
-	 * multi-module projects additional locations can be specified as well.
-	 */
-	public ServerModule(String... configurationLocations) {
-
-		if (configurationLocations == null) {
-			configurationLocations = new String[0];
-		}
-
-		this.configurationLocations = configurationLocations;
-	}
-
-	public void configure(Binder binder) {
-
-		// configure global stack properties
-		binder.bindMap(Constants.PROPERTIES_MAP).put(Constants.SERVER_MAX_ID_QUALIFIER_SIZE_PROPERTY,
-				String.valueOf(DEFAULT_MAX_ID_QUALIFIER_SIZE));
-
-		binder.bind(JdbcEventLogger.class).to(CommonsJdbcEventLogger.class);
-		binder.bind(ClassLoaderManager.class).to(DefaultClassLoaderManager.class);
-		binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
-
-		// configure known DbAdapter detectors in reverse order of popularity.
-		// Users can
-		// add their own to install custom adapters automatically
-
-		binder.bindList(Constants.SERVER_ADAPTER_DETECTORS_LIST).add(FirebirdSniffer.class).add(OpenBaseSniffer.class)
-				.add(FrontBaseSniffer.class).add(IngresSniffer.class).add(SQLiteSniffer.class).add(DB2Sniffer.class)
-				.add(H2Sniffer.class).add(HSQLDBSniffer.class).add(SybaseSniffer.class).add(DerbySniffer.class)
-				.add(SQLServerSniffer.class).add(OracleSniffer.class).add(PostgresSniffer.class)
-				.add(MySQLSniffer.class);
-
-		// configure a filter chain with only one TransactionFilter as default
-		binder.bindList(Constants.SERVER_DOMAIN_FILTERS_LIST)
+    private static final int DEFAULT_MAX_ID_QUALIFIER_SIZE = 10000;
+
+    protected String[] configurationLocations;
+
+    /**
+     * Provides access to a DI collection builder for default adapter-agnostic {@link ExtendedType}'s.
+     *
+     * @param binder DI binder passed to the module during injector startup.
+     * @return ListBuilder for ExtendedTypes.
+     * @since 4.0
+     */
+    public static ListBuilder<ExtendedType> contributeDefaultExtendedTypes(Binder binder)
{
+        return binder.bindList(Constants.SERVER_DEFAULT_TYPES_LIST);
+    }
+
+    /**
+     * Provides access to a DI collection builder for user-provided {@link ExtendedType}'s.
+     *
+     * @param binder DI binder passed to the module during injector startup.
+     * @return ListBuilder for ExtendedTypes.
+     * @since 4.0
+     */
+    public static ListBuilder<ExtendedType> contributeUserExtendedTypes(Binder binder)
{
+        return binder.bindList(Constants.SERVER_USER_TYPES_LIST);
+    }
+
+    /**
+     * Creates a ServerModule with at least one configuration location. For
+     * multi-module projects additional locations can be specified as well.
+     */
+    public ServerModule(String... configurationLocations) {
+
+        if (configurationLocations == null) {
+            configurationLocations = new String[0];
+        }
+
+        this.configurationLocations = configurationLocations;
+    }
+
+    public void configure(Binder binder) {
+
+        // configure global stack properties
+        binder.bindMap(Constants.PROPERTIES_MAP).put(Constants.SERVER_MAX_ID_QUALIFIER_SIZE_PROPERTY,
+                String.valueOf(DEFAULT_MAX_ID_QUALIFIER_SIZE));
+
+        binder.bind(JdbcEventLogger.class).to(CommonsJdbcEventLogger.class);
+        binder.bind(ClassLoaderManager.class).to(DefaultClassLoaderManager.class);
+        binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
+
+        // configure known DbAdapter detectors in reverse order of popularity.
+        // Users can
+        // add their own to install custom adapters automatically
+
+        binder.bindList(Constants.SERVER_ADAPTER_DETECTORS_LIST).add(FirebirdSniffer.class).add(OpenBaseSniffer.class)
+                .add(FrontBaseSniffer.class).add(IngresSniffer.class).add(SQLiteSniffer.class).add(DB2Sniffer.class)
+                .add(H2Sniffer.class).add(HSQLDBSniffer.class).add(SybaseSniffer.class).add(DerbySniffer.class)
+                .add(SQLServerSniffer.class).add(OracleSniffer.class).add(PostgresSniffer.class)
+                .add(MySQLSniffer.class);
+
+        // configure a filter chain with only one TransactionFilter as default
+        binder.bindList(Constants.SERVER_DOMAIN_FILTERS_LIST)
                 .add(TransactionFilter.class);
 
-		// configure extended types
-		binder.bindList(Constants.SERVER_DEFAULT_TYPES_LIST).add(new VoidType()).add(new BigDecimalType())
-				.add(new BigIntegerType()).add(new BooleanType()).add(new ByteArrayType(false, true))
-				.add(new ByteType(false)).add(new CharType(false, true)).add(new DateType()).add(new
DoubleType())
-				.add(new FloatType()).add(new IntegerType()).add(new LongType()).add(new ShortType(false))
-				.add(new TimeType()).add(new TimestampType()).add(new UtilDateType())
-				.add(new CalendarType<GregorianCalendar>(GregorianCalendar.class))
-				.add(new CalendarType<Calendar>(Calendar.class)).add(new UUIDType());
-		binder.bindList(Constants.SERVER_USER_TYPES_LIST);
-		binder.bindList(Constants.SERVER_TYPE_FACTORIES_LIST);
+        // configure extended types
+        contributeDefaultExtendedTypes(binder).add(new VoidType()).add(new BigDecimalType())
+                .add(new BigIntegerType()).add(new BooleanType()).add(new ByteArrayType(false,
true))
+                .add(new ByteType(false)).add(new CharType(false, true)).add(new DateType()).add(new
DoubleType())
+                .add(new FloatType()).add(new IntegerType()).add(new LongType()).add(new
ShortType(false))
+                .add(new TimeType()).add(new TimestampType()).add(new UtilDateType())
+                .add(new CalendarType<GregorianCalendar>(GregorianCalendar.class))
+                .add(new CalendarType<Calendar>(Calendar.class)).add(new UUIDType());
+        contributeUserExtendedTypes(binder);
+        binder.bindList(Constants.SERVER_TYPE_FACTORIES_LIST);
 
-		// configure explicit configurations
-		ListBuilder<Object> locationsListBuilder = binder.bindList(Constants.SERVER_PROJECT_LOCATIONS_LIST);
-		for (String location : configurationLocations) {
-			locationsListBuilder.add(location);
-		}
+        // configure explicit configurations
+        ListBuilder<Object> locationsListBuilder = binder.bindList(Constants.SERVER_PROJECT_LOCATIONS_LIST);
+        for (String location : configurationLocations) {
+            locationsListBuilder.add(location);
+        }
 
-		binder.bind(ConfigurationNameMapper.class).to(DefaultConfigurationNameMapper.class);
+        binder.bind(ConfigurationNameMapper.class).to(DefaultConfigurationNameMapper.class);
 
-		binder.bind(EventManager.class).to(DefaultEventManager.class);
+        binder.bind(EventManager.class).to(DefaultEventManager.class);
 
-		binder.bind(QueryCache.class).toProvider(MapQueryCacheProvider.class);
+        binder.bind(QueryCache.class).toProvider(MapQueryCacheProvider.class);
 
-		// a service to provide the main stack DataDomain
-		binder.bind(DataDomain.class).toProvider(DataDomainProvider.class);
+        // a service to provide the main stack DataDomain
+        binder.bind(DataDomain.class).toProvider(DataDomainProvider.class);
 
-		binder.bind(DataNodeFactory.class).to(DefaultDataNodeFactory.class);
+        binder.bind(DataNodeFactory.class).to(DefaultDataNodeFactory.class);
 
-		// will return DataDomain for request for a DataChannel
-		binder.bind(DataChannel.class).toProvider(DomainDataChannelProvider.class);
+        // will return DataDomain for request for a DataChannel
+        binder.bind(DataChannel.class).toProvider(DomainDataChannelProvider.class);
 
-		binder.bind(ObjectContextFactory.class).to(DataContextFactory.class);
+        binder.bind(ObjectContextFactory.class).to(DataContextFactory.class);
 
-		binder.bind(TransactionFactory.class).to(DefaultTransactionFactory.class);
+        binder.bind(TransactionFactory.class).to(DefaultTransactionFactory.class);
 
-		// a service to load project XML descriptors
-		binder.bind(DataChannelDescriptorLoader.class).to(XMLDataChannelDescriptorLoader.class);
-		binder.bind(DataChannelDescriptorMerger.class).to(DefaultDataChannelDescriptorMerger.class);
+        // a service to load project XML descriptors
+        binder.bind(DataChannelDescriptorLoader.class).to(XMLDataChannelDescriptorLoader.class);
+        binder.bind(DataChannelDescriptorMerger.class).to(DefaultDataChannelDescriptorMerger.class);
 
-		// a service to load DataMap XML descriptors
-		binder.bind(DataMapLoader.class).to(XMLDataMapLoader.class);
+        // a service to load DataMap XML descriptors
+        binder.bind(DataMapLoader.class).to(XMLDataMapLoader.class);
 
-		// a locator of resources, such as XML descriptors
+        // a locator of resources, such as XML descriptors
         binder.bind(ResourceLocator.class).to(ClassLoaderResourceLocator.class);
         binder.bind(Key.get(ResourceLocator.class, Constants.SERVER_RESOURCE_LOCATOR)).to(ClassLoaderResourceLocator.class);
 
-		// a global properties object
-		binder.bind(RuntimeProperties.class).to(DefaultRuntimeProperties.class);
+        // a global properties object
+        binder.bind(RuntimeProperties.class).to(DefaultRuntimeProperties.class);
 
-		// a service to load DataSourceFactories. DelegatingDataSourceFactory
-		// will attempt to find the actual worker factory dynamically on each
-		// call depending on DataNodeDescriptor data and the environment
-		binder.bind(DataSourceFactory.class).to(DelegatingDataSourceFactory.class);
+        // a service to load DataSourceFactories. DelegatingDataSourceFactory
+        // will attempt to find the actual worker factory dynamically on each
+        // call depending on DataNodeDescriptor data and the environment
+        binder.bind(DataSourceFactory.class).to(DelegatingDataSourceFactory.class);
 
-		binder.bind(SchemaUpdateStrategyFactory.class).to(DefaultSchemaUpdateStrategyFactory.class);
+        binder.bind(SchemaUpdateStrategyFactory.class).to(DefaultSchemaUpdateStrategyFactory.class);
 
-		// a default DBAdapterFactory used to load custom and automatic
-		// DbAdapters
-		binder.bind(DbAdapterFactory.class).to(DefaultDbAdapterFactory.class);
+        // a default DBAdapterFactory used to load custom and automatic
+        // DbAdapters
+        binder.bind(DbAdapterFactory.class).to(DefaultDbAdapterFactory.class);
 
-		// binding AshwoodEntitySorter without scope, as this is a stateful
-		// object and is
-		// configured by the owning domain
-		binder.bind(EntitySorter.class).to(AshwoodEntitySorter.class).withoutScope();
+        // binding AshwoodEntitySorter without scope, as this is a stateful
+        // object and is
+        // configured by the owning domain
+        binder.bind(EntitySorter.class).to(AshwoodEntitySorter.class).withoutScope();
 
-		binder.bind(BatchTranslatorFactory.class).to(DefaultBatchTranslatorFactory.class);
-		binder.bind(SelectTranslatorFactory.class).to(DefaultSelectTranslatorFactory.class);
+        binder.bind(BatchTranslatorFactory.class).to(DefaultBatchTranslatorFactory.class);
+        binder.bind(SelectTranslatorFactory.class).to(DefaultSelectTranslatorFactory.class);
 
-		// a default ObjectMapRetainStrategy used to create objects map for
-		// ObjectStore
-		binder.bind(ObjectMapRetainStrategy.class).to(DefaultObjectMapRetainStrategy.class);
+        // a default ObjectMapRetainStrategy used to create objects map for
+        // ObjectStore
+        binder.bind(ObjectMapRetainStrategy.class).to(DefaultObjectMapRetainStrategy.class);
 
-		// a default ObjectStoreFactory used to create ObjectStores for contexts
-		binder.bind(ObjectStoreFactory.class).to(DefaultObjectStoreFactory.class);
+        // a default ObjectStoreFactory used to create ObjectStores for contexts
+        binder.bind(ObjectStoreFactory.class).to(DefaultObjectStoreFactory.class);
 
-		binder.bind(TransactionManager.class).to(DefaultTransactionManager.class);
-		binder.bind(RowReaderFactory.class).to(DefaultRowReaderFactory.class);
+        binder.bind(TransactionManager.class).to(DefaultTransactionManager.class);
+        binder.bind(RowReaderFactory.class).to(DefaultRowReaderFactory.class);
 
-		binder.bind(SQLTemplateProcessor.class).to(VelocitySQLTemplateProcessor.class);
-	}
+        binder.bind(SQLTemplateProcessor.class).to(VelocitySQLTemplateProcessor.class);
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/850eb19a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
index b8f4f7e..aa85465 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
@@ -152,8 +152,8 @@ public class DataDomainProviderTest {
 				binder.bindList(Constants.SERVER_PROJECT_LOCATIONS_LIST).add(testConfigName);
 
 				// configure extended types
-				binder.bindList(Constants.SERVER_DEFAULT_TYPES_LIST);
-				binder.bindList(Constants.SERVER_USER_TYPES_LIST);
+				ServerModule.contributeDefaultExtendedTypes(binder);
+				ServerModule.contributeUserExtendedTypes(binder);
 				binder.bindList(Constants.SERVER_TYPE_FACTORIES_LIST);
 
 				binder.bind(EventManager.class).toInstance(eventManager);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/850eb19a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
index e3621d7..d2f8dc3 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
@@ -108,8 +108,8 @@ public class DefaultDbAdapterFactoryTest {
 
             public void configure(Binder binder) {
                 binder.bindMap(Constants.PROPERTIES_MAP);
-                binder.bindList(Constants.SERVER_DEFAULT_TYPES_LIST);
-                binder.bindList(Constants.SERVER_USER_TYPES_LIST);
+                ServerModule.contributeDefaultExtendedTypes(binder);
+                ServerModule.contributeUserExtendedTypes(binder);
                 binder.bindList(Constants.SERVER_TYPE_FACTORIES_LIST);
 
                 binder.bind(JdbcEventLogger.class).to(CommonsJdbcEventLogger.class);
@@ -145,8 +145,8 @@ public class DefaultDbAdapterFactoryTest {
 
             public void configure(Binder binder) {
                 binder.bindMap(Constants.PROPERTIES_MAP);
-                binder.bindList(Constants.SERVER_DEFAULT_TYPES_LIST);
-                binder.bindList(Constants.SERVER_USER_TYPES_LIST);
+                ServerModule.contributeDefaultExtendedTypes(binder);
+                ServerModule.contributeUserExtendedTypes(binder);
                 binder.bindList(Constants.SERVER_TYPE_FACTORIES_LIST);
 
                 binder.bind(JdbcEventLogger.class).to(CommonsJdbcEventLogger.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/850eb19a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
index abe2a2e..c4475dd 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseModule.java
@@ -52,6 +52,7 @@ import org.apache.cayenne.configuration.ObjectStoreFactory;
 import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.configuration.XMLDataMapLoader;
 import org.apache.cayenne.configuration.server.DataSourceFactory;
+import org.apache.cayenne.configuration.server.ServerModule;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.dba.DbAdapter;
@@ -157,8 +158,7 @@ public class ServerCaseModule implements Module {
         binder.bindMap(Constants.PROPERTIES_MAP);
         
         // configure extended types
-        binder
-                .bindList(Constants.SERVER_DEFAULT_TYPES_LIST)
+        ServerModule.contributeDefaultExtendedTypes(binder)
                 .add(new VoidType())
                 .add(new BigDecimalType())
                 .add(new BigIntegerType())

http://git-wip-us.apache.org/repos/asf/cayenne/blob/850eb19a/cayenne-tools/src/main/java/org/apache/cayenne/tools/configuration/ToolsModule.java
----------------------------------------------------------------------
diff --git a/cayenne-tools/src/main/java/org/apache/cayenne/tools/configuration/ToolsModule.java
b/cayenne-tools/src/main/java/org/apache/cayenne/tools/configuration/ToolsModule.java
index b800ea2..ef8b048 100644
--- a/cayenne-tools/src/main/java/org/apache/cayenne/tools/configuration/ToolsModule.java
+++ b/cayenne-tools/src/main/java/org/apache/cayenne/tools/configuration/ToolsModule.java
@@ -26,6 +26,7 @@ import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.configuration.server.DataSourceFactory;
 import org.apache.cayenne.configuration.server.DbAdapterFactory;
 import org.apache.cayenne.configuration.server.DefaultDbAdapterFactory;
+import org.apache.cayenne.configuration.server.ServerModule;
 import org.apache.cayenne.dba.db2.DB2Sniffer;
 import org.apache.cayenne.dba.derby.DerbySniffer;
 import org.apache.cayenne.dba.firebird.FirebirdSniffer;
@@ -79,8 +80,8 @@ public class ToolsModule implements Module {
         // configure empty global stack properties
         binder.bindMap(Constants.PROPERTIES_MAP);
 
-        binder.bindList(Constants.SERVER_DEFAULT_TYPES_LIST);
-        binder.bindList(Constants.SERVER_USER_TYPES_LIST);
+        ServerModule.contributeDefaultExtendedTypes(binder);
+        ServerModule.contributeUserExtendedTypes(binder);
         binder.bindList(Constants.SERVER_TYPE_FACTORIES_LIST);
 
         binder.bind(ClassLoaderManager.class).to(DefaultClassLoaderManager.class);


Mime
View raw message