SixOhIntegrationFeatures
Summary of Feature Changes in the GlassFish/SJSAS Integration for NetBeans 6.0
Contents |
Resource Definition Persistence
Resource information has been persisted into the 'Server Resources' folder of J2EE and Java EE projects in the past, as files with the extension '.sun-resource'. Each of these files conformed to one of the sun-resource_1_X.dtd (like sun-resources_1_2.dtd and were used to persist the resource definitions for a project. When a project is deployed, the files were parsed and their data is used to register new or update existing resources on the server.
File:SixOhIntegrationFeatures/551-resource-persistence SixOhIntegrationFeatures.png
Screenshot of 5.5.1
While this method has worked, we had heard that the server implementation was going to start leveraging a file based on the sun-resource DTD to register resources. So, we changed the storage format for resources to use a single file instead of multiple files.
For folks that have existing projects, we have kept the loader for the sun-resource files. Many of the old actions supported on these files have been disabled (since they are deprecated). The loader also takes care of migrating the content of your individual dot-sun-resource files into a single sun-resources.xml file automatically.
File:SixOhIntegrationFeatures/600-resource-persistence SixOhIntegrationFeatures.png
Screenshot of same project after it is opened in NetBeans 6.0
JDBC Driver Deployment
One of the most common steps in tutorials about using NetBeans to develop data-driven web sites has read something like this:
Adding the database driver's JAR file is another step that is vital to enabling the server to communicate with your database.... do the following:
This flavor of sentence is followed by additional details about what you need to do to get the server to "see" the driver and use it.
The tutorials for using Java Studio Creator usually did not include a step like this. The folks that wrote Creator realized that they already had the information that was necessary to automate this step and so they implemented it.
As the functionality of Creator has been folded into the NetBeans trunk, the JDBC driver "deployment" feature was generalized to allow more users to take advantage of it.
Just about anybody who creates a data-driven web site or enterprise application will be able to take advantage of this feature in NetBeans 6.0, Milestone 10, which is coming soon. Of course, it will be hard to tell that you have. The only thing you should encounter is an extra server restart when an application that depends on a new JDBC driver is initially deployed.
New Options and Changes to Defaults
The recent changes to the Options dialog have forced us to examine where the options associated with the plugin get displayed. When we did examine them, we found that the option used to disable directory deployment was at the wrong level. It was "global". That was a good choice in the plugin's early development, but now it seemed like the right "place" for this option was on the individual registered domains.
Once we started thinking about per-instance options a couple other candidates jumped out at us. Both of them are related to the timeouts applied to some operations in the IDE related to the server.
The first timeout is the amount of time the IDE (and therefore users) wait to find out that the IDE knows that server start-up has completed. It had been an unbearable 5+ minutes. In many cases this number can be significantly lower.
The second timeout was the amount of time that the IDE would allow a deployment operation to take, before assuming that the operation had failed. This could also be significantly lower.
we also decided to let the user have control of the JDBC driver deployment feature on this page.
One danger of lowering these values, was the potential that we dropped them too far and some valid user deployment configuration would stop working.
We decided to make sure that users could control these timeouts and be able to account for differences between server configurations, if they had to. So we created an additional tab, in the Server Manager UI for GlassFish and SJSAS domains.
File:SixOhIntegrationFeatures/new-option-tab SixOhIntegrationFeatures.png
Since we were changing the server properties, we also altered one of the default values. In NB 6.0 the default value of the Property 'Enable HTTP Monitor' was changed to true.
File:SixOhIntegrationFeatures/Connection-props SixOhIntegrationFeatures.png
Improved Registration Experience for "Shared Installations"
Many people have encountered problems when trying to register a domain, if the server bits have been installed by somebody else or via a mechanism like aptitude or Synaptic package manager on Ubuntu. The default domains are all read-only for "normal" users in these cases. That means that the list of available default local domains would be empty.
http://blogs.sun.com/vkraemer/resource/551rootinstall.png
I have seen a number of pleas from folks who have tried all kinds of tricks to make the list of domains get filed in. As folks have tried more and more tricks, the resulting installation would become more and more broken.
The "correct" way to proceed has been available in the wizard for a long time. Users need to create a personal domain. I have responded to a number of e-mails with that answer and I swear I have heard the slapping of foreheads.
Well, I finally slapped my own forehead. I realized that the wizard needed to do a better job helping folks proceed past the second page. By changing the default selection from 'Register Local Default Domain' to 'Create Personal Domain' if the default local domains are not useful for this user, the user can just click Next to do the right thing. If the user has selected one of the other two options; Register Local Domain or Register Remote Domain, their choice is not disturbed.
http://blogs.sun.com/vkraemer/resource/60rootinstall.png
Usage Profile Support
Other resources on the web describe the GlassFish V2 usage profile feature so readers should check them out for more context. The one important thing to note is the fact that a domain is created for a particular usage profile.
The plugin has allowed users to create domains for GlassFish and SJSAS for some time. I have modified the second "page" of the registration wizard to allow users to select a profile.
http://blogs.sun.com/vkraemer/resource/profilesupport.png
If the users is creating a domain based on earlier version of the SJSAS or GlassFish releases, the only available value is Default.
The 'enterprise' profile has dependencies on HADB. If you don't have it installed, you won't be able to advance past this page of the wizard, if you select that profile. This is a difference from the way the asadmin subcommand create-domain behaves. It lets you create the domain, but the domain won't start until you install HADB.
Directory Deployment of Enterprise Applications and EJB Modules
NetBeans has been able to directory deploy web apps to GlassFish for a while. There has actually been code in place that would allow the IDE to directory deploy all kinds of Java EE modules, but it has never gotten a real work-out.
If you create an Enterprise Application project in a recent build of NetBeans and target it to deploy on a domain "powered by" GlassFish V2 B49 (or greater), the app will deploy from a directory in the project's dist directory. It is directory deployed.
File:SixOhIntegrationFeatures/directory-deploy-ear SixOhIntegrationFeatures.png
This removes a lot of significant I/O operations from the work-flow for developing enterprise applications. In previous releases, packaging for archive based deployment was creating a bunch of jar files and then the deployment operation was undoing all that work. Now the unpacking operations are eliminated.
There is still more that can be done. Enterprise Application projects suffer from their own "variant" of http://www.netbeans.org/issues/show_bug.cgi?id=97118.
Now that the enterprise application projects are directory deployable, the build processing can be optimized to remove unnecessary packaging steps for situations where the user wants to run the code of their application. The time savings from these optimizations can be significant. The IDE currently does three jar operations to create an ear for a simple servlet-calling-session-bean hello world sample application... BEFORE the application is deployed. Three unjar operations also need to take place to get the application deployed.
Almost all of these operations can be eliminated when an enterprise application is directory deployed. The savings are not very high for "sample" applications, but the savings can become substantial as the scope of the app expands.
Unified Descriptor Editing Experience
In earlier releases of NetBeans, the vendor specific deployment descriptor was "managed" by leveraging JSR-88. The editing experience that was intuitive to folks familiar to that spec was significantly different than the editing experience for the "standard descriptor".
File:SixOhIntegrationFeatures/551-ejb-jar14 SixOhIntegrationFeatures.png
The editor for a J2EE 1.4 ejb-jar.xml file
File:SixOhIntegrationFeatures/551-sun-ejb-jar14 SixOhIntegrationFeatures.png
The editor for the same module's sun-ejb-jar.xml file
The differences in the editing strategies were difficult for users to really understand. In 6.0, the editing experience is similar to that for a standard descriptor.
File:SixOhIntegrationFeatures/600-sun-ejb-jar14 SixOhIntegrationFeatures.png
The same sun-ejb-jar.xml file in 6.0
The editing experience also applies to Java EE 5 modules. If you create a Sun Deployment Descriptor for a Java EE project in NetBeans 6.0, the editor looks very similar to the editor for a J2EE 1.4 project...
File:SixOhIntegrationFeatures/600-sun-ejb-jar5 SixOhIntegrationFeatures.png
The data presented in the editor merges the data available in the annotated sources (implied) with the data that is available in the actual file. As the user edits the content in the editor the proper updates to the sun-ejb-jar.xml file are made to the "source".
File:SixOhIntegrationFeatures/600-sun-ejb-jar5-xmlview SixOhIntegrationFeatures.png
The actual data in the file displayed in the previous screenshot.

