ef4j

Simple and lightweight event framework

Лицензия

Лицензия

Группа

Группа

com.github.lero4ka16
Идентификатор

Идентификатор

ef4j
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

pom.sha512
Описание

Описание

ef4j
Simple and lightweight event framework
Ссылка на сайт

Ссылка на сайт

https://github.com/lero4ka16/ef4j
Организация-разработчик

Организация-разработчик

com.github.lero4ka16
Система контроля версий

Система контроля версий

https://github.com/lero4ka16/ef4j

Скачать ef4j

Имя Файла Размер
ef4j-1.1.0.pom
ef4j-1.1.0-sources.jar 14 KB
ef4j-1.1.0-javadoc.jar 55 KB
Обзор

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Ef4j

About the project

Ef4j (Event Framework For Java) - Simple and lightweight event framework

Benchmarks

TODO

Example

class MyListener { 
  @EventHandler
  public void listen(MyEvent event) {
    System.out.println(event.getMessage());
  }
}

class MyEvent extends Event {
  private final String message;
	
  public MyEvent(String message) {
    this.message = message;
  }
    
  public String getMessage() {
    return message;
  }
}

EventBus bus = new ConcurrentEventBus();

// register listener
bus.subscribe(new MyListener());

// send event to all listeners
bus.publish(new MyEvent("Hello world!"));

You can to specify the EventNamespace to EventBus#subscribe and then you will be able to remove all listeners by that EventNamespace using EventBus#unsubscribeAll(EventNamespace)

Also you can set EventHandler's priority, just use @EventHandler(EventPriority.<...>)

There are 6 types of priority:

  • LOWEST will be executed first
  • LOW will be executed after LOWEST
  • NORMAL will be executed after LOW (default)
  • HIGH will be executed after NORMAL
  • HIGHEST will be executed after HIGH
  • MONITOR will be executed last

Add as dependency

Maven

<dependencies>
    <dependency>
        <groupId>com.github.lero4ka16</groupId>
        <artifactId>ef4j</artifactId>
        <version>1.1.0</version>
    </dependency>
</dependencies>

Gradle

dependencies {
    implementation 'com.github.lero4ka16:ef4j:1.1.0'
}

Build the project

  1. Execute ./gradlew build
  2. Output file located at build/libs/ef4j.jar

Contact

Vkontakte, Telegram

Post Scriptum

I will be very glad if someone can help me with development.

Версии библиотеки

Версия
1.1.0
1.0.0