Hi Niranjan, What you need to do is to register a listener and pass it over to the Java module rather than calling Jaggery from Java. Its always has to be down in hierarchy where you are allowed to call Java from Jaggery not Jaggery from Java. To achieve this you may have to pass the Java class from Jaggery and get it executed. This way its possible.
I had previously migrated this ntask component to Jaggery 2 years back (if I can remember correctly). It was exposed under system hostobject where you were given setTimeout and setInterval functions with some variations which uses the same task mechanism here. Anyway I believe with the introduction of Javascript timeout and interval functions this has been removed recently. What you can do is to get that implementation working and simply use those functions from Jaggery which is easy. @Ruchira is there any way we can create the Java class from Jaggery code and pass it over to the Java module? If not we may have to bundle the Java class in a module and pass it over to the component from Jaggery which again will have issues since the execution code itself needs to run in the Jaggery environment since it needs access to DB etc. So always there needs to be a listener for this. Regards, Dilshan On Thu, Apr 3, 2014 at 6:00 PM, Niranjan Karunanandham <[email protected]>wrote: > Hi, > > In EMM, there is a Compliance Monitoring which will communicate with the > devices periodically. In a single instance, this can be implemented using > setInterval (jaggery), but in a clustered environment this is not possible > as only one node has to communicate with the devices. For this we are > planning to use the Task Component. > > We need to create a TaskInfo object to which we need to give the task > implementation class which is a java class. The problem that we are facing > is that the actual implementation (Compliance Monitoring function) is in > jaggery. Therefore from the java class, we need to call the javascript > function to use the code that we have written in the emm jaggery app. > > In a gist - we need to have an execution model that allows us to hand over > an object to the task component that can execute a piece of logic. The > execution in this case need to happen in Javascript also making all the > classes and objects in the emm jaggery app available to use. > > We can do this by calling an API from java to the EMM app. Is there a way > to access emm jaggery app code without going througj HTTP?? > > Regards, > -- > > *Niranjan Karunanandham* > Senior Software Engineer - WSO2 Inc. > WSO2 Inc.: http://www.wso2.com > M: +94 777 749 661 <http:///> > -- Dilshan Edirisuriya Senior Software Engineer - WSO2 Mob: + 94 777878905 http://wso2.com/
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
