Introducing The JBoss Developer Framework

Pete Muir
Principal Software Engineer, Red Hat, Inc.
Jason Porter
Senior Software Engineer, Red Hat, Inc.

Session Objective

By the end of this session you will understand the resources that JBoss Developer Framework offers you.

You will have seen how productive you can be with the JBoss stack.


  • What is JBoss Developer Framework
    • Quickstarts & JBoss BOMs
    • Migration
    • Demo and overview of TicketMonster
  • Roadmap
    • What's in jdf 2.0
    • How does DeltaSpike fit in?

What is jdf?

JBoss Developer Framework shows you how to write applications using JBoss technologies

  • Learn how to write an application suitable for mobile
  • Learn how to use the Java EE 6 API with JBoss AS
  • Learn how to add the power of CDI to your browser


  • 54 Quickstarts, focused on a single use case or API
  • Medium complexity example - TicketMonster
  • Stacks defined for Java EE, Errai, Hibernate, Arquillian, Transactions (more to come)
  • Migration guides for Spring, Seam 2 and Java EE 5

Quick plug

Wednesday @ 3:40pm

Quickstarts & JBoss BOMs


What is TicketMonster?

  • Online ticketing application
  • Medium complexity
  • Demonstrates a choice of view layers
  • Uses JBoss Data Grid to scale application

End-User requirements

  • Smooth interaction (no flicker!)
  • Fast response
  • Mobile and tablet usage

What can administrators do?

Administrator requirements

  • Easy CRUD
  • Real-time status updates

TicketMonster Architecture

Core: Java EE

  • Persistence (JPA)
  • Dependency injection (CDI)
  • Eventing
  • Transactional business components (EJB)
  • REST-ful remote access endpoints (JAX-RS)

End-user views


  • Single page application
    • No flicker
    • Mobile optimized
  • Javascript MVC via backbone.js adds structure
  • Same architecture for mobile (jQuery Mobile) and desktop

HTML5 Architecture

Administration views

### RichFaces/JSF

  • All Java EE6 architecture
  • Rapid development through JBoss Forge
  • Richfaces adds advanced components

Monitoring views

### Errai/GWT

  • All-around Java (backend, front-end)
  • Compiled to Javascript via GWT
  • Errai adds in-browser real-time updates via CDI eventing

jdf Roadmap

jdf 2.0

Tentatively November 2012

  • DeltaSpike
  • Security
  • Mobile Native & Offline Data
  • Data Grids


Tentatively June 2013

  • More DeltaSpike
  • SSO (PicketLink)
  • Social (Agorava)
  • jbpm & Drools

Apache DeltaSpike

DeltaSpike closes the gaps in Java EE 6.

We believe the community can create awesome CDI extensions and easily share them.
  • Fragmentation
  • Duplicate work
  • location?

DeltaSpike (current) Features


  • SE compatibility
  • Utilities
  • Author tools


Project Stage

    @Inject ProjectStage projectStage;
    if (ProjectStage.Developement.equals(this.projectStage)) {
      // execute during development


    @Exclude(ifProjectStage = ProjectStage.Development.class)
    public class MyBean { }
    @Exclude(onExpression = "db==prodDB")
    public class DevDbBean { }


    public class SettingsBean implements Deactivatable {
        @Inject @ConfigProperty(name = "property1")
        private Integer intProperty1;

v0.1-incubating (cont)


    Map<String, Object> memberVals = new HashMap<String, Object>();
    memberVals.put("booleanValue", false);
    memberVals.put("byteValues", new byte[]{(byte) 0});
    memberVals.put("type", Object.class);
    TestAnnotation annotation = AnnotationInstanceProvider.of(TestAnnotation.class, memberVals);


    AnnotatedTypeBuilder builder = new AnnotatedTypeBuilder();
    String beanName = namedAnnotation.value();
    String newBeanName = beanName.substring(0, 1).toLowerCase() + beanName.substring(1);
    builder.removeFromClass(Named.class).addToClass(new NamedLiteral(newBeanName));


    MyBean bean = BeanProvider.getContextualReference("myBean", false, MyBean.class);
    MyBean bean = BeanProvider.getContextualReference(MyBean.class, false, new QualifierLiteral());
    Object bean = BeanProvider.getContextualReference("myBean", false);
    List<MyServiceInterface> myServices = BeanProvider.getContextualReferences(MyServiceInterface.class, false);
    List<MyServiceInterface> myServices = BeanProvider.getContextualReferences(MyServiceInterface.class, false, false);

DeltaSpike (current) Features


  • Security
  • Exception Handling
  • i18n


Security - Securing a bean method

    public class CustomAuthorizer {     
      @Secures @CustomSecurityBinding     
      public boolean doSecuredCheck(InvocationContext invocationContext, 
                                    BeanManager manager, @LoggedIn User user) throws Exception {         
        return user.isLoggedIn(); 
        // perform security check     
    public class SecuredBean1 {
        public void doSomething(Thing thing) {


Security - Security Parameter Binding

    public class CustomAuthorizer {
        @Secures @CustomSecurityBinding
        public boolean doSecuredCheck(InvocationContext invocationContext, 
                                      BeanManager manager, @LoggedIn User user, 
                                      @CurrentThing Thing thing) throws Exception {
            return thing.hasMember(user); // perform security check against our method parameter
    public class SecuredBean1 {
        public void doSomething(@CurrentThing Thing thing) {


Exception Handling

    public class MyHandlers {
       void printExceptions(@Handles ExceptionEvent<PersistenceException> evt) {
          System.out.println("Something bad happened: " + evt.getException().getMessage());
    public class InventoryActions {
      @PersistenceContext private EntityManager em;
      @Inject private Event<ExceptionToCatchEvent> catchEvent;
      public Integer queryForItem(Item item) {
        try {
          Query q = em.createQuery("SELECT i from Item i where = :id");
          q.setParameter("id", item.getId());
          return q.getSingleResult();
        } catch (PersistenceException e) {



    public interface SimpleMessage {
        @MessageTemplate("Welcome to DeltaSpike") String welcomeToDeltaSpike();
    @MessageContextConfig(messageInterpolator = CustomMessageInterpolator.class)
    public interface SimpleMessage {
        // in the message bundle: welcome_to=Welcome to %s
        @MessageTemplate("{welcome_to}") String welcomeTo(String name);
    public class MyBean {
        @Inject private SimpleMessage messages;
        public String welcomeToDeltaSpike {
            return this.messages.welcomeTo("DeltaSpike");

v0.3-incubating (in development)

  • JPA
  • Transaction Support

Can I get support?