Skip to main content

M123 a first FMP 3 demo

Posted by rexyoung on October 9, 2013 at 11:56 PM PDT

FMP 2 focuses on local services that run concurrently to each other while FMP 3 focuses on distributed services that work together seamlessly. And uses of these services are sharing a unified API and programming model.

M123 is a first demo about FMP 3. The demo contains three standalone programs: M1.java, M2.java, and M3.java. The setup around them is illustrated by figure 1.


Figure 1: Demo M123 setup

You can find all needed classes in the attached M123.zip file. You need three dos/term command line windows. In the first one, run ‘java M3’. Then in the second, run ‘java M2’, and in the last, run ‘java M1’. Each program contains a messenger that hosts a same name service called "calc".

Once all three programs are established, they are connected with a socket connection. The m1 and m2 are directly connected while the m2 and m3 are directly connected as well. On the other hand, the m1 and m3 are indirectly connected through the m2.

There are three tests that are all executed from within the m1.

messenger.callService ("m1 :: calc : multiply", n1, n2);
messenger.callService ("m2 :: calc : multiply", n1, n2);
messenger.callService ("m3 :: calc : multiply", n1, n2);

The demo can be further developed to support a complex network of distributed messengers shown in the figure 3 in my previous post (see below.)