package net.sourceforge.pain.logic; import net.sourceforge.pain.*; import net.sourceforge.pain.db.*; /** * AbstractEvent is a base class for any Event, this class is a first reloadable class in Events hierarchy */ public abstract class AbstractEvent implements Event { public Object processEvent(final Object param) throws Exception { final DbTransaction t = new DbTransaction() { public Object execute(Object[] params) throws Exception { return AbstractEvent.this.execute(param); } }; Core.getDB().execute(t); return null; } public AbstractEvent() { // debug check ClassLoader loader = Core.getLogicLoader().getActiveClassLoader(); if (loader != getClass().getClassLoader()) { throw new RuntimeException("BUG: all Act subclasses MUST be loaded via Core.createAct() method!"); } } public abstract Object execute(Object param) throws Exception; }