Mercurial > hg > Database > Alice
comparison 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 |
comparison
equal
deleted
inserted
replaced
21:145667a554ad | 22:2ca2d961a8d2 |
---|---|
1 package alice.test.codesegment.remote; | |
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) { | |
15 TestRemoteConfig conf = new TestRemoteConfig(args); | |
16 | |
17 new AliceDaemon(conf).listen(); | |
18 | |
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 | |
36 new RemoteStartCodeSegment().execute(); | |
37 } | |
38 | |
39 } |