GlassFish Patches now at Oracle Support
SunSolve was, and still is, Sun's way of distributing patches; the equivalent mechanism at Oracle is My Oracle Support (MOS), and Gerry just announced thatSun patches now available there. This includes the GlassFish commercial patches like 128640-20, which is one of the patches in GlassFish 2.1.1 patch 6.
I just looked directly for the patch ID (using Sun's patch number), I'll try to dig more info on how to use MOS and will post it later on.
GlassFish at FISL
Alexis and Arun went to FISL11 at Porto Alegre (Wikipedia, GeoMap) and have provided reports including photos; see Alexis' Back from FISL, and Arun's AFISL 2010 Trip Report.
Alexis's slides are available via SlideShare: GlassFish OSGi - from modular runtime to hybrid applications and The future of the GlassFish community. Arun's presentation was all demos, which he has also made available as a YouTube playlist.
Open Source is very strong in Brazil (see for example this post). As you can see from our GeoMap, GlassFish has a fair amount of adoption, but we need to improve our outreach. If you have suggestions or want to contribute, post them as comments on this entry, or contact us at theaquarium at sun dot com.
Thanks for Open Sourcing IntelliJ IDEA
Without the Groovy facet, I would have been totally lost. I doubt that, now that that Groovy facet is available in the open source, a tutorial on facets is even needed. Simply read the Groovy facet and adapt it to your own purposes, as I did here:
Open source rocks!
Technology Exchange Developer Day at VMworld 2010
Technology Exchange Developer Day at VMworld 2010 is a conference focused exclusively on the needs of systems and application developers. The show, now in its 6th year, will take place at Moscone Center in San Francisco from Aug 30 through Sept 1. It will feature the best practices for application development and delivery on VMware products and deep dive into public and private cloud APIs from VMware. There will be close to 30 sessions with content designed specifically for developers, architects and product managers. SpringSource technologies will be featured in numerous sessions including the following topics:
- Spring into the Cloud: Understanding Spring as a Cloud Application Development Platform - Chris Richardson
Abstract: This session will provide a brief technical overview of Spring, the most popular enterprise Java development framework, and then will focus on the best practices for Spring-based cloud application development. Using Spring’s dependency injection and configuration controls, Spring-based applications can become portable from the developer desktop to the enterprise datacenter and into the cloud. Join the experts from SpringSource to learn how to ensure today’s applications are ready for tomorrow’s runtime environment. - Inside VMforce: an Architectural Overview of the Enterprise Java Cloud - Ramnivas Laddad
Abstract: With the announcement of VMforce, VMware and Salesforce are building an enterprise Java Cloud that combines the Spring programming model with VMware flexibility and Force.com reliability and data integrity. This session will discuss the architecture of this new Platform-as-a-Service solution and provide a technical overview of how to run Spring applications that integrate with Force.com services. VMforce will be available for developer preview in Q4 2010, so VMware developers can attend this session for a special early preview of this exciting new cloud platform.
The complete session list and abstracts are available at Tech Exchange developer blog and will shortly be posted on the web site. Be sure to register for this great show. The conference fee for the 3-day event is $399 but if you also attend VMworld, the fee drops to $299. Follow the more news and updates at the Tech Exchange developer blog or Twitter feed.
The Big Merge is On
As promised, the big website merge, of Java.Sun.Com, Developers.Sun.Com and BigAdmin into OTN is here: as late this afternoon, the tree sites map into different sections at oracle.com/technetwork. Read the details of the merge in Justin's post: We All Are One.
Remember: good feedback leads to happy endings - and be patient with us while we incorporate it!
Spring MVC 3 Showcase
Spring Web guru, Keith Donald, has just blogged about some of the outstanding features in the 3.0 version of Spring MVC. Keith has created a special showcase project for the Spring community to download. It includes extensive examples of the different options for web interaction possible with Spring MVC and the short screencast also demonstrates how to get started with the project.
Blog | Source Project | Screencast | Presentation
Keith and the other core contributors to Spring will be presenting at SpringOne 2GX 2010 in October, so be sure to register now for early discounts.
Closed Networks and the GlassFish Update Center
One of the best features about all the versions of GlassFish 3 is how easy it is to update it through the IPS-based Update Center. The same GUI and CLI tools can be used to upgrade from 3.0 to 3.0.1, to Add or Remove components and to switch from the Open Source to the Oracle's Commercial release.
The same machinery is also used to install Commercial Patches, where it provides an experience that is much easier than in v2. With the transition to Oracle it's taken a bit to get the v3 patch pipeline, but eventually you will see the same frequency as with the v2 patches.
This all normally works through the standard repositories at Oracle but sometimes your computer has limited internet connectivity, so, what do you do? The solution is to create a local repository. This is actually Very Easy to Do (tm). And a local repository is also useful for many other things.
As you noticed if you followed the links, all these topics are now described in the, recently updated, Administration Guide; check out the Extending and Updating the GlassFish Server.
JavaOne News Update 1
An update on some recent News on JavaOne 2010. As you know JavaOne San Francisco is Sep 19-23, 2010. The Official page has links to the Registration Page and the Online Catalog. News updates include:
•
A surprisingly useful & manageable Catalog-as-tweets
via
@javaoneconf
•
Availability of
Schedule Builder (post)
•
Open enrollment in
Java University (post)
•
Announcement of dates for JavaOne Brazil and JavaOne China (post).
• The day before there is a
MySQL Sunday!
• And, the
Duke Awards
submissions page seems to still be active.
Also, this year will be the 15th anniversary for Java, and the 5th for GlassFish. Don't know if there will be a BDay party for Java; still hoping we can put something together for GlassFish, we will see!
More related news are tagged JavaOne.
Extending IntelliJ IDEA for NetBeans Platform Development
The above, which is in the free community edition, implies a future where NetBeans Platform development will be a first-class development option in IntelliJ IDEA. I have the basic plugin set up, as you can see above. However, is there someone who can tell me how I should continue from here? I need to be able to (1) set things on the classpath, (2) create runtime configurations, and (3) generate folders and files when Finish is clicked above.
Another option would be to hook a project in IntelliJ IDEA into an Ant script such as the one created in the NetBeans Platform Ant Tutorial. For example, when "Run" is invoked on the project, the related target in the NetBeans Platform would be invoked, via the Ant script outlined in the tutorial.
Any advice from IntelliJ IDEA API users out there?
Good Feedback and Happy Endings - The Ugly URLs
As everybody that does not live under a rock should know, we are in the middle of integrating Sun into Oracle, and one of the activities has been integrating the web sites. The first step was Moving the Docs, 3 weeks ago. That went pretty well... except for the ugly URLs...
I'm happy to report that, thanks to Exposure and Feedback and help from KenC, SteveH, JustinK, AdamM, HenrikS and others, the problem will be solved.
So, remember, your feedback (and your patience as we react to it!) is very important to quality. Keep that in mind as we continue our integration, including The Big Website Merge this next week.
JDesktopPane, JInternalFrame, and TopComponent
However, it would be better if the JInternalFrames were to be TopComponents instead. Any clues?
Here's how I created the above TopComponent:
...
...
...
private JDesktopPane jdpDesktop;
private int openFrameCount = 0;
public DemoTopComponent() {
initComponents();
setName(NbBundle.getMessage(DemoTopComponent.class, "CTL_DemoTopComponent"));
setToolTipText(NbBundle.getMessage(DemoTopComponent.class, "HINT_DemoTopComponent"));
setLayout(new BorderLayout());
jdpDesktop = new JDesktopPane();
createFrame(); // Create first window
createFrame(); // Create second window
createFrame(); // Create third window
//Add the JDesktop to the TopComponent
add(jdpDesktop);
}
protected void createFrame() {
MyInternalFrame frame = new MyInternalFrame();
frame.setVisible(true);
jdpDesktop.add(frame);
try {
frame.setSelected(true);
} catch (java.beans.PropertyVetoException e) {
}
}
class MyInternalFrame extends JInternalFrame {
int xPosition = 30, yPosition = 30;
public MyInternalFrame() {
super("IFrame #" + (++openFrameCount), true, // resizable
true, // closable
true, // maximizable
true);// iconifiable
setSize(300, 300);
setLocation(xPosition * openFrameCount, yPosition * openFrameCount);
// Add some content:
add(new JLabel("hello IFrame #" + (openFrameCount)));
}
}
...
...
...
Hope someone has ideas on how to use TopComponents instead of JInternalFrames in this scenario!
NetBeans RCP via Ant + No NetBeans IDE
It's a pretty simplistic tutorial, which is based on the three part "Bye NetBeans IDE" series that has appeared in this blog over the past weeks, but gets the point across, I think. There's definitely enough info there to get up and running on the NetBeans Platform with Ant and the command line. I plan to add more info, on how to set dependencies between modules, how to add windows, and how to extend the Options window.
Here's the link to the tutorial, let me know if any info is missing or incorrect:
http://platform.netbeans.org/tutorials/nbm-ant.html
Bye NetBeans IDE (Part 3)
Creating the Module Structure
- Module Root Folder. Create a new folder within the application's main folder. Name it, for example, MyModule.
- Module Project Folder. Copy the application project folder into the module root folder. In other words, you will use the application project folder as the starting point for your module project folder.
- Suite Properties. In the module project folder, delete the 'platform.properties' file. Instead of a 'platform.properties' file, you need a 'suite.properties' file, which will point to the application that owns the module. It should have this content:
suite.dir=${basedir}/.. - Build Script. In the module root folder, create a 'build.xml' file, with this content:
<?xml version="1.0" encoding="UTF-8"?> <project name="org.demo.mymodule" default="netbeans" basedir="."> <description>Builds, tests, and runs the project org.demo.mymodule.</description> <import file="nbproject/build-impl.xml"/> </project> - Manifest. In the module root folder, create a 'manifest.mf' file, with this content:
Manifest-Version: 1.0 OpenIDE-Module: org.demo.mymodule OpenIDE-Module-Specification-Version: 1.0
- Build-Impl Script. In the module project folder, create a file named 'build-impl.xml', with this content:
<?xml version="1.0" encoding="UTF-8"?> <project name="org.demo.mymodule-impl" basedir=".."> <property file="nbproject/suite.properties"/> <property file="${suite.dir}/nbproject/platform.properties"/> <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2"> <attribute name="name"/> <attribute name="value"/> <sequential> <property name="@{name}" value="${@{value}}"/> </sequential> </macrodef> <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2"> <attribute name="property"/> <attribute name="value"/> <sequential> <property name="@{property}" value="@{value}"/> </sequential> </macrodef> <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> <import file="${harness.dir}/build.xml"/> </project> - Project Properties. In the module project folder, change the file named 'project.properties', to this content:
javac.source=1.6 javac.compilerargs=-Xlint -Xlint:-serial
- Project Configuration. In the module project folder, change the file named 'project.xml', to this content:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://www.netbeans.org/ns/project/1"> <type>org.netbeans.modules.apisupport.project</type> <configuration> <data xmlns="http://www.netbeans.org/ns/nb-module-project/3"> <code-name-base>org.demo.mymodule</code-name-base> <suite-component/> <module-dependencies> </module-dependencies> <public-packages/> </data> </configuration> </project> - Main Package. In the module root folder, create folder structure 'src/org/demo/mymodule'. The content will be added later, we simply need to have the main package.
Registering the Module
Now that you have a module structure, lets register it in the application.
- Project Properties. In the application project folder, create a 'project.properties' file for the application, add this:
app.name=myapp branding.token=${app.name} modules=\ ${project.org.demo.mymodule} project.org.demo.mymodule=MyModule - Platform Properties. Change the 'platform.properties' file of the application to this:
nbplatform.active=default nbplatform.active.dir=/home/geertjan/Aaa/nbrcp/ harness.dir=${nbplatform.active.dir}/harness cluster.path=${nbplatform.active.dir}/platform disabled.modules= - Try It Out. Run the application and you'll see the module is loaded, by looking in the output:
Adding a Feature to the Module
We'll use the module to provide a new menu item to the application.
- Add an Action. In the "org.demo.mymodule" package, add a class named 'HelloWorldAction', with this content:
package org.demo.mymodule; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JOptionPane; public final class HelloWorldAction implements ActionListener { public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null, "hello..."); } } - Add a Layer. In the main package, create a new 'layer.xml' file that registers an Action item and a Menu item:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd"> <filesystem> <folder name="Actions"> <folder name="Window"> <file name="org-demo-mymodule-HelloWorldAction.instance"> <attr name="delegate" newvalue="org.demo.mymodule.HelloWorldAction"/> <attr name="displayName" bundlevalue="org.demo.mymodule.Bundle#CTL_HelloWorldAction"/> <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/> </file> </folder> </folder> <folder name="Menu"> <folder name="Window"> <file name="HelloWorldAction.shadow"> <attr name="originalFile" stringvalue="Actions/Window/org-demo-mymodule-HelloWorldAction.instance"/> </file> </folder> </folder> </filesystem> - Add a Bundle. In the main package, add a file named 'Bundle.properties' with this content:
CTL_HelloWorldAction=Hello World
- Register the Layer and Bundle. Register the latter two files in the 'manifest.mf', which is in your module root folder:
OpenIDE-Module-Layer: org/demo/mymodule/layer.xml OpenIDE-Module-Localizing-Bundle: org/demo/mymodule/Bundle.properties
Run the application. It starts up and there's a new menu item under the Window menu.
How to Get Started Porting a Swing App to the NetBeans RCP???
Here's the direct link:
http://platform.netbeans.org/tutorials/nbm-porting-basic.html
Many thanks to Pierre-Yves Rouille, who provided many very useful comments on the above tutorial and motivated me to continue working on it!
As you can tell from the URL, an advanced porting tutorial is being planned (i.e., nbm-porting-advanced.html). I have some ideas of what should be in there—if anyone else out there has suggestions, please feel free to leave them in the comments to this blog entry.
Happy porting!
Java SE 6 u21 is Now Available
Java SE 6 update 21 is now available (Downloads, release notes, bug fixes).
This release includes performance improvements, support for Oracle Enterprise Linux, Oracle VM, and Google Chrome, and Visual VM 1.2.2. The Java EE SDK still includes u20; an update with u21 is tentatively scheduled for next week.
The actual release was a few days ago but the official post just came out. BTW, Java SE News is now at BOC; I can't wait for BSC and BOC to be merged so we only have to track one site.
Spring Web Flow 2.1.1.RELEASE is now available for download
The first maintenance release in the 2.1 branch of Spring Web Flow is now available for download.
Download | Changelog
How Evil is "instanceof"? (Part 2)
The result of the code that follows, which completely replaces the LibraryNode class in the previous blog entry, is as follows:
And here's the code received from Josch, which is really quite pretty:
public class LibraryNode extends AbstractNode {
public LibraryNode(Library library) {
super(Children.create(new LibraryFactory(library), true));
setDisplayName(library.getName());
}
private static class LibraryFactory extends ChildFactory<String> {
private final Map<String, Node> categories = new HashMap<String, Node>();
private LibraryFactory(Library library) {
categories.put("Books", new BooksNode(library));
categories.put("Borrowers", new BorrowersNode(library));
}
@Override
protected boolean createKeys(List<String> list) {
list.addAll(categories.keySet());
return true;
}
@Override
protected Node createNodeForKey(String key) {
return categories.get(key);
}
}
}
class BooksNode extends AbstractNode {
public BooksNode(Library library) {
super(Children.create(new BooksFactory(library), true));
setDisplayName("Books");
}
private static class BooksFactory extends ChildFactory<Book> {
private final Library library;
private BooksFactory(Library library) {
this.library = library;
}
@Override
protected boolean createKeys(List<Book> list) {
EList<Book> books = library.getBooks();
for (Book book : books) {
list.add(book);
}
return true;
}
@Override
protected Node createNodeForKey(Book key) {
BeanNode node = null;
try {
node = new BeanNode(key);
node.setDisplayName(key.getTitle());
node.setIconBaseWithExtension("org/library/viewer/book.png");
} catch (IntrospectionException ex) {
Exceptions.printStackTrace(ex);
}
return node;
}
}
}
class BorrowersNode extends AbstractNode {
public BorrowersNode(Library library) {
super(Children.create(new BorrowersFactory(library), true));
setDisplayName("Borrowers");
}
private static class BorrowersFactory extends ChildFactory<Borrower> {
private final Library library;
private BorrowersFactory(Library library) {
this.library = library;
}
@Override
protected boolean createKeys(List<Borrower> list) {
EList<Borrower> borrowers = library.getBorrowers();
for (Borrower borrower : borrowers) {
list.add(borrower);
}
return true;
}
@Override
protected Node createNodeForKey(Borrower key) {
BeanNode node = null;
try {
node = new BeanNode(key);
node.setDisplayName(key.getLastName());
node.setIconBaseWithExtension("org/library/viewer/borrower.png");
} catch (IntrospectionException ex) {
Exceptions.printStackTrace(ex);
}
return node;
}
}
}
Thanks Josch!
GlassFish v2.1.1 p6 and GlassFish For Business
Oracle has released patch 6 for Sun GlassFish Enterprise Server 2.1.1 via SunSolve. This commercial (i.e. available to customers) patch is also patch 12 for GlassFish 2.1 and patch 18 for v2U2.
Patches are cumulative: p6 addresses 23 new fixes since p5 but includes fixes for 139 issues since 2.1.1 and 870 since 2.1U2.
GlassFish For Business (RSS) includes posts for each individual GlassFish release and also has overviews for each family (see, e.g., GF2.11p6 and GFv2 Family).
Radio Monitoring Toolkit Platform on the NetBeans RCP
Yet another NetBeans Platform application is the CCRM Radio Monitoring Toolkit Platform, with modules providing instrument drivers, IQ based demodulators, data displays, measurements applications, and more. These modules work independently of each others by transferring data through a trace system.
A screenshot:
You can stay informed on the evolution of the platform via the CCRM Platform Blog.
How Evil is "instanceof"?
Here's the code I used for the above scenario:
public class LibraryNode extends AbstractNode {
public LibraryNode(Library library) {
super(Children.create(new SubChildFactory(library), true));
setDisplayName(library.getName());
}
private static class SubChildFactory extends ChildFactory<Object> {
private final Library library;
private SubChildFactory(Library library) {
this.library = library;
}
@Override
protected boolean createKeys(List list) {
EList<Book> books = library.getBooks();
for (Book book : books) {
list.add(book);
}
EList<Borrower> borrowers = library.getBorrowers();
for (Borrower borrower : borrowers) {
list.add(borrower);
}
return true;
}
@Override
protected Node createNodeForKey(Object key) {
BeanNode childNode = null;
try {
childNode = new BeanNode(key);
if (key instanceof Book) {
Book book = (Book) key;
childNode.setDisplayName(book.getTitle());
childNode.setIconBaseWithExtension("org/library/viewer/book.png");
} else if (key instanceof Borrower) {
Borrower borrower = (Borrower) key;
childNode.setDisplayName(borrower.getLastName());
childNode.setIconBaseWithExtension("org/library/viewer/borrower.png");
}
} catch (IntrospectionException ex) {
Exceptions.printStackTrace(ex);
}
return childNode;
}
}
}
Is the above evil and how should it be rewritten to use Lookup? I guess FilterNode should be used.
Update. See part 2 for a solution to the above problem!

