changeset 343:712f9e57806e

merge
author sugi
date Wed, 16 Apr 2014 17:33:44 +0900
parents c81dff5460b0 (diff) 9a804d4db491 (current diff)
children 9f97ec18f8c5
files
diffstat 5 files changed, 69 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build.gradle	Wed Apr 16 17:33:44 2014 +0900
@@ -0,0 +1,44 @@
+apply plugin: 'java'
+apply plugin: 'eclipse'
+
+version = '1.0'
+
+dependencies {
+    compile fileTree(dir: 'lib', include: '*.jar')
+    runtime fileTree(dir: 'lib', include: '*.jar')
+    testCompile group: 'junit', name: 'junit', version: '4.+'
+}
+
+jar {
+    copy {
+        from configurations.compile
+        into 'app/lib'
+    }
+    
+    def manifestClasspath = configurations.compile.collect{ 'lib/' + it.getName() }.join(' ')
+    manifest {
+        attributes 'Implementation-Title': 'Gradle Quickstart'
+        attributes 'Implementation-Version': version
+        attributes 'Main-Class' : 'org.gradle.GradleMain'
+        attributes 'Class-Path': manifestClasspath
+    }
+    
+    from (configurations.compile.resolve().collect { it.isDirectory() ? it : fileTree(it) }) {
+        exclude 'META-INF/MANIFEST.MF'
+        exclude 'META-INF/*.SF'
+        exclude 'META-INF/*.DSA'
+        exclude 'META-INF/*.RSA'
+        exclude '**/*.jar'
+    }
+    
+    destinationDir = file('app')
+    archiveName = 'GradleTest.jar'
+}
+
+repositories {
+    mavenCentral()
+}
+
+test {
+    systemProperties 'property': 'value'
+}
--- a/src/alice/daemon/Connection.java	Wed Apr 16 16:28:11 2014 +0900
+++ b/src/alice/daemon/Connection.java	Wed Apr 16 17:33:44 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:28:11 2014 +0900
+++ b/src/alice/datasegment/DataSegmentManager.java	Wed Apr 16 17:33:44 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:28:11 2014 +0900
+++ b/src/alice/datasegment/LocalDataSegmentManager.java	Wed Apr 16 17:33:44 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:28:11 2014 +0900
+++ b/src/alice/datasegment/RemoteDataSegmentManager.java	Wed Apr 16 17:33:44 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();
+	}
+
 
 }