polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [14/33] polygene-java git commit: Explicit default services assemblers identities
Date Tue, 23 May 2017 02:13:57 GMT
Explicit default services assemblers identities


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

Branch: refs/heads/yeoman-work
Commit: 46698ed4a41dc1bfe4977d9b1be7fd0611440dd6
Parents: 3c3cb00
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sun May 21 16:49:16 2017 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sun May 21 16:49:16 2017 +0200

----------------------------------------------------------------------
 .../identity/DefaultIdentityGeneratorAssembler.java      |  9 +++++----
 .../serialization/DefaultSerializationAssembler.java     |  6 ++++--
 .../bootstrap/unitofwork/DefaultUnitOfWorkAssembler.java | 11 +++++++----
 3 files changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/46698ed4/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/identity/DefaultIdentityGeneratorAssembler.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/identity/DefaultIdentityGeneratorAssembler.java
b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/identity/DefaultIdentityGeneratorAssembler.java
index e50ec45..923f3cd 100644
--- a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/identity/DefaultIdentityGeneratorAssembler.java
+++ b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/identity/DefaultIdentityGeneratorAssembler.java
@@ -22,17 +22,18 @@ package org.apache.polygene.bootstrap.identity;
 import org.apache.polygene.api.identity.IdentityGenerator;
 import org.apache.polygene.api.identity.UuidGeneratorMixin;
 import org.apache.polygene.bootstrap.Assembler;
-import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 
 public class DefaultIdentityGeneratorAssembler
     implements Assembler
 {
+    public static final String IDENTITY = "default-identity-generator";
 
     @Override
-    public void assemble(ModuleAssembly module)
-            throws AssemblyException
+    public void assemble( ModuleAssembly module )
     {
-        module.services(IdentityGenerator.class).withMixins(UuidGeneratorMixin.class);
+        module.services( IdentityGenerator.class )
+              .withMixins( UuidGeneratorMixin.class )
+              .identifiedBy( IDENTITY );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/46698ed4/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/serialization/DefaultSerializationAssembler.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/serialization/DefaultSerializationAssembler.java
b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/serialization/DefaultSerializationAssembler.java
index db9d0a6..048764d 100644
--- a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/serialization/DefaultSerializationAssembler.java
+++ b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/serialization/DefaultSerializationAssembler.java
@@ -22,7 +22,6 @@ import org.apache.polygene.api.serialization.Deserializer;
 import org.apache.polygene.api.serialization.Serialization;
 import org.apache.polygene.api.serialization.Serializer;
 import org.apache.polygene.bootstrap.Assembler;
-import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.serialization.javaxjson.JavaxJsonAdapters;
 import org.apache.polygene.serialization.javaxjson.JavaxJsonFactories;
@@ -34,8 +33,10 @@ import org.apache.polygene.spi.serialization.JsonSerializer;
 public class DefaultSerializationAssembler
     implements Assembler
 {
+    public static final String IDENTITY = "default-serialization";
+
     @Override
-    public void assemble( ModuleAssembly module ) throws AssemblyException
+    public void assemble( ModuleAssembly module )
     {
         module.services( JavaxJsonSerialization.class )
               .withTypes( Serialization.class,
@@ -45,6 +46,7 @@ public class DefaultSerializationAssembler
                           JsonSerializer.class, JsonDeserializer.class,
                           JavaxJsonAdapters.class,
                           JavaxJsonFactories.class )
+              .identifiedBy( IDENTITY )
               .taggedWith( Serialization.Format.JSON );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/46698ed4/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/unitofwork/DefaultUnitOfWorkAssembler.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/unitofwork/DefaultUnitOfWorkAssembler.java
b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/unitofwork/DefaultUnitOfWorkAssembler.java
index 6383b75..47c5839 100644
--- a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/unitofwork/DefaultUnitOfWorkAssembler.java
+++ b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/unitofwork/DefaultUnitOfWorkAssembler.java
@@ -29,19 +29,22 @@ import org.apache.polygene.bootstrap.ModuleAssembly;
 public class DefaultUnitOfWorkAssembler
     implements Assembler
 {
+    public static final String IDENTITY = "default-uow-factory";
+
     @Override
     public void assemble( ModuleAssembly module )
-        throws AssemblyException
     {
         Class factoryMixin = loadMixinClass( "org.apache.polygene.runtime.unitofwork.UnitOfWorkFactoryMixin"
);
-        module.services( UnitOfWorkFactory.class ).withMixins( factoryMixin );
+        module.services( UnitOfWorkFactory.class )
+              .withMixins( factoryMixin )
+              .identifiedBy( IDENTITY );
 
         Class uowMixin = loadMixinClass( "org.apache.polygene.runtime.unitofwork.ModuleUnitOfWork"
);
-        module.transients( UnitOfWork.class ).withMixins( uowMixin );
+        module.transients( UnitOfWork.class )
+              .withMixins( uowMixin );
     }
 
     private Class<?> loadMixinClass( String name )
-        throws AssemblyException
     {
         try
         {


Mime
View raw message