annotate src/main/java/christie/codegear/CodeGearManager.java @ 6:3dcfe63d6394

set type to DataGear by Annotation
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Wed, 27 Dec 2017 00:06:50 +0900
parents 5be6647b87d2
children 21372a589bd3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c082039368f5 make project
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 package christie.codegear;
c082039368f5 make project
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
c082039368f5 make project
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 import christie.datagear.DataGearManager;
1
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
4 import christie.datagear.LocalDataGearManager;
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
5 import christie.datagear.RemoteDataGearManager;
0
c082039368f5 make project
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
6
3dcfe63d6394 set type to DataGear by Annotation
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
7 import java.util.concurrent.ConcurrentHashMap;
0
c082039368f5 make project
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 import java.util.concurrent.ThreadPoolExecutor;
c082039368f5 make project
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
c082039368f5 make project
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 /**
c082039368f5 make project
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 * Created by e125769 on 12/7/17.
1
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
12 * CodeGearの実行
0
c082039368f5 make project
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 */
1
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
14 public class CodeGearManager{
6
3dcfe63d6394 set type to DataGear by Annotation
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
15 private ConcurrentHashMap<String, DataGearManager> dataGearManagers = new ConcurrentHashMap<String, DataGearManager>();
1
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
16 private ThreadPoolExecutor codeGearExecutor;
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
17
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
18 public CodeGearManager(ThreadPoolExecutor exe) {
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
19 dataGearManagers.put("local", new LocalDataGearManager());
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
20 codeGearExecutor = exe;
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
21 }
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
22
6
3dcfe63d6394 set type to DataGear by Annotation
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
23 public DataGearManager getDGM(){
3dcfe63d6394 set type to DataGear by Annotation
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
24 return dataGearManagers.get("local");
5
5be6647b87d2 StartCodeGear implements Runnable to wait InputDataGear
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
25 }
5be6647b87d2 StartCodeGear implements Runnable to wait InputDataGear
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
26
1
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
27 public DataGearManager getDGM(String dest){
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
28 return dataGearManagers.get(dest);
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
29 }
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
30
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
31 public void createRemoteDataGeareManager(String dist){
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
32 dataGearManagers.put(dist, new RemoteDataGearManager());
3ea61d0bfc34 add dependency proccess but not work
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
33 }
6
3dcfe63d6394 set type to DataGear by Annotation
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
34
3dcfe63d6394 set type to DataGear by Annotation
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
35 public void submit(CodeGear cg){
3dcfe63d6394 set type to DataGear by Annotation
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
36 codeGearExecutor.execute(cg);
3dcfe63d6394 set type to DataGear by Annotation
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
37 }
3dcfe63d6394 set type to DataGear by Annotation
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
38
0
c082039368f5 make project
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 }