changeset 4:e59c8e99a5c1

modify chapter4
author sugi
date Sun, 04 Jan 2015 04:43:51 +0900
parents cacc83aea539
children c8f50c3ead48
files paper/chapter1.tex paper/chapter3.tex paper/images/DynamicTopologymanagerandnode.graffle paper/images/DynamicTopologymanagerandnode.pdf paper/images/keepAlive.pdf paper/source/CatchClosedEvent.java paper/source/StartCodeSegment.java paper/source/TestCodeSegment.java
diffstat 8 files changed, 189 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/paper/chapter1.tex	Thu Jan 01 12:27:53 2015 +0900
+++ b/paper/chapter1.tex	Sun Jan 04 04:43:51 2015 +0900
@@ -33,10 +33,10 @@
 \subsection{Data Segment API}
 以下が用意されているData Segment APIである。これらを用いてデータの送受信を行う。
 \begin{itemize}
-\item {\ttfamily void put(String key, Object val)}
-\item {\ttfamily void update(String key, Object val)}
-\item {\ttfamily void peek(Receiver receiver, String key)}
-\item {\ttfamily void take(Receiver receiver, String key)}
+\item \verb+void put(String key, Value val)+
+\item \verb+void update(String key, Value val)+
+\item \verb+void peek(Receiver receiver, String key)+
+\item \verb+void take(Receiver receiver, String key)+
 \end{itemize}
 \subsubsection{put}
 putはデータをQueueに追加するためのAPIである。Lindaのout()に相当する。(図 \ref{fig:put})
@@ -100,7 +100,7 @@
 
 \begin{figure}[htbp]
 \begin{center}
-\includegraphics[width=110mm]{images/dsandcs.pdf}
+\includegraphics[width=100mm]{images/dsandcs.pdf}
 \end{center}
 \caption{Code SegmentはInput Data Segment とOutput Data Segmentが存在する}
 \label{fig:dsandcs}
@@ -115,7 +115,7 @@
 
 \begin{figure}[htbp]
 \begin{center}
-\includegraphics[width=120mm]{images/dsandcs2.pdf}
+\includegraphics[width=110mm]{images/dsandcs2.pdf}
 \end{center}
 \caption{Input Data Segment とOut put Data SegmentがCode Segment間の依存関係を自動的に記述する}
 \label{fig:dsandcs2}
@@ -123,6 +123,43 @@
 現在、Inputの場合はsetKeyを呼ぶ際、Outputはput(またはupdate)の際にノードとkeyの指定を行っている。
 しかし、どの時点でノードとkeyの指定を行えばよいか、どのようなAPIを用意するべきかは、議論の余地がある。
 
+\subsection{Code Segmentの実行方法}
+Alice には、Start Code Segment (ソースコード \ref{src:StartCodeSegment})というC の main に相当するような最初に実行される Code Segment がある。
+\begin{table}[html]
+\lstinputlisting[label=src:StartCodeSegment, caption=StartCodeSegmentの例]{source/StartCodeSegment.java}
+\end{table}
+
+Start Code SegmentはどのData Segmentにも依存しない。つまりInput Data Segmentを持たない。
+このCode Segmentをmainメソッド内でnewし、executeメソッドを呼ぶことで実行を開始させることができる。
+
+\subsection{Code Segmentの記述方法}
+Code Segmentをユーザーが記述する際にはCode Segmentを継承して記述する(ソースコード \ref{src:CodeSegment})。
+Code SegmentはInput/Output Data Segment Managerを利用することができる。
+
+Input DSM はCode Segmentの{\tt ids}というフィールドを用いてアクセスする。
+
+\begin{table}[html]
+\lstinputlisting[label=src:CodeSegment, caption=CodeSegmentの例]{source/TestCodeSegment.java}
+\end{table}
+
+\begin{itemize}
+\item {\ttfamily Receiver create(CommandType type)}
+\end{itemize}
+createでコマンドが実行された際に取得されるData Segmentが格納される受け皿を作る。引数にはCommandTypeが取られ、指定できるCommandTypeは{\tt PEEK}または{\tt TAKE}である。
+\begin{itemize}
+\item \verb+void setKey(String managerKey, String key)+
+\end{itemize}
+setKeyメソッドにより、どこのData Segmentのあるkeyに対してpeekまたはtakeコマンドを実行させるかを指定することができる。
+コマンドの結果がレスポンスとして届き次第Code Segmentは実行される。
+
+Output DSMはCode Segmentの{\tt ods}というフィールドを用いてアクセスする。
+Output DSMは{\tt put}または{\tt update}を実行することができる。
+\begin{itemize}
+\item \verb+void put(String managerKey, String key, Object val)+
+\item \verb+void update(String managerKey, String key, Object val)+
+\end{itemize}
+
+
 \section{Meta Data Segment}
 Meta Data SegmentはData Segmentの一種である。Data Segmentは、ユーザーがput(またはupdate)したデータを管理するData Baseであるのに対して、Meta Data Segmentは、分散フレームワークAliceがputしたデータを管理するData Baseである。管理されているデータは、主にTopology Nodeの状態を表すメタデータである。ユーザーがメタデータを扱うこともできる。
 
@@ -134,7 +171,12 @@
 現在のAliceでは、メタデータはデータと同じ領域にputされているため、データと同じAPIを用いて取得できる。
 
 \section{Meta Code Segment}
-Meta Code SegmentはAlice内部で動いているCode Segmentである。つまり、daemonのことである。
+Meta Code SegmentはAliceを構成するCode Segmentである。
+
+
+
+Alice自身が全てCode Segmentで記述されているため、AliceをMeta Code Segmentのかたまりと考える事ができる。
+
 
 \section{Topology Manager}
 Aliceは複数のノードで構成され、相互に接続される。通信するノードはURLにより直接指定するのではなくTopology Managerで管理する。
@@ -193,4 +235,5 @@
 \caption{Topology ManagerとTopology Node間の通信}
 \label{fig:topologymanagerandnode}
 \end{figure}
+
 \section{Aliceによるプログラミング手法}
\ No newline at end of file
--- a/paper/chapter3.tex	Thu Jan 01 12:27:53 2015 +0900
+++ b/paper/chapter3.tex	Sun Jan 04 04:43:51 2015 +0900
@@ -17,9 +17,9 @@
 現在は、TreeVNCのTopologyである木構造のみ指定可能である。引数Childの後に子供の数を指定することで2分木だけではなく3分木などのTopologyを作ることができる。デフォルトでは2分木になっている。
 
 \subsection{Dynamic Topology Managerの参加表明処理}
-トポロジーファイルを指定して起動した場合は、図 \ref{fig:topologymanagerandnode}で示したように、アプリケーションが起動する前に全ての接続すべきTopology Nodeの情報がTopology Nodeにputされ,、接続処理が行われる。
+トポロジーファイルを指定して起動した場合は、図 \ref{fig:topologymanagerandnode}で示したように、アプリケーションが起動する前に全ての接続すべきTopology Nodeの情報がTopology Nodeにputされ、接続処理が行われる。
 
-Dynamic Topologyの場合は、新しくTopology Nodeがアプリケーションに参加するたびにTopology ManagerからTopology Nodeに対して、接続すべきTopology Nodeの情報がputされ、接続処理が行われる。(図 \ref{fig:DynamicTopology})
+Dynamic Topologyの場合は、新しくTopology Nodeがアプリケーションに参加するたびにTopology ManagerからTopology Nodeに対して、接続すべきTopology Nodeの情報がputされ、接続処理が行われる。(図 \ref{fig:DynamicTopology})。
 
 Dynamic Topologyへの参加表明の方法は、従来の方法と同じく、Topology Nodeの起動時にコマンドライン引数からTopology ManagerのIPアドレスとポート番号を指定するだけでよい。
 
@@ -27,28 +27,69 @@
 \begin{center}
 \includegraphics[width=100mm]{images/DynamicTopologymanagerandnode.pdf}
 \end{center}
-\caption{Topology Nodeが参加する毎に接続すべき情報がTopology Nodeに伝えられる}
+\caption{Dynamic Topology ManagerとTopology Node間の通信}
 \label{fig:DynamicTopology}
 \end{figure}
 
 \section{Keep Alive}
 ノード間の通信は、Remote Data Segmentに対してputやpeekを行うことでのみ発生する。従って、Code Segmentの実装次第では、長時間通信が行われない可能性がある。通信が行われない間にRemote Data Segmentとの接続が切れた場合、次の通信が行われるまで切断を発見することができない。また、接続状態ではあるが問題が発生し、応答に時間がかかる場合も考えられる。
-以上の問題を検知するために分散アプリケーションではKeep Aliveという、定期的にheart beatを送り生存確認を行う機能を持つことが望ましい。
-そこで、Alice自体にKeep Aliveの機能を実装した。
+
+以上の問題を検知するためにアプリケーションではKeep Aliveという、定期的にheart beatを送り生存確認を行う機能を持つことが望ましい。そこで、Alice自体にKeep Aliveの機能を実装した。
 
 一定時間内にノードから応答がない場合、Keep Aliveにより、そのノードのRemote Data Segmentが切断される。
 
+
+図 \ref{fig:keepAlive}は、keepAliveの処理をコミュニケーションダイアグラムで示したものである。
+keepAliveは、タスクとタスクを実行するTaskExecuterと実行順序を管理するSchedulerによって実装されている。
+タスクの種類には、{\tt PING}、{\tt CLOSE}、{\tt CREATE}があり、TaskExecuterは、タスクの種類に従って処理を行なう。
+{\tt PING}は、指定されたRemote Data Segmentに対してheartbeatを送信する。
+{\tt CLOSE}は、指定されたRemote Data Segmentを削除する。
+{\tt CREATE}は{\tt PING}のタスクを作成し、Schedulerに登録する。
+
+タスクを作成する際に実行時間の指定をする。Schedulerにタスクを登録すると、Schedulerはタスクの実行時間に従って、タスクを実行順に並び替える。
+\begin{figure}[htbp]
+\begin{center}
+\includegraphics{images/keepAlive.pdf}
+\end{center}
+\caption{keepAliveの仕組み}
+\label{fig:keepAlive}
+\end{figure}
+
+\subsubsection{処理の流れ}
+\begin{enumerate}
+\item CreateTask(Code Segment)により{\tt PING}タスクが投入される。\label{enum:putPingTask}
+\item TaskExecuterはSchedulerから次に実行すべき{\tt PING}タスクを受け取る。
+\item 指定された時間が訪れるとheartbeatがRemote Data Segment(Node B)に送信される。\label{enum:send}
+\item \ref{enum:send}と同時にheartbeatを送信したRemote Data Segmentとの接続を切断する{\tt CLOSE}タスクが投入される。\label{enum:putCloseTask}
+\item \ref{enum:putCloseTask}で投入された{\tt CLOSE}タスクが実行されるまでに、Remote Data Segment(Node B)からのレスポンスがあった場合、RemoveTask(Code Segment)により{\tt CLOSE}タスクが削除される。
+\end{enumerate}
+
+\ref{enum:putPingTask}で作られる{\tt PING}タスクは、接続しているRemote Data Segmentの数だけ投入される。
+"\_CLSIT"というkeyには、アクセス可能なRemote Data Segmentのkeyの一覧が保存されている。
+CreateTaskは、この一欄により動的にタスクを作成している。
+
+以上で説明した処理の流れは、接続状態に問題がない場合である。
+接続状態に問題があり、{\tt CLOSE}タスクの実行されるまでにレスポンスがない場合は、{\tt CLOSE}タスクによりRemote Data Segmentが削除される。
+%Singleton Code Segmentの注意点 ids.initが必要とその理由の記述
+
 \section{切断時の処理}
 DataBaseではデータ更新の際にトランザクション処理に障害が起こった場合、DataBase側でトランザクション処理開始前に戻すロールバックという処理が行われる。
 同様にTreeVNCでは切断を検知した場合、LostParentというメッセージがトップノードに対して送信される。
+
 以上の例のように、アプリケーションはノードの切断に対する処理を用意したい場合がある。
 しかし、Aliceを用いたアプリケーションの場合、アプリケーション側で検知するのは難しい。
 切断自体は、Remote Data Segmentに対してwriteまたはreadを行った際に出るExceptionにより判断することができる。
-だが、I/O の処理はCode Segmentを実行するThreadで行われず、専用のI/O Threadによって行われるためCode SegmentでExceptionを捕まえられない。
-そこで、Aliceが切断を検知、管理する機能 (ClosedEventManager)を追加した。
-アプリケーション側でClosedEventManagerにCode Segmentを登録することで切断時に任意のCode Segmentを実行することができる。
-また、切断したRemote Data Segmentの情報を利用したい場合は、Code Segmentをextends する代わりにClosed Event Code Segmentをextendsし、用意されているMethodを使うことで取得可能である。
+だが、I/O の処理はCode Segmentを実行するThreadで行われない。専用のI/O Threadによって行われるため、Code Segment内でExceptionを捕まえられず、例外として処理することができない。
+
+そこで、Aliceが切断を検知した際に、任意のCode Segmentを実行できる機能 (ClosedEventManager)を追加した。
+ユーザはClosedEventManagerにCode Segmentを登録することで、切断時に例外処理として実行するCode Segmentを指定できる。
+また、切断したRemote Data Segmentの情報を利用したい場合は、Code Segmentをextends する代わりにClosed Event Code Segmentをextendsし、用意されているMethodを使うことで取得可能である(ソースコード \ref{src:CatchClosedEvent})。
 
+\begin{table}[htbp]
+\lstinputlisting[label=src:CatchClosedEvent, caption=CloseEventCodeSegmentを継承したCodeSegment]{source/CatchClosedEvent.java}
+\end{table}
+ClosedEventCodeSegmentを継承したCode Segmentに、Input Data Segmentを追加記述する事ができる。
+その際は、もちろんInput Data Segmentが全て揃うまでCode Segmentは実行されない。
 
 \section{再接続の処理}
 
--- a/paper/images/DynamicTopologymanagerandnode.graffle	Thu Jan 01 12:27:53 2015 +0900
+++ b/paper/images/DynamicTopologymanagerandnode.graffle	Sun Jan 04 04:43:51 2015 +0900
@@ -417,7 +417,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{373.10604510875214, 463.76953125}, {57, 28}}</string>
+			<string>{{409.16854510875214, 459.4375}, {57, 28}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -466,7 +466,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{245.125, 20.875}, {57, 28}}</string>
+			<string>{{315.875, 10.125}, {57, 28}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -515,7 +515,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{239.5625, 452.37109375}, {105, 28}}</string>
+			<string>{{275.625, 448.0390625}, {105, 28}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -583,8 +583,8 @@
 			<integer>298</integer>
 			<key>Points</key>
 			<array>
-				<string>{343.5625, 504.38671875000011}</string>
-				<string>{406.90921393016993, 429.12359109355884}</string>
+				<string>{379.625, 500.05468750000011}</string>
+				<string>{442.97171393016993, 424.79155984355884}</string>
 			</array>
 			<key>Rotation</key>
 			<real>180</real>
@@ -609,7 +609,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{258.75, 279.4609375}, {57, 28}}</string>
+			<string>{{311.625, 269.8828125}, {57, 28}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -677,8 +677,8 @@
 			<integer>294</integer>
 			<key>Points</key>
 			<array>
-				<string>{154.28790978249577, 329.9921875}</string>
-				<string>{378.25, 227.6484375}</string>
+				<string>{207.16290978249577, 320.4140625}</string>
+				<string>{431.125, 218.0703125}</string>
 			</array>
 			<key>Rotation</key>
 			<real>180</real>
@@ -722,8 +722,8 @@
 			<integer>292</integer>
 			<key>Points</key>
 			<array>
-				<string>{223.125, 55.250000000000007}</string>
-				<string>{324.125, 55.249999999999993}</string>
+				<string>{293.875, 44.500000000000007}</string>
+				<string>{394.875, 44.499999999999993}</string>
 			</array>
 			<key>Rotation</key>
 			<real>180</real>
@@ -748,7 +748,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{279.0625, 552.38671875}, {57, 14}}</string>
+			<string>{{315.125, 548.0546875}, {57, 14}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -796,7 +796,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{267.0625, 504.38671875}, {81, 48}}</string>
+			<string>{{303.125, 500.0546875}, {81, 48}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FontInfo</key>
@@ -861,8 +861,8 @@
 			<integer>289</integer>
 			<key>Points</key>
 			<array>
-				<string>{145.53667400105238, 500.76043356511332}</string>
-				<string>{196.7133259989476, 428.76300393488668}</string>
+				<string>{181.59917400105238, 496.42840231511332}</string>
+				<string>{232.7758259989476, 424.43097268488668}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -888,7 +888,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{363.5625, 380.35546875}, {96, 48}}</string>
+			<string>{{399.625, 376.0234375}, {96, 48}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FontInfo</key>
@@ -929,7 +929,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{99.6875, 549.16796875}, {57, 14}}</string>
+			<string>{{135.75, 544.8359375}, {57, 14}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -977,7 +977,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{87.6875, 501.16796875}, {81, 48}}</string>
+			<string>{{123.75, 496.8359375}, {81, 48}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FontInfo</key>
@@ -1018,7 +1018,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{185.5625, 428.35546875}, {57, 14}}</string>
+			<string>{{221.625, 424.0234375}, {57, 14}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -1066,7 +1066,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{173.5625, 380.35546875}, {81, 48}}</string>
+			<string>{{209.625, 376.0234375}, {81, 48}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FontInfo</key>
@@ -1107,7 +1107,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{257.5625, 365.91796875}, {103, 28}}</string>
+			<string>{{293.625, 361.5859375}, {103, 28}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -1180,8 +1180,8 @@
 			<integer>281</integer>
 			<key>Points</key>
 			<array>
-				<string>{391.11728070500004, 428.73860438156697}</string>
-				<string>{328.0077192949999, 504.00358311843308}</string>
+				<string>{427.17978070500004, 424.40657313156697}</string>
+				<string>{364.0702192949999, 499.67155186843308}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -1233,8 +1233,8 @@
 			<integer>280</integer>
 			<key>Points</key>
 			<array>
-				<string>{363.0625, 404.3554585086867}</string>
-				<string>{255.0625, 404.3554585086867}</string>
+				<string>{399.125, 400.0234272586867}</string>
+				<string>{291.125, 400.0234272586867}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -1262,7 +1262,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{346.25, 173.2109375}, {96, 48}}</string>
+			<string>{{399.625, 162.34624734355896}, {96, 48}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FontInfo</key>
@@ -1303,7 +1303,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{82.875, 347.5859375}, {57, 14}}</string>
+			<string>{{135.75, 338.0078125}, {57, 14}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -1351,7 +1351,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{70.875, 299.5859375}, {81, 48}}</string>
+			<string>{{123.75, 290.0078125}, {81, 48}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FontInfo</key>
@@ -1392,7 +1392,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{154.25, 221.2421875}, {57, 14}}</string>
+			<string>{{221.625, 209.578125}, {57, 14}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -1440,7 +1440,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{142.25, 173.2421875}, {81, 48}}</string>
+			<string>{{209.625, 161.578125}, {81, 48}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FontInfo</key>
@@ -1481,7 +1481,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{116, 252.2421875}, {101, 28}}</string>
+			<string>{{168.875, 242.6640625}, {101, 28}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -1530,7 +1530,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{229.25, 151.2421875}, {103, 28}}</string>
+			<string>{{293.625, 148.8984375}, {103, 28}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -1603,8 +1603,8 @@
 			<integer>241</integer>
 			<key>Points</key>
 			<array>
-				<string>{345.79348605349213, 218.85898680474884}</string>
-				<string>{152.33151394625867, 305.28852887611276}</string>
+				<string>{399.16912903635364, 208.1768803951272}</string>
+				<string>{205.20589705503198, 295.56237277554931}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -1656,8 +1656,8 @@
 			<integer>249</integer>
 			<key>Points</key>
 			<array>
-				<string>{345.75000000545776, 197.21810354723033}</string>
-				<string>{223.74999999454201, 197.23612948047321}</string>
+				<string>{399.12500354020466, 186.16373670070135}</string>
+				<string>{291.12499522444659, 185.75732118760587}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -1685,7 +1685,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{150.875, 92.125}, {57, 14}}</string>
+			<string>{{221.625, 81.375}, {57, 14}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -1733,7 +1733,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{262.375, 78.125}, {27, 28}}</string>
+			<string>{{333.125, 67.375}, {27, 28}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -1806,8 +1806,8 @@
 			<integer>246</integer>
 			<key>Points</key>
 			<array>
-				<string>{321.375, 68.124990879811577}</string>
-				<string>{220.375, 68.124990879811577}</string>
+				<string>{392.125, 57.374990879811577}</string>
+				<string>{291.125, 57.374990879811577}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -1835,7 +1835,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{138.875, 44.125}, {81, 48}}</string>
+			<string>{{209.625, 33.375}, {81, 48}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FontInfo</key>
@@ -1876,7 +1876,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{321.875, 44.125}, {96, 48}}</string>
+			<string>{{392.625, 33.375}, {96, 48}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FontInfo</key>
@@ -1965,7 +1965,7 @@
 	<key>MasterSheets</key>
 	<array/>
 	<key>ModificationDate</key>
-	<string>2015-01-01 01:58:44 +0000</string>
+	<string>2015-01-01 12:10:26 +0000</string>
 	<key>Modifier</key>
 	<string>YuSugimoto</string>
 	<key>NotesVisible</key>
@@ -2037,13 +2037,13 @@
 	<key>WindowInfo</key>
 	<dict>
 		<key>BottomSlabHeight</key>
-		<real>714</real>
+		<real>669</real>
 		<key>CurrentSheet</key>
 		<integer>0</integer>
 		<key>Expanded_Canvases</key>
 		<array/>
 		<key>Frame</key>
-		<string>{{5, -0}, {1893, 1058}}</string>
+		<string>{{-2, 45}, {1239, 1013}}</string>
 		<key>ShowInfo</key>
 		<true/>
 		<key>ShowRuler</key>
@@ -2053,7 +2053,7 @@
 		<key>SidebarWidth</key>
 		<integer>230</integer>
 		<key>VisibleRegion</key>
-		<string>{{-393, -66}, {1346, 916}}</string>
+		<string>{{-66, -44}, {692, 871}}</string>
 		<key>Zoom</key>
 		<real>1</real>
 		<key>ZoomValues</key>
Binary file paper/images/DynamicTopologymanagerandnode.pdf has changed
Binary file paper/images/keepAlive.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/source/CatchClosedEvent.java	Sun Jan 04 04:43:51 2015 +0900
@@ -0,0 +1,12 @@
+import alice.codesegment.CloseEventCodeSegment;
+import alice.daemon.ConnectionInfo;
+
+public class CatchClosedEvent extends CloseEventCodeSegment{
+
+    @Override
+    public void run() {
+        ConnectionInfo e = getConnectionInfo();
+        System.out.println("IPAddr "+ e.addr);
+        System.out.println("port "+ e.port);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/source/StartCodeSegment.java	Sun Jan 04 04:43:51 2015 +0900
@@ -0,0 +1,13 @@
+public class StartCodeSegment extends CodeSegment {
+
+    @Override
+    public void run() {
+        System.out.println("run StartCodeSegment");
+	
+        new TestCodeSegment();
+        System.out.println("create TestCodeSegment");
+	
+        ods.update("local", "key1", "String data");
+    }
+
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/source/TestCodeSegment.java	Sun Jan 04 04:43:51 2015 +0900
@@ -0,0 +1,19 @@
+public class TestCodeSegment extends CodeSegment { 
+    private Receiver input1 = ids.create(CommandType.TAKE);
+    
+    public TestCodeSegment() {
+        input1.setKey("local", "key1");
+    }
+    
+    @Override
+    public void run() {
+        int num = input1.asInteger();
+        System.out.println("data = " + num);
+	
+        if (num == 10)
+            System.exit(0);
+	
+        new TestCodeSegment();
+        ods.update("local", "key1", ++num);
+    }
+}
\ No newline at end of file