JBoss Forge 2.0.0.Alpha13 is now available!
We are pleased to announce the release of “Lucky Thirteen”, a Forge Runtime that features a streamlined programming model for Addon developers (no more @Exported annotation,) as well as a wide array of new Commands for developing Java EE applications.
- Try out Forge 2 in Eclipse via our Update Site
- Use Forge 2 in your CLI / Terminal by downloading and installing the Alpha13 release. You can learn how to run the downloaded installation via our docs.
Resource Transactions and Resource Change Monitoring
There are a lot of exciting features (as you can see by the release notes below); however, there are some outstanding features that we are proud to present. The first of which are resource transactions and monitoring.
Resource Transactions:
If you are familiar with UserTransaction in Java EE applications, this should feel pretty comfortable.
ResourceTransaction transaction = factory.getTransaction();
try {
// Starts the transaction
transaction.begin();
FileResource<?> resource = factory.create(...);
// The file won't be updated until commit is performed
resource.setContents("Hello World");
String contents = resource.getContents(); // Returns "Hello World"
FileResource<?> anotherResource = factory.create(...);
// The file won't be deleted until commit is performed
anotherResource.delete();
FileResource<?> newResource = factory.create(...);
// The file won't be created until commit is performed
newResource.createNewFile();
transaction.commit();
} catch (Exception e){
// Discard all changes since the beginning of this transaction
transaction.rollback();
}
Additionally, transactions support change-set inspection, so you can compare file contents before deciding whether or not a given transaction should be committed or rolled back:
...
Collection<ResourceEvent> changeSet = transaction.getChangeSet();
...
transaction.commit();
Following the example above, this change set contains the following entries:
Collection [
ResourceCreated: <FileResource<?>>,
ResourceModified: <DirectoryResource>,
ResourceModified: <FileResource<?>>,
ResourceDeleted: <FileResource<?>>,
ResourceCreated: <FileResource<?>>
]
Resource Monitors:
@Inject
private ResourceFactory factory;
...
Resource<?> resource = factory.create(...);
ResourceMonitor monitor = factory.monitor(resource);
monitor.addResourceListener(new ResourceListener() {
@Override
public void processEvent(ResourceEvent evt) {
...
}
});
Once a monitor is no longer needed, it must be manually disposed of by calling the cancel() method:
monitor.cancel();
@CommandScoped support:
You may now use the @CommandScoped annotation to share data between pages in UIWizard implementations. No more context attribute passing!
Release Notes – Check out all the new stuff!
Bug
- [FORGE-1192] – Ill behaved addons can screw up the command popup in Eclipse
- [FORGE-1203] – Furnace CDI is unable to create proxies for services that are backed by Weld proxies (@ApplicationScoped, etc)
- [FORGE-1206] – Imported<?>.get() has a different behavior compared to iterator()
- [FORGE-1223] – CheckboxTableControlBuilder does not properly initialize data collection when default values are set
Enhancement
- [FORGE-757] – Forge tests should delete the created folders
- [FORGE-1196] – Rename flag forge.compatibility.IDE to forge.standalone
- [FORGE-1239] – UISelectOne and UISelectMany components could have dynamic value choices
Feature Request
- [FORGE-220] – Forge should listen to filesystem changes on the system and publish events for plugins to observe
- [FORGE-801] – Support for Transactional Resources
- [FORGE-846] – Create a template processor addon
- [FORGE-1193] – Eclipse plugin doesn't handle subflows correctly
- [FORGE-1194] – Support addition of warnings to a validation context
- [FORGE-1195] – Support addition of information messages to a validation context
- [FORGE-1197] – Eclipse plugin should render a Spinner component for Number types
- [FORGE-1198] – UIValidationContext should reference the current input being validated
- [FORGE-1200] – Add A@Column(length) on Entity attributes of type String
- [FORGE-1202] – Furnace Maven plugin should allow generation of the full addon dependency graph
- [FORGE-1205] – Migrate CommandScoped to Forge 2
- [FORGE-1217] – UIProvider should provide a isGUI() method
Task
- [FORGE-1111] – Write a test to ensure that furnace fails deployment if multiple containers are specified
Sub-task
- [FORGE-1171] – Port the JMS commands
- [FORGE-1174] – Port the JSTL commands
- [FORGE-1175] – Port the JTA commands
- [FORGE-1176] – Port the JAX-RS (REST) commands
- [FORGE-1177] – Port the Servlet commands
- [FORGE-1178] – Port the JAX-WS (SOAP) commands
- [FORGE-1179] – Port the Bean validation commands