Well after a lot of searches and research and freaking through forums and blogs, the best solution I could find was to use the Adobe-Java Merapi Bridge.
Merapi allows you to connect an adobe air application to a java application and call its methods.
Google for merapi, and the problem is solved!