0

I am interested in the dynamic reconfiguration capabilities of OW2 FraSCAti. (e.g Starting/Stopping of SCA Components). So far, I can see that there are two ways to achieve this.

1- By using FraSCAti FScript, as the following:

FraSCAtiFScript> $root
#<scacomponent: reconfig>

FraSCAtiFScript> stop($root)
FraSCAtiFScript> state($root)
STOPPED

FraSCAtiFScript> start($root)
FraSCAtiFScript> state($root)
STARTED 

2- By using FraSCAti Explorer GUI, for example, stopping a component as the following:

enter image description here

But I would like to perform these reconfigurations programmatically, by having an access to the API. Is there an example for doing this?

Source: http://frascati.ow2.org/doc/1.4/ch09s02.html#d95e926

Traveling Salesman
  • 2,209
  • 11
  • 46
  • 83

1 Answers1

0

You could use the Remote API. From the example:

Reconfigure with FraSCAti FScript

import org.ow2.frascati.remote.introspection.resources.Node;

Collection<Node> result;

System.out.println("Before reconfiguration:");
result = reconfiguration.eval("$domain/scadescendant::services;");
System.out.println(result);

reconfiguration.eval("set-state($domain/scadescendant::services, \"STOPPED\");");

System.out.println("After reconfiguration:");
result = reconfiguration.eval("$domain/scadescendant::services;");
System.out.println(result);

Query with FraSCAti FScript

import org.ow2.frascati.remote.introspection.resources.Node;

Collection<Node> result = reconfiguration.eval( 
    "$domain/scadescendant::component-factory/scaservice::*;"
);

System.out.println(result);
Miguel Jiménez
  • 1,276
  • 1
  • 16
  • 24