@Provider
@ApplicationScoped
public class EventProvider implements ContextualTypeProvider<Event<?>> {
public Event<?> provide(final Class[] typeargs) {
return new Event() {
private Class eventType = (typeargs.length == 1 ? typeargs[0] : Object.class);
public void fire(Object event) {
if (event == null) return;