Mercurial > hg > Database > Christie
changeset 252:be7063c0684b
add key/dg setup in local REPLY
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 25 Jan 2020 15:14:38 +0900 |
parents | e8f6c35e6b69 |
children | 9b0ad65ae5c0 |
files | src/main/java/christie/datagear/LocalDataGearManager.java src/main/java/christie/datagear/command/CommandBuilder.java src/main/java/christie/datagear/command/RemoteTakeCommand.java |
diffstat | 3 files changed, 10 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/christie/datagear/LocalDataGearManager.java Sat Jan 25 14:45:25 2020 +0900 +++ b/src/main/java/christie/datagear/LocalDataGearManager.java Sat Jan 25 15:14:38 2020 +0900 @@ -28,11 +28,9 @@ switch (cm.type) { case PUT: dataGears.setData(cm); - if (waitList.containsKey(cm.key)){ runCommand(waitList.getAndRemoveCommand(cm.key)); } - break; case TAKE: case REMOTETAKE: @@ -48,20 +46,17 @@ case REPLY: cm.execute(); break; - } } private void setData(Command cm){ cm.setDg(dataGears.getData(cm)); } + @Override public void resolveWaitCommand(String key, DataGear dg) { - } - - @Override public void finish() { System.exit(0); @@ -69,11 +64,9 @@ @Override public void close() { - } @Override public void shutdown() { - } }
--- a/src/main/java/christie/datagear/command/CommandBuilder.java Sat Jan 25 14:45:25 2020 +0900 +++ b/src/main/java/christie/datagear/command/CommandBuilder.java Sat Jan 25 15:14:38 2020 +0900 @@ -31,42 +31,42 @@ } - public CommandBuilder key(String key){ + public CommandBuilder key(String key) { this.key = key; return this; } - public CommandBuilder toDgmName(String toDgmName){ + public CommandBuilder toDgmName(String toDgmName) { this.toDgmName = toDgmName; return this; } - public CommandBuilder fromDgmName(String fromDgmName){ + public CommandBuilder fromDgmName(String fromDgmName) { this.fromDgmName = fromDgmName; return this; } - public CommandBuilder cgmID(int cgmID){ + public CommandBuilder cgmID(int cgmID) { this.cgmID = cgmID; return this; } - public CommandBuilder cg(CodeGear cg){ + public CommandBuilder cg(CodeGear cg) { this.cg = cg; return this; } - public CommandBuilder dg(DataGear dg){ + public CommandBuilder dg(DataGear dg) { this.dg = dg; return this; } - public CommandBuilder clazz(Class clazz){ + public CommandBuilder clazz(Class clazz) { this.clazz = clazz; return this; } - public CommandBuilder connection(Connection connection){ + public CommandBuilder connection(Connection connection) { this.connection = connection; return this; }
--- a/src/main/java/christie/datagear/command/RemoteTakeCommand.java Sat Jan 25 14:45:25 2020 +0900 +++ b/src/main/java/christie/datagear/command/RemoteTakeCommand.java Sat Jan 25 15:14:38 2020 +0900 @@ -20,7 +20,7 @@ @Override public void execute() { - new CommandBuilder().init(CommandType.REPLY).connection(connection).build().execute(); + new CommandBuilder().init(CommandType.REPLY).connection(connection).key(key).dg(dg).build().execute(); } @Override