Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
CDI observer for GWT / GIN
branch: develop

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
.gitignore
README.md
pom.xml

README.md

Kaitiro (Maori for "observer") brings the observer feature from CDI (JSR-299/JSR-330) to GWT.

Using CDI you can easily define custom events / listeners:

public class HelloEvent { 
    private final String message; 

    public HelloEvent(String message) { 
        this.message = message; 
    } 

    public String getMessage() { 
        return message; 
    } 
} 

public class HelloMessenger { 
    @Inject Event<HelloEvent> event; 

    public void hello() { 
        event.fire(new HelloEvent("Hi there " + System.currentTimeMillis())); 
    } 
} 

public class HelloListener { 
    public void listenToHello(@Observes HelloEvent helloEvent) { 
        System.out.println("HelloEvent: " + helloEvent); 
    } 
} 

Kaitiro aims to bring this programming model to GWT / GIN. For a reasonable implementation Kaitiro needs to participate in GINs dependency injection mechanism. There's an ongoing discussion to implement some kind of GinExtensions. Kaitiro would use such an extension to generate the necessary code for GwtEvents and EventHandlers that integrate nicley with the new GWT EventBus.

For more details about the planned GIN extensions see

Kaitiro is currently in the design phase. Any ideas, suggestions and comments are welcome!

Something went wrong with that request. Please try again.