import org.argot.*; import org.argot.event.*; public class EventDrivenApplication implements EventHandler { public EventDrivenApplication() { } public void start() { // ... EventSystem.fireEvent(new CustomEvent("custom_event")); } @EventMethod public void onCustomEvent(CustomEvent event) { // ... EventSystem.fireEvent(new AnotherEvent("another_event")); } @EventMethod public void onAnotherEvent(AnotherEvent event) { // ... } public static void main(String[] args) { EventDrivenApplication app = new EventDrivenApplication(); app.start(); } }


上一篇:
下一篇:
切换中文