import com.example.detective.core.DetectiveCore; import com.example.detective.event.ExceptionEvent; import com.example.detective.observer.ExceptionObserver; public class Application { public static void main(String[] args) { DetectiveCore detectiveCore = new DetectiveCore(); ExceptionObserver exceptionObserver = new ExceptionObserver(); detectiveCore.getEventBus().register(exceptionObserver); try { int result = 1 / 0; } catch (Exception e) { detectiveCore.getEventBus().publish(new ExceptionEvent(e)); } } }


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