Oracle Blog

Some thoughts and comments about the Java world

mardi mars 24, 2009

Sun is making available GlassFish Tools for Eclipse (v0.9, final version to be release soon). This is a pre-configured package containing Eclipse 3.4.1 alongside with GlassFish v2.1 and GlassFish v3 prelude and the required Eclipse plugins to effectively manage and deploy applications to GlassFish right from the IDE.

Q: Who is the target for this offering?A:Developers or organizations that have already standardized on or prefer Eclipse over NetBeans.

Q: Why has Sun created this offering?A:Sun has created a strong preference for GlassFish among
NetBeans users. However, a large community of developers have chosen
Eclipse as their IDE of choice. Today those developers have to
download open source products from multiple locations and configure
them to work together (error prone), increasing the barrier to entry.
This offering creates a positive feature-rich out-of-the-box experience
for Eclipse developers. In additional, developers can now leverage the
open source plugins created by competitive frameworks (Spring, SEAM,
Hibernate, etc) within a GlassFish-focused IDE. This bundle will also
improve the relationship between the community of Eclipse developers
and Sun.

Q: Is Sun moving away from Netbeans towards Eclipse?A:No. Sun is expanding its reach by embracing not just the
NetBeans developer community, but also the Eclipse community. This is a
consistent with Sun's strategy of using open source to "lower the
barrier to entry" - in this case to a large developer community.

lundi janv. 19, 2009

While writing Rich Internet Application with JavaFX is relatively easy and well documented, fetching data from remote sources seemed more obscure to me. The documentation is minimal and I did not found any good tutorial describing the various techniques available to connect to a remote web service and how to parse the results.

While this blog entry do not aim at being such a tutorial, I will just give an example I developed over the week end to integrate a JSon based REST web service from a JavaFX application.

In my JavaFX application, I want to call this web service on a regular basis. I therefore choose to use the Timer and TimerTask Java classes to wrap the calling code and execute it on a regular time-based interval.

The first piece of code is a custom TimerTask. It wraps the JavaFX provided RemoteTextDocument, a very easy to use class that wraps the HTTP communication.

The URL connection is made automatically when creating an instance of the class.

To get access to the document in an asynchronous way, I am using the bind and on replace capabilities provided by JavaFX.

My returnValue variable is bound to request.document, meaning that every time request.document is modified, returnValue is updated to reflect the new value.

The on replace trigger, allows to execute some code when the value of returnValue is changing, basically, it parses the resulting String with the Java based JSon classes and create an array of Number.

Easy to write, to read and very efficient !

The last step is to create a Java Timer to trigger the TimerTask on a regular basis. I want this process to start as soon as the JavaFX application starts. JavaFX does provide a run() function for this purpose.

lundi nov. 17, 2008

One of the interesting way to mesure the popularity of a software platform or framework is to capture the number of job posting requiring experience with the platform or the framework.

This is the type of search indeed.com allows to conduct. And guess what ? GlassFish experience appearing in job postings increased ~700% during the last two quarters ! More than 6 times the growth of popularity of the other application servers.

Until today, customers had either to download the latest stable build from our open source and community web sites (such as OpenSSO, OpenESB), either to subscribe to the commercial equivalent of these tools (Access Manager, Java CAPS) .

Once again, Sun is changing the rules.

GlassFishESB will be the officially supported version of the community open source project OpenESB, with stable releases on a more frequent basis than the commercial equivalent Java CAPS, also based on OpenESB.

But we don't want to leave our Java CAPS customers behind, therefore the components that are being released with GlassFish ESB are targeted for use by Java CAPS customers as well. The objective being that Java CAPS or ESB Suite customers can use all of the capabilities released with GlassFish ESB at the time they are available.

Further, going forward, customers who buy the higher levels Suites should not be "disadvantaged" in terms of either not having access to new components and also having access to them at the same time. In other words, we want customers of the "suites" to have the benefits and flexibility of the community approach as well

Similarly, OpenSSO Express
is the supported version of OpenSSO, available to Access Manager
customers. Access Manager releases are published every 12-15 months,
while OpenSSO Express releases are planed every 3 months.

jeudi août 02, 2007

I tried to implement the concept presented in this excellent article from my colleagues Robert Skoczylas and Marina Sum. Their article is quite well detailed. I thought the implementation would be painless and that I should have a demo to show to partners and customers in a couple of minutes.

Actually, it was a little more complex than I originally anticipated and I would like to share and describe my experience with you. Reading the above-mentioned article is a prerequisite to understand or implement the project described here under.

user authorization - with the help of the Policy Agent for URL authorization and a Custom Policy Service and the AM Client SDK for fine grained authorization.

The NetBeans project and some other supporting file needed to compile and run this example are also available.

To implement the concept presented in the above mentioned article, you have to

#1 Download & Install NetBeans 6.0

At the time of this writing, the latest beta version of NetBeans is 6.0 M10. Install it using a full option installation : this will install Glassfish, OpenSSO, JBI, ...

The NetBeans 6.0 installer will take care of installing and configuring Glassfish and OpenSSO for you. However, you will need to change one OpenSSO configuration parameter, as the default value is incorrectly set by the installer (See CR110896).

Open the file : <glassfish root>/domains/domain1/config/amflatfiledir/AMConfig.properties

#2 Add AM Admin Tools

Access Manager comes with a set of command line tools allowing you to manage the server, add or modify services etc ... Unfortunately, the OpenSSO implementation bundled with NetBeans 6M10 does not include these command line tools. You will need these tools to install a Custom Policy Service, as described below.

Modify web.xml to add the <filter> element that will enable the Policy Agent as described in the documentation. (you can also have a look at my web.xml in the NetBeans project provided with this blog entry)

#7 Call The Custom Policy service from your code

The next steps involve modifying the code in a web application to call the OpenSSO Custom Policy Service we just created.

The Java code is explained in Robert and Marina's article. You will find it also in the NetBeans project I do provide with this blog entry.

You will need to change the NetBeans project classpath to compile it because the code refers to classes provided by the AM Client SDK. Strictly speaking, it is not necessary to install the AM Client SDK because all the required jar files and config files are already installed as part of the OpenSSO and Policy Agent installation.

I choose to use the files provided by the Policy Agent. the files you need to add to your project classpath are :

<policy agent root>/Agent_001/config

<policy agent root>/locale

<policy agent root>/lib/amclientsdk.jar

#8 Create users, roles and policies with OpenSSO console

I created three users and three roles.

Then I created three policies, each one giving an access level (Hidden, Read Only, Full) to each role.

#9 Deploy, Test the application and have fun !

Depending on the user you authenticate with, you will have partial or full access to all attributes on the screen.

Should you have comments, remarks about missing pieces or errors in this short tutorial, do not hesitate to leave your comments.

About

Sébastien Stormacq is a Senior Software Architect at Sun Microsystems. He uses his 15+ years of professional experience to design large scale, secured and highly transactional architectures based on Sun's middleware solutions.