polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [1/3] polygene-java git commit: Remove ValueSerialization “type finder” concept as there’s no implementation behind it
Date Fri, 03 Feb 2017 07:57:40 GMT
Repository: polygene-java
Updated Branches:
  refs/heads/develop b61d0254f -> 9d16d5553


Remove ValueSerialization “type finder” concept as there’s no implementation behind
it

No use of the meta info Function at all.

ValueDeserializer API takes the module to use as a parameter.


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/b675c1a5
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/b675c1a5
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/b675c1a5

Branch: refs/heads/develop
Commit: b675c1a5cb0d9ffb15fdb8e5ca233ad147215281
Parents: b61d025
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sun Jan 15 20:01:48 2017 +0100
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sun Jan 15 20:02:24 2017 +0100

----------------------------------------------------------------------
 .../api/value/DocumentationSupport.java         | 10 --------
 .../JacksonValueSerializationAssembler.java     | 27 +++-----------------
 .../OrgJsonValueSerializationAssembler.java     | 27 +++-----------------
 .../stax/StaxValueSerializationAssembler.java   | 27 +++-----------------
 .../restlet/assembly/domain/DomainLayer.java    |  8 ------
 .../infrastructue/InfrastructureLayer.java      | 13 +++-------
 .../infrastructue/SerializationModule.java      | 10 --------
 .../sample/forum/assembler/ForumAssembler.java  |  1 -
 .../rental/web/assembly/StorageModule.java      |  1 -
 .../app/templates/DomainLayer/bootstrap.tmpl    |  8 ------
 .../app/templates/Heroes/bootstrap.tmpl         |  7 +----
 .../InfrastructureLayer/bootstrap.tmpl          |  9 ++-----
 .../JacksonSerializationModule/bootstrap.tmpl   | 10 --------
 .../common/ApplicationAssemblerWriter.java      |  6 +----
 .../project/common/DomainLayerWriter.java       |  8 ------
 .../common/InfrastructureLayerWriter.java       |  9 ++-----
 .../common/SerializationModuleWriter.java       | 10 --------
 17 files changed, 18 insertions(+), 173 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java
b/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java
index 67abae9..c822f68 100644
--- a/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java
+++ b/core/api/src/test/java/org/apache/polygene/api/value/DocumentationSupport.java
@@ -229,17 +229,7 @@ public class DocumentationSupport
                         {
                             servicesModule -> {
                                 servicesModule.setName( "SERVICES-Module" );
-
-                                Function<Application, Module> valuesModuleFinder =
new Function<Application, Module>()
-                                {
-                                    @Override
-                                    public Module apply( Application app1 )
-                                    {
-                                        return app1.findModule( "SINGLE-Layer", "VALUES-Module"
);
-                                    }
-                                };
                                 new OrgJsonValueSerializationAssembler().
-                                    withValuesModuleFinder( valuesModuleFinder ).
                                     assemble( servicesModule );
                             }
                         }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/extensions/valueserialization-jackson/src/main/java/org/apache/polygene/valueserialization/jackson/JacksonValueSerializationAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/valueserialization-jackson/src/main/java/org/apache/polygene/valueserialization/jackson/JacksonValueSerializationAssembler.java
b/extensions/valueserialization-jackson/src/main/java/org/apache/polygene/valueserialization/jackson/JacksonValueSerializationAssembler.java
index 9382581..8f6421d 100644
--- a/extensions/valueserialization-jackson/src/main/java/org/apache/polygene/valueserialization/jackson/JacksonValueSerializationAssembler.java
+++ b/extensions/valueserialization-jackson/src/main/java/org/apache/polygene/valueserialization/jackson/JacksonValueSerializationAssembler.java
@@ -19,9 +19,6 @@
  */
 package org.apache.polygene.valueserialization.jackson;
 
-import java.util.function.Function;
-import org.apache.polygene.api.structure.Application;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.api.value.ValueSerialization;
 import org.apache.polygene.bootstrap.Assemblers;
 import org.apache.polygene.bootstrap.AssemblyException;
@@ -33,30 +30,12 @@ import org.apache.polygene.bootstrap.ModuleAssembly;
 public class JacksonValueSerializationAssembler
     extends Assemblers.Visibility<JacksonValueSerializationAssembler>
 {
-    private Function<Application, Module> valuesModuleFinder;
-
-    public JacksonValueSerializationAssembler withValuesModuleFinder( Function<Application,
Module> valuesModuleFinder )
-    {
-        this.valuesModuleFinder = valuesModuleFinder;
-        return this;
-    }
-
     @Override
     public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
-        if( valuesModuleFinder == null )
-        {
-            module.services( JacksonValueSerializationService.class ).
-                visibleIn( visibility() ).
-                taggedWith( ValueSerialization.Formats.JSON );
-        }
-        else
-        {
-            module.services( JacksonValueSerializationService.class ).
-                visibleIn( visibility() ).
-                taggedWith( ValueSerialization.Formats.JSON ).
-                setMetaInfo( valuesModuleFinder );
-        }
+        module.services( JacksonValueSerializationService.class ).
+            visibleIn( visibility() ).
+                  taggedWith( ValueSerialization.Formats.JSON );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java
b/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java
index 2773053..07e5151 100644
--- a/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java
+++ b/extensions/valueserialization-orgjson/src/main/java/org/apache/polygene/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java
@@ -19,9 +19,6 @@
  */
 package org.apache.polygene.valueserialization.orgjson;
 
-import java.util.function.Function;
-import org.apache.polygene.api.structure.Application;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.api.value.ValueSerialization;
 import org.apache.polygene.bootstrap.Assemblers;
 import org.apache.polygene.bootstrap.AssemblyException;
@@ -33,30 +30,12 @@ import org.apache.polygene.bootstrap.ModuleAssembly;
 public class OrgJsonValueSerializationAssembler
     extends Assemblers.Visibility<OrgJsonValueSerializationAssembler>
 {
-    private Function<Application, Module> valuesModuleFinder;
-
-    public OrgJsonValueSerializationAssembler withValuesModuleFinder( Function<Application,
Module> valuesModuleFinder )
-    {
-        this.valuesModuleFinder = valuesModuleFinder;
-        return this;
-    }
-
     @Override
     public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
-        if( valuesModuleFinder == null )
-        {
-            module.services( OrgJsonValueSerializationService.class ).
-                visibleIn( visibility() ).
-                taggedWith( ValueSerialization.Formats.JSON );
-        }
-        else
-        {
-            module.services( OrgJsonValueSerializationService.class ).
-                visibleIn( visibility() ).
-                taggedWith( ValueSerialization.Formats.JSON ).
-                setMetaInfo( valuesModuleFinder );
-        }
+        module.services( OrgJsonValueSerializationService.class ).
+            visibleIn( visibility() ).
+                  taggedWith( ValueSerialization.Formats.JSON );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationAssembler.java
b/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationAssembler.java
index 93e80be..e972acb 100644
--- a/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationAssembler.java
+++ b/extensions/valueserialization-stax/src/main/java/org/apache/polygene/valueserialization/stax/StaxValueSerializationAssembler.java
@@ -19,9 +19,6 @@
  */
 package org.apache.polygene.valueserialization.stax;
 
-import java.util.function.Function;
-import org.apache.polygene.api.structure.Application;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.api.value.ValueSerialization;
 import org.apache.polygene.bootstrap.Assemblers;
 import org.apache.polygene.bootstrap.AssemblyException;
@@ -33,30 +30,12 @@ import org.apache.polygene.bootstrap.ModuleAssembly;
 public class StaxValueSerializationAssembler
     extends Assemblers.Visibility<StaxValueSerializationAssembler>
 {
-    private Function<Application, Module> valuesModuleFinder;
-
-    public StaxValueSerializationAssembler withValuesModuleFinder( Function<Application,
Module> valuesModuleFinder )
-    {
-        this.valuesModuleFinder = valuesModuleFinder;
-        return this;
-    }
-
     @Override
     public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
-        if( valuesModuleFinder == null )
-        {
-            module.services( StaxValueSerializationService.class ).
-                visibleIn( visibility() ).
-                taggedWith( ValueSerialization.Formats.XML );
-        }
-        else
-        {
-            module.services( StaxValueSerializationService.class ).
-                visibleIn( visibility() ).
-                taggedWith( ValueSerialization.Formats.XML ).
-                setMetaInfo( valuesModuleFinder );
-        }
+        module.services( StaxValueSerializationService.class ).
+            visibleIn( visibility() ).
+                  taggedWith( ValueSerialization.Formats.XML );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/domain/DomainLayer.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/domain/DomainLayer.java
b/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/domain/DomainLayer.java
index c134fe1..80611dc 100644
--- a/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/domain/DomainLayer.java
+++ b/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/domain/DomainLayer.java
@@ -19,9 +19,6 @@
  */
 package org.apache.polygene.library.restlet.assembly.domain;
 
-import java.util.function.Function;
-import org.apache.polygene.api.structure.Application;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.LayerAssembly;
 import org.apache.polygene.bootstrap.layered.LayerAssembler;
@@ -39,9 +36,4 @@ public class DomainLayer extends LayeredLayerAssembler
         createModule( layer, CrudModule.class );
         return layer;
     }
-
-    public static Function<Application, Module> typeFinder()
-    {
-        return application -> application.findModule( "Domain Layer", "TypeFinder Module"
);
-    }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/infrastructue/InfrastructureLayer.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/infrastructue/InfrastructureLayer.java
b/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/infrastructue/InfrastructureLayer.java
index 535e38a..ad3e56a 100644
--- a/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/infrastructue/InfrastructureLayer.java
+++ b/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/infrastructue/InfrastructureLayer.java
@@ -20,9 +20,6 @@
 
 package org.apache.polygene.library.restlet.assembly.infrastructue;
 
-import java.util.function.Function;
-import org.apache.polygene.api.structure.Application;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.LayerAssembly;
 import org.apache.polygene.bootstrap.ModuleAssembly;
@@ -30,26 +27,22 @@ import org.apache.polygene.bootstrap.layered.LayerAssembler;
 import org.apache.polygene.bootstrap.layered.LayeredLayerAssembler;
 import org.apache.polygene.library.restlet.assembly.configuration.ConfigurationLayer;
 import org.apache.polygene.library.restlet.assembly.configuration.ConfigurationModule;
-import org.apache.polygene.library.restlet.assembly.domain.DomainLayer;
 
 public class InfrastructureLayer extends LayeredLayerAssembler
     implements LayerAssembler
 {
     public static final String NAME = "Infrastructure Layer";
     private final ModuleAssembly configModule;
-    private final Function<Application, Module> typeFinder;
 
     public static InfrastructureLayer create( LayerAssembly layer )
     {
-        Function<Application, Module> typeFinder = DomainLayer.typeFinder();
         ModuleAssembly config = layer.application().layer( ConfigurationLayer.NAME ).module(
ConfigurationModule.NAME );
-        return new InfrastructureLayer( config, typeFinder );
+        return new InfrastructureLayer( config );
     }
 
-    public InfrastructureLayer( ModuleAssembly configModule, Function<Application, Module>
typeFinder )
+    public InfrastructureLayer( ModuleAssembly configModule )
     {
         this.configModule = configModule;
-        this.typeFinder = typeFinder;
     }
 
     @Override
@@ -57,7 +50,7 @@ public class InfrastructureLayer extends LayeredLayerAssembler
         throws AssemblyException
     {
         new IndexingModule( configModule ).assemble( layer, layer.module( IndexingModule.NAME
) );
-        new SerializationModule( typeFinder ).assemble( layer, layer.module( SerializationModule.NAME
) );
+        new SerializationModule().assemble( layer, layer.module( SerializationModule.NAME
) );
         return layer;
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/infrastructue/SerializationModule.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/infrastructue/SerializationModule.java
b/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/infrastructue/SerializationModule.java
index 1803495..736edaa 100644
--- a/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/infrastructue/SerializationModule.java
+++ b/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/assembly/infrastructue/SerializationModule.java
@@ -20,10 +20,7 @@
 
 package org.apache.polygene.library.restlet.assembly.infrastructue;
 
-import java.util.function.Function;
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Application;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.LayerAssembly;
 import org.apache.polygene.bootstrap.ModuleAssembly;
@@ -34,12 +31,6 @@ public class SerializationModule
     implements ModuleAssembler
 {
     public static final String NAME = "Serialization Module";
-    private final Function<Application, Module> typeFinder;
-
-    public SerializationModule( Function<Application, Module> typeFinder )
-    {
-        this.typeFinder = typeFinder;
-    }
 
     @Override
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
@@ -47,7 +38,6 @@ public class SerializationModule
     {
         new JacksonValueSerializationAssembler()
             .visibleIn( Visibility.layer )
-            .withValuesModuleFinder( typeFinder )
             .assemble( module );
         return module;
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/samples/forum/src/main/java/org/apache/polygene/sample/forum/assembler/ForumAssembler.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/apache/polygene/sample/forum/assembler/ForumAssembler.java
b/samples/forum/src/main/java/org/apache/polygene/sample/forum/assembler/ForumAssembler.java
index bf53c74..e3435b1 100644
--- a/samples/forum/src/main/java/org/apache/polygene/sample/forum/assembler/ForumAssembler.java
+++ b/samples/forum/src/main/java/org/apache/polygene/sample/forum/assembler/ForumAssembler.java
@@ -85,7 +85,6 @@ public class ForumAssembler
             ModuleAssembly serialization = infrastructure.module( "Serialization" );
             new OrgJsonValueSerializationAssembler().
                 visibleIn( Visibility.application ).
-                withValuesModuleFinder( app -> app.findModule( "REST", "Values" ) ).
                 assemble( serialization );
 
             ModuleAssembly entityStore = infrastructure.module( "EntityStore" );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/assembly/StorageModule.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/assembly/StorageModule.java
b/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/assembly/StorageModule.java
index 422458d..7fd88ab 100644
--- a/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/assembly/StorageModule.java
+++ b/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/assembly/StorageModule.java
@@ -37,7 +37,6 @@ public class StorageModule
         module.services( MemoryEntityStoreService.class ).visibleIn( Visibility.application
);
         new OrgJsonValueSerializationAssembler().
             visibleIn( Visibility.application ).
-            withValuesModuleFinder( app -> app.findModule( "DomainLayer", "RentalModule"
) ).
             assemble( module );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/tools/generator-polygene/app/templates/DomainLayer/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/DomainLayer/bootstrap.tmpl b/tools/generator-polygene/app/templates/DomainLayer/bootstrap.tmpl
index 6285025..4e917f0 100644
--- a/tools/generator-polygene/app/templates/DomainLayer/bootstrap.tmpl
+++ b/tools/generator-polygene/app/templates/DomainLayer/bootstrap.tmpl
@@ -19,9 +19,6 @@
 -%>
 package <%= packageName %>.bootstrap.domain;
 
-import java.util.function.Function;
-import org.apache.polygene.api.structure.Application;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.LayerAssembly;
 import org.apache.polygene.bootstrap.layered.LayerAssembler;
@@ -38,9 +35,4 @@ public class DomainLayer extends LayeredLayerAssembler
         createModule( layer, SecurityModule.class );
         return layer;
     }
-
-    public static Function<Application, Module> typeFinder()
-    {
-        return application -> application.findModule( "Domain Layer", "Assets Module"
);
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/tools/generator-polygene/app/templates/Heroes/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/Heroes/bootstrap.tmpl b/tools/generator-polygene/app/templates/Heroes/bootstrap.tmpl
index e3a9d06..f8bf77e 100644
--- a/tools/generator-polygene/app/templates/Heroes/bootstrap.tmpl
+++ b/tools/generator-polygene/app/templates/Heroes/bootstrap.tmpl
@@ -23,10 +23,6 @@ import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import java.util.function.Function;
-
-import org.apache.polygene.api.structure.Application;
-import org.apache.polygene.api.structure.Module;
 
 import org.apache.polygene.bootstrap.ApplicationAssembly;
 import org.apache.polygene.bootstrap.AssemblyException;
@@ -57,8 +53,7 @@ public class HeroesApplicationAssembler extends LayeredApplicationAssembler
         LayerAssembly configLayer = createLayer( ConfigurationLayer.class );
         ModuleAssembly configModule = assemblerOf( ConfigurationLayer.class ).configModule();
         LayerAssembly domainLayer = createLayer( DomainLayer.class );
-        Function<Application, Module> typeFinder = DomainLayer.typeFinder();
-        LayerAssembly infraLayer = new InfrastructureLayer( configModule, typeFinder ).assemble(
assembly.layer( InfrastructureLayer.NAME ) );
+        LayerAssembly infraLayer = new InfrastructureLayer( configModule ).assemble( assembly.layer(
InfrastructureLayer.NAME ) );
         LayerAssembly connectivityLayer = createLayer( ConnectivityLayer.class );
         connectivityLayer.uses( domainLayer );
         domainLayer.uses( infraLayer );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/tools/generator-polygene/app/templates/InfrastructureLayer/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/InfrastructureLayer/bootstrap.tmpl b/tools/generator-polygene/app/templates/InfrastructureLayer/bootstrap.tmpl
index a1206a9..2b86a4d 100644
--- a/tools/generator-polygene/app/templates/InfrastructureLayer/bootstrap.tmpl
+++ b/tools/generator-polygene/app/templates/InfrastructureLayer/bootstrap.tmpl
@@ -19,9 +19,6 @@
 -%>
 package <%= packageName %>.bootstrap.infrastructure;
 
-import java.util.function.Function;
-import org.apache.polygene.api.structure.Application;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.LayerAssembly;
 import org.apache.polygene.bootstrap.ModuleAssembly;
@@ -33,12 +30,10 @@ public class InfrastructureLayer extends LayeredLayerAssembler
 {
     public static final String NAME = "Infrastructure Layer";
     private final ModuleAssembly configModule;
-    private final Function<Application, Module> typeFinder;
 
-    public InfrastructureLayer( ModuleAssembly configModule, Function<Application, Module>
typeFinder )
+    public InfrastructureLayer( ModuleAssembly configModule )
     {
         this.configModule = configModule;
-        this.typeFinder = typeFinder;
     }
 
     @Override
@@ -49,7 +44,7 @@ public class InfrastructureLayer extends LayeredLayerAssembler
 
         new <%= polygene.entitystore %>StorageModule( configModule ).assemble( layer,
layer.module( <%= polygene.entitystore %>StorageModule.NAME ) );
         new <%= polygene.indexing %>IndexingModule( configModule ).assemble( layer,
layer.module( <%= polygene.indexing %>IndexingModule.NAME ) );
-        new <%= polygene.serialization %>SerializationModule( typeFinder ).assemble(
layer, layer.module( <%= polygene.serialization %>SerializationModule.NAME ) );
+        new <%= polygene.serialization %>SerializationModule().assemble( layer, layer.module(
<%= polygene.serialization %>SerializationModule.NAME ) );
         return layer;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/tools/generator-polygene/app/templates/JacksonSerializationModule/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/JacksonSerializationModule/bootstrap.tmpl
b/tools/generator-polygene/app/templates/JacksonSerializationModule/bootstrap.tmpl
index dd1d17c..afc0439 100644
--- a/tools/generator-polygene/app/templates/JacksonSerializationModule/bootstrap.tmpl
+++ b/tools/generator-polygene/app/templates/JacksonSerializationModule/bootstrap.tmpl
@@ -19,10 +19,7 @@
 -%>
 package <%= packageName %>.bootstrap.infrastructure;
 
-import java.util.function.Function;
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.structure.Application;
-import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.LayerAssembly;
 import org.apache.polygene.bootstrap.ModuleAssembly;
@@ -33,12 +30,6 @@ public class JacksonSerializationModule
     implements ModuleAssembler
 {
     public static final String NAME = "Jackson Serialization Module";
-    private final Function<Application, Module> typeFinder;
-
-    public JacksonSerializationModule( Function<Application, Module> typeFinder )
-    {
-        this.typeFinder = typeFinder;
-    }
 
     @Override
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
@@ -46,7 +37,6 @@ public class JacksonSerializationModule
     {
         new JacksonValueSerializationAssembler()
             .visibleIn( Visibility.application )
-            .withValuesModuleFinder( typeFinder )
             .assemble( module );
         return module;
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ApplicationAssemblerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ApplicationAssemblerWriter.java
b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ApplicationAssemblerWriter.java
index fe45232..d5ba78e 100644
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ApplicationAssemblerWriter.java
+++ b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ApplicationAssemblerWriter.java
@@ -43,10 +43,7 @@ public class ApplicationAssemblerWriter
             pw.println( "import java.nio.file.Files;" );
             pw.println( "import java.nio.file.Path;" );
             pw.println( "import java.nio.file.Paths;" );
-            pw.println( "import java.util.function.Function;" );
             pw.println();
-            pw.println( "import org.apache.polygene.api.structure.Application;" );
-            pw.println( "import org.apache.polygene.api.structure.Module;\n" );
             pw.println( "import org.apache.polygene.bootstrap.ApplicationAssembly;" );
             pw.println( "import org.apache.polygene.bootstrap.AssemblyException;" );
             pw.println( "import org.apache.polygene.bootstrap.LayerAssembly;" );
@@ -82,8 +79,7 @@ public class ApplicationAssemblerWriter
             pw.println( "        LayerAssembly configLayer = createLayer( ConfigurationLayer.class
);" );
             pw.println( "        ModuleAssembly configModule = assemblerOf( ConfigurationLayer.class
).configModule();" );
             pw.println( "        LayerAssembly domainLayer = createLayer( DomainLayer.class
);" );
-            pw.println( "        Function<Application, Module> typeFinder = DomainLayer.typeFinder();"
);
-            pw.println( "        LayerAssembly infraLayer = new InfrastructureLayer( configModule,
typeFinder ).assemble( assembly.layer( InfrastructureLayer.NAME ) );" );
+            pw.println( "        LayerAssembly infraLayer = new InfrastructureLayer( configModule
).assemble( assembly.layer( InfrastructureLayer.NAME ) );" );
             pw.println( "        LayerAssembly connectivityLayer = createLayer( ConnectivityLayer.class
);" );
             pw.println( "        connectivityLayer.uses( domainLayer );" );
             pw.println( "        domainLayer.uses( infraLayer );" );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/DomainLayerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/DomainLayerWriter.java
b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/DomainLayerWriter.java
index c8ca11c..dd8a684 100644
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/DomainLayerWriter.java
+++ b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/DomainLayerWriter.java
@@ -40,9 +40,6 @@ public class DomainLayerWriter
             pw.println( ".bootstrap.domain;" );
             pw.println();
             pw.println(
-                "import java.util.function.Function;\n" +
-                "import org.apache.polygene.api.structure.Application;\n" +
-                "import org.apache.polygene.api.structure.Module;\n" +
                 "import org.apache.polygene.bootstrap.AssemblyException;\n" +
                 "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
                 "import org.apache.polygene.bootstrap.layered.LayerAssembler;\n" +
@@ -60,11 +57,6 @@ public class DomainLayerWriter
                 "        createModule( layer, SecurityModule.class );   // This is a simple
sample that you typically remove.\n" +
                 "        return layer;\n" +
                 "    }\n" +
-                "\n" +
-                "    public static Function<Application, Module> typeFinder()\n" +
-                "    {\n" +
-                "        return application -> application.findModule( \"Domain Layer\",
\"Assets Module\" );\n" +
-                "    }\n" +
                 "}\n"
             );
         }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/InfrastructureLayerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/InfrastructureLayerWriter.java
b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/InfrastructureLayerWriter.java
index 18e0b50..464e938 100644
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/InfrastructureLayerWriter.java
+++ b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/InfrastructureLayerWriter.java
@@ -40,9 +40,6 @@ public class InfrastructureLayerWriter
             pw.println( ".bootstrap.infrastructure;" );
             pw.println();
             pw.println(
-                "import java.util.function.Function;\n" +
-                "import org.apache.polygene.api.structure.Application;\n" +
-                "import org.apache.polygene.api.structure.Module;\n" +
                 "import org.apache.polygene.bootstrap.AssemblyException;\n" +
                 "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
                 "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
@@ -54,12 +51,10 @@ public class InfrastructureLayerWriter
                 "{\n" +
                 "    public static final String NAME = \"Infrastructure Layer\";\n" +
                 "    private final ModuleAssembly configModule;\n" +
-                "    private final Function<Application, Module> typeFinder;\n" +
                 "\n" +
-                "    public InfrastructureLayer( ModuleAssembly configModule, Function<Application,
Module> typeFinder )\n" +
+                "    public InfrastructureLayer( ModuleAssembly configModule )\n" +
                 "    {\n" +
                 "        this.configModule = configModule;\n" +
-                "        this.typeFinder = typeFinder;\n" +
                 "    }\n" +
                 "\n" +
                 "    @Override\n" +
@@ -70,7 +65,7 @@ public class InfrastructureLayerWriter
                 "\n" +
                 "        new StorageModule( configModule ).assemble( layer, layer.module(
StorageModule.NAME ) );\n" +
                 "        new IndexingModule( configModule ).assemble( layer, layer.module(
IndexingModule.NAME ) );\n" +
-                "        new SerializationModule( typeFinder ).assemble( layer, layer.module(
SerializationModule.NAME ) );\n" +
+                "        new SerializationModule().assemble( layer, layer.module( SerializationModule.NAME
) );\n" +
                 "\n" +
                 "        return layer;\n" +
                 "    }\n" +

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/b675c1a5/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SerializationModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SerializationModuleWriter.java
b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SerializationModuleWriter.java
index 30b1d8a..b604916 100644
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SerializationModuleWriter.java
+++ b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SerializationModuleWriter.java
@@ -40,10 +40,7 @@ public class SerializationModuleWriter
             pw.println( ".bootstrap.infrastructure;" );
             pw.println();
             pw.println(
-                "import java.util.function.Function;\n" +
                 "import org.apache.polygene.api.common.Visibility;\n" +
-                "import org.apache.polygene.api.structure.Application;\n" +
-                "import org.apache.polygene.api.structure.Module;\n" +
                 "import org.apache.polygene.bootstrap.AssemblyException;\n" +
                 "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
                 "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
@@ -54,12 +51,6 @@ public class SerializationModuleWriter
                 "    implements ModuleAssembler\n" +
                 "{\n" +
                 "    public static final String NAME = \"Serialization Module\";\n" +
-                "    private final Function<Application, Module> typeFinder;\n" +
-                "\n" +
-                "    public SerializationModule( Function<Application, Module> typeFinder
)\n" +
-                "    {\n" +
-                "        this.typeFinder = typeFinder;\n" +
-                "    }\n" +
                 "\n" +
                 "    @Override\n" +
                 "    public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly
module )\n" +
@@ -67,7 +58,6 @@ public class SerializationModuleWriter
                 "    {\n" +
                 "        new JacksonValueSerializationAssembler()\n" +
                 "            .visibleIn( Visibility.application )\n" +
-                "            .withValuesModuleFinder( typeFinder )\n" +
                 "            .assemble( module );\n" +
                 "        return module;\n" +
                 "    }\n" +


Mime
View raw message