Mercurial > hg > Database > Christie
changeset 194:28c26ea5ef86
add take Sync Test
author | akahori |
---|---|
date | Wed, 06 Mar 2019 21:40:10 +0900 (2019-03-06) |
parents | f4343de364da |
children | a0be7c83fff8 |
files | src/main/java/christie/test/TakeNotSyncronized/StartTakeNotSync.java src/main/java/christie/test/TakeNotSyncronized/TakeNotSyncCodeGear1.java src/main/java/christie/test/TakeNotSyncronized/TakeNotSyncCodeGear2.java |
diffstat | 3 files changed, 57 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/christie/test/TakeNotSyncronized/StartTakeNotSync.java Wed Mar 06 21:40:10 2019 +0900 @@ -0,0 +1,20 @@ +package christie.test.TakeNotSyncronized; + +import christie.codegear.CodeGearManager; +import christie.codegear.StartCodeGear; + +public class StartTakeNotSync extends StartCodeGear { + public StartTakeNotSync(CodeGearManager cgm) { + super(cgm); + } + + public static void main(String args[]){ + CodeGearManager cgm = createCGM(10000); + cgm.setup(new TakeNotSyncCodeGear1()); // this is not exec + cgm.setup(new TakeNotSyncCodeGear2()); // this is able to exec but not exec + + cgm.getLocalDGM().put("b", 1); + cgm.getLocalDGM().put("c", 1); + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/christie/test/TakeNotSyncronized/TakeNotSyncCodeGear1.java Wed Mar 06 21:40:10 2019 +0900 @@ -0,0 +1,18 @@ +package christie.test.TakeNotSyncronized; + +import christie.annotation.Take; +import christie.codegear.CodeGear; +import christie.codegear.CodeGearManager; + +public class TakeNotSyncCodeGear1 extends CodeGear { + @Take + int a; + + @Take + int b; + + @Override + protected void run(CodeGearManager cgm) { + System.out.println("exec " + getClass().getName()); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/christie/test/TakeNotSyncronized/TakeNotSyncCodeGear2.java Wed Mar 06 21:40:10 2019 +0900 @@ -0,0 +1,19 @@ +package christie.test.TakeNotSyncronized; + +import christie.annotation.Take; +import christie.codegear.CodeGear; +import christie.codegear.CodeGearManager; + +public class TakeNotSyncCodeGear2 extends CodeGear { + @Take + int b; + + @Take + int c; + + @Override + protected void run(CodeGearManager cgm) { + System.out.println("exec " + getClass().getName()); + + } +}