Mercurial > hg > Database > Alice
changeset 15:45e98e74db96
add build.xml
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 15 Jan 2012 01:19:54 +0900 |
parents | e3f1b21718b0 |
children | 433e601a8e28 |
files | build.xml src/alice/daemon/AcceptThread.java src/alice/daemon/Config.java src/alice/test/codesegment/TestRemoteAlice.java |
diffstat | 4 files changed, 81 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build.xml Sun Jan 15 01:19:54 2012 +0900 @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="utf-8"?> + +<project name="FDL" default="jar" basedir="."> + + <!-- ****プロパティ**** --> + <!-- ソースファイルがあるディレクトリ --> + <property name="src" value="src"/> + + <!-- クラスファイルを出力するディレクトリ --> + <property name="classes" value="classes"/> + + <!-- javadocを出力するディレクトリ --> + <property name="javadoc" value="docs"/> + + <!-- jarファイル名 --> + <property name="jar" value="Alice.jar"/> + + <!-- ****ターゲット**** --> + <!-- jarファイルの作成 --> + <target name="jar" depends="compile"> + <jar jarfile="${jar}" basedir="${classes}"> + <zipgroupfileset dir="lib" includes="*.jar" /> + </jar> + </target> + + + <!-- コンパイル --> + <target name="compile"> + <mkdir dir="${classes}" /> + <javac encoding="UTF-8" srcdir="src" destdir="${classes}" fork="yes"> + <compilerarg value="-J-Dfile.encoding=UTF8"/> + <classpath> + <pathelement path="lib/junit.jar" /> + <pathelement path="lib/javassist.jar" /> + <pathelement path="lib/log4j-1.2.16.jar" /> + <pathelement path="lib/slf4j-api-1.6.1.jar" /> + <pathelement path="lib/slf4j-log4j12-1.6.1.jar" /> + <pathelement path="lib/msgpack-0.6.5-SNAPSHOT.jar" /> + </classpath> + <sourcepath> + <pathelement path="src"/> + </sourcepath> + </javac> + </target> + + <!-- javadocの作成 --> + <target name="javadoc"> + <javadoc destdir="${javadoc}"> + <fileset dir="${src}"/> + </javadoc> + </target> + + <!-- 生成したファイルやフォルダの削除 --> + <target name="clean"> + <delete dir="${classes}" /> + <delete dir="${javadoc}" /> + <delete file="${jar}" /> + </target> + +</project> +
--- a/src/alice/daemon/AcceptThread.java Sun Jan 15 00:56:25 2012 +0900 +++ b/src/alice/daemon/AcceptThread.java Sun Jan 15 01:19:54 2012 +0900 @@ -19,7 +19,9 @@ public void run() { while (true) { try { + System.out.println("wait accept..."); Socket socket = ss.accept(); + System.out.println("accepted!"); Connection connection = new Connection(socket); new IncomingTcpConnection(connection, DataSegment.get("local")).start(); new OutboundTcpConnection(connection).start();
--- a/src/alice/daemon/Config.java Sun Jan 15 00:56:25 2012 +0900 +++ b/src/alice/daemon/Config.java Sun Jan 15 01:19:54 2012 +0900 @@ -16,7 +16,7 @@ } else if ("-cp".equals(args[i])) { connectPort = Integer.parseInt(args[++i]); } else if ("-key".equals(args[i])) { - + key = args[++i]; } } }
--- a/src/alice/test/codesegment/TestRemoteAlice.java Sun Jan 15 00:56:25 2012 +0900 +++ b/src/alice/test/codesegment/TestRemoteAlice.java Sun Jan 15 01:19:54 2012 +0900 @@ -15,8 +15,22 @@ public static void main(String[] args) { Config conf = new Config(args); - AliceDaemon daemon = new AliceDaemon(conf); - daemon.listen(); + System.out.println(conf.port); + System.out.println(conf.hostname); + System.out.println(conf.connectPort); + System.out.println(conf.key); + + final AliceDaemon daemon = new AliceDaemon(conf); + new Thread() { + + @Override + public void run() { + // TODO Auto-generated method stub + daemon.listen(); + } + + }.start(); + boolean connect = true; do { try { @@ -28,6 +42,7 @@ System.out.println("connected"); } catch (IOException e) { try { + System.out.println("wait"); Thread.sleep(500); } catch (InterruptedException e1) { e1.printStackTrace();