Main

Java Archives

August 13, 2007

JavaFX compiler source code released

Source code for the OpenJavaFX Compiler is now available. The compiler enables JavaFX Script code to be compiled into Java code. "What you really want to do is compile an entire program, get it all into Java to begin with and it compiles much faster," said Chet Haase, Sun Java chief client architect (via Javaworld)

September 28, 2007

Automating ActionScript 3 classes generation from Java Beans in a LiveCycle Data Services context

In a Flex application that uses LiveCycle Data Services or the previous Flex Data Services to manage data from a remote server there is the requirement that Flex domain model classes have to match Java domain model, in structure, properties and types. Usually it means that for each Java class that is supposed to be configured as a remote alias one should write down an ActionScript class with the same properties, just as described in the Adobe livedocs at Livedocs
The documentation provides a mapping for ActionScript data types and Java data types and specifies that Java classes are dealt with through the Java Beans specification, that can be downloaded here: Javabeans

The Java class is serialized and all of its public properties and the ones with getter and setter methods are serialized. All other properties are not, including the ones without a getter. There is one thing related to the Java beans that worths a bit of attention, and it is bean attribute names that start with a lower case character followed by a upper case character: their getter and setter methods will have get/set followed by at least two upper case characters, for example "aFoo" will have "getAFoo" and "setAFoo". When the Java introspection mechanism, described in the above specification, finds these kind of properties, it will infer that the property is called "AFoo". That implies that inside the ActionScript class that matches the Java bean the property has to be called "AFoo", otherwise it will not be recognized. This usually translates on the flash log in a "ReferenceError: Error #1056: Cannot create property AFoo on [...]".

Consider the case where all of the properties of a class are declared in Java with a lower case followed by an upper case, one could easily convert into an ActionScript class that follows the same naming convention and, at runtime, there will be an empty object, with the right type but no contents; the ReferenceErrors in the flashlog will point out the problem and the solution, in this case, is to call ActionScript properties starting with two upper case characters: "AFoo".

Iin an enterprise application there can be many Java bean classes to be converted to ActionScript counterparts, a simpler way of solving this and possibly other problems related to Java to ActionScript conversion would be the use of an automatic tool. At the time of writing this blog post I personally did not find a tool that performs the conversion, a tool that can be easily integrated into an IDE, like Eclipse, or used as an Ant task, thus I'm considering writing one myself. The backend of this tool would use java.beans.Introspector to get the java.beans.PropertyDescriptor for each property of the bean, map the Java types to the ActionScript ones and generate the required imports. I'll keep the blog updated with progress on the tool, as well as interesting parts of the source code.

February 9, 2008

The new BlazeDS JMSAdapter allows to pass connection-level credentials to JMS

I want to point out for the readers of this blog (mainly Java, Flex and Livecycle developers) an article I published on my personal blog :
Passing connection-level credentials to the JMSAdapter of BlazeDS
One of the limit if the Messaging Services of Livecycle Data Services is the inability to define a username and password in the configuration file to pass them to the JMS.
I discovered that in BlazeDS there is a new JMSAdapter that allows you to set the connection-level credentials passing the username and password.
The new connection-credentials XML node sets the the username and password used while creating the JMS connection.As the documentation said, use only if JMS connection level authentication is being used :



...

Topic
javax.jms.TextMessage
jms/flex/TopicConnectionFactory

jms/topic/flex/simpletopic

NON_PERSISTENT
DEFAULT_PRIORITY
"true"
AUTO_ACKNOWLEDGE

1

For many developers this new features supported by the JMSAdapter could be very appreciated and could solve problems in many different scenarios where the authentication is required in JMS.

Read the full Passing connection-level credentials to the JMSAdapter of BlazeDS article.

March 27, 2008

Comtaste launches new Adobe Flex 3 and Adobe AIR training courses in New York City, London and Milan

Comtaste has just launched its new training courses on Adobe Flex3 and AIR for late spring-early summer 2008.

First courses to be scheduled are:

"Flex 3 and Flex Builder 3: Developing Rich Internet Applications with the new Flex 3 SDKs" (Milan and London 26-29 May, NYC-Manhattan 2-5 June)

"Developing desktop applications with Adobe AIR, Ajax and Flex" (Milan 14-17 April, NYC-Manhattan 9-12 June, London 23-26 June).

Our educational proposal, designed and set up by Flex expert Marco Casario, is mainly the result of our strong experience in real world enterprise projects.

Our courses reflect our clients' training needs that our consultants have encountered in the day by day running of enterprise-class projects, where Flex and AIR are also connected to backend applications under robust and rigid JEE architectures or other server side technologies.

Training programs and other details on company's website www.comtaste.com/en/training.htm

About Java

This page contains an archive of all entries posted to Comtaste Consulting | Enterprise RIA consulting and development in the Java category. They are listed from oldest to newest.

Flex Data Services is the previous category.

Livecycle Data Services is the next category.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33