Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added s4-edsl sub-project skeleton.

  • Loading branch information...
commit 924bc55b4f86fceea8c0fba9668cb5c40fe42cf4 1 parent 988ee77
Leo Neumeyer authored
8  build.gradle
@@ -72,7 +72,8 @@ libraries = [
72 72
     zk:                 'org.apache.zookeeper:zookeeper:3.3.1',
73 73
     jcip:               'net.jcip:jcip-annotations:1.0',
74 74
     junit:              'junit:junit:4.10',
75  
-    zkclient:           'com.github.sgroschupf:zkclient:0.1'
  75
+    zkclient:           'com.github.sgroschupf:zkclient:0.1',
  76
+    diezel:             'net.ericaro:diezel-maven-plugin:1.0.0-beta-3'
76 77
 ]
77 78
 
78 79
 subprojects {
@@ -90,6 +91,7 @@ subprojects {
90 91
 
91 92
     dependencies {
92 93
         
  94
+        compile('javax.jms:jms:1.1')
93 95
         /* Google. */
94 96
         compile( libraries.guava )
95 97
         compile( libraries.guice )
@@ -107,7 +109,7 @@ subprojects {
107 109
         /* Misc. */
108 110
         compile( libraries.jcip )
109 111
         compile( libraries.zk ) {
110  
-		 transitive = false
  112
+		 //transitive = false
111 113
 	}
112 114
         
113 115
         /* Testing. */
@@ -125,7 +127,7 @@ subprojects {
125 127
 
126 128
 dependsOnChildren()
127 129
 
128  
-platformProjects = [project(':s4-base'), project(':s4-core'), project(':s4-comm')]
  130
+platformProjects = [project(':s4-base'), project(':s4-core'), project(':s4-comm'), project(':s4-edsl')]
129 131
 
130 132
 configurations {
131 133
     platformLibs
1  settings.gradle
@@ -16,6 +16,7 @@
16 16
 include 's4-base'
17 17
 include 's4-core'
18 18
 include 's4-comm'
  19
+include 's4-edsl'
19 20
 include 's4-example'
20 21
 include ':test-apps:simple-deployable-app-1'
21 22
 include ':test-apps:simple-deployable-app-2'
40  subprojects/s4-edsl/s4-edsl.gradle
... ...
@@ -0,0 +1,40 @@
  1
+// Use the Diezel Maven plugin to build the project.
  2
+// Gradle doesn't support Maven plugin as of version 1.0
  3
+// Useful article: http://forums.gradle.org/gradle/topics/how_to_download_and_evoke_a_maven_plugin
  4
+    
  5
+def generatedSourceDir = "${buildDir}/generated-src/java"
  6
+def diezelSrcDir = "${projectDir}/src/main/diezel";
  7
+
  8
+dependencies {
  9
+    compile project(":s4-core")
  10
+}
  11
+
  12
+
  13
+sourceSets {
  14
+    generated {
  15
+        java { srcDir $generatedSourceDir }
  16
+    }
  17
+}
  18
+
  19
+buildscript {
  20
+    repositories {
  21
+        mavenCentral()
  22
+    }
  23
+    dependencies {
  24
+        classpath libraries.diezel
  25
+    }        
  26
+}
  27
+task generateSources << {
  28
+    outputs.dir generatedSourceDir
  29
+    def mojo = new net.ericaro.diezel.plugin.DiezelMojo()
  30
+    mojo.sourceDirectory = new File(diezelSrcDir);
  31
+    mojo.outputDirectory = new File(generatedSourceDir);
  32
+    mojo.staleMillis = 0;
  33
+    mojo.project = new org.apache.maven.project.MavenProject();
  34
+    org.apache.maven.model.Build build = new org.apache.maven.model.Build();
  35
+    build.setDirectory(mojo.sourceDirectory.getAbsolutePath());
  36
+    mojo.project.setBuild(build);
  37
+    mojo.execute();
  38
+}
  39
+
  40
+compileJava.source generateSources.outputs.files, sourceSets.main.java
85  subprojects/s4-edsl/src/main/diezel/s4/s4-impl.xml
... ...
@@ -0,0 +1,85 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<diezelImplementation xmlns="http://diezel.ericaro.net/2.0.0/">
  3
+	<package>org.apache.s4.core.edsl</package>
  4
+	<name>Builder</name>
  5
+	<implements>org.apache.s4.core.edsl.S4DSL</implements>
  6
+	<transitions>
  7
+		<transitionImplementation name="pe">
  8
+			<body>
  9
+				System.out.println("pe");
  10
+			</body>
  11
+		</transitionImplementation>
  12
+		<transitionImplementation name="type">
  13
+			<body>
  14
+				System.out.println("type");
  15
+			</body>
  16
+		</transitionImplementation>
  17
+		<transitionImplementation name="fireOn">
  18
+			<body>
  19
+				System.out.println("fireOn");
  20
+			</body>
  21
+		</transitionImplementation>
  22
+		<transitionImplementation name="ifInterval">
  23
+			<body>
  24
+				System.out.println("ifInterval");
  25
+			</body>
  26
+		</transitionImplementation>
  27
+		<transitionImplementation name="timer">
  28
+			<body>
  29
+				System.out.println("timer");
  30
+			</body>
  31
+		</transitionImplementation>
  32
+		<transitionImplementation name="withPeriod">
  33
+			<body>
  34
+				System.out.println("withPeriod");
  35
+			</body>
  36
+		</transitionImplementation>
  37
+		<transitionImplementation name="cache">
  38
+			<body>
  39
+				System.out.println("cache");
  40
+			</body>
  41
+		</transitionImplementation>
  42
+		<transitionImplementation name="expires">
  43
+			<body>
  44
+				System.out.println("expires");
  45
+			</body>
  46
+		</transitionImplementation>
  47
+		<transitionImplementation name="asSingleton">
  48
+			<body>
  49
+				System.out.println("asSingleton");
  50
+			</body>
  51
+		</transitionImplementation>
  52
+		<transitionImplementation name="emitEvent">
  53
+			<body>
  54
+				System.out.println("emitEvent");
  55
+			</body>
  56
+		</transitionImplementation>
  57
+		<transitionImplementation name="onField">
  58
+			<body>
  59
+				System.out.println("onField");
  60
+			</body>
  61
+		</transitionImplementation>
  62
+		<transitionImplementation name="onKey">
  63
+			<body>
  64
+				System.out.println("onKey");
  65
+			</body>
  66
+		</transitionImplementation>
  67
+		<transitionImplementation name="to">
  68
+			<body>
  69
+				System.out.println("to");
  70
+			</body>
  71
+		</transitionImplementation>
  72
+		<transitionImplementation name="info">
  73
+			<body>
  74
+				System.out.println("info");
  75
+			</body>
  76
+		</transitionImplementation>
  77
+		<transitionImplementation name="build">
  78
+			<body>
  79
+				System.out.println("build");
  80
+				return "Done!";
  81
+			</body>
  82
+		</transitionImplementation>
  83
+
  84
+	</transitions>
  85
+</diezelImplementation>
57  subprojects/s4-edsl/src/main/diezel/s4/s4.xml
... ...
@@ -0,0 +1,57 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<diezel xmlns="http://diezel.ericaro.net/2.0.0/">
  3
+	<package>org.apache.s4.core.edsl</package>
  4
+	<name>S4DSL</name>
  5
+	<expression>(pe , type , (fireOn , ifInterval? )? , (timer, withPeriod)? , (cache, size , expires? )? , asSingleton? , (emitEvent, onField?, onKey?, to )+  )+ , info?, build</expression>
  6
+	<transitions>
  7
+		<transition name="pe">
  8
+			<signature>pe()</signature>
  9
+		</transition>
  10
+		<transition name="type">
  11
+			<signature>type()</signature>
  12
+		</transition>
  13
+		<transition name="fireOn">
  14
+			<signature>fireOn()</signature>
  15
+		</transition>
  16
+		<transition name="ifInterval">
  17
+			<signature>ifInterval()</signature>
  18
+		</transition>
  19
+		<transition name="timer">
  20
+			<signature>timer()</signature>
  21
+		</transition>
  22
+		<transition name="withPeriod">
  23
+			<signature>withPeriod()</signature>
  24
+		</transition>
  25
+		<transition name="cache">
  26
+			<signature>cache()</signature>
  27
+		</transition>
  28
+		<transition name="size">
  29
+			<signature>size()</signature>
  30
+		</transition>
  31
+		<transition name="expires">
  32
+			<signature>expires()</signature>
  33
+		</transition>
  34
+		<transition name="asSingleton">
  35
+			<signature>asSingleton()</signature>
  36
+		</transition>
  37
+		<transition name="emitEvent">
  38
+			<signature>emitEvent()</signature>
  39
+		</transition>
  40
+		<transition name="onField">
  41
+			<signature>onField()</signature>
  42
+		</transition>
  43
+		<transition name="onKey">
  44
+			<signature>onKey()</signature>
  45
+		</transition>
  46
+		<transition name="to">
  47
+			<signature>to()</signature>
  48
+		</transition>
  49
+		<transition name="info">
  50
+			<signature>info()</signature>
  51
+		</transition>
  52
+		<transition name="build">
  53
+			<return>java.lang.String</return>
  54
+			<signature>build()</signature>
  55
+		</transition>
  56
+	</transitions>
  57
+</diezel>
15  subprojects/s4-edsl/src/main/java/Main.java
... ...
@@ -0,0 +1,15 @@
  1
+import org.apache.s4.core.edsl.BuilderS4DSL;
  2
+
  3
+public class Main {
  4
+    public static BuilderS4DSL build() {
  5
+        return new BuilderS4DSL();
  6
+    }
  7
+
  8
+    public static void main(String[] args) {
  9
+
  10
+        String app = new BuilderS4DSL().pe().type().fireOn().ifInterval().cache().size().asSingleton().emitEvent()
  11
+                .onField().to().build();
  12
+        System.out.println(app);
  13
+
  14
+    }
  15
+}

0 notes on commit 924bc55

Please sign in to comment.
Something went wrong with that request. Please try again.