Skip to main content

Little Wonders

Posted by editor on February 19, 2009 at 7:50 AM PST

Behold the one-class project

It seems like there's an interesting story behind the UrlEncodedQueryString project. Its page says "this project was developed in close collaboration with Sun over a period of 18 months as part of the Peabody initiative, in response to this RFE. For various reasons it did not make it into the JDK, so is instead released here under a BSD license. Full transcripts of the design decisions behind this project can be found here."

The project itself consists of a single class (OK, two if you count the unit test). So what's so important about it?

An instance of this class represents a query string encoded using the www-form-urlencoded encoding scheme, as defined by HTML 4.01 Specification: application/x-www-form-urlencoded, and HTML 4.01 Specification: Ampersands in URI attribute values. This is a common encoding scheme of the query component of a URI, though the RFC 2396 URI specification itself does not define a specific format for the query component.

This class provides static methods for creating UrlEncodedQueryString instances by parsing URI and string forms. Methods for creating, retrieving, updating and deleting the parameters on a query string, and methods for applying the query string back to an existing URI."

At first glance, this looks pretty interesting and broadly useful for composing or pulling apart query string URLs. It makes you wonder why it didn't make the cut for the JDK, and a link to design discussions is a dead-end as it's only available to project members. And if this class isn't going to clear RFE 6306820, I guess we have to assume the bug will stay in the "accepted" state indefinitely, or will it become a "won't fix".

Or maybe it doesn't matter. With the class released under a BSD license, its features are available to anyone who chooses to download it.

Also in Java Today, a new InfoQ article by Derek Frankforth looks at Distributed JBI with GlassFish. "The Java Business Integration (JBI) specification, known as JSR 208, describes an Enterprise Service Bus (ESB) and its interactions. These interactions are described in terms of components plugging into a software bus to exchange information. This construction, at first glance, appears to create a system where all pieces reside in the same process or virtual machine. OpenESB, an open source implementation of JBI, includes a homogeneous topology option using clustered JBI instances when run in a GlassFish Application Server. This allows for scalability and load balancing by increasing the number of clustered instances. Recently, a prototype implementation of a component called the Proxy Binding, allows OpenESB instances to be transparently linked together using a heterogeneous topology, much like extending the bus over a network. This article will describe and contrast the strengths and weaknesses of the two different styles of distributed access as applied to the OpenESB environment and show how in the end they complement each other."

In a new interview, Artima's Frank Sommers talks to Eran Davidov, Sun's director of Java engineering about Scaling JavaFX Applications Across Devices. In it, they talk about the respective roles of the developer and the runtime in adapting to different environments, the ability to discover and react to device characteristics like screen size, and whether you should have to create different versions of your application to target different devices.

In today's Weblogs, James Gosling reports that
India is amazing! "It's the end of day 1 of Tech Days in Hyderabad. What a great crowd! The locals were apologizing that "only" 6000 developers were there: the conference center is only big enough to accommodate 6000 attendees, and it's the largest conference center in India. The place is just jammed."

Xuan Yun shows how to
Customize Renderer of JComboBox in Synth Look And Feel. "Customizing the JComboBox style in Synth look and feel is a little complex, I can write a long article for it, but I don't want to be too tired, so please let me share my experience piece by piece."

Finally, Van Riper promotes the Benefits of JUG-USA Affiliation. "The opportunities afforded by affiliating together all the JUGs residing in the United States as part of an umbrella JUG-USA organization seem self-evident to me. In my efforts to bring JUGs around the country on board, I am learning that this is simply not the case. So, please read the full blog entry for my thoughts on this matter."

In today's Forums, signal3 points out that you can't kill the kill switch, in
Re: How to Disable END(or)Hangup key in J2ME. "It's still worth noting, the buck has to stop somewhere... so there will be some mechanism that the application management system provides to send the SIGTERM/SIGKILL combination. Again, it's typically the end/hangup key (as you already noticed). Nokia states explicitly: "The MIDlet can be still closed from the list of open applications." This is why, for all practical purposes, I consider the answer to you question a resounding no."

ziesemer reports success getting Sun to post an updated source drop in
Re: JDK 6 Source Code. "I then followed-up with Roger Yeung, who is the last person who I observed making updates on the jdk6 project. He just replied today that the jdk6u12 source w/ JRL license is now available! The links on the main have been corrected as well. Hopefully this is kept up-to-date now with future releases. Thank you Roger and anyone else that may have been involved in fixing this issue!"

Sahoo explains dependency injection limitations in the followup
Re: Dependency injection problems. "You can't inject an EntityManager into an EntityListener. EntityListener is not managed by any of the containers. Ideally, the callback methods should have passed the persistence context in which the entity is being managed as an argument, but they don't. I have mentioned that as a feedback to JPA spec lead, but I am not sure if they incorporated the feedback or not. You can try the same."

Finally, samantha001 is looking for
file transfer. "I am using sockets for transferring file but unable to transfer large files because of unreliable connection any one can tell me how can i make connection reliable. can i move to cms, file transfer is possible using cms on any type of network including private connection(using relay). If yes then how can i do this and plz tell me the limitations too."

Current and upcoming Java

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

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 href=""> Archive.

Behold the one-class project