Mercurial > hg > Database > Christie
changeset 135:cf00c3cd7672
add example HelloWorld
author | ichikitakahiro <e165713@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 28 Dec 2018 17:40:03 +0900 |
parents | 8949d0ecf1f6 |
children | 08bd1ecbafc1 |
files | src/test/java/christie/example/HelloWorld/HelloWorldCodeGear.java src/test/java/christie/example/HelloWorld/StartHelloWorld.java |
diffstat | 2 files changed, 36 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/java/christie/example/HelloWorld/HelloWorldCodeGear.java Fri Dec 28 17:40:03 2018 +0900 @@ -0,0 +1,18 @@ +package christie.example.HelloWorld; + +import christie.annotation.Take; +import christie.codegear.CodeGear; +import christie.codegear.CodeGearManager; + +public class HelloWorldCodeGear extends CodeGear { + + @Take + String hello; + @Take + String world; + + @Override + protected void run(CodeGearManager cgm) { + System.out.println(hello + " " + world); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/java/christie/example/HelloWorld/StartHelloWorld.java Fri Dec 28 17:40:03 2018 +0900 @@ -0,0 +1,18 @@ +package christie.example.HelloWorld; + +import christie.codegear.CodeGearManager; +import christie.codegear.StartCodeGear; + +public class StartHelloWorld extends StartCodeGear { + + public StartHelloWorld(CodeGearManager cgm) { + super(cgm); + } + + public static void main(String[] args){ + CodeGearManager cgm = createCGM(10000); + cgm.setup(new HelloWorldCodeGear()); + cgm.getLocalDGM().put("hello","hello"); + cgm.getLocalDGM().put("world", "world"); + } +}