Mercurial > hg > Members > tatsuki > Alice
changeset 339:dba0d22e15d9
Merge with a725e90c3a9b92b3e130fe7c0f2cbf05b6fbfcd0
author | sugi |
---|---|
date | Wed, 16 Apr 2014 16:14:25 +0900 |
parents | 174ea66bf28a (diff) a725e90c3a9b (current diff) |
children | c81dff5460b0 |
files | |
diffstat | 4 files changed, 25 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/daemon/Connection.java Wed Apr 16 16:13:01 2014 +0900 +++ b/src/alice/daemon/Connection.java Wed Apr 16 16:14:25 2014 +0900 @@ -17,7 +17,7 @@ this.socket = socket; } - public Connection() { } + public Connection() {} public void sendCommand(Command cmd) { try { @@ -44,4 +44,15 @@ e.printStackTrace(); } } + + public void close(){ + try { + socket.shutdownOutput(); + socket.shutdownInput(); + socket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + + } }
--- a/src/alice/datasegment/DataSegmentManager.java Wed Apr 16 16:13:01 2014 +0900 +++ b/src/alice/datasegment/DataSegmentManager.java Wed Apr 16 16:14:25 2014 +0900 @@ -61,6 +61,7 @@ public abstract void quickTake(Receiver receiver, CodeSegment cs); public abstract void remove(String key); + public abstract void shutdown(String key); public abstract void close(); public abstract void finish();
--- a/src/alice/datasegment/LocalDataSegmentManager.java Wed Apr 16 16:13:01 2014 +0900 +++ b/src/alice/datasegment/LocalDataSegmentManager.java Wed Apr 16 16:14:25 2014 +0900 @@ -6,6 +6,7 @@ import java.util.concurrent.TimeUnit; import org.apache.log4j.Logger; + import alice.codesegment.CodeSegment; public class LocalDataSegmentManager extends DataSegmentManager { @@ -163,4 +164,9 @@ } + @Override + public void shutdown(String key) { + + } + }
--- a/src/alice/datasegment/RemoteDataSegmentManager.java Wed Apr 16 16:13:01 2014 +0900 +++ b/src/alice/datasegment/RemoteDataSegmentManager.java Wed Apr 16 16:14:25 2014 +0900 @@ -5,6 +5,7 @@ import java.nio.channels.SocketChannel; import org.apache.log4j.Logger; + import alice.codesegment.CodeSegment; import alice.daemon.Connection; import alice.daemon.IncomingTcpConnection; @@ -156,5 +157,10 @@ connection.write(cmd); } + @Override + public void shutdown(String key) { + connection.close(); + } + }