Skip to content

hpehl/kaitiro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

CDI observer for GWT / GIN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages