1 package dst.ass2.aop.event;
3 import java.util.logging.Handler;
4 import java.util.logging.LogRecord;
6 import dst.ass2.aop.IPluginExecutable;
9 * Logging handler that uses the {@link EventBus} for publishing events.
11 public class EventBusHandler extends Handler {
12 @SuppressWarnings("unchecked")
14 public void publish(LogRecord record) {
15 if (record.getLoggerName().endsWith("PluginExecutable") && record.getMessage().contains("PluginExecutable")) {
17 Class<? extends IPluginExecutable> clazz = (Class<? extends IPluginExecutable>) Class.forName(record.getLoggerName());
18 EventBus.getInstance().add(EventType.INFO, clazz, record.getSourceClassName());
19 } catch (ClassNotFoundException e) {
20 throw new RuntimeException(e);
26 * Simply does nothing.
33 * Simply does nothing.