Mercurial > hg > Database > Alice
annotate src/alice/test/codesegment/remote/TestRemoteAlice.java @ 22:2ca2d961a8d2
implements outline of TopologyManager
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 17 Jan 2012 00:40:27 +0900 |
parents | src/alice/test/codesegment/TestRemoteAlice.java@0bb03861b5cd |
children | ca079a730d0b |
rev | line source |
---|---|
22
2ca2d961a8d2
implements outline of TopologyManager
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
1 package alice.test.codesegment.remote; |
14 | 2 |
3 import java.io.IOException; | |
4 import java.net.InetSocketAddress; | |
5 import java.nio.channels.SocketChannel; | |
6 | |
7 import alice.daemon.AliceDaemon; | |
8 import alice.daemon.Connection; | |
9 import alice.datasegment.DataSegment; | |
10 import alice.datasegment.RemoteDataSegmentManager; | |
11 | |
12 public class TestRemoteAlice { | |
13 | |
14 public static void main(String[] args) { | |
22
2ca2d961a8d2
implements outline of TopologyManager
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
15 TestRemoteConfig conf = new TestRemoteConfig(args); |
15 | 16 |
20 | 17 new AliceDaemon(conf).listen(); |
15 | 18 |
14 | 19 boolean connect = true; |
20 do { | |
21 try { | |
22 SocketChannel sc = SocketChannel.open(new InetSocketAddress(conf.hostname, conf.connectPort)); | |
23 Connection connection = new Connection(sc.socket()); | |
24 RemoteDataSegmentManager manager = new RemoteDataSegmentManager(connection); | |
25 DataSegment.regist(conf.key, manager); | |
26 connect = false; | |
27 } catch (IOException e) { | |
28 try { | |
29 Thread.sleep(500); | |
30 } catch (InterruptedException e1) { | |
31 e1.printStackTrace(); | |
32 } | |
33 } | |
34 } while (connect); | |
35 | |
19 | 36 new RemoteStartCodeSegment().execute(); |
14 | 37 } |
38 | |
39 } |