polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [06/50] polygene-java git commit: :tutorials:intro:two-minutes refine snippets
Date Mon, 15 May 2017 11:03:11 GMT
:tutorials:intro:two-minutes refine snippets


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

Branch: refs/heads/develop
Commit: 3af7f5b80082289e338a7458cf996a2b1ba89573
Parents: 4963baf
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Mon May 15 09:22:06 2017 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Mon May 15 09:22:06 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/polygene/demo/twominute/Main.java  | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/3af7f5b8/tutorials/introduction/twominutes/src/main/java/org/apache/polygene/demo/twominute/Main.java
----------------------------------------------------------------------
diff --git a/tutorials/introduction/twominutes/src/main/java/org/apache/polygene/demo/twominute/Main.java
b/tutorials/introduction/twominutes/src/main/java/org/apache/polygene/demo/twominute/Main.java
index 038224b..4ac39c9 100644
--- a/tutorials/introduction/twominutes/src/main/java/org/apache/polygene/demo/twominute/Main.java
+++ b/tutorials/introduction/twominutes/src/main/java/org/apache/polygene/demo/twominute/Main.java
@@ -19,8 +19,6 @@
  */
 package org.apache.polygene.demo.twominute;
 
-import org.apache.polygene.bootstrap.AssemblyException;
-import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.bootstrap.SingletonAssembler;
 
 // START SNIPPET: documentation
@@ -29,15 +27,8 @@ public class Main
     public static void main( String[] args )
         throws Exception
     {
-        SingletonAssembler assembler = new SingletonAssembler() // <1>
-        {
-            @Override
-            public void assemble( ModuleAssembly assembly )
-                throws AssemblyException
-            {
-                assembly.transients( Speaker.class );           // <2>
-            }
-        };
+        SingletonAssembler assembler = new SingletonAssembler(              // <1>
+            module -> module.transients( Speaker.class ) );                 // <2>
         Speaker speaker = assembler.module().newTransient( Speaker.class ); // <3>
         System.out.println( speaker.sayHello() );
     }


Mime
View raw message