GraphStream Users

Archives de la liste Aide

Re: Questions about RMI

Chronologique Discussions 
  • From: Yoann Pigné <yoann.pigne AT>
  • To: graphstream-users AT
  • Subject: Re: Questions about RMI
  • Date: Thu, 20 Oct 2011 16:27:31 +0200

Hi Numo,

In the documentation, the "Generator" part is just an example. Actually the
RMISink only waits for a source to register on it. A Graph is a source too,
so you can replace the "generator" part with your graph.

From the example on the documentation :

Generator gen = new XXXGenerator();

can become:

Graph g = new DefaultGraph("My graph");

and then you can use the addNode/Edge methods you are used to :

g.addEdge("edge1", "node1","node2");

Hope It will help you,

Let us know,


On Oct 20, 2011, at 3:55 PM,
<Nuno.Carvalho AT>

> Dear all,
> I’m just started using GraphStream and I must say that this is a very
> powerful tool.
> Now I want to use it with the RMI functionality. I want to implement the
> following scenario:
> - Process A is generating Nodes and Edges for the Graph
> - Process B is just getting the new nodes and edges and displaying
> it on the screen.
> For that, I’ve been trying to follow this tutorial:
> So, before I had something like this:
> Graph graph = new SingleGraph(“g”);
> graph.display();
> graph.addNode(...);
> graph.addEdge(...);
> // and so on...
> Now I have this code split in two parts:
> On one side, I have the part that displays the graph on the screen, which
> is very simple:
> RMISource source = new RMISource();
> Graph graph = new DefaultGraph(“g”);
> source.addSink(graph);
> graph.display();
> On the other process, I must have an RMISink where I push the new nodes and
> edges, right?
> So, I must have the following:
> RMISink sink = new RMISink();
> Sink.register(...);
> Then, according to the Tutorial, I have to create a Generator, connect it
> to the Sink and start loop on the generator.nextEvents();
> The questions that I have are the following:
> - The generator must be implemented by myself, based on my graph
> data source, or I can use some already implemented Generator with a
> interface similar to what I have for graphs(addNode, addEdge, etc)?
> - If I need to implement my own generator, how should I do it? Is
> there any tutorial to do this? I’m missing this part: how to add nodes and
> edges, and push it to the RMISink...
> All help will be much appreciated!
> Thanks and kind regards,
> Nuno
> ______________________________________________________________________
> Fujitsu Laboratories of Europe Limited
> Hayes Park Central, Hayes End Road, Hayes, Middlesex, UB4 8FE
> Registered No. 4153469
> This e-mail and any attachments are for the sole use of addressee(s) and
> may contain information which is privileged and confidential. Unauthorised
> use or copying for disclosure is strictly prohibited. The fact that this
> e-mail has been scanned by Trendmicro Interscan does not guarantee that
> it has not been intercepted or amended nor that it is virus-free.

Archives gérées par MHonArc 2.6.16.

Top of page