incubator-s4-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leo...@apache.org
Subject [7/7] git commit: Added s4-edsl sub-project skeleton.
Date Thu, 23 Feb 2012 00:22:31 GMT
Added s4-edsl sub-project skeleton.


Project: http://git-wip-us.apache.org/repos/asf/incubator-s4/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s4/commit/924bc55b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s4/tree/924bc55b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s4/diff/924bc55b

Branch: refs/heads/piper
Commit: 924bc55b4f86fceea8c0fba9668cb5c40fe42cf4
Parents: 988ee77
Author: Leo Neumeyer <leoneu@apache.org>
Authored: Sat Feb 4 11:05:08 2012 -0800
Committer: Leo Neumeyer <leoneu@apache.org>
Committed: Sat Feb 4 11:05:08 2012 -0800

----------------------------------------------------------------------
 build.gradle                                       |    8 +-
 settings.gradle                                    |    1 +
 subprojects/s4-edsl/s4-edsl.gradle                 |   40 +++++++
 subprojects/s4-edsl/src/main/diezel/s4/s4-impl.xml |   85 +++++++++++++++
 subprojects/s4-edsl/src/main/diezel/s4/s4.xml      |   57 ++++++++++
 subprojects/s4-edsl/src/main/java/Main.java        |   15 +++
 6 files changed, 203 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/924bc55b/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index a14fd20..a467269 100644
--- a/build.gradle
+++ b/build.gradle
@@ -72,7 +72,8 @@ libraries = [
     zk:                 'org.apache.zookeeper:zookeeper:3.3.1',
     jcip:               'net.jcip:jcip-annotations:1.0',
     junit:              'junit:junit:4.10',
-    zkclient:           'com.github.sgroschupf:zkclient:0.1'
+    zkclient:           'com.github.sgroschupf:zkclient:0.1',
+    diezel:             'net.ericaro:diezel-maven-plugin:1.0.0-beta-3'
 ]
 
 subprojects {
@@ -90,6 +91,7 @@ subprojects {
 
     dependencies {
         
+        compile('javax.jms:jms:1.1')
         /* Google. */
         compile( libraries.guava )
         compile( libraries.guice )
@@ -107,7 +109,7 @@ subprojects {
         /* Misc. */
         compile( libraries.jcip )
         compile( libraries.zk ) {
-		 transitive = false
+		 //transitive = false
 	}
         
         /* Testing. */
@@ -125,7 +127,7 @@ subprojects {
 
 dependsOnChildren()
 
-platformProjects = [project(':s4-base'), project(':s4-core'), project(':s4-comm')]
+platformProjects = [project(':s4-base'), project(':s4-core'), project(':s4-comm'), project(':s4-edsl')]
 
 configurations {
     platformLibs

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/924bc55b/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index a5655c4..71b1207 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -16,6 +16,7 @@
 include 's4-base'
 include 's4-core'
 include 's4-comm'
+include 's4-edsl'
 include 's4-example'
 include ':test-apps:simple-deployable-app-1'
 include ':test-apps:simple-deployable-app-2'

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/924bc55b/subprojects/s4-edsl/s4-edsl.gradle
----------------------------------------------------------------------
diff --git a/subprojects/s4-edsl/s4-edsl.gradle b/subprojects/s4-edsl/s4-edsl.gradle
new file mode 100644
index 0000000..f80e103
--- /dev/null
+++ b/subprojects/s4-edsl/s4-edsl.gradle
@@ -0,0 +1,40 @@
+// Use the Diezel Maven plugin to build the project.
+// Gradle doesn't support Maven plugin as of version 1.0
+// Useful article: http://forums.gradle.org/gradle/topics/how_to_download_and_evoke_a_maven_plugin
+    
+def generatedSourceDir = "${buildDir}/generated-src/java"
+def diezelSrcDir = "${projectDir}/src/main/diezel";
+
+dependencies {
+    compile project(":s4-core")
+}
+
+
+sourceSets {
+    generated {
+        java { srcDir $generatedSourceDir }
+    }
+}
+
+buildscript {
+    repositories {
+        mavenCentral()
+    }
+    dependencies {
+        classpath libraries.diezel
+    }        
+}
+task generateSources << {
+    outputs.dir generatedSourceDir
+    def mojo = new net.ericaro.diezel.plugin.DiezelMojo()
+    mojo.sourceDirectory = new File(diezelSrcDir);
+    mojo.outputDirectory = new File(generatedSourceDir);
+    mojo.staleMillis = 0;
+    mojo.project = new org.apache.maven.project.MavenProject();
+    org.apache.maven.model.Build build = new org.apache.maven.model.Build();
+    build.setDirectory(mojo.sourceDirectory.getAbsolutePath());
+    mojo.project.setBuild(build);
+    mojo.execute();
+}
+
+compileJava.source generateSources.outputs.files, sourceSets.main.java

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/924bc55b/subprojects/s4-edsl/src/main/diezel/s4/s4-impl.xml
----------------------------------------------------------------------
diff --git a/subprojects/s4-edsl/src/main/diezel/s4/s4-impl.xml b/subprojects/s4-edsl/src/main/diezel/s4/s4-impl.xml
new file mode 100644
index 0000000..4e2cdbe
--- /dev/null
+++ b/subprojects/s4-edsl/src/main/diezel/s4/s4-impl.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<diezelImplementation xmlns="http://diezel.ericaro.net/2.0.0/">
+	<package>org.apache.s4.core.edsl</package>
+	<name>Builder</name>
+	<implements>org.apache.s4.core.edsl.S4DSL</implements>
+	<transitions>
+		<transitionImplementation name="pe">
+			<body>
+				System.out.println("pe");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="type">
+			<body>
+				System.out.println("type");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="fireOn">
+			<body>
+				System.out.println("fireOn");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="ifInterval">
+			<body>
+				System.out.println("ifInterval");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="timer">
+			<body>
+				System.out.println("timer");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="withPeriod">
+			<body>
+				System.out.println("withPeriod");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="cache">
+			<body>
+				System.out.println("cache");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="expires">
+			<body>
+				System.out.println("expires");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="asSingleton">
+			<body>
+				System.out.println("asSingleton");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="emitEvent">
+			<body>
+				System.out.println("emitEvent");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="onField">
+			<body>
+				System.out.println("onField");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="onKey">
+			<body>
+				System.out.println("onKey");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="to">
+			<body>
+				System.out.println("to");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="info">
+			<body>
+				System.out.println("info");
+			</body>
+		</transitionImplementation>
+		<transitionImplementation name="build">
+			<body>
+				System.out.println("build");
+				return "Done!";
+			</body>
+		</transitionImplementation>
+
+	</transitions>
+</diezelImplementation>

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/924bc55b/subprojects/s4-edsl/src/main/diezel/s4/s4.xml
----------------------------------------------------------------------
diff --git a/subprojects/s4-edsl/src/main/diezel/s4/s4.xml b/subprojects/s4-edsl/src/main/diezel/s4/s4.xml
new file mode 100644
index 0000000..85d6bcb
--- /dev/null
+++ b/subprojects/s4-edsl/src/main/diezel/s4/s4.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<diezel xmlns="http://diezel.ericaro.net/2.0.0/">
+	<package>org.apache.s4.core.edsl</package>
+	<name>S4DSL</name>
+	<expression>(pe , type , (fireOn , ifInterval? )? , (timer, withPeriod)? , (cache,
size , expires? )? , asSingleton? , (emitEvent, onField?, onKey?, to )+  )+ , info?, build</expression>
+	<transitions>
+		<transition name="pe">
+			<signature>pe()</signature>
+		</transition>
+		<transition name="type">
+			<signature>type()</signature>
+		</transition>
+		<transition name="fireOn">
+			<signature>fireOn()</signature>
+		</transition>
+		<transition name="ifInterval">
+			<signature>ifInterval()</signature>
+		</transition>
+		<transition name="timer">
+			<signature>timer()</signature>
+		</transition>
+		<transition name="withPeriod">
+			<signature>withPeriod()</signature>
+		</transition>
+		<transition name="cache">
+			<signature>cache()</signature>
+		</transition>
+		<transition name="size">
+			<signature>size()</signature>
+		</transition>
+		<transition name="expires">
+			<signature>expires()</signature>
+		</transition>
+		<transition name="asSingleton">
+			<signature>asSingleton()</signature>
+		</transition>
+		<transition name="emitEvent">
+			<signature>emitEvent()</signature>
+		</transition>
+		<transition name="onField">
+			<signature>onField()</signature>
+		</transition>
+		<transition name="onKey">
+			<signature>onKey()</signature>
+		</transition>
+		<transition name="to">
+			<signature>to()</signature>
+		</transition>
+		<transition name="info">
+			<signature>info()</signature>
+		</transition>
+		<transition name="build">
+			<return>java.lang.String</return>
+			<signature>build()</signature>
+		</transition>
+	</transitions>
+</diezel>

http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/924bc55b/subprojects/s4-edsl/src/main/java/Main.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-edsl/src/main/java/Main.java b/subprojects/s4-edsl/src/main/java/Main.java
new file mode 100644
index 0000000..b2d50ba
--- /dev/null
+++ b/subprojects/s4-edsl/src/main/java/Main.java
@@ -0,0 +1,15 @@
+import org.apache.s4.core.edsl.BuilderS4DSL;
+
+public class Main {
+    public static BuilderS4DSL build() {
+        return new BuilderS4DSL();
+    }
+
+    public static void main(String[] args) {
+
+        String app = new BuilderS4DSL().pe().type().fireOn().ifInterval().cache().size().asSingleton().emitEvent()
+                .onField().to().build();
+        System.out.println(app);
+
+    }
+}


Mime
View raw message