Overview
Griffon 0.9.2-rc1 – "Aquila audax" - is a maintenance release of Griffon 0.9.
New Features
Buildtime
Configuration flags
All of the command options described in section
4.6 Command Line
Options of the Griffon Guide can now be specified in
griffon-app/conf/BuildConfig.groovy or
$USER_HOME/.griffon/settings.groovy.
Logging
The logging DSL previously introduced in 0.9.1 for execution
during runtime is now available during buildtime. You can
configure it by editing either
griffon-app/conf/BuildConfig.groovy or
$USER_HOME/.griffon/settings.groovy and placing a
log4j section.
Runtime
AddonManager
There's a new helper class (
griffon.core.AddonManager) that will keep track of
installed Addons. Each addon now has an associated descriptor of
type
griffon.core.GriffonAddonDescriptor that can helps
an application figure out more about addon contributions at
runtime.
Services as Application Event Handlers
You might be aware that Griffon automatically manages services
instances (with or without installing the Spring plugin). Each
service is treated as a singleton, which made it a bit difficult
to configure services as application event listeners. Starting
with this release services instances will become application
event listeners by default, same as controllers. Also, all
available service instances can be accessed from the application
instance using the
getServices() method/property. Be warned that
services are still instantiated on demand so you won't be able to
query all services instances at a given time if not all of them
have been instantiated already.
Threading AST Transformation
There's a new AST transformation that can be used to inject proper threading management used to execute code outside/inside the UI thread. Refer to section 9.3 Annotation Based Threading of the Griffon Guide.
Automatic threading management in Controllers
It's been known since the beginning of Swing that executing a long operation inside the EDT is a bad practice and should be avoided. Sadly there is no compile time support for checking for violations of this rule. However starting with this release all controller actions are guaranteed to be executed outside of the EDT. This feature can configured/disabled in several ways
1. Specify
griffon.disable.threading.injection=true during the
compilation process
2. Alternatively specify
griffon.disable.threading.injection=true in either
griffon-app/conf/BuildConfig.groovy or
$USER_HOME/.griffon/settings.groovy.
3. Follow the instructions found in section 8.1.1 Threads and Actions of the Griffon Guide.
4. Or annotate the action property/method with @Threading(Threading.Policy.SKIP)
This feature complements the @Threading AST transformation, which means it will honor any settings you specify if an action is annotated with @Threading. A controller action is considered to be
- a public method or a closure property (no access modifier)
- the name of the method/property does not match an event handler (it does not begin with 'on')
Breaking Changes
Runtime Behavior
Automatic threading management for controller actions is a very desirable feature but it breaks compatibility with previous releases. You can disable this feature in many ways if it proves to be problematic during transition. Please review all methods and closure properties found in your controllers. Any candidate that follows the rules for actions will be automatically transformed.
Dependencies
The jar
org.springframework.test is no longer provided for
the test configuration.
Sample Applications
Griffon 0.9.2-rc1 ships with 5 sample applications of varying levels of complexity demonstrating various parts of the framework. In order of complexity they are:
File Viewer
File Viewer is a simple demonstration of creating new MVCGroups on the fly.
Source: samples/FileViewer
To run the sample from source, change into the source
directory and run
griffon run-app from the command prompt.
GroovyEdit
GroovyEdit is an improved version of FileViewer that uses custom observable models.
Source: samples/GroovyEdit
To run the sample from source, change into the source
directory and run
griffon run-app from the command prompt.
Font Picker
Font Picker demonstrates form based data binding to adjust the sample rendering of system fonts.
Source: samples/FontPicker
To run the sample from source, change into the source
directory and run
griffon run-app from the command prompt.
Greet
Greet, a full featured Griffon Application, is a Twitter client. It shows Joint Java/Groovy compilation, richer MVCGroup interactions, and network service based data delivery.
Source: samples/Greet
To run the sample from source, change into the source
directory and run
griffon run-webstart from the command prompt.
Because Greet uses JNLP APIs for browser integration using
run-app will prevent web links from working.


