Skip navigation
Home/Support/

Forums

768 Views 5 Replies Latest reply: Jan 4, 2009 7:20 AM by FlexNewbie2009 RSS
FlexNewbie2009 Calculating status... 5 posts since
Jan 3, 2009
Currently Being Moderated

Jan 3, 2009 5:35 PM

Flex/AIR + Java Integration

Hello everyone,

I am a Flex+AIR newbie and just wonder if it's possible to develop a layered FLEX/AIR application where only the presentation layer is built in Flex and the business logic / DB access layer is Java. But not in a web or J2EE context with a remote server.

The scenario I have in mind is the following:

1. A Flex application is deployed on the user's local machine via AIR.
2. The user starts the application. So far so good.
-----------------------------------------------
3. On startup the application performs a method call on a Java class located on the user's local machine's class path.
4. The method call triggers a multithreaded Java engine to get started.
5. The Flex app "talks" to the Java engine and vice versa.

Several questions arise here:

a: How can a Flex app "speak" to Java classes? Is it possible at all?
b: I heard of a "RemoteObject" tag. Is this the way to go?
c: Can a Flex app start a process on the local machine (e.g. a JVM)?
d: Is it possible to deploy the Java JAR file "piggy-back" with the Flex/AIR app?

Or e: Maybe I am on a totally wrong track. Can anybody suggest a better solution?

It should be possible since Bruce Eckel of Adobe writes: "However, a Flex UI is not limited to communicating with a server. It can also communicate with a local application. Thus, you can create an application in any language you prefer, even a dynamic language like Python or Ruby, and use Flex to build a beautiful UI." ( http://www.adobe.com/devnet/flex/articles/hybridizing_java_08.html)

Thanks in advance!

Best Regards,
Phil
  • BB_Cool User 12 posts since
    Jan 6, 2008
    Currently Being Moderated
    1. Jan 3, 2009 11:15 PM (in response to FlexNewbie2009)
    Re: Flex/AIR + Java Integration
    I have the exact same needs but after voicing the need for the ability to invoke a Java class for a year I still haven't heard a definitive answer.
  • pquaid Calculating status... 3 posts since
    Jan 4, 2009
    Currently Being Moderated
    3. Jan 4, 2009 6:30 AM (in response to FlexNewbie2009)
    Re: Flex/AIR + Java Integration
    I've got similar research going on for a project that sounds similar (multi-threaded java app with an AIR-based GUI). This is by no means a definitive answer but what I (think) I've found so far:

    a. I've found something called merapi ( http://merapiproject.net/) that appears to let an air app and a java app exchange AMF messages w/out the use of blazeDS and a J2EE container. A caveat though: I haven't tried it yet and I'm having trouble getting access to the code.

    b. don't know yet

    c. I haven't yet found a way to do that. My current thinking is that my multi-threaded java application will have to start first and then launch the AIR app via something like ProcessBuildier or Runtime.getRuntime().exec(). This creates some additional problems but it's the only way I can find so far.

    d. don't know yet

More Like This

  • Retrieving data ...

Bookmarked By (0)