Main New Features:
Granite Data Services 2.0.0 Release Candidate 1 has just been released and comes with four main new features:
Granite-config.xml Changes (MUST READ):
The granite-config.dtd has changed in order to make the config more readable: as a general rule, all configuration attributes use now a “dashed�? convention: “annotedwith�? is now spelled “annotated-with�?, “instanceof�? “instance-of�?, etc. There is also a new “gravity�? section whose meaning content is detailed in “Gravity Changes�? below.
The new DTD is online and will help you with a DTD aware XML editor.
Gravity Changes:
Gravity code was getting messy, with several duplicated source sections, and hard to maintain. With the addition of Servlet 3.0 and GAE support, things were going even more harder, so the code has been cleaned up and widely refactored. However, the new code has been fully tested and shouldn’t bring any problem.
A new feature in this rewriting is the use of a thread pool for publishing messages. Previously, a published message was delivered to subscribed channels in a synchronous way, using the publish request container thread (delivering means only duplicating the message for all channels subscribed to the message’s topic and adding each copy to each channel’s queue). This operation was potentially time consuming with a large number of channels connected to the same topic and could block the caller container thread for a significant amount of time. A thread pool is now used for that purpose in all servlet implementations (Tomcat, JBossWeb, Jetty and Servlet 3.0) except for GAE.
Instead of servlet parameters, Gravity configuration now goes in a dedicated section of granite-config.xml. Here is an example of all options with there default values:
factory=�?org.granite.gravity.DefaultGravityFactory�? channel-idle-timeout-millis=�?1800000″ long-polling-timeout-millis=�?20000″ reconnect-interval-millis=�?30000″ reconnect-max-attempts=�?60″> core-pool-size=�?5″ maximum-pool-size=�?20″ keep-alive-time-millis=�?10000″ queue-capacity=�?2147483647″ />
This section is purely optionnal and you may omit it if you accept default values. Full documentation will be provided later but here is some comments on the most important options:
You may also use the new Gravity MBean in order to change most of these options at runtime (see below).
Servlet v3 support is new in this RC1 and should be considered as beta software. The only up-to-date implementation of the new API at this time is in Glassfish v3 trunk and you may download it (Servlet 3.0 support has been tested with glassfish-v3-preview-b47-windows.exe and may or may not work with other builds).
Configuring the GDS chat sample for Glassfish v3 is a two steps process:
You should then be able to connect to http://localhost:8080/graniteds-chat/ and test the application.
Configuration MBeans:
This RC1 comes with two new MBeans for GDS runtime management:
To access these MBeans with JBoss, browse to http://localhost:8080/jmx-console and scroll to the “org.granite�? section.
1 Comment
Does the appengine support work with the latest 1.2.1 version of appengine? I noticed all the example code is using 1.2.0 of appengine.