Tuesday, January 12, 2010

Adobe Flex and Java with data push live example

Today I want to present to your attention my Adobe Flex 3 + Java rich internet application.
http://myflexapp.daoway.staxapps.net auth: user/user. Under "user" account you'll not able to control scheduler behavior - start and stop. Declarative, role-based method-level security using Spring Security rocks ! :)

I have to say few words about what my RIA actually can do. It could be useful for live JVM memory monitoring and visualization. Or maybe not... Anyway, this is my playground. In the future, source of data for visualization could be anything else. I suppose that approach will remain the same.

I have a Quartz scheduler which is asking for a memory state every 1 sec. Then this data goes to Flex using data push. To view live chart click on menu Live data> Subscribe. BlazeDS is responsible for Flex-Java interaction. I have to admit that it's pleasant to work with Spring-Flex integration. So, if you using Flex and and Spring together - try Spring BlazeDS integration !

You can make a screen shot of current state of free memory chart or go full screen. You can change a number of frames to show on live chart. It was not very hard to implement. I've spent much more time to implement "make snapshot" functionality. The idea is to record memory state every 5 seconds for later analysis. Well, I can add cron job to Quartz scheduler dynamically, but there is no notification functionality for managing "ready state" or "still in progress". I'll implement it later... I have some ideas. So, adding a job to scheduler works and this job can successfully write data to database for later reuse or export. Hibernate is used here. Maybe to heavyweight, but nobody stops me to implement new service implementation using JDBC. Spring and DI should work here. Work on ability to store different snapshots in right way is still in progress. At this moment every data from any request for snapshot goes into the same database table. It's alpha... User registration is also under development. Don't try to register yet, just use credentials I've mentioned before - user/user.

If you have any issues with this application give me a sign, please. Any comments or emails with suggestions or improvements are welcome ! It's early alpha and there is a lot of work to be done to make it looking nice and shiny. So, I hope for your feedback. Maybe I'll share the sources. Thanks !


Diana said...

Great help! Thanks for sharing it!

Stas Ostapenko said...

Hi ! I'm happy to hear that :) Thanks for comment !

Julien Ripault said...

Very interesting and nice work ! Is it possible to look to the sources ? I'm interested in the server push

Stas Ostapenko said...

Hi Julien ! Thanks for comment. If I'm not missing something, source of this application I'd commited to my googlecode

Anonymous said...

Thanks Stas.. that is what i require very much for my project.. Can you please share the code so that i can also use the same?? My email id is jaymehta18@gmail.com