Skip navigation
ANNOUNCEMENT: is currently Read only due to planned upgrade until 29-Sep-2020 9:30 AM Pacific Time. Any changes made during Read only mode will be lost and will need to be re-entered when the application is back read/write.

The Way It Goes Blog

Posted by kfarnham Sep 29, 2006

Do great libraries come from ivory towers or rugged trenches?

Artima linked to yesterday's feature article Jini Beyond the Choir, which features an audio/video re-creation of Daniel's presentation from the 10th Jini Community Meeting. One of the comments says:

What Steinberg doesn't mention (at least in the brief excerpt quoted at Artima) is that the lack of a decent application to illustrate the value of the technology is exactly what was wrong with Sun's strategy on a number of fronts including JINI.

Imagine the yawns the would have resulted if Google had simply written a white paper (as Sun is so fond of doing) describing how an AJAX style application could be written instead of writing an interesting one.

It's unfortunate that the poster didn't think to actually watch the presentation (c'mon, it's only 13 minutes!), because Daniel does address this directly. He says explicitly that Jini needs "a good jump-start book and a killer app."

But that does raise a larger issue. For all the praise heaped on Jini, not a lot of people actually use it. Here's a troubling hypothesis to consider: what if, despite its technical elegance, it's not sufficiently grounded in real-world needs to be useful? What if it's not that it hasn't been promoted well, but that it doesn't solve the right problems, or solve them the right way? The idea is surely blasphemy to the Jini audience, which notes that Jini advocated software-as-service long before "service oriented architecture" became a buzzword du jour.

But let's think of this: would Jini be different if it had been created to fulfill a need in some other application, rather than being created as an end in itself. This is wildly speculative, of course: what the heck is this fanciful application that would need Jini-like functionality? But a knock on some Java technologies that come from big specs and big thinkers is that they try to solve too many problems, too early. And wouldn't that make as much sense asboiling oceans when you just need a cup of tea?

There's a camp that argues the best libraries are those that emerge from ad hoc solutions in doing other work. The first cut of servlets left programmers tending to put HTML in their Java code, a maintenance nightmare. With perhaps more than a little inspiration from ASP, someone took the approach of putting a little Java (or calls to server-side beans) in HTML and Java Server Pages were born. On the one hand, you'll find almost no developer arguing that JSP is a more technically elegant solution to serving up dynamic pages than Jini is to developing distributed applications. On the other hand, the number of developers who use JSP seems many orders of magnitude larger than those who use Jini.

And maybe adoption isn't the most fair metric to compare, but adoption tends to lead to support, documentation, help, community, etc. Being big often has a lot of advantages over being small. So bad, good, or great, popularity helps.

The idea of direct applicability is an interesting and appealing notion. In my other programming life, it's interesting to see how the "ivory tower" pieces of the QuickTime media library -- wired sprites, Flash support, a toy "VR" functionality -- are falling by the wayside as the technology is called upon to power Apple's media applications, which in turn now largely exist to sell iPods and (perhaps to a lesser degree) consumer Macs. Now the features that get added and supported are those that are directly used by real-world applications, the most important of which are written by Apple itself. Or look at the MPEG-4 standard, which has wildly speculative specifications for 3D VR-like functionality and an elaborate "scene graph" of interactive media objects... almost none of which is actually implemented or used in practice.

Do you think good libraries necessarily come from specific application needs, or is there still a future for libraries created by caveat, endorsed by standards bodies, and implemented in the hope that they'll suit your needs?

In Java Today, the 0.6 early access release of Compute Servertechnology introduces APIs for the creation of standalone applications, support for more efficient use of grid resources, and enhanced debugging aids. Using the new standalone application APIs, developers can create applications for end users, to be run outside of the NetBeans IDE, that produce and package compute server application input for uploading to the grid, and/or process compute server job output that has been downloaded from the grid. Developers can also now limit the cpu-hours, and therefore money spent, executing a Compute Server job on the grid by specifying a new "Max CPU hours" threshold for job termination.

Wouldn't it be great if you could post updates to your client-side application as easily as you could commit a file to SVN? Or if you could get your customers to constantly update their running codebase to the latest and greatest, just like you do when you develop? Downrushis a Subversion-based client-side application installer/updater/launcher. It is backed by a binary-only repository and can be configured to update each individual file in an application to a particular revision, which means rolling back from a broken version is as easy as updating to a new one. The project is looking for developers, testers and people to give it a try in the real world

Java's well-being gets a harsh assessment from eWeek Security writer Larry Seltzer in Java's Momentum is Running Low: "Many lawsuits and real-world trials later, Java is still a major platform for server-side application development, but only one of many and no longer the one with momentum. Heavily influenced by Java, Microsoft's .NET has more mind share where it counts. On the client, I can no longer say that Java is in freefall because it's closer to rock bottom. As a client application development platform it's far behind a wave of interpreted languages like Ruby and Python."

The latest Poll asks "What do you prefer for enterprise Java persistence?" Cast your vote on the front page, then visit the reuslts page for current tallies and discussion.

In today's Forums, Bill Snyder unveils SwingX TransitionEffects: "So a couple months ago I started playing around with the TimingFramework and Painters. Since there has been a little more discussion on the list lately about it, I checked in some code I had for TransitionEffects. TransitionEffects are just simple wrappers around the ImageEffects and TimingFramework. A webstart link yet is forthcoming, but for now the code is in my incubator (wsnyder6) folder. (woohoo my first commit to the incubator since I signed the JCA 3-4 years ago). And yes, there is a Ripple animation."

User bouteill has figured out the problem Re: EAR Redeploy fails: Cannot delete existing directory: "For everyone's benefit: After debugging this with Sun support we found the problem to be a unix soft link defined upstream of glassfish install. Apparently Glassfish undeploy logic is having reservations about deleting linked paths, so it just doesn't do it. The fix is to edit glassfish-home/config/asenv.conf to hardcode absolute/unlinked paths only. No shell variables allowed. No known work-around..."

Pete Morgan kicks off a new series in today's Weblogs. In IP v IP. (Intellectual Property versus Innovation Protection) Part 1: Courts and Coders, he "attempts to raise Java programmers awareness of legal issues facing open source projects. Particularly the 'small guy'."

Evan Summers makes A Case Against Uppercase, saying "a hangover from C (macros) is the uppercase naming convention for constants."

Finally, in Goodbye Major League Baseball and Hello Little League, John O'Conner writes: "The MLB season is nearly over, but my local Little League is just starting to plan its next season. I'm on the League board, and boy do I have a job to do!"

In today's News Headlines :

Registered users can submit news items for the News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the News RSS feed.

Current and upcoming Java Events :

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

Do great libraries come from ivory towers or rugged trenches?  

Show Me the Way Blog

Posted by kfarnham Sep 27, 2006

Looking for the future of Jini and of media presentations

It's a statistical quirk that the two people who've ever edited this site -- Daniel Steinberg and myself -- are big Jini fans, even though Jini itself has a fairly small user base. Personally, I found Jini's clear-eyed realism about distributed code to be a real breakthrough after working for a few years on a sometimes fragile client-server system (JMS "guarantees" delivery of messages, my eye!). A proof-of-concept I wrote with Jini ended up turning into production code because it had that most essential of qualities:it worked.

Daniel has attended a number of Jini Community Meetings and is significantly involved in the community. In advance of the 10th Jini Community Meeting, he asked me to look over the script to his presentation and I could see he was up to something really different. Instead of the usual five-bullet-point per slide presentation that is then read aloud with a few embellishments, Daniel proposed a rapid-fire presentation with short phrases (even single words) meant to emphasize or counterpoint what he was saying at a particular moment.

I thought the intended effect would be terrific, provided he could speak well at the same time that he handled the slides, which came up at an average rate of about one every five seconds. If anything, it almost read like an A/V script. And that got me thinking: what would happen if we re-recorded the presentation and then made a carefully-timed video track of the slides? Usually, sitting on a slide in an online video is boring, but these would come often enough, and raised interesting ideas and counterpoints of their own, that they would probably be worth watching in addition to listening to the audio of Daniel's presentation.

So it's in the spirit of experimentation that we offer our Feature Article, entitled Jini Beyond the Choir. We're interested both in your reactions to this style of presentation as an online video (we also have an audio-only version, so you can listen to it while you drive), and in Daniel's idea about reorienting the Jini community to figure out what it can and should do in today's world.

Plans for source-controlling the open-source Java project top today's Weblogs. Martin Englund starts off with Migrating from TeamWare to a new SCM: "As Mark pointed out, I'm investigating the technical details on how we should migrate from TeamWare to a more recent SCM. At the moment I'm busy gathering data about Mercurial to determine the impact it will have on disk usage..."

In his blog, Teamware, Mercurial, and SCCS revs that go bump in the night, Kelly O'Hair discusses the key advantages of the previous source-control management system and why they need to be present in its successor. "Besides all the basic SCM features you'd want, Teamware provided two extremely valuable features in my view. The primary feature was the ability to have any number of workspaces (repositories) with a parent/child relationship, there is no single repository. The second feature was it's extremely powerful merging tool called filemerge."

Finally, Greg Murray has some advice for Preventing Cross Site Scripting Attacks: "There has been a great deal of news about cross site scripting (XSS). Here are some tips for both JavaScript and Java developers on keeping you and your site out of the news for some of the most common problems."

Where did the JDK 6 builds go? The answer is in today's Forums. In Re: No build 100 this week? Had to ask., ray_ganswrites: "We're finishing things off and into final (heavy) testing. New builds should be coming out much less frequently now. JDK 6 is still slated for release in December. See Mark Reinhold's blog entry for more information."

Meanwhile, Ingo L


Blink Blog

Posted by kfarnham Sep 27, 2006

Take a look at Java2D and SwingX visuals

In an odd coincidence, Aerith co-developers Joshua Marinacci and Romain Guy both posted graphics-intense blogs yesterday, so it seems only natural and appropriate to highlight them in the daily blog.

Even though they're working in different API's, both of them offer powerful tutorials on pushing desktop Java's imaging capabilities farther than you might know to take them. And really, Java2D and Swing aren't that far apart -- after all, one of Swing's greatest strengths is the ease with which you can call upon Java2D to provide pixels for your GUI. Indeed, Joshua's current topic, SwingX Painters, exist for the explicit purpose of using and reusing Java2D painting logic.

When Joshua and I did a presentation a few JavaOnes ago, we found ourselves coming back to the phrase "if you can paint it, you can have it". Our point was that you weren't bound to any particular appearance, or simple shapes and colors. The idea was that whatever you can compose in Java2D can easily be part of a Swing GUI, often just with a Graphics.drawImage() call in an overridden paintComponent() method.

So hopefully you'll enjoy the graphics bent of today's Weblogs, which kicks off withIntroducing Painters II: filters, shapes, and the builder, in which "Joshua continues his introduction to Painters with filters, shape effects, and a visual builder tool."

Then in Java2D Gradients Performance, Romain Guy reports "Gradients are one of my favorite Java2D tools and I just made some interesting discoveries about their performance."

Also in today's Weblogs, Rama Pulavarthi introduces Support for WS-Addressing in JAX-WS 2.1 RI EA1: "JAX-WS 2.1 RI EA1 has added support for WS-Addressing. One of the nice things is that it makes using Addressing in Java Web Services easier. Users don't need to deal with sending/consuming various addressing headers. Thats all done by JAX-WS RI. All that User needs to do is enable Addressing Feature. Read on to find about doing that in JAX-WS..."

Following up on his SwingX Painters blog, Joshua Marinacci seeks input in the Forum, message Painters: next steps: "I've just committed all of the code for the visual builder an a few other outstanding changes I had. So what are the next steps? I really want to let you guys drive this. What do you want out of painters? I have a list of things I know I need to do (like trim out extraneous support jars) but in terms of the grand scheme I need feedback. What is missing? What are the architectural issues we need to fix? What should we do to improve the gui tool?"

Elsewhere in the forums, bobfoster32 is troubled by a debugging problem in part of soap response not unmarshalled: "After generating the client proxy from a wsdl file, I managed to send and receive a soap message. The thing is though, that only parts of the reply are accessible through the object.. I mean not all is unmarshalled. It would be a great help if there was a way to get debug messages but I can not find a way to turn them on. Even setting <root> in log4j.xml to debug does not lead to any messages. What can I do?"

In Java Today, Mark Reinhold writes: "The aging source-code management (SCM) system we've been using for the JDK all these years is unsuitable for open development. To which newer system should we migrate as we open-source the code?" In Source-code management for an open JDK he looks at the history of SCM for JDK development, the requirements for such a system, and reveals that the team is currently leaning towards using Mercurial.

The 259th issue of the NetBeans Newsletter is out, highighted by an announcement of the Governance Board election results: David Strupl and Rich Unger have been re-elected for another year, while Charlie Hunt will stay on as the Sun-appointed member. The newsletter also covers what's new in NetBeans 6.0 Milestone 3, seeks input for editor features, links to new NetBeans tutorials, and more.

The Intelligent Tester project is focusing on optimized test case generation intelligently by means of Intelligent Agents, pieces of software that are designed to make computing and other tasks easier by assisting and acting on behalf of the user. "The user can interact with the agent through the user interface while the agent can sense and act according to the condition of the external environment."

In today's News Headlines :

Registered users can submit news items for the News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the News RSS feed.

Current and upcoming Java Events :

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

Take a look at Java2D and SwingX visuals  

Mess Around Blog

Posted by kfarnham Sep 26, 2006

Why can't constructors do stuff before calling super()?

It's hard for me not to give a strong hint or quick answer in the editor's blog when we do the not-so-stupid questions, because the comments sections always offer some ideas and opinions that aren't immediately obvious, and from these insights come further discussion and brainstorming. And you shouldn't necessarily think that the comments already posted when you read the article are the final word on the subject either; with questions like today's, there are often several ways to think about why things are they way they are, and whether they really have to be.

So enough stalling, what's the question? Today's Feature Article, features (Not So) Stupid Question #13: "Why do constructors have to start with a call to super()?" Put another way, what if you want to do some work to prepare an argument for your superclass' constructor... why can't you do that first and then callsuper()? We hope you'll take a look at the initial question and the motivation behind it, and then check in with the ongoing discussion in the comments.

In Java Today, the Embedded Java Community page is featuring the article Wireless robotics: Object-oriented programming with (physical) objects: "Learn why there is room for the development of new, lightweight wireless networking protocols and how the profusion of wireless computers may represent one way to solve a traditional stumbling block of artificial intelligence."

jSh3ll, the Amazon S3 command shell for Java, is a Java based command shell for managing your Amazon S3 objects, built upon the Amazon S3 REST Java library. In addition to standard Amazon S3Shell functionality, jSh3ll provides ACL and HEAD retrieval for buckets and items, support for getting a .torrent file for an item, script mode support, streaming file upload support, file compression support with ZLIB, and more.

The Enterprise Java Beans (EJB) 3.0 specification vastly improves the simplicity of programming enterprise beans. This promises to increase your productivity as a developer. But what about the productivity of your production system? Will it be fast enough to meet the demands of your organization, or will you spend all your newly found free time refactoring code for performance? The article Writing Performant EJB Beans in the Java EE 5 Platform (EJB 3.0) Using Annotations shows you how to get the best performance out of the new EJB 3.0 programming model.



Not Paying Attention Blog

Posted by kfarnham Sep 25, 2006

Distracted by media

Sorry, I should be focusing on what's on the page today, but I have a number of media projects stacking up, and it's pulling all my attention away from XML binding and Hibernate persistence and over to thoughts of cross-fades, insert edits, waveforms, and transcoding. Partially, this is from IM'ing with Daniel Steinberg this morning about adapting his 10th Jini Community Meeting presentation to an online format. I think at this hour he's just about bailed on iMovie and is moving to Final Cut Pro, which is sort of like moving from a ten-speed bicycle to a 747 in terms of power and complexity.

Plus, I need to write a blog on another site about what I think may be the ideal starter podcasting microphone. Ideal because it's a USB device and only costs $20.

I'm also giddy from having seen far too many anime music videos over the weekend, but more on that some other time.

It's funny -- I didn't think that Flash embracing video was going to be such a big deal, but then again, who saw YouTube coming? The site has made video on the web far more common than it was a year ago, even though technologically it's far from cutting edge. According to Wikipedia, most Flash videos use a variant of H.263, a codec so simple and unencumbered by legal concerns that even the all-Java version of the Java Media Framework supports it, and did so six years ago. The advantage of YouTube seems to be that it's fairly easy to use and, being Flash based, runs on pretty much any OS. Feel free to connect the editorial dots in this paragraph and draw your own conclusions. I'm too distracted. I mean, this mic is nifty for being so cheap...

In Java Today, the ninety-fifth issue of the JavaTools Community Newsletter is online, welcoming a number of projects to the community and noting one graduation, DBBackup, from the community's incubator. The newsletter also collects tool-related news from around the web and offers a Tool Tip for using the cvs-news service. Finally it seeks volunteers for the "JavaTools 30 Days IDE Swap Experiment".

A new article on RegDeveloper offers A Practical Guide to JAXB 2.0: "JSR-222 specifies the Java Architecture for XML Binding (JAXB) 2.0. JAXB 2.0 specification is implemented in Java Web Services Developer Pack (JWSDP) 2.0. JAXB 2.0 has some new features that facilitate the marshalling and unmarshalling of an XML document. I have used both JAXB 1.0 and JAXB 2.0 and have found that JAXB 2.0 generates less code and has some additional features."

"Object identity is deceptively hard to implement correctly when objects are persisted to a database. However, the problems stem entirely from allowing objects to exist without an ID before they are saved. We can solve these problems by taking the responsibility of assigning object IDs away from object-relational mapping frameworks such as Hibernate." James Brundege says the solution is to create your own unique ID as soon as the object is instantiated, and to use that as the basis of object and database identity. In Don't Let Hibernate Steal Your Identity, he shows how to accomplish this.

Need continuous integration? This week's Spotlightis on Hudson. This project monitors executions of repeated jobs, such as software builds or automated tests. "Hudson provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continoues build increases the productivity." Features include easy installation, change sets, permalinks to "latest build" and "latest successful build", RSS/e-mail integration, distributed builds, plugin support, and more

In today's Forums,karlgold asks Is WS-Security the best security scheme for a public web service? I haven't found a single major web service player (Amazon, Google, Yahoo, Flickr, Salesforce, etc.) that uses WS-Security for their public web services. They all seem to rely on something simpler, using SSL as the transport layer. I'm feeling like it can't necessarily be a bad thing to imitate the big boys on this. Am I wrong? Am I missing out on significant API and tool support by not using WS-Security?

Here's a unique request: gordonke is looking for aNight vision friendly look and feel: "I have an application to be deployed on a ship's bridge. It needs to have a night mode which doesn't interfere with the watch keepers night vision, i.e. dark backgrounds and light, but not bright, foregrounds. To achieve this I think I need a look and feel that supports it properly. Does such a look and feel already exist? Is there a better way of doing this?"

Tim Boudreau has been busy, and unveils some Wizard project updates in today's Weblogs. I spent part of the weekend adding some needed features to the Wizard library on If you need to do wizard-style UIs in Swing, this library makes it pretty easy to do something slick.

Kirill Grouchnikov takes a Swing at criticism in Passionate / screaming users: "Kathy Sierra writes on her blog that the best feedback you can get is a negative feedback. I fully agree, but with one condition - if the feedback is concrete (it doesn't have to be constructive)."

Finally, in Reliable Messaging in WSIT Milestone 2, Mike Grogan offers "A description of the Reliable Messaging features in the WSIT Milestone 2 Binary release."

In today's News Headlines :

Registered users can submit news items for the News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the News RSS feed.

Current and upcoming Java Events :

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

Distracted by media  

World Machine Blog

Posted by kfarnham Sep 22, 2006

Jini: more grids, fewer toasters

There's still Jini material to catch up with after last week'sJini Community Meeting. Jim Hurley pinged me to catch up with a recent Java Posse interview, as it managed to touch on a community (Jini), a federated community (Sun Grid), and a project (Computecycles), all in one interview.

Well, how could I resist putting that on the top of the page? Lots of us have wanted to see Jini shake off the "your toaster can talk to your refrigerator" marketing message of 1999, and the "let's write printer drivers" overhype discussed in the podcast.

So, atop the Java Today section, you'll find a link to the Java Posse's 81st podcast, part one of a three-part interview. Their Interview with Van Simmons on Jini and ComputeCycles discusses the famous eight fallacies of distributed computing and how Jini compels the developer to deal with them. He also introduces the Computecycles project, which uses Jini, GlassFish, and Groovy to distribute work across a grid.

While we're sharing media links, the Java Champions project has begun posting a series of James Gosling videos recorded earlier this month. Aaron Houston, Program Coordinator for JUGs and Java Champions, says "the idea is to 'Keep it Simple' and let the Java Champions (JC) and Java User Group Communities use these videos freely at their meetings and other activities to promote interest in Java."

The Glazed Listsproject released their version 1.7 last month, and the Swing Bling blog talks it up in a recent entry: "Anyone who has written a Swing application with a JTable will quickly get swallowed into the murky world of sorting, and possibly filtering. Basically, it's a real PITA and rather off-putting to Swing newbies. Well, GlazedLists is the package for you. If your program has a table or list, get hold of this package and life will be sweet."

The latest Poll asks "How active are you in your local Java User Group?" Cast your vote on the front page, then visit the results page for current tallies and discussion.

In today's Forums,cayhorstmann is Unhappy about deprecation: "Apparently, is now deprecated: 'Initialization of this field is prone to deadlocks. The field must be initialized by the Logger class initialization which may cause deadlocks with the LogManager class initialization. In such cases two class initialization wait for each other to complete. As of JDK version 1.6, the preferred way to get the global logger object is via the call Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).' I like using to entice beginning programmers into logging. 'Just change System.out.println into'. Same number of keystrokes... Logger.getLogger(Logger.GLOBAL_LOGGER_NAME) isn't going to win the hearts and minds of those programmers. I know it's a small thing, but these small things matter when you try to get lazy people to stop using S.o.p. Surely someone can figure out a way to solve that. After all, we have System.out"

Stop me if you've hear this request before: meekwants to know How to make swing application work faster? "I am working on swing based application at front end, the application i have made is much slower compare to an application made in .NET. I have used SWING components for the front end. I want to know for a nice article to make the swing application work faster. I have tried to search all the way on internet but unable to find a nice article. Can you people help me out. I don't want to use any third party api for faster perfomance (JGoodies, JIDE, etc)."

In today's Weblogs, Tom White asks Are your beans thread-safe? "Why it's worth being a little paranoid about what your IoC container does in a multi-threaded environment."

Jean-Francois Arcand says "Implementing support for SSL over NIO is far from simple. This time I will discuss how SSL over NIO has been implemented in GlassFish." The secrets are in Tricks and Tips with NIO part V: SSL and NIO, friend or foe?

Finally, a complaint from John O'Conner in JDK 5.0 for Ubuntu x64, no applets or Java Web Start? "Although installing JDK 5.0 for Linux x64 wasn't difficult, the fact that I couldn't run applets or Java Web Start was certainly hard to swallow."

In today's News Headlines :

Registered users can submit news items for the News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the News RSS feed.

Current and upcoming Java Events :

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

Jini: more grids, fewer toasters  

Running in the Family Blog

Posted by kfarnham Sep 21, 2006

Sooner or later, everything will be callable from Java

A few years back, I needed to call AppleScript from a Java program -- really, what I needed was to send Apple Events -- but with no way to do it programmatically, I was forced to do aRuntime.exec() invocation of osascript. Yuck.

Fortunately, Thomas Künneth's jasconn project uses JDK 6's scripting language support, as defined by JSR-223, to offer a Java-friendly binding to AppleScript. It only works with the pre-release JDK 6 available from the Apple Developer Connection (NDA genuflection required) and of course is only for Macs, but I thought I'd give it a spin yesterday.

It's a pleasure to report that jasconn worked well. What I did was to take an AppleScript I use to set my iChat status as the number of e-mails in my O'Reilly INBOX, so co-workers can see how many blog requests, article proposals, and news blurbs I have yet to dig through before I'm able to take on anything new. Here's the script:

global messageCount
tell application "Mail"
        set oReillyAccount to account named "O'Reilly"
        set oReillyBox to mailbox "INBOX" of oReillyAccount
        set oReillyMessages to messages of oReillyBox
        (* set oReillyCount to length of oReillyMessages *)
        (* only count non-deleted messages *)
        set messageCount to 0
        repeat with aMessage in oReillyMessages
                if (deleted status of aMessage is not true) then
                        set messageCount to (messageCount + 1)
                end if
        end repeat
end tell

tell application "iChat"
        set status message to "O'R Inbox at " & messageCount
end tell

Normally, this sits in my ~/Library/Scripts, waiting for me to invoke it from the optional script menu. For kicks, I decided to wire it up to a trivial Swing GUI:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import de.thomaskuenneth.jasconn.*;
import javax.script.*;

public class JASConnTest extends JFrame implements ActionListener {

    JButton button;
    ScriptEngine engine;
    String script;

    public JASConnTest() {
        super ("JASConn Test");
        getContentPane().setLayout (new FlowLayout());
        button = new JButton ("Update iChat");
        button.addActionListener (this);
        getContentPane().add (button);
        try {
        } catch (Exception e) {

    private void setUpScriptEngine() throws IOException {
        // get jasconn
        ScriptEngineManager sem = new ScriptEngineManager();
        engine = sem.getEngineByName ("jasconn");
        if (engine == null)
            throw new RuntimeException ("couldn't find jasconn engine");
        // read script into a string
        char[] buffy = new char[1000];
        StringBuffer sb = new StringBuffer();
        BufferedReader reader =
            new BufferedReader (new FileReader ("OReillyInboxAt.applescript"));
        int bytesRead = 0;
        while ( (bytesRead = (buffy)) > 0) {
            sb.append (buffy, 0, bytesRead);
        script = sb.toString();

    public static void main (String[] arrrImAPirate) {
        Frame f = new JASConnTest();

    public void actionPerformed (ActionEvent e) {
        if (e.getSource() == button) {
            try {
                engine.eval (script);
            } catch (ScriptException  se) {

Notice how the script has an .applescript extension, indicating that it has been saved as plain-text. I'm not sure whether compiled .scpt files would work. Also notice that this reads the entire script into a String and caches it. That's one option with using ScriptEngine.eval(); another is to give it a Reader, presumably pointed to the flat file. Call it a premature optimization, but reading the whole script in and keeping it in memory is a huge performance boost over letting the native script menu read, parse, and execute the script each time.

Anyways, compile and run with the full long path (you have to point to/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commandsto do this, as anyone who's juggled Java versions on Mac OS X knows. Here's the resulting GUI:


And when I click the button, here's the result in iChat:


This is one of those unanticipated bonuses of JSR-223. It's not about whether other languages are "better" or "worse" than Java, but what they can do. AppleScript is a profoundly nifty way of interacting with native applications on the system, and jasconn exposes them to Java. Nobody planned that when they wrote the JSR-223 draft, any more than they anticipated, say, websites that would let you upload and run server-side JavaScript with Rhino. But that's what this feature enables. And a lot of people are going to find cool things to do with it.

So, would you like to bring your favorite language to Java? I'm glad you asked...

In today's Feature Article, Thomas shows you the nuts-and-bolts of Making Scripting Languages JSR-223-Aware, in which he writes:

Establishing a basic link between Java and existing scripting languages using JSR 223 is quite easy. The number of interfaces you need to implement is fairly small. Additionally, Sun provides useful helper classes that you can take advantage of in your implementation.

Read on for the details of making scripting languages callable from Java.

In Java Today, Artima takes note of JSR 306 in the discussion New JSR Aims To Change How Java Standards are Defined. "The recently submitted JSR 306, 'Towards a New Version of the JCP,' aims to refine how the Java Community Process (JCP) creates and manages Java standards. Artima spoke with Onno Kluyt, chair of the JCP, about the proposed changes. [...] The expert group for JSR 306 consists of JCP executive committee member companies and individuals. Artima spoke with Sun's JCP Chair Onno Kluyt, and JCP program manager Heather VanCura, about the proposed changes."

Last week's 10th Jini Community Meeting was a big success, and those who didn't attend can start catching up with some of the materials on the wiki. The 10th JCM Live page is being left as an informal collection of conference blogs, photos, and more. The 10th JCM Sessionspage lists all the sessions and lightning talks from the meeting, and many of them already link to PDF slides and/or QuickTime video of the talks.

"Concurrent or multi-threaded software is not a new technology but its importance has been accelerating. This is primarily due to the low cost of multi-core CPUs that are becoming common in even the most basic machines." But how do you take advantage of concurrency? Nathan Tippy's article Discover the Elegant Simplicity of JSR 166 offers an introduction to a handful of the features provided by the java.util.concurrentpackages.



Take A Look Blog

Posted by kfarnham Sep 19, 2006

A new way to view and navigate your code

Prolific blogger and developer Kohsuke Kawaguchi is at it again. As if JAXB and Hudson weren't enough, now he's started a project to make it easier to browse your code, with a better understanding of how classes and members are related than previous tools have provided.

In today's Weblogs, Kohsuke takes the wraps off Sorcerer: a better source-code cross referencing tool:

There have been a few source code cross reference generators, like JXR in Maven and OpenGrok, but the problem I found with all of those tools is that they don't understand Java semantics. It can do lexical analysis, but none of them do the semantic analysis of the Java code. So the end result is that the generated HTML doesn't have much intelligence. The best it can do is to do syntax-coloring or do some keyword match (the tool basically just guess that this token MySAXParserFilterImpl probably meansorg/acme/ I'm used to modern Java IDEs, so my expectation was higher.

This is where sorcerer does a better job. It actually builds the AST of Java source files, just like javac does (by using javac tree API.) So when it sees something like p.println(5) in your source file, it knows that "p" is a local variable defined in line 95 as PrintWriter, the println method invocation is PrintWriter.println(int), and so on.

To get a sense of what this project can do, Kohsuke has run it on sourcerer itself, to produce a sample report. Take a look and see if this will help with your own development.

Also in today's Weblogs, Tom Ball is Hacking javac... but in a good way: "The news that JSR-199, JSR-269, and the javac Tree API are almost finished seems to be flying under the radar, but tool nerds should take notice: there is a lot more you can do with these API than just compile source files and process annotations. In the spirit of O'Reilly Media's Hacks series, here are some alternative areas to explore."

Finally, John O'Conner has some thoughts on the combination ofUbuntu, Free Software, and Sun's JDK: "I may have just experienced the easiest OS install of my life. Ubuntu was a snap, but where's JDK 5.0?"

Today's Forums, also take note of Kohsuke's project mentioned at the top of this daily blog. In Sorcerer, coxcu wonders if it could be exposed to a Swing GUI: "Sorcererprovides a cool new way to browse Java source. Perhaps it could be easily appropriated to be the ultimate code/API review tool. Right now, it provides a really great first effort at Java code browsing. I'm curious how polished the user interface will eventually become. Will it hit the wall with browser technology? Kohsuke doesn't tend to reach for Swing first. Supporting migration between broswers and Swing is going to remain incredibly important."

dfuchs points out a JMX challenge in the thread Re: some JMX questions: "There is no existing JMX connector that I know of, which doesn't use a socket at some point to communicate with the remote process. The JMX specification will let you write new connectors, thanks to the JMXConnectorFactory/JMXConnectorServerFactory provider API, but this is no small task, and it wouldn't be a 'standard' connector anyway. I believe it would be much easier for you to teach your end users how to configure their firewall to let JMX traffic flow, if need be."

Topping off the items in Java Today, the NetBeans 6.0 (Dev) Milestone 3 is now available for download at the Milestones downloads page. Milestone 3 contains new and noteworthy improvements, including: * Ant output window now features Stop and Re-run buttons, * Windows Vista look and feel is fully supported if you run NetBeans 6.0 on latest available build of Java SE 6.0, *Run configurations is now avaialable also for Java SE projects.

Frank Sommers is considering The JVM as an (Un)Common Language Runtime: "Efforts to make non-Java languages perform well on the JVM accelerated in recent years. The benefits of turning the JVM into a highly-optimized, general-purpose execution environment are many, but so are the challenges."

The JUGJF discussion group was created on 8th August of 2006 as an academic student initiative in Juiz de Fora - Minas Gerais. The main goal is to do studies about the Java platform and technologies related with them. By the use of software engineering methodologies, the group aims to share knowledge and contribute with other java user groups.

In today's News Headlines :

Registered users can submit news items for the News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the News RSS feed.

Current and upcoming Java Events :

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

A new way to view and navigate your code  

Follow Me Blog

Posted by kfarnham Sep 18, 2006

The era of asynchronicity

I'm coming around to the opinion that the best thing in Java SE 5 isn't annotations (and for darn sure it isn't generics or autoboxing), but rather the inclusion of thejava.util.concurrent package for concurrent programming. More and more, I think we're seeing pressures that are combining to make a simple, synchronous approach to programming increasingly untenable, if not utterly unrealistic. Probably the big two pressures are the increasing commonality of multi-CPU machines and multi-core processors, and the increasing use of high-latency network calls, now that seemingly every new app is either a web app or a thick client that makes network calls.

Both multi-processing and remote calls are poorly suited to the "single synchronous thread" style of programming. Code that way and your application will ignore half (or three-quarters, or seven-eights...) of the processor capability available to it. It's even worse when you make a network call and block on it. At least Swing developers know when they've screwed this up: the app refuses to repaint until the call returns. For the webapp, it's just a longer delay getting a result page, something that users are increasingly less willing to tolerate.

More and more, you need to think asynchronously: put some work in a thread and send it off, letting the OS potentially put it on another core or processor. This means that your application has to live on in some stable state while the request is processing, and properly deal with the return value when it comes in on the other thread. Some of the concurrent package's classes, most notablyFuture and its default implementationFutureTask, make coordination of asynchronous calls easier to manage.

Todays Feature Article takes on the challenges of latency when using web services. Young Yang describes the asychronous answer in Asynchronous Web Service Invocation with JAX-WS 2.0: "JAX-WS 2.0 comes with one effective solution to this problem: asynchronous web service invocation, with which a web service client may interact with a web service in a non-blocking, asynchronous approach. In this article, we will provide an exposition of this technology with examples built upon the reference implementation."

When you think of the synchronized keyword, you probably think of concurrency, and that's the problem with a new version of the closure proposal, according to Rémi Forax. InSynchronized or confined, featured in today's Weblogs, he writes: "A new version of the closure proposal has been post at the end of this week by Neal Gafter and proposes in section 3 to tag parameter with a special keyword to differenciate between synchronous and asynchronous closure. For me this section contains two flaws, the first one is that the keyword used is synchronized, the second one is to not recognize that such feature can be useful in other contexts than closure."

Gregg Sporar checks in with a round up of JavaZone 2006: "Oslo is beautiful and I saw some some good sessions, but as usual, the best part of attending a conference was the people I got to meet."

Finally, in Open quality metrics and processes, Konstantin I. Boudnik writes: "Despite the differences between business models, development processes, functional areas of the application, and the languages applications are written in, the quality approaches for them are quite similar and final goal is the same."

Internationalization and localization of the JDK tops the Java Today section. One of several JDK documentation localization projects, the jdk-api-ja aims to improve the translation quality of the Japanese JDK documentation currently available on The project "would like to ask willing Japanese speaking community members to review those translations. There has been quite a lot of feedback on Tiger docs after they were released. Now is a good chance to send your input before Mustang is released!"

Twin Java Specification Requests (JSRs) are under way that will define the new Mobile Services Architecture (MSA), the next generation of the Java platform for mobile devices. The SDN articleThe Mobile Service Architecture Specification says "ultimately, JSRs 248 and 249 will define a comprehensive structure of APIs aimed at facilitating development and deployment of the widest possible variety of applications, in a form that will be easily portable across the broadest possible spectrum of mobile devices."

The ninety-forth ssue of the JavaTools Community Newsletter is online, and in an odd bit of timing, it has no graduations to announce or new projects to welcome to the community this week. What is does have is a round-up of tool-related news from around the web, and a Tool Tip collecting tools of particular interest to developers moving to Mac OS X.

Does the JDIC project have too many Latent Subtle Windowsisms? In today's Forums,robross is working on the Mac version, and in working out analogous cross-platform behavior, he has a Question for implementors of native system tray on Windows: "If you worked on the native code in JDIC to support the system tray features on Windows, I would like to ask you some questions. I'm looking at implementing this on the Mac. There are some areas where there may not be a one-to-one correspondence of features possible between Mac and Windows (or other platforms.) For example, on current versions of Mac OS X, there is no "official" support from Apple for providing access to the top-right area of the menu bar, to install MenuExtras as they are called. (But there are well-known work-arounds that are in use by many commercial third-party applications.) This area on the Mac is not an exact substitute for the system tray area on Windows. Some of the system tray features of Windows can actually be implemented fairly easy in the Mac OS Dock, but this is a slightly different use than the taskbar in Windows."

brian10 is getting deeper into JavaHelp and is asking for some Authoring Tool Recommendations: "We recently completed a swing application in which we created our JavaHelp helpset by authoring an XML document and using docbook's javahelp.xsl for transformation. As a developer, I loved the ease with which this allowed us to generate the helpset. For version 2, however, our helpset will grow substantially and authoring via an XML document may not be realistic. Therefore we are about to begin evaluating tools that offer a more robust means of authoring the help document. RoboHelp currently tops the list because it is a familiar name (although no one on our team has used it)."

In today's News Headlines :

Registered users can submit news items for the News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the News RSS feed.

Current and upcoming Java Events :

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

The era of asynchronicity  

A Physical Presence Blog

Posted by kfarnham Sep 18, 2006

A brief tour for the Swing team

Joshua Marinacci reports driving down to Southern California with fellow Swing team member Richard Bair to give a series of presentations on desktop Java, both to SoCal JUG's and corporate customers. The results of his meetings make for interesting reading, which is why we're featuring his blog LA-stravaganza in the Java Today section.

Among his list of discoveries is the fact that when you give the same presentation seven times, it gets better each time. That makes for a nice reminder of why it's a bad idea to write your presentation the morning it's to be delivered and never rehearse it before presenting it (I'm sure I'm not the only one who's done this).

Another discovery is a better reception for Java Web Start than might be generally known... possibly because few people seem to be using Web Start:

A lot of people don't know about Java Web Start. This surprised me because I've known about it for years (and written severaldifferent articleson it), but at most sites the developers didn't know about Webstart or only heard a few details. Clearly we need to do more to get the word out.

Developers who use WebStart love it. At one customer site, where they use 1.5 and WebStart for everything on the desktop they said "Java Webstart has been a huge win for us". The developers are in LA and the customers are in New York. They can fix a bug in the afternoon, push out a new version that evening, then the customers are updated the next morning. That's what we like to hear!

Some of Josh's other revelations include Java 5 adoption, Swing inroads, and the emergence of Flex. Check out his blog for more notes from the trip.

Also in Java Today, The java-dev mailing list message Ann: Java SE 6.0 Release 1 Developer Preview 6 Now Available brings word of the latest build of Mustang for Mac OS X, for both Intel and PowerPC systems, based on JDK 1.6.0_b88. This latest developer preview is available from the Apple Developer Connection to all ADC members, including those at the free "online" level. Note that ADC pre-release terms and conditions still apply, meaning the build can only be discussed on Apple's feedback channels. Also note that this preview release is not removable.

The incubated Java Desktop project Zambro is a "simple and light web browser, written in Java 5 and using the Swing framework." Its features inlcude remote and local browsing, bookmarks support (where bookmarks can be exported in a HTML document), HTML code viewer/editor, integrated web search, minimalistic back/forward memory for visited sites' history, hideable panels, and per-user customizable settings.

David Herron has a Followup on bug tracker for open source JDK in today's Weblogs. "Whatever is used for bug tracking in the public has to share bugs/comments/etc with the internal system. This is one of the big question marks over whether to take an existing bug tracking system and modify it to interface with the internal system. Or whether to write a custom solution."

In Animating your lists, tables and trees, Kirill Grouchnikov writes: "the latest trend in the UI world seems to be animations (on pretty much everything), including fade-ins on rollovers, selections, layout changes and what not. So, what better thing to add to the latest drop of Substance if not the support for animated fades on lists (was already there in release 3.0), tables and trees."

Finally, Shannon Hickey offers Top-Level Drop with Swing and Java SE 6, in which he "demonstrates support in Java SE 6 for dropping into top-level containers such as JFrame and JDialog."

In today's Forums,dfoster clears up some performance concerns in Re: Huge page support on Linux does not work: "As far as I understand it when you turn on huge page support it needs to be as big as the maximum amount of memory the JVM will consume. This means not only the heap but all the memory the JVM will use. You may want to try cranking up the number of pages. The other problem you may be suffering from is that even though the pages are (supposed to be) reserved they may not be contigious. The current JVM requires that the memory allocated to it is contigious. So if you do increase the page size or even if you don't you should reboot and fire up your app right away before the memory gets fragmented."

rafanami is switching gears and has some Questions about "Best Practices" in using Swing as UI layerHello everyone. I'm trying to create an architecture that is targeted to ease the efforts on developing Swing applications. I have a 3 year background on Web-Based applications, and about 1 year and half using JavaServer Faces. The first thing I've noticed was that is not so trivial promoting a certain level of reuse in Swing. I'm trying to do something that I do in JSF - a BaseActionMessageHandler, that has methods to throw i18n messages to a customizable panel or to a JOptionPane, a BaseDataModelAction, that provides population utilities to DataModels, and a BaseFrameAction, that is injected with an entity, a service interface and has methods to execute operations on the service layer.

In today's News Headlines :

Registered users can submit news items for the News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the News RSS feed.

Current and upcoming Java Events :

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

A brief tour for the Swing team  

Wouldn't you like to build a "filthy rich" client?

So where is everybody's favorite desktop Java rock star? For the purposes of this blog (because sometimes I mean Josh, or Rich, or Chet, or Kirill, or...), I'm talking about the deft and daft Romain Guy (say it together: Roh-MAHN GHEE), who came from Lyon with an inestimable grab-bag of JOGL tricks, Java2D blits, affine transforms and gradients to drool over. He contributed to Swing Hacks and really made a splash with the JavaOne 2006 debut of the photography manager/mapper/mashup Aerith, with its pleasing white-on-black reflective aesthetics and drool-worthy animation.

So... you might be tempted to ask... how do you do all that? It would suck to learn that it's unapproachably difficult or, worse yet, the irreproducible work of JNI code. But never fear, Romain is unveiling the secrets of his crazy-cool client aesthetics. If you were at JavaZone 2006 the Norwegian Java conference put on by the javaBin JUG, you probably already saw it! But if not (maybe you were at the Jini Community Meeting instead?), he's posted his work for all to see.

In his blog, Romain writes: "I gave a presentation entitled Filthy Rich Clients this morning at JavaZone 2006. This presentation explains how to create good looking Swing applications by using Java2D, animations and 3D. It also contains some performance tips."

Also in Java Today, a brief SDN article discusses issues with older JRE's and U.S. Daylight Saving Time Changes in 2007: "The Java Runtime Environment (JRE) stores rules about DST observance all around the globe. Older JREs will have outdated rules that will be superseded by the Energy Policy Act of 2005. As a result, applications running on an older JRE may report incorrect time from March 11, 2007 through April 2, 2007 and from October 29, 2007 through November 4, 2007." Links to updated JRE/JDK's for J2SE 1.4, 5.0, and Java SE 6.0 are provided.

Ever find JColorChooser just a little too heavyweight? The Quick Color Chooserproject offers a fast, single-mouse-gesture color chooser component for Swing apps. Some of the code has been around as long as six years, so it's fairly mature. There is also a Netbeans module created with BeanNetter which adds it to the Matisse component palette for drag and drop use.

The latest Poll asks "What would best help Jini gain traction?" Cast your vote on the front page, then visit the results page for current vote totals and discussion.

In today's Weblogs, Simon Morris wondersDoes Size Matter? "Why do so many people think the JRE download size is a problem? What causes the end user to readily download one plugin, while ignoring another? Is it just a numbers game? It's time to engage in a spot of amateur Psychology..."

Rémi Forax continues to make his case for Using jrunscript as a build tool: "After advocating in my last entry that jrunscript can replace Ant in order to execute build script. I show how to declare function dependencies with a tiny amount of javascript."

Finally, Vikram Goyal looks back on what he thinks may have beenAnother failed interview: "I was here to be interviewed for the position of a J2EE developer. While that in itself is enough to send shudders down my spine, the fact that I was going to be interviewed for a J2EE developer after working for more than 2 years on ASP.NET was making me hyperventilate."

In today's Forums,kupior is looking to do some Heap manipulation: "Is there any way to directly manipulate the heap from within a java program? I am working on the standard multithreaded java application with multiple threads operating on a lot of small (serializable) objects. In order to account for a possible system failure, I would like to periodically serialize and store all of the data for backup purposes. I want the minimum possible delay to normal operations within the program. I dont want concurrency problems corrupting data (gradual backup on live data is not feasible in this case). If it is [ever] possible, I would like to clone the heap then have another thread back up all of the needed data within the heap."

In Calculate new image width and image height, lmhoasays: "I'm working on an application that reads a image from file, applies AffineTransform including scale, shear and rotate parameters and then saves it to another image file. But the new image is lost some when I keep it the same size as the original image. Question: Is there any ways to calculate new image size which is depend on scale, shear and rotate parameters?"

In today's News Headlines :

Registered users can submit news items for the News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the News RSS feed.

Current and upcoming Java Events :

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

Wouldn't you like to build a "filthy rich" client?  

Just You, Just Me Blog

Posted by kfarnham Sep 14, 2006

Maintaining identity and credentials

A while back, Denis Pilupchuk wrote a definitive analysis of the relative strengths and weaknesses of Java and .NET security for ONJava. This exhaustive comparison nearly got me killed by my copy-editor (most feature articles run about 2,000 words; the final installment of the series was well over 7,000), and got into serious depth about not just the obvious issues security API's should handle, but also cryptography, code protection, code containment, user authentication and access, and how far each of the approaches you got you. By the way, you can buy this whole series as an inexpensive 80-page PDF from O'Reilly's online store.

But that series was written a few years ago, and standards have updated since then. In particular, Java Authentication and Authorization Service (JAAS) was added to the JDK a while back, so that should be a common solution for everyone right? Not so fast. Denis reports that it's had a hard time integrating into EE, and in many cases, vendors have implmented proprietary and mutually incompatible approaches to dealing with JAAS/EE non-integration. This problem is compounded by the emergence of service-oriented architecture and the need to provide a common security model across heterogenous services. Denis writes: "Many enterprises with heavy investments into Java technologies have already developed sophisticated JAAS-based security stacks, both on Java SE and EE platforms. Therefore, the task at hand is to define ways for taking such JAAS-based security services to the next level, to help in linking SOA services."

In our Feature Article, Using JAAS in Java EE and SOA Environments Denis looks at the current situation, the compounding issue of SOA, and assesses future directions for JAAS.

In Java Today, The Project Looking Glass team has posted a forum message detailing their plans for a 1.0 release. "'Panorama' is the code name that the LG core team members have been using to describe the desktop aspect of LG. (As opposed to 'AppKit' which denotes the application library aspect of LG). I just posted on the LG Twiki the plan for Panorama Release 1.0. The main focus of this release is stability and bug fixes. There are no new major features planned at this time." The wiki page can be found in the Java Desktop wiki, under InfoReleases.

The Tidal Blog has a summary of the first day of the 10th Jini Community Meeting, currently wrapping up in Brussels, in the entry 10th Jini Meeting - Day +1. "One of the most interesting talks was the thought-provoking 'Beyond the choir' by Daniel Steinberg. The point was the usual paradox with Jini: it has proved to be reliable, good, substantially easy to work with, in a few words 'it works', BUT it's still a niche technology, ten years after its introduction. Is there any hidden problem lingering around?"

Key Indicator Data Systems, represented in the kids2 project, is a free GIS mapping software under development for over five years. Supported by grants from the Food and Agriculture Organization of the United Nations (FAO) and other funding bodies, KIDS is being used by numerous educational, government, and non-governmental agencies for thematic mapping and spatial analysis of indicator data.

You may think you're clever to use red text to indicate some important state in your GUI, but the red-green colorblind user is never going to see it. In today's Weblogs, Kirill Grouchnikov discusses How color-blind people see your UIs: "According to medical studies, eight to ten percent of male population suffers from some kind of color blindness (the figure for female population is much lower). What does it mean to the average Swing developer? Well, if you rely too much on color differences, you may be not conveying the information as well as you thought."

In JPRT: Build/Test System for the JDK, Kelly O'Hair reports: "I did a little blogging on JPRT [on] but that was mostly to talk about the COOL rack of Sun hardware that I used. Now I want to talk a little more about why we need something like JPRT, and what it does for us."

Jim Hurley seems to be having a good time at the 10th Jini Community Meeting in Brussels, and says Hey EuroOSCON! We're planning on leaving the place "messy"!"The Meeting is open and free (like the technology), so if you're in early for EuroOSCON, you're invited to stop by."

In today's Forums,rturnbull questions some old Swing rules-of-thumb in the thread Re: Closures and Swing: "> [snip] Most experienced Swing developers don't use action listeners we use Actions. Why? Other people have said the same thing. I quote from the Action javadoc: "Note that Action implementations tend to be more expensive in terms of storage than a typical ActionListener, which does not offer the benefits of centralized control of functionality and broadcast of property changes. For this reason, you should take care to only use Actions where their benefits are desired, and use simple ActionListeners elsewhere." It seems to me Actions should only be used where you have two or more components that invoke the same action, e.g. a menu entry and a toolbar button."

Bill Snyder offers his feedback on the latest SwingX component in Re: JXStatusBar ready for public review: "I really like the idea of having a status bar component that I can plug any bean into, rather whan having a generic JPanel subclass where the message and progress indicator is always in the same place. (Though I think common use cases like this should be readily available). Is there going to be a SwingLabs StatusBar and a JSR296 StatusBar?"

In today's News Headlines :

Registered users can submit news items for the News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the News RSS feed.

Current and upcoming Java Events :

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

Maintaining identity and credentials  

Ruby, My Dear Blog

Posted by kfarnham Sep 13, 2006

More on JRuby and Sun

Last week, you'll recall the surprise announcement that the two primary JRuby developers are joining Sun. It's a particularly apt choice given the interest in Ruby from Java developers: it seems the one agile language with the greatest appeal to the Java mindset (I think Michael Ivey told me five years ago that I should give Ruby a try, that it was a natural fit for Java programmers). And honestly, would we be pining for closures in Java if they were they were the highlight of some uglier, scale-proof language like PHP or Perl?

So what are the JRuby guys going to be doing? In JRuby Love, Tim Bray says the JRuby guys will be working on JRuby full-time, but "they also have a mandate to think about developer tools. Right now, developers who use dynamic languages like Python and Ruby are poorly served, compared to what Java developers have."

That rubbed ONJava blogger Timothy M. O'Brien the wrong way. InSun hires JRuby Developers (to focus on developer tools?), he wrote:

WRONG, has he ever used RadRails, Eclipse, Komodo? Probably not, at Sun, the only IDE that exists is NetBeans, and I certainly hope tihs doesn't mean that Charles Nutter and Thomas Enebo and going to be forced to work on the NetBeans team. I fear that might be the case. The one common theme I've noticed from Sun over the past few years is that they spend an irrational amount of time hyping NetBeans as the answer to every problem. I hope this is good news, and I hope that they didn't just hire the JRuby guys to be semi-junior developers on the NetBeans team.

Charles Nutter responded to this, which O'Brien quoted at length in a follow-up blog, Charles Nutter Responds: "our full-time responsibility is a solid JRuby 1.0". Nutter says:

Totally false. The principals at Sun


We See Blog

Posted by kfarnham Sep 12, 2006

Taking a look at look-and-feel development

I've only known a handful of people who've even attempted to develop a Swing look-and-feel, and those were all for internal corporate projects that were intended to only be used in one application, generally only on one operating system. The idea of creating a generally-useful L&F that could be widely distributed and used must be more of a challenge than most developers are up to -- look at the small number of L&F's compared to say, the overabundance of "skins" for WinAmp and similar media players.

One person who's up to the challenge is Kirill Grouchnikov, who you may recognize from his frequent appearances in the weblogs section of the front page. He has an immense knowledge of Swing, and a lot of that can be attributed to Substance, a highly-customizable look and feel that recently reached version 3.0.

There isn't a definitive book on look-and-feel creation, but if there were, Kirill should probably be the one to write it. He's working on some articles for to show the way to aspiring L&F authors, and the first of these debuts today. In our Feature Article, How to Write a Custom Look and Feel, he discusses the ideas, values, goals, and hazards of L&F development. He then goes into what kinds of topics you'll need to understand, and lays out guidelines learned from his experience, rules-of-thumb that can help you deliver a more successful L&F.

James Gosling weighs in on the discussion of closures in JDK 7 in today's Weblogs. Describing The Black Hole Theory of Design -- the idea that trying to design something "similar to but different from" something else that already exists tends to end up imitating the original -- he wonders if closures were the right direction for Java all along. "Closures feel to me like one of these design Black Holes. When inner classes were designed, we wanted to avoid the complexity of closures. But this brought about oddness and tension of its own that has left me less than happy with inner classes. So, should we just give in to the force of gravity and go the rest of the way?"

Mason Glaves checks out a concurrency gotcha in Rechecking Double Checking Double checked locking. If you have been around Java long enough, especially if you are writing multi-threaded code, and double especially if you are used to performing perfectly safe double checked locks in C or C++, you'll have been shocked and amazed to learn that you can't do it safely in Java.

Finally, Joshua Marinacci is releasing the Source to the Magnifying Glass Hack: "It can be tough sometimes, to admit with I can't do something; but I would rather admit I don't have the time for this rather than have the code rot on my hard drive. So, here it is."

In Java Today, the JavaDesktop Community is highlighting Gizmoball, a nifty pinball game editor app from students Greg Belote, Joshua Wang, and Tiffany Chang at MIT, as the community's latest featured Web Start application. "Gizmoball is a version of pinball, an arcade game in which the object is to keep a ball moving around in the game, without falling off the bottom of the playing area. The player controls a set of flippers that can bat at the ball as it falls." The player creates flippers, balls, pins, and other assorted thingamajigs, and and then wires up actions to keys. Press the "run" button and you'll be entertained for hours.

Microfinance Open Source (Mifos) describes itself as "an exciting open source information system to fight global poverty. Microfinance is a proven technique to help people lift themselves out of poverty. The challenge now is to scale microfinance operations around the world to reach more people and to attract more capital. Mifos will be a high impact solution because it removes several of the barriers to growth of microfinance programs. Volunteer contributors are needed!"

"Separation of concerns is a core principle of Service-Oriented Architectures. Unfortunately, this principle is often lost when it comes to the implementations of SOA services. All too often we see a big implementation class with multiple concerns such as security, transaction management, and logging all mixed in with the business logic." So what's a developer to do? In the ONJava article Separation of Concerns in Web Service Implementations, Tieu Luu advocates using Spring alongside Axis2 to achieve separation at the implementation level, doing so by bridging in a security framework that is separate from the business logic.

In today's Forums,paul_mattheis is having a hard time taking the pieces of Swing and Putting it all together: "Ok, so I have found a ton of books/articles/etc about the individual components of Swing, some even with small sample applications to show off the components. But what I'm looking for is books/articles/(good) examples on how to actually create good, maintainable Client-side applications. I have some ideas on things I want to create, but I always get stuck on where to start the "architecture" of the application so that it is maintainable, simple, and acstetically pleasing."

demiant wonders if GlassFish gives him a way to Schedule method executions: "Assuming I need some methods to be executed during specific times or per constant interval (for example a process that go through all orders within the system and make sure all of them were paid in time), is it possible to schedule these method executions through GF? or I have to use an external scheduler such as Quartz?"

In today's News Headlines :

Registered users can submit news items for the News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the News RSS feed.

Current and upcoming Java Events :

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

Taking a look at look-and-feel development  

Decidedly Blog

Posted by kfarnham Sep 10, 2006

Of polls and ballots

I don't know if it's that the responses have been chosen with an eye to mixing up the results, or if the Java community is really this divided, but the last few polls on the site have been striking in their lack of consensus.

Consider the recent poll asking Do You Use Groovy? With five responses, four of the five responses are clustered right around 25%, with a fifth getting less than 1%, leaving the response almost equally split four ways between Groovy fans, Groovy wanna-be's, Groovy doubters, and those who just don't know what it is.

Then check out the poll asking Would you like JDK 7 to support closures? If it were a political election, it would need a run-off, as no response got 50%. "Yes" came in first with 41.3%, but was followed by "What's a closure" at 27.2%. Is it too early for some to have an opinion, or does not knowing what the feature is argue against its inclusion?

One more: What license would you like Sun's open-source JDK to use?. It's probably not terribly surprising that Apache and GPL are the top choices. What's maybe a little more interesting is how closely they run with the option of not open-sourcing the JDK at all, which of course isn't an option under Sun's announced policy of open sourcing everything.

It's probably a good sign of diversity that opinions run a wide gamut in the Java community. There are so many Java developers, in so many different fields, it's only natural that different members are going to see things very differently.

From polling to voting: balloting for the NetBeans Governance Board elections has begun, and ends September 21, 2006 midnight last time zone. The nominees are Iwan Eising, Frank-Michael Moser, Edson Carlos Ericksson Richter, David Strupl, Rich Unger, and Gregg Wonderly, and you can read their profiles and positions on the candidate profiles page.

Also in Java Today, the ninety-third issue of the JavaTools Community Newsletter is online, collecting tool-related news from around the web, welcoming new projects to the community and congratulating maven-xmlvalidate-pluginon its graduation from the tools community incubator. Just for kicks (ha ha), the weekly tool tip suggests you watch the video Meet People - Practice Kicks, in which Bruno Souza and Ean Schuessler filmed various Java luminaries at JavaOne 2006 being kicked by a giant green shoe.

Mobile network operators must continuously monitor their networks in order to improve service. The new Event Tracking API for J2ME, JSR 190, currently in public review, standardizes event relay and collection for mobile networks, enabling application developers to build event tracking into their applications based on that standard. In the interview Event Tracking in a Mobile Environment, JSR 190 spec lead Shai Gotlib shares with Artima the requirements of mobile event collection, how JSR 190 provides reliable event collection in the face of intermittent network failures, and discusses the privacy and security aspects of mobile event collection.

This week's Spotlightis on GlueGen which makes JNI programming easier to manage. The project page describes GlueGen as "a tool which automatically generates the Java and JNI code necessary to call C libraries. It reads as input ANSI C header files and separate configuration files which provide control over many aspects of the glue code generation. GlueGen uses a complete ANSI C parser and an internal representation (IR) capable of representing all C types to represent the APIs for which it generates interfaces." GlueGen is used to generate several Java-to-C wrapper libraries, including JOGL and JOAL.



Between the Worlds Blog

Posted by kfarnham Sep 8, 2006

Java? Ruby? Both?

If you read Beyond Java, it was hard not to notice author Bruce Tate's clear affection for Ruby, which he clearly preferred not only to modern-day Java, but also to most of the dynamic languages out there. But it's easy to forget that he praised a lot of Java's accomplishments, such as how the JVM solves compatibility and security problems across operating systems. In fact, he predicted the Next Big Thing would have to run on the JVM, and because of that, he said to keep an eye on JRuby, particularly on when it would be able to run Ruby on Rails.

He wasn't the only one tracking JRuby, apparently.

Topping off the Java Today section is news that the two core JRuby developers, Charles Oliver Nutter and Thomas Enebo, will soon join Sun to work on JRuby full-time. As Nutter says in his blog, JRuby Developers Join Sun, "the primary goal is to give JRuby the attention it really needs. The potential for Ruby on the JVM has not escaped notice at Sun, and so we'll be focusing on making JRuby as complete, performant, and solid as possible." David Herron also comments on the move in his blog Good news, JRuby developers coming to Sun.

The JavaDesktop Community's latest featured applet is actually 3 applet games that have been created with the new JGame framework for 2D games. According to the release 0.8 announcement: "JGame is a small high-level 2D game engine for producing games on a variety of platforms. It does a lot of the stuff you need for a game automatically, and classic type arcade games can be developed with a minimum of effort. It is based on sprites with automatic collision detection, and a tile-based background with easy sprite-tile interaction facilities. JGame games can easily be run as stand-alone applications or as applets, and can be scaled to any resolution."

The 30 Minute Flex Test Drive gives Java developers a way to explore Flex and the various ways it integrates with Java EE, with a minimal time commitment: you just deploy a war file in Tomcat (or another app server), and then go through 10 concise and targeted samples. The samples focus on integrating Flex with Java back-ends (remote method and web services invocation, server push, real-time collaboration, pub/sub messaging, JMS integration, and persistence).

Our latest Feature Article, is S. W. Eran Chinthaka's look at Axis2: The Next Generation of Apache Web Services. Apache's Axis2 employs profound lessons learned from its popular predecessor, offering the developer vastly improved XML parsing along with an extensible core, pluggable data binding, and more. In this article, he offers an overview of what's new in Axis2, the "next generation" of this popular Web services SOAP stack.

Closures are still on the top of many of our bloggers' minds. In today's Weblogs. Kirill


New Precision Blog

Posted by kfarnham Sep 7, 2006

Want a JVM with just the pieces you need?

Stop me if you've heard this before: the JRE is too big to be a casual, on-demand download, so end users won't install it. If true, one solution is to download just enough of a JRE to bootstrap an application and then get just the pieces the user needs right then.

If this is a familiar argument to you, then you're probably a long-time reader of Ethan Nicholas' blog, as he has been calling for some time for a "Java Browser Edition" that would do just this.

Well, now Ethan is at Sun. And this proposal for an incrementally-downloaded JRE is happening. And he gets to do it... if it's even possible at all. In "Java Browser Edition": New name, first steps, he writes:

I was cautioned by several folks at Sun that the Browser Edition would simply never happen. It would never be approved as a feature in the first place, and even if it were approved, we would never be able to actually pull it off. I'm told that this basic idea has actually been attempted within Sun twice before, and in both cases the resulting size reduction wasn't enough to be worthwhile. The core VM, it seems, is simply too big, and trying to make it smaller is too hard. There has even been a detailed analysisof the idea which paints a rather bleak picture of the potential gains.

But under the new name "Java Kernel", Ethan's trying to make this a reality. In his blog, you'll find his interesting approach for developing a runtime that is just enough to do aSystem.out.println(), or bring up an AWTFrame.

His approach to determining what classes are necessary seems similar to the Java Media Framework's JMF Customizer, which allowed you to create a JAR of only those classes your JMF application needed. Maybe there are some insights from that project that could be brought to bear on this effort?

At any rate, the small, modular JRE has long been a dream of many Java developers. After all, if the network is the computer, why not get Java in a just-in-time piecemeal fashion, over the network?

Also in today's Weblogs Tom


Ships in the Night Blog

Posted by kfarnham Sep 6, 2006

Important facts you may have missed

The forums were particularly interesting yesterday, and I ended up putting three forum items on the front page instead of the usual two. There were two others I thought about posting, but instead, I'd like to address their teachable moments in the daily blog.

The first, by nishu_saini, is in the Java Advanced Imaging (JAI) forum, and asks Where are the binaries of this project:

I have to use the Java Advanced Imaging Image-IO API but I could not find the binaries of any version of this project. I find it very tedius task to checkout from cvs and build the project myself. I am sitting behind a firewall and not able to ping and therefore unable to checkout from cvs.

Granted, if you look at the JAI project, and click on its Documents and Files link, there are no downloads there. However, look at the front page and you'll see a Downloads link, which takes you to the explainer:

The latest early access build of Java Advanced Imaging, JAI 1.1.3-beta, is one of the binary buildsavailable on

If you take a look at that "binary builds" link, you'll see that what this project is doing is using its web space rather than the "downloads and files" section to post its binaries. OK, maybe that's not the standard approach, but it seems to work for the JAI project. Plus, the project web space is an underappreciated resource -- you could host all kinds of content here, such as Javadocs, documentation, community documents (like maps to get-togethers), etc.

nishu_saini's complaints continue in a followup message, Where are the binaries of this project:: The projects in suck, which reads:

I hope to find the latest binaries of all releases of the project in the documents and files section but to my disappointment..... most of the projects on do not provide binaries for their projects nor a good description of how to check out from cvs behind the firewall.

Having already covered the location of JAI's binaries, there may be an issue here that I hadn't thought of: our CVS-based projects use the typical pserver option for file transfer, and that typically runs over port 2401. It's entirely possible that some users work in environments with Stalinist network administrators who block all ports except for 80 and 110 (web and POP mail), which is a hideous network anti-pattern that usually makes things less secure, not more, but it's their network, and they're the ones with the shiny MCSA certifications<snicker/>. For small projects, one workaround would be to just browse the CVS source with your browser. Another option is to host projects with the http-friendly Subversion, which has supported for new projects for some time now (existing CVS-based projects have the option of freezing their old project and starting a new one that uses Subversion, or working with CollabNet on a fee-based conversion from CVS to Subversion).

As for all projects not providing binaries, it's not a given that every project should immediately (or ever) provide binaries. A just-launched project will probably need some time before its owners feel its ready to have a binary release. And many projects on the site have purposes other than creating binaries, such as projects to host JUG's, documentation projects like eclipse-tutorial, localization projects like the Simplified Chinese Translation of the JDK javadocs, etc.

It's also kind of interesting to note that some of the forgie-come-latelies, like Google Code Hosting and Mac OS Forge don't appear to have a release mechanism or web space at all. Both offer Subversion-based code repositories and a blog-like mechanism for one-way communication from project owners to the rest of the world. Google's also has a bug tracker. But at first glance, they don't appear to offer mailing lists, forums, wikis, a release mechanism, or webspace (outside of, say, creating a www directory within the project and handing out that URL, as both sites use http-based Subversion). They also seem uninterested in community, offering nothing that would bring together members of different projects, or lurkers who aren't even in projects. These are all things that we think distinguish Of course, if they're doing something right that we're doing wrong, please let us know.

Among today's other Forum messages,robilad stresses the issue of compatibility in the age of open source Java in Re: I think, there could be existing a unique Java-license: "Everyone is interested in seeing full compatibility between different implementations of the standards. There are many ways to encourage and get that, from releasing the TCKs under friendly licenses, to opening the reference implementation under suitable licensing conditions so that it can be shared and worked on together, to working more closely on JSRs. These approaches are not mutually exclusive, and Sun has shown some really encouraging movement on many sides in the past, including this year's commendable push towards free software in that area."

mkaul appears to need some help navigating the various desktop Java options, writing in JDIC capabilities: "I just came across JDIC. I am not sure if this is what I need. But I have someone who wants to have the ability to launch desktop applications from Windows/Linux.. existing applications like Lotus Notes, E-mail clients, IM clients etc. Is this possible in Java? I have a j2ee enterprise application that has no client component, so was wondering how I can extend it such that I can launch desktop applications."

Finally, twalljava talks about practical approaches to bringing unit-testing to desktop Java apps in Re: Testing custom components: "For testing custom components, I'd recommend a library based on java.awt.Robot, since you want to verify proper responses to native events. These tests can fit in nicely with JUnit (see abbot's front page for an example of what the code looks like). For regular plumbing/listener/hookup testing, programmatic frobbing (JButton.doClick()) may be sufficient, and you can also do that within JUnit (also check out the libraries for their component lookup utilities). For automating the application itself, your mileage may vary depending on your context. Some folks swear by it, some at it."

In Java Today, the JSR Community page notes that JSR review balloting is underway for JSR 305: Annotations for Software Defect Detection, and will end on Monday, Sept. 11. You can also nominate yourself for membership in the expert group, as noted on the JSR page. This JSR will "attempt to develop a standard set of annotations that can assist defect detection tools", such as annotations to prompt checks for null-ness, concurrency, internationalization, and return value usage.

The NetBeans Profiler developers have added a new HeapWalker feature to Milestone 2 of NetBeans 6.0. This new feature is still being defined and the developers are very open to feedback. To make it even easier to try it out, they even created a small Java Web Start version of the HeapWalker. For full details, check out the NetBeans Profiler Milestone 2 project page.

With so many Continuous Integration (CI) servers to choose from, it can be difficult to decide which one is right for you. In Choosing a Continuous Integration server, development automation expert Paul Duvall looks at a handful of open source CI servers, including Continuum, CruiseControl, and Luntbuild, using a consistent evaluation criteria and illustrative examples.

Evan Summers unveils Plumber's Hack 2: Blog o' warez in today's Weblogs. "As much as i love HTML/CSS as my preferred format for writing technical documents, i wanna to make it easier for myself. So i've thrown together some softwarez to lemme write with the minimal of markup noise. It parses my "poor text format" file and generates my desired output, eg. HTML for my weblog with syntax highlighting, innit."

Kohsuke Kawaguchi does a little implementation planning for Separate compilation in the JAXB RI 2.1: "A better support for separate compilation is one of the key proposed features in JAXB 2.1. So today's topic is how it will work."

Finally, in Munge: Swing's Secret Preprocessor, Tom Ball recalls: "The Swing team had run on 1.1 and 1.2 JDKs with conflicting APIs while seeming to change package names every week based on community and legal feedback. Munge is the tool we used to manage these changes easily, and here it finally is."

In today's News Headlines :

Registered users can submit news items for the News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the News RSS feed.

Current and upcoming Java Events :

Registered users can submit event listings for the Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.

Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of it will be archived along with other past issues in the Archive.

Important facts you may have missed  

Beauty Secrets Blog

Posted by kfarnham Sep 5, 2006

Bringing substance to Swing's look-and-feels

Desktop demands are weird. Give people an MP3 player, and the users will demand it be skinnable, so that one user can see his trackname and time like something from Star Trek, while someone else wants hers in script on mock papyrus. On the other hand, give people a wide-open look-and-feel engine that allows these and effectively any other visualization that developers care to render... and people complain that it doesn't look enough like Windows.

Sometimes it doesn't pay to listen to feedback, does it?

While the Napkin LAF may be one of the best-known third-party look-and-feels, Substance surely deserves to be known by a wider audience. The project has delivered an attractive, production-quality L&F that is distinguished by its extensive theme-ability and the extensive set of themes (which run from the color gamut from cold steel to bright citrus) that ship with it. Also, project owner Kirill Grouchnikov is one of our most prolific bloggers and has a rare understanding of Swing's look-and-feel technology (which he'll be sharing in some upcoming feature articles).

Today's big news is that the Substance project has released version 3.0 of its highly-customizable Swing look-and-feel. This version offers a number of new color themes, improved painting in various places, animated effects, and more. Kirill summarizes the highlights of the new release in his blog Substance LAF 3.0 official release, which includes more screenshots of its top features and a Java WebStart demo.

Further down in Java Today, Mark Reinhold announces that show-stopper bugs and a high rate of incoming bugs has forced a Java SE 6 schedule update. "With these changes the release candidate will now ship at the end of October and the final release will ship in the first week of December. (It won't be in the last week of November due to the Thanksgiving holiday here in the U.S.) We're also continuing to work with our PC OEM partners to ensure that the Java SE 6 JRE will be included on new PCs at the time of the Windows Vista launch."

Within the Apache world, the idea of running multiple websites off of one server instance is a pretty well-understood problem, and is just a matter of mastering the <VirtualHost> directive in the configuration file. And that's great for static pages or those served via Apache CGI, but for many Java web applications, the server of choice is Tomcat, and Tomcat's way of doing things is entirely different. In How to Publish Multiple Websites Using a Single Tomcat Web Application, Satya Komatineni illustrates how he took a simple, web-based content management system called "Knowledge Folders" and exposed a single instance of it as multiple websites, each with its own unique hostname.

In today's Forums,ss141213 works through JPA misunderstandings in Re: Entity manager in web applications: "There is nothing called container managed persistence in Java Persistence API. Are you referring to container managed entity manager? If you are using a Servlet 2.5 compliant container like GlassFish (note Tomcat 5.x is not Servlet 2.5 compliant), then I suggest you use container managed entity manager. This can be obtained either by injection (@PersistenceContext) or JNDI lookup. Since you must not inject an entity manager into a multi-threaded servlet, you are left with the option of looking up an entity manager using JNDI in the doGet() or doPost() method of the servlet."

In the GlassFish forums, anilam is seeking Feedback on Admin Console one pager: "Please provide us comments/feedback on the proposed admin console changes in Glassfish V2. An overall document describing this can be found at:AdminGuiOnePager.html. Feedback/review period closes 2 weeks from today. Any comments received after that would not be considered for this release (GlassFish V2)."

In today's Weblogs, John Reynolds invites you to "Go back with me to the mid-90's and revisit the issues that we had with that closed-source code that we'd purchased," in Open software pragmatism - Free (as in beer) isn't the point.

Sharing a Conspiracy theory about closures in Dolphin, Kirill


Third Floor Heaven Blog

Posted by kfarnham Sep 4, 2006

Making conferences and unconferences more useful

Do enough conferences and it's easy to get pretty jaded by the PowerPoint slides... oh, excuse me, StarOffice Impress slides... along with the hard sells, big promises, and presentations that are more valuable to the speaker than the audience. Do enough sessions and it's not hard to finally snap. For me, that would be at the JavaOne 2006 Blu-Ray session (oh yeah, Iblogged it).

Personally, I've found that I've tended to enjoy and get more out of JavaOne's birds-of-a-feather sessions (BoF's) than the technical sessions, and then again more from the tech sessions than the keynotes.

In contrast the "agile" conference -- the loose, spur-of-the-moment type of confab -- is gaining traction as a means of organizing get-togethers. FOO Camp is among the best known, but the concept is spreading. Earlier this year, Disney held an internal "Pooh Camp", which probably suits that company's increasingly progressive attitude towards technology and new media.

Thing is, the FOO-style approach, or the unconference in general, is thought to be optimized for smaller gatherings, and isn't thought to scale beyond more than a couple hundred participants. Would you want to show up for JavaOne with 15,000 other Java developers and all of you not have any idea where to go or what to do?

In other words, are there new ideas that can improve the conference experience, and where are they applicable? Two of today's featured Weblogs take on this question. Tim Boudreau has one concept that might suit a BoF or tech session, as he describes the proposed "Fishbowl Debate" at NetBeans Day Seattle. What's a Fishbowl Debate? Tim explains that the idea comes from Simon Phipps:

  • You have a table with 6 chairs onstage (well, ideally it's done in the round, but in Seattle the chairs will be bolted down)
  • At any time 5 people are seated, discussing a topic of interest to all of them
  • One chair is always empty; when someone in the audience hears something they strongly feel they have something to say about, they get up and go sit in the sixth chair; at that point one person who was already seated gets up and takes a seat back in the audience

Do you have other ideas for JavaOne? Jim Driscoll wants to hear them. In JavaOne meetings starting up, he writes: "It's that time again... JavaOne time. What? Barely over the parties from last year? That's ok - it's in May. But meetings are starting to determine the content for May."

Elsewhere in the blogs, Rémi Forax has a Garden thought about closures and their uses in GUI code: "Why [isn't it permitted] to define a closure using a reference to a method ? It could greatly simplify UI code by enabling definition of listener in a simple way."

This week's Spotlightis on Subversion, one of your choices for version control when starting a project. Now, CollabNet, which powers the project hosting and collaboration facilities on, has posted a one-hour webinar on Subversion Best Practices, hosted by CollabNet's Chris Clarke and Garrett Rooney. "In this one hour web seminar, you'll get an insider's view of how best to use Subversion's most important functions, how to create new branches, what should be under version control, how to make atomic commits, and more."

In Java Today, the jdk-jrl-sources project has been released to the general public. This is a Subversion full source release of the JDK6and JDK7 source tree under the JRL license. JRL licensed sources are now available as either a tar ball or from a repository. The advantage of the repository is that each build of JDK 7 and the last 10 or so builds from JDK 6 are available to developers. Igor Kushnirskiy has more details in his blog Readonly subversion repository for JDK sources under the JRL license.

The ninety-second issue of the JavaTools Community Newsletter is online, collecting tool-related news from around the web, celebrating the graduation of the UTF-X project, welcoming new projects to the community, and featuring a Tool Tip on finding code samples in open source projects.

Artima's Frank Sommers writes of The Death of the General-Purpose IDE and the Last Java Developer: "As modern IDEs are becoming larger, IDE projects cope with entropy by creating versions of their tools aimed at specialized developer communities, for instance, around popular enterprise frameworks. What does the segmentation of the IDE market place along the lines of developer micro-communities say about the future of IDEs?

In today's Forums,robilad has some thoughts about open-source Java licensing in Focus on real, current issues: "The reason why Apache Harmony has not attracted GNU Classpath developers lies in ASF's inability to make sure the resulting work is under a license suitable for *all* VMs and use cases, rather than the VM made within the context of the Harmony project. Putting the class library under the Apache license does not work for GPLd VMs, and it does not work for ahead of time compilation of GPLd Java code, as in both cases using Apache Harmony would lead to an undistributable result. That's all there is to it: people will work on code they can use, and they won't work on code that they can't use."

pago considers the GUI developer's use-cases for closures in Re: Closures and Swing: "The cool thing about the second example is that you could have a hole lot of fun with it by switching the "implementation" (=closure) for specific events at runtime. Most of my MouseListeners would probably benefit from something like this, because the resulting code would be much clearer. Let me repeat this: A closure shouldn't have a state at all (except for the state of its context - the method/class where it is declared). If there's coupling between mouse-enter and mouse-exit, then you'll want to go for an object that has a state of its own.


Are You Receiving Me? Blog

Posted by kfarnham Sep 1, 2006

More on Swing and closures

So I had another one of those "jeez, I wish I had closures" moments last night. But first, let me digress into how a lot of desktop people are talking about the closure proposal right now. Over on the forum thread Closures and Swing, there's a pretty wide-ranging discussion of the various ways to wire behavior to a button, from anonymous classActionListeners to Actions, to what I think is a prooposed onAction() method forJXButton (my apologies for not getting this right...JXButton seems to be in the Attic, so it's hard to tell what is and isn't real in SwingX-land). These options are then compared to closures with an eye to whether closures provide any genuine value beyond syntactic sugar, and if that's the case, whether it's still worth doing because the existing ActionListener scheme is so difficult for beginners to understand.

That's all well and good, but while we're still talking about function pointers, the idea of enclosing state, one of the key concepts of a closure, really doesn't matter in this kind of discussion, which makes it debatable as to whether this is the right argument to have about closures -- if closures help the hard cases, and are just an option for the easy ones, is that a good reason to add them? Or will they end up making the easy cases hard, which most agree is exactly what Java doesn't need right now.

OK, here's my case, which makes a stronger argument for real closures. I'm working through a QuickTime for Java bug with some Apple engineers and they want me to duplicate my bug -- a crash when bringing up a settings dialog -- in their code. Their code is an Applet, mine's an Application. What I want to do is to get their app running and then, after Applet.start() has done all its work, simulate an asynchronous launching of the dialog. So I decide what I want to do is to just wait five seconds and then bring up the dialog.

So, I need an inner thread. And the inner thread needs to be able to get two local variables (one to stop and start the capture and the other to show the native settings dialog) that are local toApplet.start(). So I have to write an ugly hack like this:

final SequenceGrabber mySG = sg;
final SGVideoChannel myVC = vc;
Thread waitAndDialog = new Thread() {
    public void run() {
        // lots of try-catches removed for clarity

Now this is the kind of thing I need a closure for. It's not just that I need a function pointer to describe the threaded functionality, it's that that code also needs two local variables whose values I only know at the time I create the Thread. Thefinal gives me a way to do it, so I'm grateful it's possible without major code reorganization, but it's pretty ugly. The less ugly (but far more verbose) alternative would be a named inner class, which would take the SequenceGrabber andSGVideoChannel in its constructor... split off from the section of code where it matters, this option seems even worse.

Is this worth doing closures for? Hard to say -- was it worth it to add generics so the compiler could pre-emptively preventClassCastExceptions from the collections classes? I never thought it was that big a deal (because I could either account for every use of my collection, or because it didn't kill me to throw in an "if X instanceof Y"-type check), but a lot of others thought this was worth changing the language for.

So how many people are doing these kinds of crazy one-off anonymous asynchronous Threads anyways? Are you, say, firing off a database query (with some query arguments only available as local variables) and populating a Swing JTable asynchronously when the results come back? Are there other good use-cases for closures?

In Java Today, the Enterprise-class WSRP Open Source Project aims to develop a WSRP v1 producer and consumer, support registries that allow publishing and discovery of remote portlets, and support propagation of user identity and other security capabilities between producer and consumer. The project is part of the larger Portal Open Source Project.

A recent "meet the engineer" article on SDN features an interview with blogger Tom Ball. In Meet Tom Ball, Technical Director at Sun Microsystems, he talks about Jackpot's ability to transform and re-engineer Java code and the accessibility of the Jackpot engine. He also advocates writing "boring code" whenever possible, talks about the surprising history of the JDK's Java Sound implementation, and shares stories about the early development of Java.

A recent item on the Java Web Services and XML community page considers Four Alternatives for Distributed SOA: "Service-oriented Architecture (SOA) provides the vehicle to evolve from server-centric to network-distributed computing. But why would organizations want to do this? Business-wise, distributed SOA aligns technology with business goals which in turn fuels organization capability and productivity. From a technology perspective, it enables broad system integration, practical code reuse and speeds up application development. In other words, SOA offers a value proposition to achieve demonstrable, quantifiable competitive advantage for the organization."

The latest Poll asks "Do you use Groovy?" Cast your vote on the front page, then check out the results page for current tallies and discussion.

Project organization is on the agenda in today's Forums, In HTTP Load Balancer availability and enhancements in GlassFish v2, pj126383 writes: "GlassFish v2, introduces a software based HTTP Load Balancer. As a core functionality it provides support to, policy based, load balance HTTP requests across cluster/group of Sun Java System Application Server 9.1 (GlassFish v2) instances. Please provide your feedback/comments on the proposed enhancements to Sun Java System Application Server 9.1 (GlassFish v2) HTTP Load Balancer. The document enlisting these enhancements is made available at LB-onepager.txt The feedback/review period closes 2 weeks from today. Any comments received after that would not be considered for this release (GlassFish v2)."

kwalsh announces that JAX-WS 2.0.1 nightly builds to jax-ws project have resumed!: "JAX-WS nightly builds and postings of binary and source installer jars have resumed! Please download JAX-WS 2.0.1 nightly bits and test them out. If you find problems(bugs)submit them in issues tracker for timely resolution. Of course, if you need greater stability download the more stable milestone release As always, thanks for your patience."


Filter Blog

By date: