edgent-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gayashan Amarasinghe <gayashan.amarasin...@gmail.com>
Subject Looking for samples and some help on Loosely coupled Edgent applications
Date Wed, 31 May 2017 03:11:46 GMT
Hi Edgent community,

I am a PhD student from University of Melbourne and I am interested in the
Apache Edgent project. I need some help to implement a scenario to submit a
topology externally to a provider. Unfortunately apart from some test cases
in the source code and [1], I couldn't find any documentation on this. So
here's what I have done so far,

   - I have implemented the TopologyBuilder interface and created a
   separate jar. This is the code in the class.

public class MyTopology implements TopologyBuilder {


    public String getName() {

        return "MyCPUTempApp";



    public BiConsumer<Topology, JsonObject> getBuilder() {

        CPUTempSensor cpuTempSensor = new CPUTempSensor();

        return (t, c) -> t.poll(cpuTempSensor, 2, TimeUnit.SECONDS)

                .filter(readings -> readings >



   - In a separate project, I have created another class to instantiate a
   DirectProvider and to load the previous jar using an AppService similar to
   the IotAppServiceTest. Here's the code,

public class DynamicAppLoader {
    public static void main(String[] args) {
        DirectProvider directProvider = new DirectProvider();
        JsonControlService jsonControlService = new JsonControlService();
        ApplicationService service =
AppService.createAndRegister(directProvider, directProvider);
        File cpuTempAppJar =
        try {
            URL cpuTempAppJarUrl = cpuTempAppJar.toURI().toURL();
            JsonObject registerJar =
            JsonObject submitCpuTempApp = newSubmitRequest("MyCPUTempApp");
        } catch (Exception e) {
            System.err.println("Error: " + e.getLocalizedMessage());

// newRegisterJarRequest and newSubmitRequest methods are as same as in
the IotAppServiceTest class.

But unfortunately I don't understand how to get this to work. Can someone
help me with this and point where I am making a mistake? Apologies in
advance if this seems like a trivial question.

Thank you.


Best regards,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message