polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject zest-qi4j git commit: Adding Spring Library documentation.
Date Mon, 06 Jul 2015 08:59:45 GMT
Repository: zest-qi4j
Updated Branches:
  refs/heads/develop 9128eee82 -> acb533305


Adding Spring Library documentation.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/acb53330
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/acb53330
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/acb53330

Branch: refs/heads/develop
Commit: acb5333052a9769acc63be0268bb3d92cd7c2fdd
Parents: 9128eee
Author: Niclas Hedhman <hedmann@betfair.com>
Authored: Mon Jul 6 11:59:38 2015 +0300
Committer: Niclas Hedhman <hedmann@betfair.com>
Committed: Mon Jul 6 11:59:38 2015 +0300

----------------------------------------------------------------------
 libraries/spring/src/docs/spring.txt            | 14 +++++++--
 .../qi4j/library/spring/MyZestBootstrapper.java | 31 ++++++++++++++++++++
 2 files changed, 42 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/acb53330/libraries/spring/src/docs/spring.txt
----------------------------------------------------------------------
diff --git a/libraries/spring/src/docs/spring.txt b/libraries/spring/src/docs/spring.txt
index cb28126..8ced689 100644
--- a/libraries/spring/src/docs/spring.txt
+++ b/libraries/spring/src/docs/spring.txt
@@ -62,6 +62,8 @@ A new bean will appear in the application context, called +"qi4jApplication"+
wh
 intended for internal use of this library.
 
 Example application context;
+[source,xml]
+----
  <?xml version="1.0" encoding="UTF-8"?>
 
  <beans xmlns="http://www.springframework.org/schema/beans"
@@ -73,11 +75,17 @@ Example application context;
 
   <!-- class that implements Qi4jApplicationBootstrap -->
 
-  <qi4j:bootstrap class="org.qi4j.library.spring.bootstrap.Qi4jTestBootstrap"/>
+  <qi4j:bootstrap class="org.hedhman.niclas.MyZestBootstrapper"/>
 
-  <bean id="commentServiceHolder" class="org.qi4j.library.spring.bootstrap.CommentServiceHolder">
+  <bean id="someService" class="org.hedhman.niclas.SomeService">
 
-  <constructor-arg ref="commentService"/> <!-- Reference qi4j comment service -->
+  <constructor-arg ref="someService"/> <!-- Reference qi4j comment service -->
 
  </bean>
+----
 
+[snippet,java]
+----
+source=libraries/spring/src/test/java/org/qi4j/library/spring/MyZestBootstrapper.java
+tag=importer
+----

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/acb53330/libraries/spring/src/test/java/org/qi4j/library/spring/MyZestBootstrapper.java
----------------------------------------------------------------------
diff --git a/libraries/spring/src/test/java/org/qi4j/library/spring/MyZestBootstrapper.java
b/libraries/spring/src/test/java/org/qi4j/library/spring/MyZestBootstrapper.java
new file mode 100644
index 0000000..171a3c5
--- /dev/null
+++ b/libraries/spring/src/test/java/org/qi4j/library/spring/MyZestBootstrapper.java
@@ -0,0 +1,31 @@
+package org.qi4j.library.spring;
+
+import org.qi4j.bootstrap.ApplicationAssembly;
+import org.qi4j.bootstrap.AssemblyException;
+import org.qi4j.library.spring.bootstrap.Qi4jApplicationBootstrap;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+// START SNIPPET: code
+public class MyZestBootstrapper extends Qi4jApplicationBootstrap
+        implements ApplicationContextAware
+{
+    private ApplicationContext applicationContext;
+
+    @Override
+    public void assemble(ApplicationAssembly assembly) throws AssemblyException
+    {
+        // Normal assembly of an application.
+// END SNIPPET: code
+// START SNIPPET: code
+    }
+
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
+    {
+        this.applicationContext = applicationContext;
+    }
+
+}
+// END SNIPPET: code


Mime
View raw message