If you're in the Ottawa area, stop by and check out my Errai talk at FOSSCL's Software Developers' Haven on Saturday August 27th.
You can find details here: http://fosslc.org/drupal/sc2011
I'll also be hanging around for beers and talk afterwards.
|
We're almost there. Today we have release Errai 1.3 Candidate Release 1. There's no new features to talk about since the beta release, of course. But the bug fixes are in, and we're excited to be closing in on the final!
|
About four months of hardcore, heads down work, I am pleased to announce the first official beta release of Errai 1.3. Don’t be dissuaded by the relatively small increment to the version number -- this is a big release!The number one philosophy of
... [More]
Errai is to erase boilerplate and bring the power of server-side programming to the browser. In 1.3, we’ve made great strides in this area.The EnterpriseFirst and foremost, much of our efforts have been focused on our Errai enterprise integration around Java EE6 technologies. We wanted more than just dependency-injection in the browser, we wanted the full power of CDI in the browser. And while we still fall short of 100% of the CDI specification being implemented, we have managed to implement a significant footprint of the specification.A big priority for 1.3 was making the CDI integration even more invisible. So, if you’re going to do CDI in the browser, than it should be against the standard APIs. So, gone if the old client Event interface, and in is use of the javax.enterprise.event.Event interface for CDI events.Qualifiers for events and injection are now fully supported in Errai client code. And even for server-client events, in both directions!We also now have support for CDI Producers and private-method PostConstructs. The FrameworkImplementing the aforementioned requires a lot of framework infrastructure. So we went back to the drawing board and revisited the way in which Errai generates code. And in so doing, we implemented a brand new class meta model, which completely abstracts away the GWT generator API, and we then implemented our core IOC engine on top of it. The end result is all the ridiculously awesome stuff we’re doing with CDI! This new code generation framework, forms the basis for how we foresee going forward and implementing integration for more of the EE6 stack, as well as other great technologies like Infinispan, for instance.Our latest team member to join, Christian Sadilek, has put a lot of effort into developing our test harness and getting our test coverage up to a respectable level, and I think that will pay dividends in the quality of this release as well as future releases. The DocsWe are renovating our documentation. And we’ve already done a lot. But there’s more to do. For the latest docs -- which we’ll be updating frequently in the coming weeks -- please check out or Confluence Wiki here.The ArchetypeTo get started with Errai SE, you can run this command right now:mvn archetype:generate \-DarchetypeGroupId=org.jboss.errai.archetypes \-DarchetypeArtifactId=bus-quickstart \-DarchetypeVersion=1.3.0.Beta1.R1 \-DarchetypeRepository=https://repository.jboss.org/nexus/content/repositories/snapshots/To get started with Errai EE, you can run this command right now:mvn archetype:generate \-DarchetypeGroupId=org.jboss.errai.archetypes \-DarchetypeArtifactId=cdi-quickstart \-DarchetypeVersion=1.3.0.Beta1.R1 \-DarchetypeRepository=https://repository.jboss.org/nexus/content/repositories/snapshots/….The DownloadsIf you’re allergic to Maven, our downloads page is here: http://www.jboss.org/errai/DownloadsAlso, expect an awesome Forge plugin to be on the horizon -- especially considering that I co-founded that project (I know, I know… it’s embarrassing that i don’t have a plugin yet. But i’m a busy guy!)The FutureWe are only at the beginning. We expect to add a third team member in the next few weeks, and we are working closely with other JBoss projects, like Seam and RichFaces to expand the reach of the benefits which we bring to the JBoss web technology ecosystem. Since we’re a framework which looks so heavily to the power of the browser, you can expect that over the next few months, our focus will shift intensely to leveraging the scope of capabilities that HTML5 brings to the table for developing rich applications. Our ideas are vast, and we hope to share them with you going forward. So stay tuned.The GratitudeThank you for everyone in the community who has given us feedback, reported bugs and supported us. Thanks to Heiko Braun for helping to get this project off the ground, and we’ll miss him as he moves on to work on other things. Thanks to Christian Sadilek for coming out of left-field and being incredibly awesome in every way. Thanks to Rodney Russ for being the world’s awesomest manager. Thanks to Mark Little for supporting all this from day one. Thanks to Dan Allen for his evangelization. Thanks to Pete Muir for his support. Thanks to Lincoln Baxter, Jay Balunas, and Shane Bryzak! And thanks to you for reading this. [Less]
|
JBoss World kicked off with a real cool keynote presentation which represented a confluence of JBoss’s cutting-edge technology. The demo brought together JBoss AS, Infinispan, HibernateOGM, CDI and Errai. Of course, our little part of the
... [More]
presentation was the demonstration of Errai powering a real-time tag cloud which really brought home the concept of the "real-time web"; most certainly not something which hasn’t been done before, but it was how we did it that makes it interesting. I'm not going to rehash too much of what has already been said in the aforementioned blog posts, and I highly recommend you click the hyperlinks and check them out. Instead, I'm going to talk about CDI and Errai.CDI is a technology we’re pushing really aggressively at JBoss, and Errai is no exception. In fact, we’re relatively sure that we’re the one and only in-browser CDI engine. It was only natural we’d want to show this off at JBoss World. And that we did. The demo involved bringing in a live tweet stream from Twitter and then producing real-time information based on what hashtags were most popular. The key was to have a fully dynamic tag cloud which would be updated the instant that the information was available. And as such, we used Errai’s push technology to display the information to every browser simultaneously and in real time. CDI in the Browser So what does CDI in the browser look like? Well, this might come as a shock: it looks exactly as it does in your server-side code. Consider the following server code:@ApplicationScopedpublic class MyService { @Inject @Updated private <>Event updatedTagEvent; ... }And now consider the following client GWT code: public void onTagUpdated(@Observes @Updated Tag tag) { System.out.println("Tag was updated: " + tag)} In the former code snipped we setup a CDI event consumer, and in the latter, we setup a CDI event observer. Believe it or not, that’s pretty much everything you need to know about push messaging with Errai CDI. In fact, this is exactly how our tag cloud was updated. Using our transparent push mechanism, serialization and bus framework, all of the boilerplate associated with doing “push” is eliminated. Yes, it’s that cool. I’m not going to show you a bunch of XML , property or boilerplate class files because, well, there are none. As a developer you simply want to think about your logic and your data. Utilizing Errai and CDI to build your rich web applications allows you to do just that. How does it work? Errai is very much a compile-time framework. In order to provide the runtime infrastructure to transparently communicate between browser code (written in GWT) and the server, we provide a significant amount of code generation to support functionality based on declarative configuration. For instance, we provide a straight forward annotation, @ExposeEntity which effectively instructs Errai to produce marshaller and demarshaller wrappers -- ultimately compiled down to JavaScript -- for the entity. The other aspect of Errai is a powerful messaging bus which, consistently with Errai’s “pervasive” theme, runs concurrently in the browser and on the server. As opposed to thinking about client vs server, we have aggressively pursued a flat architecture where the client and server APIs are common and shared. So there isn’t one way to write server code for Errai and another way to write client code. This also provides the underlying application with transport agnosticism. That is to say, this only contract is between the bus APIs and the client code for all client-server communication. Or even more high-level in the case of Errai CDI, between the application and the CDI eventing system. This means the method of communication, be it WebSockets or COMET is invisible to the application. Developers no longer need to worry about the particularities of working with those technologies. The future? We think the future of the web is rich applications. But not only that pervasive applications. And the demo we showed at JBoss World which can be viewed here at about 35 minutes into the presentation is merely a taste of how powerful pervasive computing can be. [Less]
|
CDI event qualifiersThe Errai CDI integration module (see a previous blog post) has support for event qualifiers now, both for event producers and observers. Multiple qualifiers can be specified for an event and of course custom qualifiers can be
... [More]
used.CDI conversationsThe simple use of @Conversational allows a server to directly address a single client in response to an event.BusReadyEventClients can observe a BusReadyEvent to be notified when the CDI event system has been initialized and the message bus is ready to be used.The example code below shows how to use these new features. Notice again the use of a uniform API on both the client and server. For more details on Errai's CDI support see the online documentation. Any feedback is appreciated!@EntryPointpublic class SimpleDocumentClient extends LayoutPanel { @Inject private Event<DocumentSubscription> documentSubscriptionEvent; @Inject @Published private Event<Document> publishedDocumentEvent; public void buildUI(@Observes BusReadyEvent busReadyEvent) { documentSubscriptionEvent.fire(new DocumentSubscription()); // ... new Button().addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { publishedDocumentEvent.fire(new Document()); } }); } public void onDocumentsReceived(@Observes Documents document) { // this event is received as a direct response to the subscription event // ... } public void onDocumentCreated(@Observes @New Document document) { // ... } public void onDocumentUpdated(@Observes @Updated Document document) { // ... } public void onDocumentDeleted(@Observes @Deleted Document document) { // ... }}@ApplicationScopedpublic class SimpleDocumentService { @Inject private Event<Documents> subscriptionResponseEvent; @Inject @New private Event<Document> documentCreatedEvent; @Inject @Updated private Event<Document> documentUpdatedEvent; @Inject @Deleted private Event<Document> documentDeletedEvent; @Conversational public void onDocumentSubscription(@Observes DocumentSubscription subscription) { Documents documents = new Documents(); //... // respond to the client directly subscriptionResponseEvent.fire(documents); } public void onDocumentPublished(@Observes @Published Document document) { // receive document published events from the clients //... } private void createDocument(Document document) { // ... documentCreatedEvent.fire(document); } private void updateDocument(Document document) { // ... documentUpdatedEvent.fire(document); } private void deleteDocument(Document document) { // ... documentDeletedEvent.fire(document); }} [Less]
|
I am pleased to announce the public release of Errai 1.2. This is a maintenance release on Errai, with big fixes, better support for CDI integration and so on. Existing users of Errai 1.1 should be able to directly upgrade to 1.2. We have recently
... [More]
expanded our team and we plan on aggressively pushing the project in new and exciting directions going forward. So please check this space often. There's a lot in the offing. [Less]
|
This time we got Heiko and Pete talking with us about JUDCon Berlin and Heiko's work on the Errai project.As usual we also cover short news from the JBoss Community, but if you've wondered what Errai actually is and what it brings to the table then take a listen from about 30 minutes in, Heiko outlines it all in this episode.Get it here
|
"Errai offers a set of components for building rich web applications using The Google Web Toolkit. The framework provides a unified federation and RPC infrastructure with true, uniform, asynchronous messaging across the client and server.It extends
... [More]
the Google Web Toolkit in two distinct areas:- True asynchronous bi-directional communication between GWT clients and backend systems - Integration with enterprise component models and technologies. In this session we'll look at CDI integration module. It offers seamless integration of CDI backend components with GWT client applications. Build as an extension to the Errai core framework, it allows you to transparently access CDI beans while harnessing the power of the core framework.Beans that are deployed to a CDI container (i.e. JBoss 6) will automatically be registered with Errai and exposed to your GWT client application. Communication between GWT client components and CDI beans can be done in several ways:- RPC style invocations on beans through a typed interface- Access beans in a publish/subscribe manner- Wiring up your GWT application with the CDI event subsystemAfter this session you should have a good idea about the core framework capabilities and CDI integration in particular."Gwt cdi jud_con_berlinView more presentations from hbraun. [Less]
|
We'll be presenting Errai at the JBoss Developer Conference in Berlin next month.Besides the core framework features we'll take a particular look at the CDI integration capabilities.Bring your laptops, because we'll wait for you at the hackfest Thursday night.More information here
|
The CDI integration module offers seamless integration of CDI backend components with GWT client applications. Build as an extension to the Errai core framework, it allows you to transparently access CDI beans while harnessing the power of the core
... [More]
framework.Beans that are deployed to a CDI container (i.e. JBoss 6) will automatically be registered with Errai and exposed to your GWT client application. Communication between GWT client components and CDI beans can be done in several ways:RPC style invocations on beans through a typed interfaceAccess beans in a publish/subscribe mannerWiring up your GWT application with the CDI event subsystemRPC Style InvocationsWhen chosing RPC style invocations on beans, you basically rely on a typed java interface the CDI managed bean needs to expose. A GWT client component can then create an invocation proxy based on this interface. For more information see chapter on RPC mechanism.Publish/Subscribe with CDI managed componentsIf you chose publish/subscribe then your CDI bean needs to implement the MessageCallback interface, as described in chapter 'Messaging'. Any bean exposed in this way can be accessed through the MessageBuilder API.Integration with the CDI event subsystemAny CDI managed component may produce and consume events. This allows beans to interact in a completely decoupled fashion. Beans consume events by registering for a particular event type and qualifier. The Errai CDI extension simply extends this concept into the client tier. A GWT client application can simply register an Observer for a particular event type and thus receive events that are produced on the server side. Likewise GWT clients can produce events that are consumed by a server side component.Let's take a look at an example GWT component:public class FraudClient extends LayoutPanel {@Injectpublic Event event; (1)private HTML responsePanel;public FraudClient() { super(new BoxLayout(BoxLayout.Orientation.VERTICAL)); Button button = new Button("Create activity", new ClickHandler() { public void onClick(ClickEvent clickEvent) { event.fire(new AccountActivity()); } }); responsePanel = new HTML(); add(button); add(responsePanel);}public void processFraud(@Observes Fraud fraudEvent) { (2) responsePanel.setText("Fraud detected: " + fraudEvent.getTimestamp());}} Two things are notable in this example:Injection of an event dispatcher proxyCreation of an Oberserver method for a particular event typeEvent dispatcher proxyThe event dispatcher is responsible to send events created on the client side to the server side event subsystem (CDI container). This means any event that is fired through a dispatcher will eventually be consumed by a CDI managed bean. If there is an Observer registered for it on the server side.Client side observer methodsIn order to consume events that are created on the server side you need to declare an Observer method for a particular event type. In case an event is fired on the server side this method will be invoked with an event instance of the type you declared.To complete this exercise, let's look at the corresponding CDI managed bean as well:@ApplicationScopedpublic class AccountService { @Inject @Any Event event; public void watchActivity(@Observes @Inbound AccountActivity activity) { Fraud payload = new Fraud(System.currentTimeMillis()); event.fire(new Outbound(payload)); }}Whetting your appetite? Here are some links to get you going:Some more examplesCreate a project and import it into EclipseErrai 1.1.0-CR1 UserguideWeld, the CDI reference implementation [Less]
|