This project is a fork of the EventBus of Google Guava
Java
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
core
legman-maven-plugin
support
test
.gitignore
README.md
pom.xml

README.md

Legman

Legman is a fork of the Guava Eventbus.

Differences to Guava

  • weak references by default
  • synchronous and asynchronous dispatching in same EventBus
  • all options are controlled by attributes of the subscribe annotation
  • exceptions are propagated to caller (works only with synchronous dispatching)

Maven

<dependencies>

  <dependency>
    <groupId>com.github.legman</groupId>
    <artifactId>core</artifactId>
    <version>1.2.0</version>
  </dependency>

</dependencies>

<repositories>

  <repository>
    <id>maven.scm-manager.org</id>
    <name>scm-manager release repository</name>
    <url>http://maven.scm-manager.org/nexus/content/groups/public</url>
  </repository>

</repositories>

Usage

public class Event {

}

public class Listener {

  @Subscribe
  public void handleEvent(Event event){
    // handle event
  }

}

Listener listener = new Listener();

EventBus eventBus = new EventBus();
eventBus.register(listener);
eventBus.post(new Event());