Mercurial > hg > Database > Christie
changeset 254:04bb299f18bd
tweak
author | ichikitakahiro <e165713@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 24 Jan 2020 18:23:01 +0900 |
parents | aad654568598 |
children | a46033945af9 |
files | src/test/java/christie/example/HelloWorld/FinishHelloWorld.java src/test/java/christie/example/HelloWorld/HelloWorldCodeGear.java |
diffstat | 2 files changed, 28 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/FinishHelloWorld.java Fri Jan 24 18:23:01 2020 +0900 @@ -0,0 +1,23 @@ +package christie.example.HelloWorld; + +import christie.annotation.Peek; +import christie.annotation.Take; +import christie.codegear.CodeGear; +import christie.codegear.CodeGearManager; +import christie.topology.Message; +import christie.topology.node.TopologyNodeConfig; + +public class FinishHelloWorld extends CodeGear { + @Take + Message hello; + + + @Peek + TopologyNodeConfig topologyNodeConfig; + + + @Override + protected void run(CodeGearManager cgm) { + getDGM(topologyNodeConfig.getManagerKey()).put("FINISHMESSAGE", new Message()); + } +}
--- a/src/test/java/christie/example/HelloWorld/HelloWorldCodeGear.java Fri Jan 24 18:03:02 2020 +0900 +++ b/src/test/java/christie/example/HelloWorld/HelloWorldCodeGear.java Fri Jan 24 18:23:01 2020 +0900 @@ -4,6 +4,7 @@ import christie.annotation.Take; import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; +import christie.topology.Message; public class HelloWorldCodeGear extends CodeGear { @@ -14,5 +15,9 @@ protected void run(CodeGearManager cgm) { System.out.print(helloWorld + " "); cgm.setup(new HelloWorldCodeGear()); + if(helloWorld == "world"){ + System.out.println("catch"); + cgm.getLocalDGM().put("finishMessage", new Message()); + } } } \ No newline at end of file